diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/HISTORY.rst b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/HISTORY.rst index afa5901d7f95..8bd70b34f712 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/HISTORY.rst +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/HISTORY.rst @@ -3,6 +3,27 @@ Release History =============== +5.0.0 (2019-06-21) +++++++++++++++++++ + +**Features** + +- Model CognitiveServicesAccount has a new parameter network_acls +- Add operation check_domain_availability + +**General Breaking changes** + +This version uses a next-generation code generator that *might* introduce breaking changes for some imports. +In summary, some modules were incorrectly visible/importable and have been renamed. This fixed several issues caused by usage of classes that were not supposed to be used in the first place. + +- CognitiveServicesManagementClient cannot be imported from `azure.mgmt.cognitiveservices.v20xx_yy_zz.cognitive_services_management_client` anymore (import from `azure.mgmt.cognitiveservices.v20xx_yy_zz` works like before) +- CognitiveServicesManagementClientConfiguration import has been moved from `azure.mgmt.cognitiveservices.v20xx_yy_zz.cognitive_services_management_client` to `azure.mgmt.cognitiveservices.v20xx_yy_zz` +- A model `MyClass` from a "models" sub-module cannot be imported anymore using `azure.mgmt.cognitiveservices.v20xx_yy_zz.models.my_class` (import from `azure.mgmt.cognitiveservices.v20xx_yy_zz.models` works like before) +- An operation class `MyClassOperations` from an `operations` sub-module cannot be imported anymore using `azure.mgmt.cognitiveservices.v20xx_yy_zz.operations.my_class_operations` (import from `azure.mgmt.cognitiveservices.v20xx_yy_zz.operations` works like before) + +Last but not least, HTTP connection pooling is now enabled by default. You should always use a client as a context manager, or call close(), or use no more than one client per process. + + 4.0.0 (2019-05-01) ++++++++++++++++++ diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/__init__.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/__init__.py index 76656ccb6ad3..98489cd6e6ab 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/__init__.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/__init__.py @@ -9,10 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from .cognitive_services_management_client import CognitiveServicesManagementClient -from .version import VERSION +from ._configuration import CognitiveServicesManagementClientConfiguration +from ._cognitive_services_management_client import CognitiveServicesManagementClient +__all__ = ['CognitiveServicesManagementClient', 'CognitiveServicesManagementClientConfiguration'] -__all__ = ['CognitiveServicesManagementClient'] +from .version import VERSION __version__ = VERSION diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/cognitive_services_management_client.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/_cognitive_services_management_client.py similarity index 61% rename from sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/cognitive_services_management_client.py rename to sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/_cognitive_services_management_client.py index e2c25cc61bb5..2ca978152523 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/cognitive_services_management_client.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/_cognitive_services_management_client.py @@ -11,48 +11,17 @@ from msrest.service_client import SDKClient from msrest import Serializer, Deserializer -from msrestazure import AzureConfiguration -from .version import VERSION -from .operations.accounts_operations import AccountsOperations -from .operations.resource_skus_operations import ResourceSkusOperations -from .operations.operations import Operations -from .operations.check_sku_availability_operations import CheckSkuAvailabilityOperations -from . import models - - -class CognitiveServicesManagementClientConfiguration(AzureConfiguration): - """Configuration for CognitiveServicesManagementClient - 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` - :param subscription_id: Azure Subscription ID. - :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(CognitiveServicesManagementClientConfiguration, self).__init__(base_url) - - self.add_user_agent('azure-mgmt-cognitiveservices/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials - self.subscription_id = subscription_id +from ._configuration import CognitiveServicesManagementClientConfiguration +from .operations import CognitiveServicesManagementClientOperationsMixin +from .operations import AccountsOperations +from .operations import ResourceSkusOperations +from .operations import Operations +from .operations import CheckSkuAvailabilityOperations +from . import models -class CognitiveServicesManagementClient(SDKClient): +class CognitiveServicesManagementClient(CognitiveServicesManagementClientOperationsMixin, SDKClient): """Cognitive Services Management Client :ivar config: Configuration for client. diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/_configuration.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/_configuration.py new file mode 100644 index 000000000000..4f35201f35ea --- /dev/null +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/_configuration.py @@ -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 CognitiveServicesManagementClientConfiguration(AzureConfiguration): + """Configuration for CognitiveServicesManagementClient + 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` + :param subscription_id: Azure Subscription ID. + :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(CognitiveServicesManagementClientConfiguration, 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-cognitiveservices/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/__init__.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/__init__.py index 2468499507fa..96965c85b5f0 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/__init__.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/__init__.py @@ -10,55 +10,67 @@ # -------------------------------------------------------------------------- try: - from .sku_py3 import Sku - from .cognitive_services_account_create_parameters_py3 import CognitiveServicesAccountCreateParameters - from .cognitive_services_account_update_parameters_py3 import CognitiveServicesAccountUpdateParameters - from .cognitive_services_account_py3 import CognitiveServicesAccount - from .cognitive_services_account_keys_py3 import CognitiveServicesAccountKeys - from .regenerate_key_parameters_py3 import RegenerateKeyParameters - from .cognitive_services_resource_and_sku_py3 import CognitiveServicesResourceAndSku - from .cognitive_services_account_enumerate_skus_result_py3 import CognitiveServicesAccountEnumerateSkusResult - from .metric_name_py3 import MetricName - from .usage_py3 import Usage - from .usages_result_py3 import UsagesResult - from .error_body_py3 import ErrorBody - from .error_py3 import Error, ErrorException - from .operation_display_info_py3 import OperationDisplayInfo - from .operation_entity_py3 import OperationEntity - from .check_sku_availability_parameter_py3 import CheckSkuAvailabilityParameter - from .check_sku_availability_result_py3 import CheckSkuAvailabilityResult - from .check_sku_availability_result_list_py3 import CheckSkuAvailabilityResultList - from .resource_sku_restriction_info_py3 import ResourceSkuRestrictionInfo - from .resource_sku_restrictions_py3 import ResourceSkuRestrictions - from .resource_sku_py3 import ResourceSku + from ._models_py3 import CheckDomainAvailabilityParameter + from ._models_py3 import CheckDomainAvailabilityResult + from ._models_py3 import CheckSkuAvailabilityParameter + from ._models_py3 import CheckSkuAvailabilityResult + from ._models_py3 import CheckSkuAvailabilityResultList + from ._models_py3 import CognitiveServicesAccount + from ._models_py3 import CognitiveServicesAccountCreateParameters + from ._models_py3 import CognitiveServicesAccountEnumerateSkusResult + from ._models_py3 import CognitiveServicesAccountKeys + from ._models_py3 import CognitiveServicesAccountUpdateParameters + from ._models_py3 import CognitiveServicesResourceAndSku + from ._models_py3 import Error, ErrorException + from ._models_py3 import ErrorBody + from ._models_py3 import IpRule + from ._models_py3 import MetricName + from ._models_py3 import NetworkRuleSet + from ._models_py3 import OperationDisplayInfo + from ._models_py3 import OperationEntity + from ._models_py3 import RegenerateKeyParameters + from ._models_py3 import ResourceSku + from ._models_py3 import ResourceSkuRestrictionInfo + from ._models_py3 import ResourceSkuRestrictions + from ._models_py3 import Sku + from ._models_py3 import Usage + from ._models_py3 import UsagesResult + from ._models_py3 import VirtualNetworkRule except (SyntaxError, ImportError): - from .sku import Sku - from .cognitive_services_account_create_parameters import CognitiveServicesAccountCreateParameters - from .cognitive_services_account_update_parameters import CognitiveServicesAccountUpdateParameters - from .cognitive_services_account import CognitiveServicesAccount - from .cognitive_services_account_keys import CognitiveServicesAccountKeys - from .regenerate_key_parameters import RegenerateKeyParameters - from .cognitive_services_resource_and_sku import CognitiveServicesResourceAndSku - from .cognitive_services_account_enumerate_skus_result import CognitiveServicesAccountEnumerateSkusResult - from .metric_name import MetricName - from .usage import Usage - from .usages_result import UsagesResult - from .error_body import ErrorBody - from .error import Error, ErrorException - from .operation_display_info import OperationDisplayInfo - from .operation_entity import OperationEntity - from .check_sku_availability_parameter import CheckSkuAvailabilityParameter - from .check_sku_availability_result import CheckSkuAvailabilityResult - from .check_sku_availability_result_list import CheckSkuAvailabilityResultList - from .resource_sku_restriction_info import ResourceSkuRestrictionInfo - from .resource_sku_restrictions import ResourceSkuRestrictions - from .resource_sku import ResourceSku -from .cognitive_services_account_paged import CognitiveServicesAccountPaged -from .resource_sku_paged import ResourceSkuPaged -from .operation_entity_paged import OperationEntityPaged -from .cognitive_services_management_client_enums import ( + from ._models import CheckDomainAvailabilityParameter + from ._models import CheckDomainAvailabilityResult + from ._models import CheckSkuAvailabilityParameter + from ._models import CheckSkuAvailabilityResult + from ._models import CheckSkuAvailabilityResultList + from ._models import CognitiveServicesAccount + from ._models import CognitiveServicesAccountCreateParameters + from ._models import CognitiveServicesAccountEnumerateSkusResult + from ._models import CognitiveServicesAccountKeys + from ._models import CognitiveServicesAccountUpdateParameters + from ._models import CognitiveServicesResourceAndSku + from ._models import Error, ErrorException + from ._models import ErrorBody + from ._models import IpRule + from ._models import MetricName + from ._models import NetworkRuleSet + from ._models import OperationDisplayInfo + from ._models import OperationEntity + from ._models import RegenerateKeyParameters + from ._models import ResourceSku + from ._models import ResourceSkuRestrictionInfo + from ._models import ResourceSkuRestrictions + from ._models import Sku + from ._models import Usage + from ._models import UsagesResult + from ._models import VirtualNetworkRule +from ._paged_models import CognitiveServicesAccountPaged +from ._paged_models import OperationEntityPaged +from ._paged_models import ResourceSkuPaged +from ._cognitive_services_management_client_enums import ( SkuTier, ProvisioningState, + NetworkRuleBypassOptions, + NetworkRuleAction, KeyName, UnitType, QuotaUsageStatus, @@ -67,32 +79,39 @@ ) __all__ = [ - 'Sku', - 'CognitiveServicesAccountCreateParameters', - 'CognitiveServicesAccountUpdateParameters', + 'CheckDomainAvailabilityParameter', + 'CheckDomainAvailabilityResult', + 'CheckSkuAvailabilityParameter', + 'CheckSkuAvailabilityResult', + 'CheckSkuAvailabilityResultList', 'CognitiveServicesAccount', + 'CognitiveServicesAccountCreateParameters', + 'CognitiveServicesAccountEnumerateSkusResult', 'CognitiveServicesAccountKeys', - 'RegenerateKeyParameters', + 'CognitiveServicesAccountUpdateParameters', 'CognitiveServicesResourceAndSku', - 'CognitiveServicesAccountEnumerateSkusResult', - 'MetricName', - 'Usage', - 'UsagesResult', - 'ErrorBody', 'Error', 'ErrorException', + 'ErrorBody', + 'IpRule', + 'MetricName', + 'NetworkRuleSet', 'OperationDisplayInfo', 'OperationEntity', - 'CheckSkuAvailabilityParameter', - 'CheckSkuAvailabilityResult', - 'CheckSkuAvailabilityResultList', + 'RegenerateKeyParameters', + 'ResourceSku', 'ResourceSkuRestrictionInfo', 'ResourceSkuRestrictions', - 'ResourceSku', + 'Sku', + 'Usage', + 'UsagesResult', + 'VirtualNetworkRule', 'CognitiveServicesAccountPaged', 'ResourceSkuPaged', 'OperationEntityPaged', 'SkuTier', 'ProvisioningState', + 'NetworkRuleBypassOptions', + 'NetworkRuleAction', 'KeyName', 'UnitType', 'QuotaUsageStatus', diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_management_client_enums.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/_cognitive_services_management_client_enums.py similarity index 89% rename from sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_management_client_enums.py rename to sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/_cognitive_services_management_client_enums.py index 7e36de1ee434..d2098d0d0cbf 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_management_client_enums.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/_cognitive_services_management_client_enums.py @@ -29,6 +29,18 @@ class ProvisioningState(str, Enum): failed = "Failed" +class NetworkRuleBypassOptions(str, Enum): + + azure_services = "AzureServices" + none = "None" + + +class NetworkRuleAction(str, Enum): + + allow = "Allow" + deny = "Deny" + + class KeyName(str, Enum): key1 = "Key1" diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/_models.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/_models.py new file mode 100644 index 000000000000..02643c552cc3 --- /dev/null +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/_models.py @@ -0,0 +1,876 @@ +# 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 CheckDomainAvailabilityParameter(Model): + """Check Domain availability parameter. + + All required parameters must be populated in order to send to Azure. + + :param subdomain_name: Required. The subdomain name to use. + :type subdomain_name: str + :param type: Required. The Type of the resource. + :type type: str + """ + + _validation = { + 'subdomain_name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'subdomain_name': {'key': 'subdomainName', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CheckDomainAvailabilityParameter, self).__init__(**kwargs) + self.subdomain_name = kwargs.get('subdomain_name', None) + self.type = kwargs.get('type', None) + + +class CheckDomainAvailabilityResult(Model): + """Check Domain availability result. + + :param is_subdomain_available: Indicates the given SKU is available or + not. + :type is_subdomain_available: bool + :param reason: Reason why the SKU is not available. + :type reason: str + :param subdomain_name: The subdomain name to use. + :type subdomain_name: str + :param type: The Type of the resource. + :type type: str + """ + + _attribute_map = { + 'is_subdomain_available': {'key': 'isSubdomainAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'subdomain_name': {'key': 'subdomainName', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CheckDomainAvailabilityResult, self).__init__(**kwargs) + self.is_subdomain_available = kwargs.get('is_subdomain_available', None) + self.reason = kwargs.get('reason', None) + self.subdomain_name = kwargs.get('subdomain_name', None) + self.type = kwargs.get('type', None) + + +class CheckSkuAvailabilityParameter(Model): + """Check SKU availability parameter. + + All required parameters must be populated in order to send to Azure. + + :param skus: Required. The SKU of the resource. + :type skus: list[str] + :param kind: Required. The Kind of the resource. + :type kind: str + :param type: Required. The Type of the resource. + :type type: str + """ + + _validation = { + 'skus': {'required': True}, + 'kind': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'skus': {'key': 'skus', 'type': '[str]'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CheckSkuAvailabilityParameter, self).__init__(**kwargs) + self.skus = kwargs.get('skus', None) + self.kind = kwargs.get('kind', None) + self.type = kwargs.get('type', None) + + +class CheckSkuAvailabilityResult(Model): + """Check SKU availability result. + + :param kind: The Kind of the resource. + :type kind: str + :param type: The Type of the resource. + :type type: str + :param sku_name: The SKU of Cognitive Services account. + :type sku_name: str + :param sku_available: Indicates the given SKU is available or not. + :type sku_available: bool + :param reason: Reason why the SKU is not available. + :type reason: str + :param message: Additional error message. + :type message: str + """ + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'sku_name': {'key': 'skuName', 'type': 'str'}, + 'sku_available': {'key': 'skuAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CheckSkuAvailabilityResult, self).__init__(**kwargs) + self.kind = kwargs.get('kind', None) + self.type = kwargs.get('type', None) + self.sku_name = kwargs.get('sku_name', None) + self.sku_available = kwargs.get('sku_available', None) + self.reason = kwargs.get('reason', None) + self.message = kwargs.get('message', None) + + +class CheckSkuAvailabilityResultList(Model): + """Check SKU availability result list. + + :param value: Check SKU availability result list. + :type value: + list[~azure.mgmt.cognitiveservices.models.CheckSkuAvailabilityResult] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CheckSkuAvailabilityResult]'}, + } + + def __init__(self, **kwargs): + super(CheckSkuAvailabilityResultList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CognitiveServicesAccount(Model): + """Cognitive Services Account is an Azure resource representing the + provisioned account, its type, location and SKU. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param etag: Entity Tag + :type etag: str + :ivar id: The id of the created account + :vartype id: str + :param kind: Type of cognitive service account. + :type kind: str + :param location: The location of the resource + :type location: str + :ivar name: The name of the created account + :vartype name: str + :ivar provisioning_state: Gets the status of the cognitive services + account at the time the operation was called. Possible values include: + 'Creating', 'ResolvingDNS', 'Moving', 'Deleting', 'Succeeded', 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.cognitiveservices.models.ProvisioningState + :param endpoint: Endpoint of the created account. + :type endpoint: str + :param internal_id: The internal identifier. + :type internal_id: str + :param custom_sub_domain_name: Optional subdomain name used for + token-based authentication. + :type custom_sub_domain_name: str + :param network_acls: A collection of rules governing the accessibility + from specific network locations. + :type network_acls: ~azure.mgmt.cognitiveservices.models.NetworkRuleSet + :param sku: The SKU of Cognitive Services account. + :type sku: ~azure.mgmt.cognitiveservices.models.Sku + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater than 128 characters and + value no greater than 256 characters. + :type tags: dict[str, str] + :ivar type: Resource type + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'etag': {'key': 'etag', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'endpoint': {'key': 'properties.endpoint', 'type': 'str'}, + 'internal_id': {'key': 'properties.internalId', 'type': 'str'}, + 'custom_sub_domain_name': {'key': 'properties.customSubDomainName', 'type': 'str'}, + 'network_acls': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CognitiveServicesAccount, self).__init__(**kwargs) + self.etag = kwargs.get('etag', None) + self.id = None + self.kind = kwargs.get('kind', None) + self.location = kwargs.get('location', None) + self.name = None + self.provisioning_state = None + self.endpoint = kwargs.get('endpoint', None) + self.internal_id = kwargs.get('internal_id', None) + self.custom_sub_domain_name = kwargs.get('custom_sub_domain_name', None) + self.network_acls = kwargs.get('network_acls', None) + self.sku = kwargs.get('sku', None) + self.tags = kwargs.get('tags', None) + self.type = None + + +class CognitiveServicesAccountCreateParameters(Model): + """The parameters to provide for the account. + + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the SKU of the resource. + :type sku: ~azure.mgmt.cognitiveservices.models.Sku + :param kind: Required. Required. Gets or sets the Kind of the resource. + :type kind: str + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update the request will succeed. + :type location: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater than 128 characters and + value no greater than 256 characters. + :type tags: dict[str, str] + :param properties: Required. Must exist in the request. Must be an empty + object. Must not be null. + :type properties: object + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(CognitiveServicesAccountCreateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.kind = kwargs.get('kind', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.properties = kwargs.get('properties', None) + + +class CognitiveServicesAccountEnumerateSkusResult(Model): + """The list of cognitive services accounts operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: Gets the list of Cognitive Services accounts and their + properties. + :vartype value: + list[~azure.mgmt.cognitiveservices.models.CognitiveServicesResourceAndSku] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CognitiveServicesResourceAndSku]'}, + } + + def __init__(self, **kwargs): + super(CognitiveServicesAccountEnumerateSkusResult, self).__init__(**kwargs) + self.value = None + + +class CognitiveServicesAccountKeys(Model): + """The access keys for the cognitive services account. + + :param key1: Gets the value of key 1. + :type key1: str + :param key2: Gets the value of key 2. + :type key2: str + """ + + _attribute_map = { + 'key1': {'key': 'key1', 'type': 'str'}, + 'key2': {'key': 'key2', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CognitiveServicesAccountKeys, self).__init__(**kwargs) + self.key1 = kwargs.get('key1', None) + self.key2 = kwargs.get('key2', None) + + +class CognitiveServicesAccountUpdateParameters(Model): + """The parameters to provide for the account. + + :param sku: Gets or sets the SKU of the resource. + :type sku: ~azure.mgmt.cognitiveservices.models.Sku + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater than 128 characters and + value no greater than 256 characters. + :type tags: dict[str, str] + :param properties: Additional properties for Account. Only provided fields + will be updated. + :type properties: object + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(CognitiveServicesAccountUpdateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.tags = kwargs.get('tags', None) + self.properties = kwargs.get('properties', None) + + +class CognitiveServicesResourceAndSku(Model): + """Cognitive Services resource type and SKU. + + :param resource_type: Resource Namespace and Type + :type resource_type: str + :param sku: The SKU of Cognitive Services account. + :type sku: ~azure.mgmt.cognitiveservices.models.Sku + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, **kwargs): + super(CognitiveServicesResourceAndSku, self).__init__(**kwargs) + self.resource_type = kwargs.get('resource_type', None) + self.sku = kwargs.get('sku', None) + + +class Error(Model): + """Cognitive Services error object. + + :param error: The error body. + :type error: ~azure.mgmt.cognitiveservices.models.ErrorBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorBody'}, + } + + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorException(HttpOperationError): + """Server responsed with exception of type: 'Error'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorException, self).__init__(deserialize, response, 'Error', *args) + + +class ErrorBody(Model): + """Cognitive Services error body. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. error code + :type code: str + :param message: Required. error message + :type message: str + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorBody, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class IpRule(Model): + """A rule governing the accessibility from a specific ip address or ip range. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. An IPv4 address range in CIDR notation, such as + '124.56.78.91' (simple IP address) or '124.56.78.0/24' (all addresses that + start with 124.56.78). + :type value: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IpRule, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class MetricName(Model): + """A metric name. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The name of the metric. + :vartype value: str + :ivar localized_value: The friendly name of the metric. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MetricName, self).__init__(**kwargs) + self.value = None + self.localized_value = None + + +class NetworkRuleSet(Model): + """A set of rules governing the network accessibility. + + :param bypass: Tells what traffic can bypass network rules. This can be + 'AzureServices' or 'None'. If not specified the default is + 'AzureServices'. Possible values include: 'AzureServices', 'None' + :type bypass: str or + ~azure.mgmt.cognitiveservices.models.NetworkRuleBypassOptions + :param default_action: The default action when no rule from ipRules and + from virtualNetworkRules match. This is only used after the bypass + property has been evaluated. Possible values include: 'Allow', 'Deny' + :type default_action: str or + ~azure.mgmt.cognitiveservices.models.NetworkRuleAction + :param ip_rules: The list of IP address rules. + :type ip_rules: list[~azure.mgmt.cognitiveservices.models.IpRule] + :param virtual_network_rules: The list of virtual network rules. + :type virtual_network_rules: + list[~azure.mgmt.cognitiveservices.models.VirtualNetworkRule] + """ + + _attribute_map = { + 'bypass': {'key': 'bypass', 'type': 'str'}, + 'default_action': {'key': 'defaultAction', 'type': 'str'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IpRule]'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + } + + def __init__(self, **kwargs): + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = kwargs.get('bypass', None) + self.default_action = kwargs.get('default_action', None) + self.ip_rules = kwargs.get('ip_rules', None) + self.virtual_network_rules = kwargs.get('virtual_network_rules', None) + + +class OperationDisplayInfo(Model): + """The operation supported by Cognitive Services. + + :param description: The description of the operation. + :type description: str + :param operation: The action that users can perform, based on their + permission level. + :type operation: str + :param provider: Service provider: Microsoft Cognitive Services. + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplayInfo, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.operation = kwargs.get('operation', None) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + + +class OperationEntity(Model): + """The operation supported by Cognitive Services. + + :param name: Operation name: {provider}/{resource}/{operation}. + :type name: str + :param display: The operation supported by Cognitive Services. + :type display: ~azure.mgmt.cognitiveservices.models.OperationDisplayInfo + :param origin: The origin of the operation. + :type origin: str + :param properties: Additional properties. + :type properties: object + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplayInfo'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(OperationEntity, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.properties = kwargs.get('properties', None) + + +class RegenerateKeyParameters(Model): + """Regenerate key parameters. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. key name to generate (Key1|Key2). Possible + values include: 'Key1', 'Key2' + :type key_name: str or ~azure.mgmt.cognitiveservices.models.KeyName + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'KeyName'}, + } + + def __init__(self, **kwargs): + super(RegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) + + +class ResourceSku(Model): + """Describes an available Cognitive Services SKU. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar resource_type: The type of resource the SKU applies to. + :vartype resource_type: str + :ivar name: The name of SKU. + :vartype name: str + :ivar tier: Specifies the tier of Cognitive Services account. + :vartype tier: str + :ivar kind: The Kind of resources that are supported in this SKU. + :vartype kind: str + :ivar locations: The set of locations that the SKU is available. + :vartype locations: list[str] + :ivar restrictions: The restrictions because of which SKU cannot be used. + This is empty if there are no restrictions. + :vartype restrictions: + list[~azure.mgmt.cognitiveservices.models.ResourceSkuRestrictions] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'name': {'readonly': True}, + 'tier': {'readonly': True}, + 'kind': {'readonly': True}, + 'locations': {'readonly': True}, + 'restrictions': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'restrictions': {'key': 'restrictions', 'type': '[ResourceSkuRestrictions]'}, + } + + def __init__(self, **kwargs): + super(ResourceSku, self).__init__(**kwargs) + self.resource_type = None + self.name = None + self.tier = None + self.kind = None + self.locations = None + self.restrictions = None + + +class ResourceSkuRestrictionInfo(Model): + """ResourceSkuRestrictionInfo. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar locations: Locations where the SKU is restricted + :vartype locations: list[str] + :ivar zones: List of availability zones where the SKU is restricted. + :vartype zones: list[str] + """ + + _validation = { + 'locations': {'readonly': True}, + 'zones': {'readonly': True}, + } + + _attribute_map = { + 'locations': {'key': 'locations', 'type': '[str]'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ResourceSkuRestrictionInfo, self).__init__(**kwargs) + self.locations = None + self.zones = None + + +class ResourceSkuRestrictions(Model): + """Describes restrictions of a SKU. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of restrictions. Possible values include: 'Location', + 'Zone' + :vartype type: str or + ~azure.mgmt.cognitiveservices.models.ResourceSkuRestrictionsType + :ivar values: The value of restrictions. If the restriction type is set to + location. This would be different locations where the SKU is restricted. + :vartype values: list[str] + :ivar restriction_info: The information about the restriction where the + SKU cannot be used. + :vartype restriction_info: + ~azure.mgmt.cognitiveservices.models.ResourceSkuRestrictionInfo + :ivar reason_code: The reason for restriction. Possible values include: + 'QuotaId', 'NotAvailableForSubscription' + :vartype reason_code: str or + ~azure.mgmt.cognitiveservices.models.ResourceSkuRestrictionsReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + 'restriction_info': {'readonly': True}, + 'reason_code': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'ResourceSkuRestrictionsType'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'restriction_info': {'key': 'restrictionInfo', 'type': 'ResourceSkuRestrictionInfo'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceSkuRestrictions, self).__init__(**kwargs) + self.type = None + self.values = None + self.restriction_info = None + self.reason_code = None + + +class Sku(Model): + """The SKU of the cognitive services account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the sku name. Required for account + creation, optional for update. + :type name: str + :ivar tier: Gets the sku tier. This is based on the SKU name. Possible + values include: 'Free', 'Standard', 'Premium' + :vartype tier: str or ~azure.mgmt.cognitiveservices.models.SkuTier + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + } + + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = None + + +class Usage(Model): + """The usage data for a usage request. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param unit: The unit of the metric. Possible values include: 'Count', + 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', + 'Milliseconds' + :type unit: str or ~azure.mgmt.cognitiveservices.models.UnitType + :ivar name: The name information for the metric. + :vartype name: ~azure.mgmt.cognitiveservices.models.MetricName + :ivar quota_period: The quota period used to summarize the usage values. + :vartype quota_period: str + :ivar limit: Maximum value for this metric. + :vartype limit: float + :ivar current_value: Current value for this metric. + :vartype current_value: float + :ivar next_reset_time: Next reset time for current quota. + :vartype next_reset_time: str + :param status: Cognitive Services account quota usage status. Possible + values include: 'Included', 'Blocked', 'InOverage', 'Unknown' + :type status: str or ~azure.mgmt.cognitiveservices.models.QuotaUsageStatus + """ + + _validation = { + 'name': {'readonly': True}, + 'quota_period': {'readonly': True}, + 'limit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'next_reset_time': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'MetricName'}, + 'quota_period': {'key': 'quotaPeriod', 'type': 'str'}, + 'limit': {'key': 'limit', 'type': 'float'}, + 'current_value': {'key': 'currentValue', 'type': 'float'}, + 'next_reset_time': {'key': 'nextResetTime', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) + self.unit = kwargs.get('unit', None) + self.name = None + self.quota_period = None + self.limit = None + self.current_value = None + self.next_reset_time = None + self.status = kwargs.get('status', None) + + +class UsagesResult(Model): + """The response to a list usage request. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of usages for Cognitive Service account. + :vartype value: list[~azure.mgmt.cognitiveservices.models.Usage] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Usage]'}, + } + + def __init__(self, **kwargs): + super(UsagesResult, self).__init__(**kwargs) + self.value = None + + +class VirtualNetworkRule(Model): + """A rule governing the accessibility from a specific virtual network. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Full resource id of a vnet subnet, such as + '/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1'. + :type id: str + :param state: Gets the state of virtual network rule. + :type state: str + :param ignore_missing_vnet_service_endpoint: Ignore missing vnet service + endpoint or not. + :type ignore_missing_vnet_service_endpoint: bool + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'ignore_missing_vnet_service_endpoint': {'key': 'ignoreMissingVnetServiceEndpoint', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(VirtualNetworkRule, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.state = kwargs.get('state', None) + self.ignore_missing_vnet_service_endpoint = kwargs.get('ignore_missing_vnet_service_endpoint', None) diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/_models_py3.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/_models_py3.py new file mode 100644 index 000000000000..d0c111651f88 --- /dev/null +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/_models_py3.py @@ -0,0 +1,876 @@ +# 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 CheckDomainAvailabilityParameter(Model): + """Check Domain availability parameter. + + All required parameters must be populated in order to send to Azure. + + :param subdomain_name: Required. The subdomain name to use. + :type subdomain_name: str + :param type: Required. The Type of the resource. + :type type: str + """ + + _validation = { + 'subdomain_name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'subdomain_name': {'key': 'subdomainName', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, subdomain_name: str, type: str, **kwargs) -> None: + super(CheckDomainAvailabilityParameter, self).__init__(**kwargs) + self.subdomain_name = subdomain_name + self.type = type + + +class CheckDomainAvailabilityResult(Model): + """Check Domain availability result. + + :param is_subdomain_available: Indicates the given SKU is available or + not. + :type is_subdomain_available: bool + :param reason: Reason why the SKU is not available. + :type reason: str + :param subdomain_name: The subdomain name to use. + :type subdomain_name: str + :param type: The Type of the resource. + :type type: str + """ + + _attribute_map = { + 'is_subdomain_available': {'key': 'isSubdomainAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'subdomain_name': {'key': 'subdomainName', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, is_subdomain_available: bool=None, reason: str=None, subdomain_name: str=None, type: str=None, **kwargs) -> None: + super(CheckDomainAvailabilityResult, self).__init__(**kwargs) + self.is_subdomain_available = is_subdomain_available + self.reason = reason + self.subdomain_name = subdomain_name + self.type = type + + +class CheckSkuAvailabilityParameter(Model): + """Check SKU availability parameter. + + All required parameters must be populated in order to send to Azure. + + :param skus: Required. The SKU of the resource. + :type skus: list[str] + :param kind: Required. The Kind of the resource. + :type kind: str + :param type: Required. The Type of the resource. + :type type: str + """ + + _validation = { + 'skus': {'required': True}, + 'kind': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'skus': {'key': 'skus', 'type': '[str]'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, skus, kind: str, type: str, **kwargs) -> None: + super(CheckSkuAvailabilityParameter, self).__init__(**kwargs) + self.skus = skus + self.kind = kind + self.type = type + + +class CheckSkuAvailabilityResult(Model): + """Check SKU availability result. + + :param kind: The Kind of the resource. + :type kind: str + :param type: The Type of the resource. + :type type: str + :param sku_name: The SKU of Cognitive Services account. + :type sku_name: str + :param sku_available: Indicates the given SKU is available or not. + :type sku_available: bool + :param reason: Reason why the SKU is not available. + :type reason: str + :param message: Additional error message. + :type message: str + """ + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'sku_name': {'key': 'skuName', 'type': 'str'}, + 'sku_available': {'key': 'skuAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, type: str=None, sku_name: str=None, sku_available: bool=None, reason: str=None, message: str=None, **kwargs) -> None: + super(CheckSkuAvailabilityResult, self).__init__(**kwargs) + self.kind = kind + self.type = type + self.sku_name = sku_name + self.sku_available = sku_available + self.reason = reason + self.message = message + + +class CheckSkuAvailabilityResultList(Model): + """Check SKU availability result list. + + :param value: Check SKU availability result list. + :type value: + list[~azure.mgmt.cognitiveservices.models.CheckSkuAvailabilityResult] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CheckSkuAvailabilityResult]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(CheckSkuAvailabilityResultList, self).__init__(**kwargs) + self.value = value + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CognitiveServicesAccount(Model): + """Cognitive Services Account is an Azure resource representing the + provisioned account, its type, location and SKU. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param etag: Entity Tag + :type etag: str + :ivar id: The id of the created account + :vartype id: str + :param kind: Type of cognitive service account. + :type kind: str + :param location: The location of the resource + :type location: str + :ivar name: The name of the created account + :vartype name: str + :ivar provisioning_state: Gets the status of the cognitive services + account at the time the operation was called. Possible values include: + 'Creating', 'ResolvingDNS', 'Moving', 'Deleting', 'Succeeded', 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.cognitiveservices.models.ProvisioningState + :param endpoint: Endpoint of the created account. + :type endpoint: str + :param internal_id: The internal identifier. + :type internal_id: str + :param custom_sub_domain_name: Optional subdomain name used for + token-based authentication. + :type custom_sub_domain_name: str + :param network_acls: A collection of rules governing the accessibility + from specific network locations. + :type network_acls: ~azure.mgmt.cognitiveservices.models.NetworkRuleSet + :param sku: The SKU of Cognitive Services account. + :type sku: ~azure.mgmt.cognitiveservices.models.Sku + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater than 128 characters and + value no greater than 256 characters. + :type tags: dict[str, str] + :ivar type: Resource type + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'etag': {'key': 'etag', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'endpoint': {'key': 'properties.endpoint', 'type': 'str'}, + 'internal_id': {'key': 'properties.internalId', 'type': 'str'}, + 'custom_sub_domain_name': {'key': 'properties.customSubDomainName', 'type': 'str'}, + 'network_acls': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, etag: str=None, kind: str=None, location: str=None, endpoint: str=None, internal_id: str=None, custom_sub_domain_name: str=None, network_acls=None, sku=None, tags=None, **kwargs) -> None: + super(CognitiveServicesAccount, self).__init__(**kwargs) + self.etag = etag + self.id = None + self.kind = kind + self.location = location + self.name = None + self.provisioning_state = None + self.endpoint = endpoint + self.internal_id = internal_id + self.custom_sub_domain_name = custom_sub_domain_name + self.network_acls = network_acls + self.sku = sku + self.tags = tags + self.type = None + + +class CognitiveServicesAccountCreateParameters(Model): + """The parameters to provide for the account. + + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the SKU of the resource. + :type sku: ~azure.mgmt.cognitiveservices.models.Sku + :param kind: Required. Required. Gets or sets the Kind of the resource. + :type kind: str + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update the request will succeed. + :type location: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater than 128 characters and + value no greater than 256 characters. + :type tags: dict[str, str] + :param properties: Required. Must exist in the request. Must be an empty + object. Must not be null. + :type properties: object + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, *, sku, kind: str, location: str, properties, tags=None, **kwargs) -> None: + super(CognitiveServicesAccountCreateParameters, self).__init__(**kwargs) + self.sku = sku + self.kind = kind + self.location = location + self.tags = tags + self.properties = properties + + +class CognitiveServicesAccountEnumerateSkusResult(Model): + """The list of cognitive services accounts operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: Gets the list of Cognitive Services accounts and their + properties. + :vartype value: + list[~azure.mgmt.cognitiveservices.models.CognitiveServicesResourceAndSku] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CognitiveServicesResourceAndSku]'}, + } + + def __init__(self, **kwargs) -> None: + super(CognitiveServicesAccountEnumerateSkusResult, self).__init__(**kwargs) + self.value = None + + +class CognitiveServicesAccountKeys(Model): + """The access keys for the cognitive services account. + + :param key1: Gets the value of key 1. + :type key1: str + :param key2: Gets the value of key 2. + :type key2: str + """ + + _attribute_map = { + 'key1': {'key': 'key1', 'type': 'str'}, + 'key2': {'key': 'key2', 'type': 'str'}, + } + + def __init__(self, *, key1: str=None, key2: str=None, **kwargs) -> None: + super(CognitiveServicesAccountKeys, self).__init__(**kwargs) + self.key1 = key1 + self.key2 = key2 + + +class CognitiveServicesAccountUpdateParameters(Model): + """The parameters to provide for the account. + + :param sku: Gets or sets the SKU of the resource. + :type sku: ~azure.mgmt.cognitiveservices.models.Sku + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater than 128 characters and + value no greater than 256 characters. + :type tags: dict[str, str] + :param properties: Additional properties for Account. Only provided fields + will be updated. + :type properties: object + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, *, sku=None, tags=None, properties=None, **kwargs) -> None: + super(CognitiveServicesAccountUpdateParameters, self).__init__(**kwargs) + self.sku = sku + self.tags = tags + self.properties = properties + + +class CognitiveServicesResourceAndSku(Model): + """Cognitive Services resource type and SKU. + + :param resource_type: Resource Namespace and Type + :type resource_type: str + :param sku: The SKU of Cognitive Services account. + :type sku: ~azure.mgmt.cognitiveservices.models.Sku + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, *, resource_type: str=None, sku=None, **kwargs) -> None: + super(CognitiveServicesResourceAndSku, self).__init__(**kwargs) + self.resource_type = resource_type + self.sku = sku + + +class Error(Model): + """Cognitive Services error object. + + :param error: The error body. + :type error: ~azure.mgmt.cognitiveservices.models.ErrorBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorBody'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.error = error + + +class ErrorException(HttpOperationError): + """Server responsed with exception of type: 'Error'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorException, self).__init__(deserialize, response, 'Error', *args) + + +class ErrorBody(Model): + """Cognitive Services error body. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. error code + :type code: str + :param message: Required. error message + :type message: str + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str, message: str, **kwargs) -> None: + super(ErrorBody, self).__init__(**kwargs) + self.code = code + self.message = message + + +class IpRule(Model): + """A rule governing the accessibility from a specific ip address or ip range. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. An IPv4 address range in CIDR notation, such as + '124.56.78.91' (simple IP address) or '124.56.78.0/24' (all addresses that + start with 124.56.78). + :type value: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, value: str, **kwargs) -> None: + super(IpRule, self).__init__(**kwargs) + self.value = value + + +class MetricName(Model): + """A metric name. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The name of the metric. + :vartype value: str + :ivar localized_value: The friendly name of the metric. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(MetricName, self).__init__(**kwargs) + self.value = None + self.localized_value = None + + +class NetworkRuleSet(Model): + """A set of rules governing the network accessibility. + + :param bypass: Tells what traffic can bypass network rules. This can be + 'AzureServices' or 'None'. If not specified the default is + 'AzureServices'. Possible values include: 'AzureServices', 'None' + :type bypass: str or + ~azure.mgmt.cognitiveservices.models.NetworkRuleBypassOptions + :param default_action: The default action when no rule from ipRules and + from virtualNetworkRules match. This is only used after the bypass + property has been evaluated. Possible values include: 'Allow', 'Deny' + :type default_action: str or + ~azure.mgmt.cognitiveservices.models.NetworkRuleAction + :param ip_rules: The list of IP address rules. + :type ip_rules: list[~azure.mgmt.cognitiveservices.models.IpRule] + :param virtual_network_rules: The list of virtual network rules. + :type virtual_network_rules: + list[~azure.mgmt.cognitiveservices.models.VirtualNetworkRule] + """ + + _attribute_map = { + 'bypass': {'key': 'bypass', 'type': 'str'}, + 'default_action': {'key': 'defaultAction', 'type': 'str'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IpRule]'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + } + + def __init__(self, *, bypass=None, default_action=None, ip_rules=None, virtual_network_rules=None, **kwargs) -> None: + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = bypass + self.default_action = default_action + self.ip_rules = ip_rules + self.virtual_network_rules = virtual_network_rules + + +class OperationDisplayInfo(Model): + """The operation supported by Cognitive Services. + + :param description: The description of the operation. + :type description: str + :param operation: The action that users can perform, based on their + permission level. + :type operation: str + :param provider: Service provider: Microsoft Cognitive Services. + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + } + + def __init__(self, *, description: str=None, operation: str=None, provider: str=None, resource: str=None, **kwargs) -> None: + super(OperationDisplayInfo, self).__init__(**kwargs) + self.description = description + self.operation = operation + self.provider = provider + self.resource = resource + + +class OperationEntity(Model): + """The operation supported by Cognitive Services. + + :param name: Operation name: {provider}/{resource}/{operation}. + :type name: str + :param display: The operation supported by Cognitive Services. + :type display: ~azure.mgmt.cognitiveservices.models.OperationDisplayInfo + :param origin: The origin of the operation. + :type origin: str + :param properties: Additional properties. + :type properties: object + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplayInfo'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, *, name: str=None, display=None, origin: str=None, properties=None, **kwargs) -> None: + super(OperationEntity, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.properties = properties + + +class RegenerateKeyParameters(Model): + """Regenerate key parameters. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. key name to generate (Key1|Key2). Possible + values include: 'Key1', 'Key2' + :type key_name: str or ~azure.mgmt.cognitiveservices.models.KeyName + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'KeyName'}, + } + + def __init__(self, *, key_name, **kwargs) -> None: + super(RegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = key_name + + +class ResourceSku(Model): + """Describes an available Cognitive Services SKU. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar resource_type: The type of resource the SKU applies to. + :vartype resource_type: str + :ivar name: The name of SKU. + :vartype name: str + :ivar tier: Specifies the tier of Cognitive Services account. + :vartype tier: str + :ivar kind: The Kind of resources that are supported in this SKU. + :vartype kind: str + :ivar locations: The set of locations that the SKU is available. + :vartype locations: list[str] + :ivar restrictions: The restrictions because of which SKU cannot be used. + This is empty if there are no restrictions. + :vartype restrictions: + list[~azure.mgmt.cognitiveservices.models.ResourceSkuRestrictions] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'name': {'readonly': True}, + 'tier': {'readonly': True}, + 'kind': {'readonly': True}, + 'locations': {'readonly': True}, + 'restrictions': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'restrictions': {'key': 'restrictions', 'type': '[ResourceSkuRestrictions]'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceSku, self).__init__(**kwargs) + self.resource_type = None + self.name = None + self.tier = None + self.kind = None + self.locations = None + self.restrictions = None + + +class ResourceSkuRestrictionInfo(Model): + """ResourceSkuRestrictionInfo. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar locations: Locations where the SKU is restricted + :vartype locations: list[str] + :ivar zones: List of availability zones where the SKU is restricted. + :vartype zones: list[str] + """ + + _validation = { + 'locations': {'readonly': True}, + 'zones': {'readonly': True}, + } + + _attribute_map = { + 'locations': {'key': 'locations', 'type': '[str]'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceSkuRestrictionInfo, self).__init__(**kwargs) + self.locations = None + self.zones = None + + +class ResourceSkuRestrictions(Model): + """Describes restrictions of a SKU. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of restrictions. Possible values include: 'Location', + 'Zone' + :vartype type: str or + ~azure.mgmt.cognitiveservices.models.ResourceSkuRestrictionsType + :ivar values: The value of restrictions. If the restriction type is set to + location. This would be different locations where the SKU is restricted. + :vartype values: list[str] + :ivar restriction_info: The information about the restriction where the + SKU cannot be used. + :vartype restriction_info: + ~azure.mgmt.cognitiveservices.models.ResourceSkuRestrictionInfo + :ivar reason_code: The reason for restriction. Possible values include: + 'QuotaId', 'NotAvailableForSubscription' + :vartype reason_code: str or + ~azure.mgmt.cognitiveservices.models.ResourceSkuRestrictionsReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + 'restriction_info': {'readonly': True}, + 'reason_code': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'ResourceSkuRestrictionsType'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'restriction_info': {'key': 'restrictionInfo', 'type': 'ResourceSkuRestrictionInfo'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceSkuRestrictions, self).__init__(**kwargs) + self.type = None + self.values = None + self.restriction_info = None + self.reason_code = None + + +class Sku(Model): + """The SKU of the cognitive services account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the sku name. Required for account + creation, optional for update. + :type name: str + :ivar tier: Gets the sku tier. This is based on the SKU name. Possible + values include: 'Free', 'Standard', 'Premium' + :vartype tier: str or ~azure.mgmt.cognitiveservices.models.SkuTier + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + } + + def __init__(self, *, name: str, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = None + + +class Usage(Model): + """The usage data for a usage request. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param unit: The unit of the metric. Possible values include: 'Count', + 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', + 'Milliseconds' + :type unit: str or ~azure.mgmt.cognitiveservices.models.UnitType + :ivar name: The name information for the metric. + :vartype name: ~azure.mgmt.cognitiveservices.models.MetricName + :ivar quota_period: The quota period used to summarize the usage values. + :vartype quota_period: str + :ivar limit: Maximum value for this metric. + :vartype limit: float + :ivar current_value: Current value for this metric. + :vartype current_value: float + :ivar next_reset_time: Next reset time for current quota. + :vartype next_reset_time: str + :param status: Cognitive Services account quota usage status. Possible + values include: 'Included', 'Blocked', 'InOverage', 'Unknown' + :type status: str or ~azure.mgmt.cognitiveservices.models.QuotaUsageStatus + """ + + _validation = { + 'name': {'readonly': True}, + 'quota_period': {'readonly': True}, + 'limit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'next_reset_time': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'MetricName'}, + 'quota_period': {'key': 'quotaPeriod', 'type': 'str'}, + 'limit': {'key': 'limit', 'type': 'float'}, + 'current_value': {'key': 'currentValue', 'type': 'float'}, + 'next_reset_time': {'key': 'nextResetTime', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, *, unit=None, status=None, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.unit = unit + self.name = None + self.quota_period = None + self.limit = None + self.current_value = None + self.next_reset_time = None + self.status = status + + +class UsagesResult(Model): + """The response to a list usage request. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of usages for Cognitive Service account. + :vartype value: list[~azure.mgmt.cognitiveservices.models.Usage] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Usage]'}, + } + + def __init__(self, **kwargs) -> None: + super(UsagesResult, self).__init__(**kwargs) + self.value = None + + +class VirtualNetworkRule(Model): + """A rule governing the accessibility from a specific virtual network. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Full resource id of a vnet subnet, such as + '/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1'. + :type id: str + :param state: Gets the state of virtual network rule. + :type state: str + :param ignore_missing_vnet_service_endpoint: Ignore missing vnet service + endpoint or not. + :type ignore_missing_vnet_service_endpoint: bool + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'ignore_missing_vnet_service_endpoint': {'key': 'ignoreMissingVnetServiceEndpoint', 'type': 'bool'}, + } + + def __init__(self, *, id: str, state: str=None, ignore_missing_vnet_service_endpoint: bool=None, **kwargs) -> None: + super(VirtualNetworkRule, self).__init__(**kwargs) + self.id = id + self.state = state + self.ignore_missing_vnet_service_endpoint = ignore_missing_vnet_service_endpoint diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_paged.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/_paged_models.py similarity index 53% rename from sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_paged.py rename to sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/_paged_models.py index 6a1e5be90b2a..312ad7c70438 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_paged.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/_paged_models.py @@ -25,3 +25,29 @@ class CognitiveServicesAccountPaged(Paged): def __init__(self, *args, **kwargs): super(CognitiveServicesAccountPaged, self).__init__(*args, **kwargs) +class ResourceSkuPaged(Paged): + """ + A paging container for iterating over a list of :class:`ResourceSku ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ResourceSku]'} + } + + def __init__(self, *args, **kwargs): + + super(ResourceSkuPaged, self).__init__(*args, **kwargs) +class OperationEntityPaged(Paged): + """ + A paging container for iterating over a list of :class:`OperationEntity ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[OperationEntity]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationEntityPaged, self).__init__(*args, **kwargs) diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/check_sku_availability_parameter.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/check_sku_availability_parameter.py deleted file mode 100644 index 13bd8adec825..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/check_sku_availability_parameter.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 CheckSkuAvailabilityParameter(Model): - """Check SKU availability parameter. - - All required parameters must be populated in order to send to Azure. - - :param skus: Required. The SKU of the resource. - :type skus: list[str] - :param kind: Required. The Kind of the resource. - :type kind: str - :param type: Required. The Type of the resource. - :type type: str - """ - - _validation = { - 'skus': {'required': True}, - 'kind': {'required': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'skus': {'key': 'skus', 'type': '[str]'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(CheckSkuAvailabilityParameter, self).__init__(**kwargs) - self.skus = kwargs.get('skus', None) - self.kind = kwargs.get('kind', None) - self.type = kwargs.get('type', None) diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/check_sku_availability_parameter_py3.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/check_sku_availability_parameter_py3.py deleted file mode 100644 index 216bf214d575..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/check_sku_availability_parameter_py3.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 CheckSkuAvailabilityParameter(Model): - """Check SKU availability parameter. - - All required parameters must be populated in order to send to Azure. - - :param skus: Required. The SKU of the resource. - :type skus: list[str] - :param kind: Required. The Kind of the resource. - :type kind: str - :param type: Required. The Type of the resource. - :type type: str - """ - - _validation = { - 'skus': {'required': True}, - 'kind': {'required': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'skus': {'key': 'skus', 'type': '[str]'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, *, skus, kind: str, type: str, **kwargs) -> None: - super(CheckSkuAvailabilityParameter, self).__init__(**kwargs) - self.skus = skus - self.kind = kind - self.type = type diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/check_sku_availability_result.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/check_sku_availability_result.py deleted file mode 100644 index 0bf6f25e6345..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/check_sku_availability_result.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 CheckSkuAvailabilityResult(Model): - """Check SKU availability result. - - :param kind: The Kind of the resource. - :type kind: str - :param type: The Type of the resource. - :type type: str - :param sku_name: The SKU of Cognitive Services account. - :type sku_name: str - :param sku_available: Indicates the given SKU is available or not. - :type sku_available: bool - :param reason: Reason why the SKU is not available. - :type reason: str - :param message: Additional error message. - :type message: str - """ - - _attribute_map = { - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'sku_name': {'key': 'skuName', 'type': 'str'}, - 'sku_available': {'key': 'skuAvailable', 'type': 'bool'}, - 'reason': {'key': 'reason', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(CheckSkuAvailabilityResult, self).__init__(**kwargs) - self.kind = kwargs.get('kind', None) - self.type = kwargs.get('type', None) - self.sku_name = kwargs.get('sku_name', None) - self.sku_available = kwargs.get('sku_available', None) - self.reason = kwargs.get('reason', None) - self.message = kwargs.get('message', None) diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/check_sku_availability_result_list.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/check_sku_availability_result_list.py deleted file mode 100644 index bb5d7bdb5aba..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/check_sku_availability_result_list.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 CheckSkuAvailabilityResultList(Model): - """Check SKU availability result list. - - :param value: Check SKU availability result list. - :type value: - list[~azure.mgmt.cognitiveservices.models.CheckSkuAvailabilityResult] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[CheckSkuAvailabilityResult]'}, - } - - def __init__(self, **kwargs): - super(CheckSkuAvailabilityResultList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/check_sku_availability_result_list_py3.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/check_sku_availability_result_list_py3.py deleted file mode 100644 index e5c1bee9636e..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/check_sku_availability_result_list_py3.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 CheckSkuAvailabilityResultList(Model): - """Check SKU availability result list. - - :param value: Check SKU availability result list. - :type value: - list[~azure.mgmt.cognitiveservices.models.CheckSkuAvailabilityResult] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[CheckSkuAvailabilityResult]'}, - } - - def __init__(self, *, value=None, **kwargs) -> None: - super(CheckSkuAvailabilityResultList, self).__init__(**kwargs) - self.value = value diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/check_sku_availability_result_py3.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/check_sku_availability_result_py3.py deleted file mode 100644 index d822425dcf1c..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/check_sku_availability_result_py3.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 CheckSkuAvailabilityResult(Model): - """Check SKU availability result. - - :param kind: The Kind of the resource. - :type kind: str - :param type: The Type of the resource. - :type type: str - :param sku_name: The SKU of Cognitive Services account. - :type sku_name: str - :param sku_available: Indicates the given SKU is available or not. - :type sku_available: bool - :param reason: Reason why the SKU is not available. - :type reason: str - :param message: Additional error message. - :type message: str - """ - - _attribute_map = { - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'sku_name': {'key': 'skuName', 'type': 'str'}, - 'sku_available': {'key': 'skuAvailable', 'type': 'bool'}, - 'reason': {'key': 'reason', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, *, kind: str=None, type: str=None, sku_name: str=None, sku_available: bool=None, reason: str=None, message: str=None, **kwargs) -> None: - super(CheckSkuAvailabilityResult, self).__init__(**kwargs) - self.kind = kind - self.type = type - self.sku_name = sku_name - self.sku_available = sku_available - self.reason = reason - self.message = message diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account.py deleted file mode 100644 index e179eb7fc855..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account.py +++ /dev/null @@ -1,91 +0,0 @@ -# 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 CognitiveServicesAccount(Model): - """Cognitive Services Account is an Azure resource representing the - provisioned account, its type, location and SKU. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param etag: Entity Tag - :type etag: str - :ivar id: The id of the created account - :vartype id: str - :param kind: Type of cognitive service account. - :type kind: str - :param location: The location of the resource - :type location: str - :ivar name: The name of the created account - :vartype name: str - :ivar provisioning_state: Gets the status of the cognitive services - account at the time the operation was called. Possible values include: - 'Creating', 'ResolvingDNS', 'Moving', 'Deleting', 'Succeeded', 'Failed' - :vartype provisioning_state: str or - ~azure.mgmt.cognitiveservices.models.ProvisioningState - :param endpoint: Endpoint of the created account. - :type endpoint: str - :param internal_id: The internal identifier. - :type internal_id: str - :param custom_sub_domain_name: Optional subdomain name used for - token-based authentication. - :type custom_sub_domain_name: str - :param sku: The SKU of Cognitive Services account. - :type sku: ~azure.mgmt.cognitiveservices.models.Sku - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used in viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key no greater than 128 characters and - value no greater than 256 characters. - :type tags: dict[str, str] - :ivar type: Resource type - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'etag': {'key': 'etag', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'endpoint': {'key': 'properties.endpoint', 'type': 'str'}, - 'internal_id': {'key': 'properties.internalId', 'type': 'str'}, - 'custom_sub_domain_name': {'key': 'properties.customSubDomainName', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(CognitiveServicesAccount, self).__init__(**kwargs) - self.etag = kwargs.get('etag', None) - self.id = None - self.kind = kwargs.get('kind', None) - self.location = kwargs.get('location', None) - self.name = None - self.provisioning_state = None - self.endpoint = kwargs.get('endpoint', None) - self.internal_id = kwargs.get('internal_id', None) - self.custom_sub_domain_name = kwargs.get('custom_sub_domain_name', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - self.type = None diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_create_parameters.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_create_parameters.py deleted file mode 100644 index e3577255672d..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_create_parameters.py +++ /dev/null @@ -1,62 +0,0 @@ -# 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 CognitiveServicesAccountCreateParameters(Model): - """The parameters to provide for the account. - - All required parameters must be populated in order to send to Azure. - - :param sku: Required. Required. Gets or sets the SKU of the resource. - :type sku: ~azure.mgmt.cognitiveservices.models.Sku - :param kind: Required. Required. Gets or sets the Kind of the resource. - :type kind: str - :param location: Required. Required. Gets or sets the location of the - resource. This will be one of the supported and registered Azure Geo - Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - resource cannot be changed once it is created, but if an identical geo - region is specified on update the request will succeed. - :type location: str - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used in viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key no greater than 128 characters and - value no greater than 256 characters. - :type tags: dict[str, str] - :param properties: Required. Must exist in the request. Must be an empty - object. Must not be null. - :type properties: object - """ - - _validation = { - 'sku': {'required': True}, - 'kind': {'required': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': 'object'}, - } - - def __init__(self, **kwargs): - super(CognitiveServicesAccountCreateParameters, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - self.kind = kwargs.get('kind', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.properties = kwargs.get('properties', None) diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_create_parameters_py3.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_create_parameters_py3.py deleted file mode 100644 index 619a92743f93..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_create_parameters_py3.py +++ /dev/null @@ -1,62 +0,0 @@ -# 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 CognitiveServicesAccountCreateParameters(Model): - """The parameters to provide for the account. - - All required parameters must be populated in order to send to Azure. - - :param sku: Required. Required. Gets or sets the SKU of the resource. - :type sku: ~azure.mgmt.cognitiveservices.models.Sku - :param kind: Required. Required. Gets or sets the Kind of the resource. - :type kind: str - :param location: Required. Required. Gets or sets the location of the - resource. This will be one of the supported and registered Azure Geo - Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - resource cannot be changed once it is created, but if an identical geo - region is specified on update the request will succeed. - :type location: str - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used in viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key no greater than 128 characters and - value no greater than 256 characters. - :type tags: dict[str, str] - :param properties: Required. Must exist in the request. Must be an empty - object. Must not be null. - :type properties: object - """ - - _validation = { - 'sku': {'required': True}, - 'kind': {'required': True}, - 'location': {'required': True}, - 'properties': {'required': True}, - } - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': 'object'}, - } - - def __init__(self, *, sku, kind: str, location: str, properties, tags=None, **kwargs) -> None: - super(CognitiveServicesAccountCreateParameters, self).__init__(**kwargs) - self.sku = sku - self.kind = kind - self.location = location - self.tags = tags - self.properties = properties diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_enumerate_skus_result.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_enumerate_skus_result.py deleted file mode 100644 index 96992c1e071d..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_enumerate_skus_result.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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 CognitiveServicesAccountEnumerateSkusResult(Model): - """The list of cognitive services accounts operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar value: Gets the list of Cognitive Services accounts and their - properties. - :vartype value: - list[~azure.mgmt.cognitiveservices.models.CognitiveServicesResourceAndSku] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[CognitiveServicesResourceAndSku]'}, - } - - def __init__(self, **kwargs): - super(CognitiveServicesAccountEnumerateSkusResult, self).__init__(**kwargs) - self.value = None diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_enumerate_skus_result_py3.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_enumerate_skus_result_py3.py deleted file mode 100644 index 4327cfe5fa1c..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_enumerate_skus_result_py3.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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 CognitiveServicesAccountEnumerateSkusResult(Model): - """The list of cognitive services accounts operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar value: Gets the list of Cognitive Services accounts and their - properties. - :vartype value: - list[~azure.mgmt.cognitiveservices.models.CognitiveServicesResourceAndSku] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[CognitiveServicesResourceAndSku]'}, - } - - def __init__(self, **kwargs) -> None: - super(CognitiveServicesAccountEnumerateSkusResult, self).__init__(**kwargs) - self.value = None diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_keys.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_keys.py deleted file mode 100644 index 14f54a0735b3..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_keys.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 CognitiveServicesAccountKeys(Model): - """The access keys for the cognitive services account. - - :param key1: Gets the value of key 1. - :type key1: str - :param key2: Gets the value of key 2. - :type key2: str - """ - - _attribute_map = { - 'key1': {'key': 'key1', 'type': 'str'}, - 'key2': {'key': 'key2', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(CognitiveServicesAccountKeys, self).__init__(**kwargs) - self.key1 = kwargs.get('key1', None) - self.key2 = kwargs.get('key2', None) diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_keys_py3.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_keys_py3.py deleted file mode 100644 index 0407f9a5198b..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_keys_py3.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 CognitiveServicesAccountKeys(Model): - """The access keys for the cognitive services account. - - :param key1: Gets the value of key 1. - :type key1: str - :param key2: Gets the value of key 2. - :type key2: str - """ - - _attribute_map = { - 'key1': {'key': 'key1', 'type': 'str'}, - 'key2': {'key': 'key2', 'type': 'str'}, - } - - def __init__(self, *, key1: str=None, key2: str=None, **kwargs) -> None: - super(CognitiveServicesAccountKeys, self).__init__(**kwargs) - self.key1 = key1 - self.key2 = key2 diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_py3.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_py3.py deleted file mode 100644 index 756104162c63..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_py3.py +++ /dev/null @@ -1,91 +0,0 @@ -# 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 CognitiveServicesAccount(Model): - """Cognitive Services Account is an Azure resource representing the - provisioned account, its type, location and SKU. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param etag: Entity Tag - :type etag: str - :ivar id: The id of the created account - :vartype id: str - :param kind: Type of cognitive service account. - :type kind: str - :param location: The location of the resource - :type location: str - :ivar name: The name of the created account - :vartype name: str - :ivar provisioning_state: Gets the status of the cognitive services - account at the time the operation was called. Possible values include: - 'Creating', 'ResolvingDNS', 'Moving', 'Deleting', 'Succeeded', 'Failed' - :vartype provisioning_state: str or - ~azure.mgmt.cognitiveservices.models.ProvisioningState - :param endpoint: Endpoint of the created account. - :type endpoint: str - :param internal_id: The internal identifier. - :type internal_id: str - :param custom_sub_domain_name: Optional subdomain name used for - token-based authentication. - :type custom_sub_domain_name: str - :param sku: The SKU of Cognitive Services account. - :type sku: ~azure.mgmt.cognitiveservices.models.Sku - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used in viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key no greater than 128 characters and - value no greater than 256 characters. - :type tags: dict[str, str] - :ivar type: Resource type - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'etag': {'key': 'etag', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'endpoint': {'key': 'properties.endpoint', 'type': 'str'}, - 'internal_id': {'key': 'properties.internalId', 'type': 'str'}, - 'custom_sub_domain_name': {'key': 'properties.customSubDomainName', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, *, etag: str=None, kind: str=None, location: str=None, endpoint: str=None, internal_id: str=None, custom_sub_domain_name: str=None, sku=None, tags=None, **kwargs) -> None: - super(CognitiveServicesAccount, self).__init__(**kwargs) - self.etag = etag - self.id = None - self.kind = kind - self.location = location - self.name = None - self.provisioning_state = None - self.endpoint = endpoint - self.internal_id = internal_id - self.custom_sub_domain_name = custom_sub_domain_name - self.sku = sku - self.tags = tags - self.type = None diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_update_parameters.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_update_parameters.py deleted file mode 100644 index 96fd4967867b..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_update_parameters.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 CognitiveServicesAccountUpdateParameters(Model): - """The parameters to provide for the account. - - :param sku: Gets or sets the SKU of the resource. - :type sku: ~azure.mgmt.cognitiveservices.models.Sku - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used in viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key no greater than 128 characters and - value no greater than 256 characters. - :type tags: dict[str, str] - :param properties: Additional properties for Account. Only provided fields - will be updated. - :type properties: object - """ - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': 'object'}, - } - - def __init__(self, **kwargs): - super(CognitiveServicesAccountUpdateParameters, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - self.properties = kwargs.get('properties', None) diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_update_parameters_py3.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_update_parameters_py3.py deleted file mode 100644 index 798e507da635..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_update_parameters_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 CognitiveServicesAccountUpdateParameters(Model): - """The parameters to provide for the account. - - :param sku: Gets or sets the SKU of the resource. - :type sku: ~azure.mgmt.cognitiveservices.models.Sku - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used in viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key no greater than 128 characters and - value no greater than 256 characters. - :type tags: dict[str, str] - :param properties: Additional properties for Account. Only provided fields - will be updated. - :type properties: object - """ - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': 'object'}, - } - - def __init__(self, *, sku=None, tags=None, properties=None, **kwargs) -> None: - super(CognitiveServicesAccountUpdateParameters, self).__init__(**kwargs) - self.sku = sku - self.tags = tags - self.properties = properties diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_resource_and_sku.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_resource_and_sku.py deleted file mode 100644 index da6668117698..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_resource_and_sku.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 CognitiveServicesResourceAndSku(Model): - """Cognitive Services resource type and SKU. - - :param resource_type: Resource Namespace and Type - :type resource_type: str - :param sku: The SKU of Cognitive Services account. - :type sku: ~azure.mgmt.cognitiveservices.models.Sku - """ - - _attribute_map = { - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__(self, **kwargs): - super(CognitiveServicesResourceAndSku, self).__init__(**kwargs) - self.resource_type = kwargs.get('resource_type', None) - self.sku = kwargs.get('sku', None) diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_resource_and_sku_py3.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_resource_and_sku_py3.py deleted file mode 100644 index 3151afd709e4..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_resource_and_sku_py3.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 CognitiveServicesResourceAndSku(Model): - """Cognitive Services resource type and SKU. - - :param resource_type: Resource Namespace and Type - :type resource_type: str - :param sku: The SKU of Cognitive Services account. - :type sku: ~azure.mgmt.cognitiveservices.models.Sku - """ - - _attribute_map = { - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__(self, *, resource_type: str=None, sku=None, **kwargs) -> None: - super(CognitiveServicesResourceAndSku, self).__init__(**kwargs) - self.resource_type = resource_type - self.sku = sku diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/error.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/error.py deleted file mode 100644 index 8a5104af371a..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/error.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 Error(Model): - """Cognitive Services error object. - - :param error: The error body. - :type error: ~azure.mgmt.cognitiveservices.models.ErrorBody - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorBody'}, - } - - def __init__(self, **kwargs): - super(Error, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class ErrorException(HttpOperationError): - """Server responsed with exception of type: 'Error'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(ErrorException, self).__init__(deserialize, response, 'Error', *args) diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/error_body.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/error_body.py deleted file mode 100644 index 4371278624ec..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/error_body.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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 ErrorBody(Model): - """Cognitive Services error body. - - All required parameters must be populated in order to send to Azure. - - :param code: Required. error code - :type code: str - :param message: Required. error message - :type message: str - """ - - _validation = { - 'code': {'required': True}, - 'message': {'required': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ErrorBody, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/error_body_py3.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/error_body_py3.py deleted file mode 100644 index 7851e15157c3..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/error_body_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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 ErrorBody(Model): - """Cognitive Services error body. - - All required parameters must be populated in order to send to Azure. - - :param code: Required. error code - :type code: str - :param message: Required. error message - :type message: str - """ - - _validation = { - 'code': {'required': True}, - 'message': {'required': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, *, code: str, message: str, **kwargs) -> None: - super(ErrorBody, self).__init__(**kwargs) - self.code = code - self.message = message diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/error_py3.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/error_py3.py deleted file mode 100644 index 54d832eb4725..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/error_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 Error(Model): - """Cognitive Services error object. - - :param error: The error body. - :type error: ~azure.mgmt.cognitiveservices.models.ErrorBody - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorBody'}, - } - - def __init__(self, *, error=None, **kwargs) -> None: - super(Error, self).__init__(**kwargs) - self.error = error - - -class ErrorException(HttpOperationError): - """Server responsed with exception of type: 'Error'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(ErrorException, self).__init__(deserialize, response, 'Error', *args) diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/metric_name.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/metric_name.py deleted file mode 100644 index fd3e3d504c9d..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/metric_name.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 MetricName(Model): - """A metric name. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar value: The name of the metric. - :vartype value: str - :ivar localized_value: The friendly name of the metric. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(MetricName, self).__init__(**kwargs) - self.value = None - self.localized_value = None diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/metric_name_py3.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/metric_name_py3.py deleted file mode 100644 index 811d94729969..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/metric_name_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 MetricName(Model): - """A metric name. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar value: The name of the metric. - :vartype value: str - :ivar localized_value: The friendly name of the metric. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(MetricName, self).__init__(**kwargs) - self.value = None - self.localized_value = None diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/operation_display_info.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/operation_display_info.py deleted file mode 100644 index 612864781d45..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/operation_display_info.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 OperationDisplayInfo(Model): - """The operation supported by Cognitive Services. - - :param description: The description of the operation. - :type description: str - :param operation: The action that users can perform, based on their - permission level. - :type operation: str - :param provider: Service provider: Microsoft Cognitive Services. - :type provider: str - :param resource: Resource on which the operation is performed. - :type resource: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(OperationDisplayInfo, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.operation = kwargs.get('operation', None) - self.provider = kwargs.get('provider', None) - self.resource = kwargs.get('resource', None) diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/operation_display_info_py3.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/operation_display_info_py3.py deleted file mode 100644 index 18ea28fc7a43..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/operation_display_info_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 OperationDisplayInfo(Model): - """The operation supported by Cognitive Services. - - :param description: The description of the operation. - :type description: str - :param operation: The action that users can perform, based on their - permission level. - :type operation: str - :param provider: Service provider: Microsoft Cognitive Services. - :type provider: str - :param resource: Resource on which the operation is performed. - :type resource: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - } - - def __init__(self, *, description: str=None, operation: str=None, provider: str=None, resource: str=None, **kwargs) -> None: - super(OperationDisplayInfo, self).__init__(**kwargs) - self.description = description - self.operation = operation - self.provider = provider - self.resource = resource diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/operation_entity.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/operation_entity.py deleted file mode 100644 index 3411ea34f450..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/operation_entity.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 OperationEntity(Model): - """The operation supported by Cognitive Services. - - :param name: Operation name: {provider}/{resource}/{operation}. - :type name: str - :param display: The operation supported by Cognitive Services. - :type display: ~azure.mgmt.cognitiveservices.models.OperationDisplayInfo - :param origin: The origin of the operation. - :type origin: str - :param properties: Additional properties. - :type properties: object - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplayInfo'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'object'}, - } - - def __init__(self, **kwargs): - super(OperationEntity, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) - self.origin = kwargs.get('origin', None) - self.properties = kwargs.get('properties', None) diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/operation_entity_paged.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/operation_entity_paged.py deleted file mode 100644 index 6eb55311b159..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/operation_entity_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 OperationEntityPaged(Paged): - """ - A paging container for iterating over a list of :class:`OperationEntity ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[OperationEntity]'} - } - - def __init__(self, *args, **kwargs): - - super(OperationEntityPaged, self).__init__(*args, **kwargs) diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/operation_entity_py3.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/operation_entity_py3.py deleted file mode 100644 index 654a27867bda..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/operation_entity_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 OperationEntity(Model): - """The operation supported by Cognitive Services. - - :param name: Operation name: {provider}/{resource}/{operation}. - :type name: str - :param display: The operation supported by Cognitive Services. - :type display: ~azure.mgmt.cognitiveservices.models.OperationDisplayInfo - :param origin: The origin of the operation. - :type origin: str - :param properties: Additional properties. - :type properties: object - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplayInfo'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'object'}, - } - - def __init__(self, *, name: str=None, display=None, origin: str=None, properties=None, **kwargs) -> None: - super(OperationEntity, self).__init__(**kwargs) - self.name = name - self.display = display - self.origin = origin - self.properties = properties diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/regenerate_key_parameters.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/regenerate_key_parameters.py deleted file mode 100644 index 132a0d8c16cc..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/regenerate_key_parameters.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 RegenerateKeyParameters(Model): - """Regenerate key parameters. - - All required parameters must be populated in order to send to Azure. - - :param key_name: Required. key name to generate (Key1|Key2). Possible - values include: 'Key1', 'Key2' - :type key_name: str or ~azure.mgmt.cognitiveservices.models.KeyName - """ - - _validation = { - 'key_name': {'required': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'KeyName'}, - } - - def __init__(self, **kwargs): - super(RegenerateKeyParameters, self).__init__(**kwargs) - self.key_name = kwargs.get('key_name', None) diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/regenerate_key_parameters_py3.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/regenerate_key_parameters_py3.py deleted file mode 100644 index 1fd67eabb405..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/regenerate_key_parameters_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 RegenerateKeyParameters(Model): - """Regenerate key parameters. - - All required parameters must be populated in order to send to Azure. - - :param key_name: Required. key name to generate (Key1|Key2). Possible - values include: 'Key1', 'Key2' - :type key_name: str or ~azure.mgmt.cognitiveservices.models.KeyName - """ - - _validation = { - 'key_name': {'required': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'KeyName'}, - } - - def __init__(self, *, key_name, **kwargs) -> None: - super(RegenerateKeyParameters, self).__init__(**kwargs) - self.key_name = key_name diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku.py deleted file mode 100644 index 72f1cee9b8e9..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku.py +++ /dev/null @@ -1,62 +0,0 @@ -# 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 ResourceSku(Model): - """Describes an available Cognitive Services SKU. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar resource_type: The type of resource the SKU applies to. - :vartype resource_type: str - :ivar name: The name of SKU. - :vartype name: str - :ivar tier: Specifies the tier of Cognitive Services account. - :vartype tier: str - :ivar kind: The Kind of resources that are supported in this SKU. - :vartype kind: str - :ivar locations: The set of locations that the SKU is available. - :vartype locations: list[str] - :ivar restrictions: The restrictions because of which SKU cannot be used. - This is empty if there are no restrictions. - :vartype restrictions: - list[~azure.mgmt.cognitiveservices.models.ResourceSkuRestrictions] - """ - - _validation = { - 'resource_type': {'readonly': True}, - 'name': {'readonly': True}, - 'tier': {'readonly': True}, - 'kind': {'readonly': True}, - 'locations': {'readonly': True}, - 'restrictions': {'readonly': True}, - } - - _attribute_map = { - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'restrictions': {'key': 'restrictions', 'type': '[ResourceSkuRestrictions]'}, - } - - def __init__(self, **kwargs): - super(ResourceSku, self).__init__(**kwargs) - self.resource_type = None - self.name = None - self.tier = None - self.kind = None - self.locations = None - self.restrictions = None diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku_paged.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku_paged.py deleted file mode 100644 index fb650eef27f1..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 ResourceSkuPaged(Paged): - """ - A paging container for iterating over a list of :class:`ResourceSku ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ResourceSku]'} - } - - def __init__(self, *args, **kwargs): - - super(ResourceSkuPaged, self).__init__(*args, **kwargs) diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku_py3.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku_py3.py deleted file mode 100644 index 3aa9b8470364..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku_py3.py +++ /dev/null @@ -1,62 +0,0 @@ -# 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 ResourceSku(Model): - """Describes an available Cognitive Services SKU. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar resource_type: The type of resource the SKU applies to. - :vartype resource_type: str - :ivar name: The name of SKU. - :vartype name: str - :ivar tier: Specifies the tier of Cognitive Services account. - :vartype tier: str - :ivar kind: The Kind of resources that are supported in this SKU. - :vartype kind: str - :ivar locations: The set of locations that the SKU is available. - :vartype locations: list[str] - :ivar restrictions: The restrictions because of which SKU cannot be used. - This is empty if there are no restrictions. - :vartype restrictions: - list[~azure.mgmt.cognitiveservices.models.ResourceSkuRestrictions] - """ - - _validation = { - 'resource_type': {'readonly': True}, - 'name': {'readonly': True}, - 'tier': {'readonly': True}, - 'kind': {'readonly': True}, - 'locations': {'readonly': True}, - 'restrictions': {'readonly': True}, - } - - _attribute_map = { - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'restrictions': {'key': 'restrictions', 'type': '[ResourceSkuRestrictions]'}, - } - - def __init__(self, **kwargs) -> None: - super(ResourceSku, self).__init__(**kwargs) - self.resource_type = None - self.name = None - self.tier = None - self.kind = None - self.locations = None - self.restrictions = None diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku_restriction_info.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku_restriction_info.py deleted file mode 100644 index 677e93463d58..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku_restriction_info.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 ResourceSkuRestrictionInfo(Model): - """ResourceSkuRestrictionInfo. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar locations: Locations where the SKU is restricted - :vartype locations: list[str] - :ivar zones: List of availability zones where the SKU is restricted. - :vartype zones: list[str] - """ - - _validation = { - 'locations': {'readonly': True}, - 'zones': {'readonly': True}, - } - - _attribute_map = { - 'locations': {'key': 'locations', 'type': '[str]'}, - 'zones': {'key': 'zones', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(ResourceSkuRestrictionInfo, self).__init__(**kwargs) - self.locations = None - self.zones = None diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku_restriction_info_py3.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku_restriction_info_py3.py deleted file mode 100644 index 008cf8d4c5fa..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku_restriction_info_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 ResourceSkuRestrictionInfo(Model): - """ResourceSkuRestrictionInfo. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar locations: Locations where the SKU is restricted - :vartype locations: list[str] - :ivar zones: List of availability zones where the SKU is restricted. - :vartype zones: list[str] - """ - - _validation = { - 'locations': {'readonly': True}, - 'zones': {'readonly': True}, - } - - _attribute_map = { - 'locations': {'key': 'locations', 'type': '[str]'}, - 'zones': {'key': 'zones', 'type': '[str]'}, - } - - def __init__(self, **kwargs) -> None: - super(ResourceSkuRestrictionInfo, self).__init__(**kwargs) - self.locations = None - self.zones = None diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku_restrictions.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku_restrictions.py deleted file mode 100644 index 5c1ae1141f3d..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku_restrictions.py +++ /dev/null @@ -1,57 +0,0 @@ -# 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 ResourceSkuRestrictions(Model): - """Describes restrictions of a SKU. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar type: The type of restrictions. Possible values include: 'Location', - 'Zone' - :vartype type: str or - ~azure.mgmt.cognitiveservices.models.ResourceSkuRestrictionsType - :ivar values: The value of restrictions. If the restriction type is set to - location. This would be different locations where the SKU is restricted. - :vartype values: list[str] - :ivar restriction_info: The information about the restriction where the - SKU cannot be used. - :vartype restriction_info: - ~azure.mgmt.cognitiveservices.models.ResourceSkuRestrictionInfo - :ivar reason_code: The reason for restriction. Possible values include: - 'QuotaId', 'NotAvailableForSubscription' - :vartype reason_code: str or - ~azure.mgmt.cognitiveservices.models.ResourceSkuRestrictionsReasonCode - """ - - _validation = { - 'type': {'readonly': True}, - 'values': {'readonly': True}, - 'restriction_info': {'readonly': True}, - 'reason_code': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'ResourceSkuRestrictionsType'}, - 'values': {'key': 'values', 'type': '[str]'}, - 'restriction_info': {'key': 'restrictionInfo', 'type': 'ResourceSkuRestrictionInfo'}, - 'reason_code': {'key': 'reasonCode', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ResourceSkuRestrictions, self).__init__(**kwargs) - self.type = None - self.values = None - self.restriction_info = None - self.reason_code = None diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku_restrictions_py3.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku_restrictions_py3.py deleted file mode 100644 index 62dee12bb165..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku_restrictions_py3.py +++ /dev/null @@ -1,57 +0,0 @@ -# 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 ResourceSkuRestrictions(Model): - """Describes restrictions of a SKU. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar type: The type of restrictions. Possible values include: 'Location', - 'Zone' - :vartype type: str or - ~azure.mgmt.cognitiveservices.models.ResourceSkuRestrictionsType - :ivar values: The value of restrictions. If the restriction type is set to - location. This would be different locations where the SKU is restricted. - :vartype values: list[str] - :ivar restriction_info: The information about the restriction where the - SKU cannot be used. - :vartype restriction_info: - ~azure.mgmt.cognitiveservices.models.ResourceSkuRestrictionInfo - :ivar reason_code: The reason for restriction. Possible values include: - 'QuotaId', 'NotAvailableForSubscription' - :vartype reason_code: str or - ~azure.mgmt.cognitiveservices.models.ResourceSkuRestrictionsReasonCode - """ - - _validation = { - 'type': {'readonly': True}, - 'values': {'readonly': True}, - 'restriction_info': {'readonly': True}, - 'reason_code': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'ResourceSkuRestrictionsType'}, - 'values': {'key': 'values', 'type': '[str]'}, - 'restriction_info': {'key': 'restrictionInfo', 'type': 'ResourceSkuRestrictionInfo'}, - 'reason_code': {'key': 'reasonCode', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(ResourceSkuRestrictions, self).__init__(**kwargs) - self.type = None - self.values = None - self.restriction_info = None - self.reason_code = None diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/sku.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/sku.py deleted file mode 100644 index 182f5238d4de..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/sku.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 Sku(Model): - """The SKU of the cognitive services account. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Gets or sets the sku name. Required for account - creation, optional for update. - :type name: str - :ivar tier: Gets the sku tier. This is based on the SKU name. Possible - values include: 'Free', 'Standard', 'Premium' - :vartype tier: str or ~azure.mgmt.cognitiveservices.models.SkuTier - """ - - _validation = { - 'name': {'required': True}, - 'tier': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'SkuTier'}, - } - - def __init__(self, **kwargs): - super(Sku, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.tier = None diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/sku_py3.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/sku_py3.py deleted file mode 100644 index e474ec999560..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/sku_py3.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 Sku(Model): - """The SKU of the cognitive services account. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Gets or sets the sku name. Required for account - creation, optional for update. - :type name: str - :ivar tier: Gets the sku tier. This is based on the SKU name. Possible - values include: 'Free', 'Standard', 'Premium' - :vartype tier: str or ~azure.mgmt.cognitiveservices.models.SkuTier - """ - - _validation = { - 'name': {'required': True}, - 'tier': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'SkuTier'}, - } - - def __init__(self, *, name: str, **kwargs) -> None: - super(Sku, self).__init__(**kwargs) - self.name = name - self.tier = None diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/usage.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/usage.py deleted file mode 100644 index 6911376e0206..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/usage.py +++ /dev/null @@ -1,66 +0,0 @@ -# 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 Usage(Model): - """The usage data for a usage request. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param unit: The unit of the metric. Possible values include: 'Count', - 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', - 'Milliseconds' - :type unit: str or ~azure.mgmt.cognitiveservices.models.UnitType - :ivar name: The name information for the metric. - :vartype name: ~azure.mgmt.cognitiveservices.models.MetricName - :ivar quota_period: The quota period used to summarize the usage values. - :vartype quota_period: str - :ivar limit: Maximum value for this metric. - :vartype limit: float - :ivar current_value: Current value for this metric. - :vartype current_value: float - :ivar next_reset_time: Next reset time for current quota. - :vartype next_reset_time: str - :param status: Cognitive Services account quota usage status. Possible - values include: 'Included', 'Blocked', 'InOverage', 'Unknown' - :type status: str or ~azure.mgmt.cognitiveservices.models.QuotaUsageStatus - """ - - _validation = { - 'name': {'readonly': True}, - 'quota_period': {'readonly': True}, - 'limit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'next_reset_time': {'readonly': True}, - } - - _attribute_map = { - 'unit': {'key': 'unit', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'MetricName'}, - 'quota_period': {'key': 'quotaPeriod', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'float'}, - 'current_value': {'key': 'currentValue', 'type': 'float'}, - 'next_reset_time': {'key': 'nextResetTime', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Usage, self).__init__(**kwargs) - self.unit = kwargs.get('unit', None) - self.name = None - self.quota_period = None - self.limit = None - self.current_value = None - self.next_reset_time = None - self.status = kwargs.get('status', None) diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/usage_py3.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/usage_py3.py deleted file mode 100644 index b053f5be1790..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/usage_py3.py +++ /dev/null @@ -1,66 +0,0 @@ -# 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 Usage(Model): - """The usage data for a usage request. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param unit: The unit of the metric. Possible values include: 'Count', - 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', - 'Milliseconds' - :type unit: str or ~azure.mgmt.cognitiveservices.models.UnitType - :ivar name: The name information for the metric. - :vartype name: ~azure.mgmt.cognitiveservices.models.MetricName - :ivar quota_period: The quota period used to summarize the usage values. - :vartype quota_period: str - :ivar limit: Maximum value for this metric. - :vartype limit: float - :ivar current_value: Current value for this metric. - :vartype current_value: float - :ivar next_reset_time: Next reset time for current quota. - :vartype next_reset_time: str - :param status: Cognitive Services account quota usage status. Possible - values include: 'Included', 'Blocked', 'InOverage', 'Unknown' - :type status: str or ~azure.mgmt.cognitiveservices.models.QuotaUsageStatus - """ - - _validation = { - 'name': {'readonly': True}, - 'quota_period': {'readonly': True}, - 'limit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'next_reset_time': {'readonly': True}, - } - - _attribute_map = { - 'unit': {'key': 'unit', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'MetricName'}, - 'quota_period': {'key': 'quotaPeriod', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'float'}, - 'current_value': {'key': 'currentValue', 'type': 'float'}, - 'next_reset_time': {'key': 'nextResetTime', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__(self, *, unit=None, status=None, **kwargs) -> None: - super(Usage, self).__init__(**kwargs) - self.unit = unit - self.name = None - self.quota_period = None - self.limit = None - self.current_value = None - self.next_reset_time = None - self.status = status diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/usages_result.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/usages_result.py deleted file mode 100644 index 67ece7d4e243..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/usages_result.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 UsagesResult(Model): - """The response to a list usage request. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar value: The list of usages for Cognitive Service account. - :vartype value: list[~azure.mgmt.cognitiveservices.models.Usage] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Usage]'}, - } - - def __init__(self, **kwargs): - super(UsagesResult, self).__init__(**kwargs) - self.value = None diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/usages_result_py3.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/usages_result_py3.py deleted file mode 100644 index 880dd7fd58e3..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/usages_result_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 UsagesResult(Model): - """The response to a list usage request. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar value: The list of usages for Cognitive Service account. - :vartype value: list[~azure.mgmt.cognitiveservices.models.Usage] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Usage]'}, - } - - def __init__(self, **kwargs) -> None: - super(UsagesResult, self).__init__(**kwargs) - self.value = None diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/__init__.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/__init__.py index 3596470cf0ad..751c6929e4df 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/__init__.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/__init__.py @@ -9,14 +9,16 @@ # regenerated. # -------------------------------------------------------------------------- -from .accounts_operations import AccountsOperations -from .resource_skus_operations import ResourceSkusOperations -from .operations import Operations -from .check_sku_availability_operations import CheckSkuAvailabilityOperations +from ._accounts_operations import AccountsOperations +from ._resource_skus_operations import ResourceSkusOperations +from ._operations import Operations +from ._check_sku_availability_operations import CheckSkuAvailabilityOperations +from ._cognitive_services_management_client_operations import CognitiveServicesManagementClientOperationsMixin __all__ = [ 'AccountsOperations', 'ResourceSkusOperations', 'Operations', 'CheckSkuAvailabilityOperations', + 'CognitiveServicesManagementClientOperationsMixin', ] diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/accounts_operations.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/_accounts_operations.py similarity index 98% rename from sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/accounts_operations.py rename to sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/_accounts_operations.py index 9dbff4be3071..36f867bd65aa 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/accounts_operations.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/_accounts_operations.py @@ -18,6 +18,8 @@ class AccountsOperations(object): """AccountsOperations operations. + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -96,7 +98,6 @@ def create( raise models.ErrorException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('CognitiveServicesAccount', response) if response.status_code == 201: @@ -177,7 +178,6 @@ def update( raise models.ErrorException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('CognitiveServicesAccount', response) @@ -292,7 +292,6 @@ def get_properties( raise models.ErrorException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('CognitiveServicesAccount', response) @@ -322,8 +321,7 @@ def list_by_resource_group( :raises: :class:`ErrorException` """ - def internal_paging(next_link=None, raw=False): - + def prepare_request(next_link=None): if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] @@ -353,6 +351,11 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: @@ -361,12 +364,10 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.CognitiveServicesAccountPaged(internal_paging, self._deserialize.dependencies) - + header_dict = None if raw: header_dict = {} - client_raw_response = models.CognitiveServicesAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response + deserialized = models.CognitiveServicesAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts'} @@ -387,8 +388,7 @@ def list( :raises: :class:`ErrorException` """ - def internal_paging(next_link=None, raw=False): - + def prepare_request(next_link=None): if not next_link: # Construct URL url = self.list.metadata['url'] @@ -417,6 +417,11 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: @@ -425,12 +430,10 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.CognitiveServicesAccountPaged(internal_paging, self._deserialize.dependencies) - + header_dict = None if raw: header_dict = {} - client_raw_response = models.CognitiveServicesAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response + deserialized = models.CognitiveServicesAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/accounts'} @@ -487,7 +490,6 @@ def list_keys( raise models.ErrorException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('CognitiveServicesAccountKeys', response) @@ -560,7 +562,6 @@ def regenerate_key( raise models.ErrorException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('CognitiveServicesAccountKeys', response) @@ -624,7 +625,6 @@ def list_skus( raise models.ErrorException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('CognitiveServicesAccountEnumerateSkusResult', response) @@ -692,7 +692,6 @@ def get_usages( raise models.ErrorException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('UsagesResult', response) diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/check_sku_availability_operations.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/_check_sku_availability_operations.py similarity index 97% rename from sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/check_sku_availability_operations.py rename to sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/_check_sku_availability_operations.py index 6e0d26613672..b176a5a4babc 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/check_sku_availability_operations.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/_check_sku_availability_operations.py @@ -19,6 +19,8 @@ class CheckSkuAvailabilityOperations(object): """CheckSkuAvailabilityOperations operations. + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -99,7 +101,6 @@ def list( raise exp deserialized = None - if response.status_code == 200: deserialized = self._deserialize('CheckSkuAvailabilityResultList', response) diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/_cognitive_services_management_client_operations.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/_cognitive_services_management_client_operations.py new file mode 100644 index 000000000000..8ba64d5489bf --- /dev/null +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/_cognitive_services_management_client_operations.py @@ -0,0 +1,81 @@ +# 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.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from .. import models +import uuid + + +class CognitiveServicesManagementClientOperationsMixin(object): + + def check_domain_availability( + self, subdomain_name, type, custom_headers=None, raw=False, **operation_config): + """Check whether a domain is available. + + :param subdomain_name: The subdomain name to use. + :type subdomain_name: str + :param type: The Type of the resource. + :type type: str + :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`. + :return: CheckDomainAvailabilityResult or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.cognitiveservices.models.CheckDomainAvailabilityResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = models.CheckDomainAvailabilityParameter(subdomain_name=subdomain_name, type=type) + + # Construct URL + url = self.check_domain_availability.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'CheckDomainAvailabilityParameter') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CheckDomainAvailabilityResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_domain_availability.metadata = {'url': '/providers/Microsoft.CognitiveServices/checkDomainAvailability'} diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/operations.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/_operations.py similarity index 90% rename from sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/operations.py rename to sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/_operations.py index 46be7e37a6fe..e39d8491eed7 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/operations.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/_operations.py @@ -19,6 +19,8 @@ class Operations(object): """Operations operations. + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -51,8 +53,7 @@ def list( ~azure.mgmt.cognitiveservices.models.OperationEntityPaged[~azure.mgmt.cognitiveservices.models.OperationEntity] :raises: :class:`CloudError` """ - def internal_paging(next_link=None, raw=False): - + def prepare_request(next_link=None): if not next_link: # Construct URL url = self.list.metadata['url'] @@ -77,6 +78,11 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: @@ -87,12 +93,10 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.OperationEntityPaged(internal_paging, self._deserialize.dependencies) - + header_dict = None if raw: header_dict = {} - client_raw_response = models.OperationEntityPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response + deserialized = models.OperationEntityPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list.metadata = {'url': '/providers/Microsoft.CognitiveServices/operations'} diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/resource_skus_operations.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/_resource_skus_operations.py similarity index 91% rename from sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/resource_skus_operations.py rename to sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/_resource_skus_operations.py index 082df141e08f..c0d7e239f716 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/resource_skus_operations.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/_resource_skus_operations.py @@ -19,6 +19,8 @@ class ResourceSkusOperations(object): """ResourceSkusOperations operations. + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -52,8 +54,7 @@ def list( ~azure.mgmt.cognitiveservices.models.ResourceSkuPaged[~azure.mgmt.cognitiveservices.models.ResourceSku] :raises: :class:`CloudError` """ - def internal_paging(next_link=None, raw=False): - + def prepare_request(next_link=None): if not next_link: # Construct URL url = self.list.metadata['url'] @@ -82,6 +83,11 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: @@ -92,12 +98,10 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.ResourceSkuPaged(internal_paging, self._deserialize.dependencies) - + header_dict = None if raw: header_dict = {} - client_raw_response = models.ResourceSkuPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response + deserialized = models.ResourceSkuPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/skus'} diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/version.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/version.py index 20cee28211d4..654c55a24205 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/version.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "4.0.0" +VERSION = "5.0.0"