diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/CHANGELOG.md b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/CHANGELOG.md index d14863daf085..f79368efc1a7 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/CHANGELOG.md +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/CHANGELOG.md @@ -1,5 +1,28 @@ # Release History +## 7.0.0 (2021-06-03) + +**Features** + + - Model PrivateEndpointConnectionProperties has a new parameter provisioning_state + - Model PrivateLinkServiceConnectionState has a new parameter actions_required + - Model UserOwnedStorage has a new parameter identity_client_id + - Model KeyVaultProperties has a new parameter identity_client_id + - Model PrivateEndpointConnection has a new parameter system_data + - Model PrivateEndpointConnection has a new parameter etag + - Model PrivateEndpointConnection has a new parameter location + - Added operation AccountsOperations.get + - Added operation AccountsOperations.list_usages + - Added operation group DeletedAccountsOperations + +**Breaking changes** + + - Operation PrivateEndpointConnectionsOperations.create_or_update has a new signature + - Model PrivateLinkServiceConnectionState no longer has parameter action_required + - Removed operation AccountsOperations.get_usages + - Removed operation AccountsOperations.get_properties + - Model Sku has a new signature + ## 6.3.0 (2020-10-09) **Features** diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/MANIFEST.in b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/MANIFEST.in index a3cb07df8765..3a9b6517412b 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/MANIFEST.in +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/MANIFEST.in @@ -1,3 +1,4 @@ +include _meta.json recursive-include tests *.py *.yaml include *.md include azure/__init__.py diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/_meta.json b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/_meta.json new file mode 100644 index 000000000000..ee806f021c12 --- /dev/null +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/_meta.json @@ -0,0 +1,8 @@ +{ + "autorest": "V2", + "use": "@microsoft.azure/autorest.python@~4.0.71", + "commit": "d3a5ab585146ee8ee09f43eb0948c45daacd36f7", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/cognitiveservices/resource-manager/readme.md --keep-version-file --multiapi --no-async --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --use=@microsoft.azure/autorest.python@~4.0.71 --version=V2", + "readme": "specification/cognitiveservices/resource-manager/readme.md" +} \ No newline at end of file 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 index 6fcf5687b9e9..a57b957d9867 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 @@ -15,6 +15,7 @@ from ._configuration import CognitiveServicesManagementClientConfiguration from .operations import CognitiveServicesManagementClientOperationsMixin from .operations import AccountsOperations +from .operations import DeletedAccountsOperations from .operations import ResourceSkusOperations from .operations import Operations from .operations import PrivateEndpointConnectionsOperations @@ -30,6 +31,8 @@ class CognitiveServicesManagementClient(CognitiveServicesManagementClientOperati :ivar accounts: Accounts operations :vartype accounts: azure.mgmt.cognitiveservices.operations.AccountsOperations + :ivar deleted_accounts: DeletedAccounts operations + :vartype deleted_accounts: azure.mgmt.cognitiveservices.operations.DeletedAccountsOperations :ivar resource_skus: ResourceSkus operations :vartype resource_skus: azure.mgmt.cognitiveservices.operations.ResourceSkusOperations :ivar operations: Operations operations @@ -54,12 +57,14 @@ def __init__( super(CognitiveServicesManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2017-04-18' + self.api_version = '2021-04-30' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self.accounts = AccountsOperations( self._client, self.config, self._serialize, self._deserialize) + self.deleted_accounts = DeletedAccountsOperations( + self._client, self.config, self._serialize, self._deserialize) self.resource_skus = ResourceSkusOperations( self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( 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 614ea8f24c2b..84ff25f94b23 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,28 +10,28 @@ # -------------------------------------------------------------------------- try: + from ._models_py3 import Account + from ._models_py3 import AccountProperties + from ._models_py3 import AccountSku + from ._models_py3 import AccountSkuListResult + from ._models_py3 import ApiKeys + from ._models_py3 import ApiProperties from ._models_py3 import AzureEntityResource + from ._models_py3 import CallRateLimit 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 CognitiveServicesAccountApiProperties - from ._models_py3 import CognitiveServicesAccountEnumerateSkusResult - from ._models_py3 import CognitiveServicesAccountKeys - from ._models_py3 import CognitiveServicesAccountProperties - from ._models_py3 import CognitiveServicesResourceAndSku + from ._models_py3 import DomainAvailability from ._models_py3 import Encryption - from ._models_py3 import Error, ErrorException - from ._models_py3 import ErrorBody + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorDetail + from ._models_py3 import ErrorResponse, ErrorResponseException from ._models_py3 import Identity from ._models_py3 import IpRule from ._models_py3 import KeyVaultProperties from ._models_py3 import MetricName from ._models_py3 import NetworkRuleSet - from ._models_py3 import OperationDisplayInfo - from ._models_py3 import OperationEntity + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay from ._models_py3 import PrivateEndpoint from ._models_py3 import PrivateEndpointConnection from ._models_py3 import PrivateEndpointConnectionListResult @@ -41,42 +41,49 @@ from ._models_py3 import PrivateLinkResourceProperties from ._models_py3 import PrivateLinkServiceConnectionState from ._models_py3 import ProxyResource + from ._models_py3 import QuotaLimit from ._models_py3 import RegenerateKeyParameters + from ._models_py3 import RequestMatchPattern from ._models_py3 import Resource from ._models_py3 import ResourceSku from ._models_py3 import ResourceSkuRestrictionInfo from ._models_py3 import ResourceSkuRestrictions from ._models_py3 import Sku + from ._models_py3 import SkuAvailability + from ._models_py3 import SkuAvailabilityListResult from ._models_py3 import SkuCapability + from ._models_py3 import SkuChangeInfo + from ._models_py3 import SystemData + from ._models_py3 import ThrottlingRule from ._models_py3 import TrackedResource from ._models_py3 import Usage - from ._models_py3 import UsagesResult + from ._models_py3 import UsageListResult from ._models_py3 import UserAssignedIdentity from ._models_py3 import UserOwnedStorage from ._models_py3 import VirtualNetworkRule except (SyntaxError, ImportError): + from ._models import Account + from ._models import AccountProperties + from ._models import AccountSku + from ._models import AccountSkuListResult + from ._models import ApiKeys + from ._models import ApiProperties from ._models import AzureEntityResource + from ._models import CallRateLimit 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 CognitiveServicesAccountApiProperties - from ._models import CognitiveServicesAccountEnumerateSkusResult - from ._models import CognitiveServicesAccountKeys - from ._models import CognitiveServicesAccountProperties - from ._models import CognitiveServicesResourceAndSku + from ._models import DomainAvailability from ._models import Encryption - from ._models import Error, ErrorException - from ._models import ErrorBody + from ._models import ErrorAdditionalInfo + from ._models import ErrorDetail + from ._models import ErrorResponse, ErrorResponseException from ._models import Identity from ._models import IpRule from ._models import KeyVaultProperties from ._models import MetricName from ._models import NetworkRuleSet - from ._models import OperationDisplayInfo - from ._models import OperationEntity + from ._models import Operation + from ._models import OperationDisplay from ._models import PrivateEndpoint from ._models import PrivateEndpointConnection from ._models import PrivateEndpointConnectionListResult @@ -86,60 +93,71 @@ from ._models import PrivateLinkResourceProperties from ._models import PrivateLinkServiceConnectionState from ._models import ProxyResource + from ._models import QuotaLimit from ._models import RegenerateKeyParameters + from ._models import RequestMatchPattern from ._models import Resource from ._models import ResourceSku from ._models import ResourceSkuRestrictionInfo from ._models import ResourceSkuRestrictions from ._models import Sku + from ._models import SkuAvailability + from ._models import SkuAvailabilityListResult from ._models import SkuCapability + from ._models import SkuChangeInfo + from ._models import SystemData + from ._models import ThrottlingRule from ._models import TrackedResource from ._models import Usage - from ._models import UsagesResult + from ._models import UsageListResult from ._models import UserAssignedIdentity from ._models import UserOwnedStorage from ._models import VirtualNetworkRule -from ._paged_models import CognitiveServicesAccountPaged -from ._paged_models import OperationEntityPaged +from ._paged_models import AccountPaged +from ._paged_models import OperationPaged from ._paged_models import ResourceSkuPaged from ._cognitive_services_management_client_enums import ( SkuTier, + ResourceIdentityType, + CreatedByType, ProvisioningState, NetworkRuleAction, KeySource, PrivateEndpointServiceConnectionStatus, + PrivateEndpointConnectionProvisioningState, PublicNetworkAccess, - IdentityType, KeyName, UnitType, QuotaUsageStatus, ResourceSkuRestrictionsType, ResourceSkuRestrictionsReasonCode, + Origin, + ActionType, ) __all__ = [ + 'Account', + 'AccountProperties', + 'AccountSku', + 'AccountSkuListResult', + 'ApiKeys', + 'ApiProperties', 'AzureEntityResource', + 'CallRateLimit', 'CheckDomainAvailabilityParameter', - 'CheckDomainAvailabilityResult', 'CheckSkuAvailabilityParameter', - 'CheckSkuAvailabilityResult', - 'CheckSkuAvailabilityResultList', - 'CognitiveServicesAccount', - 'CognitiveServicesAccountApiProperties', - 'CognitiveServicesAccountEnumerateSkusResult', - 'CognitiveServicesAccountKeys', - 'CognitiveServicesAccountProperties', - 'CognitiveServicesResourceAndSku', + 'DomainAvailability', 'Encryption', - 'Error', 'ErrorException', - 'ErrorBody', + 'ErrorAdditionalInfo', + 'ErrorDetail', + 'ErrorResponse', 'ErrorResponseException', 'Identity', 'IpRule', 'KeyVaultProperties', 'MetricName', 'NetworkRuleSet', - 'OperationDisplayInfo', - 'OperationEntity', + 'Operation', + 'OperationDisplay', 'PrivateEndpoint', 'PrivateEndpointConnection', 'PrivateEndpointConnectionListResult', @@ -149,32 +167,43 @@ 'PrivateLinkResourceProperties', 'PrivateLinkServiceConnectionState', 'ProxyResource', + 'QuotaLimit', 'RegenerateKeyParameters', + 'RequestMatchPattern', 'Resource', 'ResourceSku', 'ResourceSkuRestrictionInfo', 'ResourceSkuRestrictions', 'Sku', + 'SkuAvailability', + 'SkuAvailabilityListResult', 'SkuCapability', + 'SkuChangeInfo', + 'SystemData', + 'ThrottlingRule', 'TrackedResource', 'Usage', - 'UsagesResult', + 'UsageListResult', 'UserAssignedIdentity', 'UserOwnedStorage', 'VirtualNetworkRule', - 'CognitiveServicesAccountPaged', + 'AccountPaged', 'ResourceSkuPaged', - 'OperationEntityPaged', + 'OperationPaged', 'SkuTier', + 'ResourceIdentityType', + 'CreatedByType', 'ProvisioningState', 'NetworkRuleAction', 'KeySource', 'PrivateEndpointServiceConnectionStatus', + 'PrivateEndpointConnectionProvisioningState', 'PublicNetworkAccess', - 'IdentityType', 'KeyName', 'UnitType', 'QuotaUsageStatus', 'ResourceSkuRestrictionsType', 'ResourceSkuRestrictionsReasonCode', + 'Origin', + 'ActionType', ] 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 index 7e3072cc69ca..1a69eedfa702 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 @@ -15,18 +15,37 @@ class SkuTier(str, Enum): free = "Free" + basic = "Basic" standard = "Standard" premium = "Premium" + enterprise = "Enterprise" + + +class ResourceIdentityType(str, Enum): + + none = "None" + system_assigned = "SystemAssigned" + user_assigned = "UserAssigned" + system_assigned_user_assigned = "SystemAssigned, UserAssigned" + + +class CreatedByType(str, Enum): + + user = "User" + application = "Application" + managed_identity = "ManagedIdentity" + key = "Key" class ProvisioningState(str, Enum): + accepted = "Accepted" creating = "Creating" - resolving_dns = "ResolvingDNS" - moving = "Moving" deleting = "Deleting" - succeeded = "Succeeded" + moving = "Moving" failed = "Failed" + succeeded = "Succeeded" + resolving_dns = "ResolvingDNS" class NetworkRuleAction(str, Enum): @@ -46,20 +65,20 @@ class PrivateEndpointServiceConnectionStatus(str, Enum): pending = "Pending" approved = "Approved" rejected = "Rejected" - disconnected = "Disconnected" -class PublicNetworkAccess(str, Enum): +class PrivateEndpointConnectionProvisioningState(str, Enum): - enabled = "Enabled" - disabled = "Disabled" + succeeded = "Succeeded" + creating = "Creating" + deleting = "Deleting" + failed = "Failed" -class IdentityType(str, Enum): +class PublicNetworkAccess(str, Enum): - none = "None" - system_assigned = "SystemAssigned" - user_assigned = "UserAssigned" + enabled = "Enabled" + disabled = "Disabled" class KeyName(str, Enum): @@ -97,3 +116,15 @@ class ResourceSkuRestrictionsReasonCode(str, Enum): quota_id = "QuotaId" not_available_for_subscription = "NotAvailableForSubscription" + + +class Origin(str, Enum): + + user = "user" + system = "system" + usersystem = "user,system" + + +class ActionType(str, Enum): + + internal = "Internal" 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 index 19b5a826d4a3..ec8f09fe6239 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/_models.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/_models.py @@ -16,16 +16,19 @@ class Resource(Model): """Resource. + Common fields that are returned in the response for all Azure Resource + Manager resources. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str """ @@ -49,19 +52,21 @@ def __init__(self, **kwargs): class AzureEntityResource(Resource): - """The resource model definition for a Azure Resource Manager resource with an - etag. + """Entity Resource. + + The resource model definition for an Azure Resource Manager resource with + an etag. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -86,229 +91,279 @@ def __init__(self, **kwargs): self.etag = None -class CheckDomainAvailabilityParameter(Model): - """Check Domain availability parameter. +class Account(AzureEntityResource): + """Cognitive Services account is an Azure resource representing the + provisioned account, it's type, location and SKU. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when + sending a request. - :param subdomain_name: Required. The subdomain name to use. - :type subdomain_name: str - :param type: Required. The Type of the resource. - :type type: str + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param kind: The Kind of the resource. + :type kind: str + :param sku: + :type sku: ~azure.mgmt.cognitiveservices.models.Sku + :param identity: + :type identity: ~azure.mgmt.cognitiveservices.models.Identity + :ivar system_data: + :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: The geo-location where the resource lives + :type location: str + :param properties: Properties of Cognitive Services account. + :type properties: ~azure.mgmt.cognitiveservices.models.AccountProperties """ _validation = { - 'subdomain_name': {'required': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'subdomain_name': {'key': 'subdomainName', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'system_data': {'readonly': True}, } - 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'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'AccountProperties'}, } 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) + super(Account, self).__init__(**kwargs) + self.kind = kwargs.get('kind', None) + self.sku = kwargs.get('sku', None) + self.identity = kwargs.get('identity', None) + self.system_data = None + self.tags = kwargs.get('tags', None) + self.location = kwargs.get('location', None) + self.properties = kwargs.get('properties', None) -class CheckSkuAvailabilityParameter(Model): - """Check SKU availability parameter. +class AccountProperties(Model): + """Properties of Cognitive Services account. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when + sending a request. - :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 + :ivar provisioning_state: Gets the status of the cognitive services + account at the time the operation was called. Possible values include: + 'Accepted', 'Creating', 'Deleting', 'Moving', 'Failed', 'Succeeded', + 'ResolvingDNS' + :vartype provisioning_state: str or + ~azure.mgmt.cognitiveservices.models.ProvisioningState + :ivar endpoint: Endpoint of the created account. + :vartype endpoint: str + :ivar internal_id: The internal identifier (deprecated, do not use this + property). + :vartype internal_id: str + :ivar capabilities: Gets the capabilities of the cognitive services + account. Each item indicates the capability of a specific feature. The + values are read-only and for reference only. + :vartype capabilities: + list[~azure.mgmt.cognitiveservices.models.SkuCapability] + :ivar is_migrated: If the resource is migrated from an existing key. + :vartype is_migrated: bool + :param migration_token: Resource migration token. + :type migration_token: str + :ivar sku_change_info: Sku change info of account. + :vartype sku_change_info: + ~azure.mgmt.cognitiveservices.models.SkuChangeInfo + :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 encryption: The encryption properties for this resource. + :type encryption: ~azure.mgmt.cognitiveservices.models.Encryption + :param user_owned_storage: The storage accounts for this resource. + :type user_owned_storage: + list[~azure.mgmt.cognitiveservices.models.UserOwnedStorage] + :ivar private_endpoint_connections: The private endpoint connection + associated with the Cognitive Services account. + :vartype private_endpoint_connections: + list[~azure.mgmt.cognitiveservices.models.PrivateEndpointConnection] + :param public_network_access: Whether or not public endpoint access is + allowed for this account. Value is optional but if passed in, must be + 'Enabled' or 'Disabled'. Possible values include: 'Enabled', 'Disabled' + :type public_network_access: str or + ~azure.mgmt.cognitiveservices.models.PublicNetworkAccess + :param api_properties: The api properties for special APIs. + :type api_properties: ~azure.mgmt.cognitiveservices.models.ApiProperties + :ivar date_created: Gets the date of cognitive services account creation. + :vartype date_created: str + :ivar call_rate_limit: + :vartype call_rate_limit: + ~azure.mgmt.cognitiveservices.models.CallRateLimit + :ivar quota_limit: + :vartype quota_limit: ~azure.mgmt.cognitiveservices.models.QuotaLimit + :param restrict_outbound_network_access: + :type restrict_outbound_network_access: bool + :param allowed_fqdn_list: + :type allowed_fqdn_list: list[str] + :param disable_local_auth: + :type disable_local_auth: bool + :ivar endpoints: + :vartype endpoints: dict[str, str] + :param restore: + :type restore: bool """ _validation = { - 'skus': {'required': True}, - 'kind': {'required': True}, - 'type': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'endpoint': {'readonly': True}, + 'internal_id': {'readonly': True}, + 'capabilities': {'readonly': True}, + 'is_migrated': {'readonly': True}, + 'sku_change_info': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, + 'date_created': {'readonly': True}, + 'call_rate_limit': {'readonly': True}, + 'quota_limit': {'readonly': True}, + 'endpoints': {'readonly': True}, } _attribute_map = { - 'skus': {'key': 'skus', 'type': '[str]'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'endpoint': {'key': 'endpoint', 'type': 'str'}, + 'internal_id': {'key': 'internalId', 'type': 'str'}, + 'capabilities': {'key': 'capabilities', 'type': '[SkuCapability]'}, + 'is_migrated': {'key': 'isMigrated', 'type': 'bool'}, + 'migration_token': {'key': 'migrationToken', 'type': 'str'}, + 'sku_change_info': {'key': 'skuChangeInfo', 'type': 'SkuChangeInfo'}, + 'custom_sub_domain_name': {'key': 'customSubDomainName', 'type': 'str'}, + 'network_acls': {'key': 'networkAcls', 'type': 'NetworkRuleSet'}, + 'encryption': {'key': 'encryption', 'type': 'Encryption'}, + 'user_owned_storage': {'key': 'userOwnedStorage', 'type': '[UserOwnedStorage]'}, + 'private_endpoint_connections': {'key': 'privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, + 'api_properties': {'key': 'apiProperties', 'type': 'ApiProperties'}, + 'date_created': {'key': 'dateCreated', 'type': 'str'}, + 'call_rate_limit': {'key': 'callRateLimit', 'type': 'CallRateLimit'}, + 'quota_limit': {'key': 'quotaLimit', 'type': 'QuotaLimit'}, + 'restrict_outbound_network_access': {'key': 'restrictOutboundNetworkAccess', 'type': 'bool'}, + 'allowed_fqdn_list': {'key': 'allowedFqdnList', 'type': '[str]'}, + 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + 'endpoints': {'key': 'endpoints', 'type': '{str}'}, + 'restore': {'key': 'restore', 'type': 'bool'}, } 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) + super(AccountProperties, self).__init__(**kwargs) + self.provisioning_state = None + self.endpoint = None + self.internal_id = None + self.capabilities = None + self.is_migrated = None + self.migration_token = kwargs.get('migration_token', None) + self.sku_change_info = None + self.custom_sub_domain_name = kwargs.get('custom_sub_domain_name', None) + self.network_acls = kwargs.get('network_acls', None) + self.encryption = kwargs.get('encryption', None) + self.user_owned_storage = kwargs.get('user_owned_storage', None) + self.private_endpoint_connections = None + self.public_network_access = kwargs.get('public_network_access', None) + self.api_properties = kwargs.get('api_properties', None) + self.date_created = None + self.call_rate_limit = None + self.quota_limit = None + self.restrict_outbound_network_access = kwargs.get('restrict_outbound_network_access', None) + self.allowed_fqdn_list = kwargs.get('allowed_fqdn_list', None) + self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.endpoints = None + self.restore = kwargs.get('restore', None) -class CheckSkuAvailabilityResult(Model): - """Check SKU availability result. +class AccountSku(Model): + """Cognitive Services resource type and SKU. - :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 + :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 = { - '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'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, } 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) + super(AccountSku, self).__init__(**kwargs) + self.resource_type = kwargs.get('resource_type', None) + self.sku = kwargs.get('sku', None) -class CheckSkuAvailabilityResultList(Model): - """Check SKU availability result list. +class AccountSkuListResult(Model): + """The list of cognitive services accounts operation response. - :param value: Check SKU availability result list. - :type value: - list[~azure.mgmt.cognitiveservices.models.CheckSkuAvailabilityResult] + :param value: Gets the list of Cognitive Services accounts and their + properties. + :type value: list[~azure.mgmt.cognitiveservices.models.AccountSku] """ _attribute_map = { - 'value': {'key': 'value', 'type': '[CheckSkuAvailabilityResult]'}, + 'value': {'key': 'value', 'type': '[AccountSku]'}, } def __init__(self, **kwargs): - super(CheckSkuAvailabilityResultList, self).__init__(**kwargs) + super(AccountSkuListResult, 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. +class ApiKeys(Model): + """The access keys for the cognitive services account. - :ivar etag: Entity Tag - :vartype etag: str - :ivar id: The id of the created account - :vartype id: str - :param kind: The Kind of the resource. - :type kind: str - :param location: The location of the resource - :type location: str - :ivar name: The name of the created account - :vartype name: str - :param properties: Properties of Cognitive Services account. - :type properties: - ~azure.mgmt.cognitiveservices.models.CognitiveServicesAccountProperties - :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 - :param identity: The identity of Cognitive Services account. - :type identity: ~azure.mgmt.cognitiveservices.models.Identity + :param key1: Gets the value of key 1. + :type key1: str + :param key2: Gets the value of key 2. + :type key2: str """ - _validation = { - 'etag': {'readonly': True}, - 'id': {'readonly': True}, - 'name': {'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'}, - 'properties': {'key': 'properties', 'type': 'CognitiveServicesAccountProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, + 'key1': {'key': 'key1', 'type': 'str'}, + 'key2': {'key': 'key2', 'type': 'str'}, } def __init__(self, **kwargs): - super(CognitiveServicesAccount, self).__init__(**kwargs) - self.etag = None - self.id = None - self.kind = kwargs.get('kind', None) - self.location = kwargs.get('location', None) - self.name = None - self.properties = kwargs.get('properties', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - self.type = None - self.identity = kwargs.get('identity', None) + super(ApiKeys, self).__init__(**kwargs) + self.key1 = kwargs.get('key1', None) + self.key2 = kwargs.get('key2', None) -class CognitiveServicesAccountApiProperties(Model): +class ApiProperties(Model): """The api properties for special APIs. + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] :param qna_runtime_endpoint: (QnAMaker Only) The runtime endpoint of QnAMaker. :type qna_runtime_endpoint: str + :param qna_azure_search_endpoint_key: (QnAMaker Only) The Azure Search + endpoint key of QnAMaker. + :type qna_azure_search_endpoint_key: str + :param qna_azure_search_endpoint_id: (QnAMaker Only) The Azure Search + endpoint id of QnAMaker. + :type qna_azure_search_endpoint_id: str :param statistics_enabled: (Bing Search Only) The flag to enable statistics of Bing Search. :type statistics_enabled: bool @@ -341,7 +396,10 @@ class CognitiveServicesAccountApiProperties(Model): } _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, 'qna_runtime_endpoint': {'key': 'qnaRuntimeEndpoint', 'type': 'str'}, + 'qna_azure_search_endpoint_key': {'key': 'qnaAzureSearchEndpointKey', 'type': 'str'}, + 'qna_azure_search_endpoint_id': {'key': 'qnaAzureSearchEndpointId', 'type': 'str'}, 'statistics_enabled': {'key': 'statisticsEnabled', 'type': 'bool'}, 'event_hub_connection_string': {'key': 'eventHubConnectionString', 'type': 'str'}, 'storage_account_connection_string': {'key': 'storageAccountConnectionString', 'type': 'str'}, @@ -352,8 +410,11 @@ class CognitiveServicesAccountApiProperties(Model): } def __init__(self, **kwargs): - super(CognitiveServicesAccountApiProperties, self).__init__(**kwargs) + super(ApiProperties, self).__init__(**kwargs) + self.additional_properties = kwargs.get('additional_properties', None) self.qna_runtime_endpoint = kwargs.get('qna_runtime_endpoint', None) + self.qna_azure_search_endpoint_key = kwargs.get('qna_azure_search_endpoint_key', None) + self.qna_azure_search_endpoint_id = kwargs.get('qna_azure_search_endpoint_id', None) self.statistics_enabled = kwargs.get('statistics_enabled', None) self.event_hub_connection_string = kwargs.get('event_hub_connection_string', None) self.storage_account_connection_string = kwargs.get('storage_account_connection_string', None) @@ -363,150 +424,124 @@ def __init__(self, **kwargs): self.website_name = kwargs.get('website_name', 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. +class CallRateLimit(Model): + """The call rate limit Cognitive Services account. - :ivar value: Gets the list of Cognitive Services accounts and their - properties. - :vartype value: - list[~azure.mgmt.cognitiveservices.models.CognitiveServicesResourceAndSku] + :param count: The count value of Call Rate Limit. + :type count: float + :param renewal_period: The renewal period in seconds of Call Rate Limit. + :type renewal_period: float + :param rules: + :type rules: list[~azure.mgmt.cognitiveservices.models.ThrottlingRule] """ - _validation = { - 'value': {'readonly': True}, - } - _attribute_map = { - 'value': {'key': 'value', 'type': '[CognitiveServicesResourceAndSku]'}, + 'count': {'key': 'count', 'type': 'float'}, + 'renewal_period': {'key': 'renewalPeriod', 'type': 'float'}, + 'rules': {'key': 'rules', 'type': '[ThrottlingRule]'}, } def __init__(self, **kwargs): - super(CognitiveServicesAccountEnumerateSkusResult, self).__init__(**kwargs) - self.value = None + super(CallRateLimit, self).__init__(**kwargs) + self.count = kwargs.get('count', None) + self.renewal_period = kwargs.get('renewal_period', None) + self.rules = kwargs.get('rules', None) -class CognitiveServicesAccountKeys(Model): - """The access keys for the cognitive services account. +class CheckDomainAvailabilityParameter(Model): + """Check Domain availability parameter. - :param key1: Gets the value of key 1. - :type key1: str - :param key2: Gets the value of key 2. - :type key2: str + 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 = { - 'key1': {'key': 'key1', 'type': 'str'}, - 'key2': {'key': 'key2', 'type': 'str'}, + 'subdomain_name': {'key': 'subdomainName', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, } def __init__(self, **kwargs): - super(CognitiveServicesAccountKeys, self).__init__(**kwargs) - self.key1 = kwargs.get('key1', None) - self.key2 = kwargs.get('key2', None) + super(CheckDomainAvailabilityParameter, self).__init__(**kwargs) + self.subdomain_name = kwargs.get('subdomain_name', None) + self.type = kwargs.get('type', None) -class CognitiveServicesAccountProperties(Model): - """Properties of Cognitive Services account. +class CheckSkuAvailabilityParameter(Model): + """Check SKU availability parameter. - 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. - :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 - :ivar endpoint: Endpoint of the created account. - :vartype endpoint: str - :ivar internal_id: The internal identifier. - :vartype internal_id: str - :ivar capabilities: Gets the capabilities of the cognitive services - account. Each item indicates the capability of a specific feature. The - values are read-only and for reference only. - :vartype capabilities: - list[~azure.mgmt.cognitiveservices.models.SkuCapability] - :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 encryption: The encryption properties for this resource. - :type encryption: ~azure.mgmt.cognitiveservices.models.Encryption - :param user_owned_storage: The storage accounts for this resource. - :type user_owned_storage: - list[~azure.mgmt.cognitiveservices.models.UserOwnedStorage] - :param private_endpoint_connections: The private endpoint connection - associated with the Cognitive Services account. - :type private_endpoint_connections: - list[~azure.mgmt.cognitiveservices.models.PrivateEndpointConnection] - :param public_network_access: Whether or not public endpoint access is - allowed for this account. Value is optional but if passed in, must be - 'Enabled' or 'Disabled'. Possible values include: 'Enabled', 'Disabled' - :type public_network_access: str or - ~azure.mgmt.cognitiveservices.models.PublicNetworkAccess - :param api_properties: The api properties for special APIs. - :type api_properties: - ~azure.mgmt.cognitiveservices.models.CognitiveServicesAccountApiProperties + :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 = { - 'provisioning_state': {'readonly': True}, - 'endpoint': {'readonly': True}, - 'internal_id': {'readonly': True}, - 'capabilities': {'readonly': True}, + 'skus': {'required': True}, + 'kind': {'required': True}, + 'type': {'required': True}, } _attribute_map = { - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'internal_id': {'key': 'internalId', 'type': 'str'}, - 'capabilities': {'key': 'capabilities', 'type': '[SkuCapability]'}, - 'custom_sub_domain_name': {'key': 'customSubDomainName', 'type': 'str'}, - 'network_acls': {'key': 'networkAcls', 'type': 'NetworkRuleSet'}, - 'encryption': {'key': 'encryption', 'type': 'Encryption'}, - 'user_owned_storage': {'key': 'userOwnedStorage', 'type': '[UserOwnedStorage]'}, - 'private_endpoint_connections': {'key': 'privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'api_properties': {'key': 'apiProperties', 'type': 'CognitiveServicesAccountApiProperties'}, + 'skus': {'key': 'skus', 'type': '[str]'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, } def __init__(self, **kwargs): - super(CognitiveServicesAccountProperties, self).__init__(**kwargs) - self.provisioning_state = None - self.endpoint = None - self.internal_id = None - self.capabilities = None - self.custom_sub_domain_name = kwargs.get('custom_sub_domain_name', None) - self.network_acls = kwargs.get('network_acls', None) - self.encryption = kwargs.get('encryption', None) - self.user_owned_storage = kwargs.get('user_owned_storage', None) - self.private_endpoint_connections = kwargs.get('private_endpoint_connections', None) - self.public_network_access = kwargs.get('public_network_access', None) - self.api_properties = kwargs.get('api_properties', None) + super(CheckSkuAvailabilityParameter, self).__init__(**kwargs) + self.skus = kwargs.get('skus', None) + self.kind = kwargs.get('kind', None) + self.type = kwargs.get('type', None) -class CognitiveServicesResourceAndSku(Model): - """Cognitive Services resource type and SKU. +class CloudError(Model): + """CloudError. + """ - :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 = { + } + + +class DomainAvailability(Model): + """Domain availability. + + :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 = { - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + '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(CognitiveServicesResourceAndSku, self).__init__(**kwargs) - self.resource_type = kwargs.get('resource_type', None) - self.sku = kwargs.get('sku', None) + super(DomainAvailability, 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 Encryption(Model): @@ -532,73 +567,123 @@ def __init__(self, **kwargs): self.key_source = kwargs.get('key_source', "Microsoft.KeyVault") -class Error(Model): - """Cognitive Services error object. +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. - :param error: The error body. - :type error: ~azure.mgmt.cognitiveservices.models.ErrorBody + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object """ + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorBody'}, + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, } def __init__(self, **kwargs): - super(Error, self).__init__(**kwargs) - self.error = kwargs.get('error', None) + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None -class ErrorException(HttpOperationError): - """Server responsed with exception of type: 'Error'. +class ErrorDetail(Model): + """The error detail. - :param deserialize: A deserializer - :param response: Server response to be deserialized. + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.cognitiveservices.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.cognitiveservices.models.ErrorAdditionalInfo] """ - def __init__(self, deserialize, response, *args): + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } - super(ErrorException, self).__init__(deserialize, response, 'Error', *args) + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + def __init__(self, **kwargs): + super(ErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None -class ErrorBody(Model): - """Cognitive Services error body. - All required parameters must be populated in order to send to Azure. +class ErrorResponse(Model): + """Error response. - :param code: Required. error code - :type code: str - :param message: Required. error message - :type message: str - """ + Common error response for all Azure Resource Manager APIs to return error + details for failed operations. (This also follows the OData error response + format.). - _validation = { - 'code': {'required': True}, - 'message': {'required': True}, - } + :param error: The error object. + :type error: ~azure.mgmt.cognitiveservices.models.ErrorDetail + """ _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ErrorDetail'}, } def __init__(self, **kwargs): - super(ErrorBody, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) class Identity(Model): - """Managed service identity. + """Identity for the resource. Variables are only populated by the server, and will be ignored when sending a request. - :param type: Type of managed service identity. Possible values include: - 'None', 'SystemAssigned', 'UserAssigned' - :type type: str or ~azure.mgmt.cognitiveservices.models.IdentityType - :ivar tenant_id: Tenant of managed service identity. + :param type: The identity type. Possible values include: 'None', + 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned' + :type type: str or + ~azure.mgmt.cognitiveservices.models.ResourceIdentityType + :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str - :ivar principal_id: Principal Id of managed service identity. + :ivar principal_id: The principal ID of resource identity. :vartype principal_id: str :param user_assigned_identities: The list of user assigned identities associated with the resource. The user identity dictionary key references @@ -614,7 +699,7 @@ class Identity(Model): } _attribute_map = { - 'type': {'key': 'type', 'type': 'IdentityType'}, + 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, 'principal_id': {'key': 'principalId', 'type': 'str'}, 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, @@ -661,12 +746,15 @@ class KeyVaultProperties(Model): :type key_version: str :param key_vault_uri: Uri of KeyVault :type key_vault_uri: str + :param identity_client_id: + :type identity_client_id: str """ _attribute_map = { 'key_name': {'key': 'keyName', 'type': 'str'}, 'key_version': {'key': 'keyVersion', 'type': 'str'}, 'key_vault_uri': {'key': 'keyVaultUri', 'type': 'str'}, + 'identity_client_id': {'key': 'identityClientId', 'type': 'str'}, } def __init__(self, **kwargs): @@ -674,25 +762,18 @@ def __init__(self, **kwargs): self.key_name = kwargs.get('key_name', None) self.key_version = kwargs.get('key_version', None) self.key_vault_uri = kwargs.get('key_vault_uri', None) + self.identity_client_id = kwargs.get('identity_client_id', 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 + :param value: The name of the metric. + :type value: str + :param localized_value: The friendly name of the metric. + :type localized_value: str """ - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - _attribute_map = { 'value': {'key': 'value', 'type': 'str'}, 'localized_value': {'key': 'localizedValue', 'type': 'str'}, @@ -700,8 +781,8 @@ class MetricName(Model): def __init__(self, **kwargs): super(MetricName, self).__init__(**kwargs) - self.value = None - self.localized_value = None + self.value = kwargs.get('value', None) + self.localized_value = kwargs.get('localized_value', None) class NetworkRuleSet(Model): @@ -732,61 +813,102 @@ def __init__(self, **kwargs): self.virtual_network_rules = kwargs.get('virtual_network_rules', None) -class OperationDisplayInfo(Model): - """The operation supported by Cognitive Services. +class Operation(Model): + """REST API Operation. - :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 + Details of a REST API operation, returned from the Resource Provider + Operations API. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the operation, as per Resource-Based Access + Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", + "Microsoft.Compute/virtualMachines/capture/action" + :vartype name: str + :ivar is_data_action: Whether the operation applies to data-plane. This is + "true" for data-plane operations and "false" for ARM/control-plane + operations. + :vartype is_data_action: bool + :param display: Localized display information for this particular + operation. + :type display: ~azure.mgmt.cognitiveservices.models.OperationDisplay + :ivar origin: The intended executor of the operation; as in Resource Based + Access Control (RBAC) and audit logs UX. Default value is "user,system". + Possible values include: 'user', 'system', 'user,system' + :vartype origin: str or ~azure.mgmt.cognitiveservices.models.Origin + :ivar action_type: Enum. Indicates the action type. "Internal" refers to + actions that are for internal only APIs. Possible values include: + 'Internal' + :vartype action_type: str or + ~azure.mgmt.cognitiveservices.models.ActionType """ + _validation = { + 'name': {'readonly': True}, + 'is_data_action': {'readonly': True}, + 'origin': {'readonly': True}, + 'action_type': {'readonly': True}, + } + _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'action_type': {'key': 'actionType', '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) + super(Operation, self).__init__(**kwargs) + self.name = None + self.is_data_action = None + self.display = kwargs.get('display', None) + self.origin = None + self.action_type = None -class OperationEntity(Model): - """The operation supported by Cognitive Services. +class OperationDisplay(Model): + """Localized display information for this particular operation. - :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 + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: The localized friendly form of the resource provider name, + e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + :vartype provider: str + :ivar resource: The localized friendly name of the resource type related + to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + :vartype resource: str + :ivar operation: The concise, localized friendly name for the operation; + suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart + Virtual Machine". + :vartype operation: str + :ivar description: The short, localized friendly description of the + operation; suitable for tool tips and detailed views. + :vartype description: str """ + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + 'description': {'readonly': True}, + } + _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplayInfo'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'object'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, } def __init__(self, **kwargs): - super(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) + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = None class PrivateEndpoint(Model): @@ -812,41 +934,54 @@ def __init__(self, **kwargs): self.id = None -class PrivateEndpointConnection(Resource): +class PrivateEndpointConnection(AzureEntityResource): """The Private Endpoint Connection resource. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str :param properties: Resource properties. :type properties: ~azure.mgmt.cognitiveservices.models.PrivateEndpointConnectionProperties + :ivar system_data: + :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData + :param location: The location of the private endpoint connection + :type location: str """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'system_data': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'PrivateEndpointConnectionProperties'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'location': {'key': 'location', 'type': 'str'}, } def __init__(self, **kwargs): super(PrivateEndpointConnection, self).__init__(**kwargs) self.properties = kwargs.get('properties', None) + self.system_data = None + self.location = kwargs.get('location', None) class PrivateEndpointConnectionListResult(Model): @@ -879,6 +1014,11 @@ class PrivateEndpointConnectionProperties(Model): provider. :type private_link_service_connection_state: ~azure.mgmt.cognitiveservices.models.PrivateLinkServiceConnectionState + :param provisioning_state: The provisioning state of the private endpoint + connection resource. Possible values include: 'Succeeded', 'Creating', + 'Deleting', 'Failed' + :type provisioning_state: str or + ~azure.mgmt.cognitiveservices.models.PrivateEndpointConnectionProvisioningState :param group_ids: The private link resource group ids. :type group_ids: list[str] """ @@ -890,6 +1030,7 @@ class PrivateEndpointConnectionProperties(Model): _attribute_map = { 'private_endpoint': {'key': 'privateEndpoint', 'type': 'PrivateEndpoint'}, 'private_link_service_connection_state': {'key': 'privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, 'group_ids': {'key': 'groupIds', 'type': '[str]'}, } @@ -897,6 +1038,7 @@ def __init__(self, **kwargs): super(PrivateEndpointConnectionProperties, self).__init__(**kwargs) self.private_endpoint = kwargs.get('private_endpoint', None) self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + self.provisioning_state = kwargs.get('provisioning_state', None) self.group_ids = kwargs.get('group_ids', None) @@ -906,13 +1048,13 @@ class PrivateLinkResource(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :param properties: Resource properties. :type properties: @@ -962,34 +1104,34 @@ class PrivateLinkResourceProperties(Model): :ivar group_id: The private link resource group id. :vartype group_id: str - :ivar display_name: The private link resource display name. - :vartype display_name: str :ivar required_members: The private link resource required member names. :vartype required_members: list[str] :param required_zone_names: The private link resource Private link DNS zone name. :type required_zone_names: list[str] + :ivar display_name: The private link resource display name. + :vartype display_name: str """ _validation = { 'group_id': {'readonly': True}, - 'display_name': {'readonly': True}, 'required_members': {'readonly': True}, + 'display_name': {'readonly': True}, } _attribute_map = { 'group_id': {'key': 'groupId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, 'required_zone_names': {'key': 'requiredZoneNames', 'type': '[str]'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, } def __init__(self, **kwargs): super(PrivateLinkResourceProperties, self).__init__(**kwargs) self.group_id = None - self.display_name = None self.required_members = None self.required_zone_names = kwargs.get('required_zone_names', None) + self.display_name = None class PrivateLinkServiceConnectionState(Model): @@ -998,43 +1140,45 @@ class PrivateLinkServiceConnectionState(Model): :param status: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values - include: 'Pending', 'Approved', 'Rejected', 'Disconnected' + include: 'Pending', 'Approved', 'Rejected' :type status: str or ~azure.mgmt.cognitiveservices.models.PrivateEndpointServiceConnectionStatus :param description: The reason for approval/rejection of the connection. :type description: str - :param action_required: A message indicating if changes on the service + :param actions_required: A message indicating if changes on the service provider require any updates on the consumer. - :type action_required: str + :type actions_required: str """ _attribute_map = { 'status': {'key': 'status', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, - 'action_required': {'key': 'actionRequired', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, } def __init__(self, **kwargs): super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) self.status = kwargs.get('status', None) self.description = kwargs.get('description', None) - self.action_required = kwargs.get('action_required', None) + self.actions_required = kwargs.get('actions_required', None) class ProxyResource(Resource): - """The resource model definition for a ARM proxy resource. It will have - everything other than required location and tags. + """Proxy Resource. + + The resource model definition for a Azure Resource Manager proxy resource. + It will not have tags and a location. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str """ @@ -1054,6 +1198,30 @@ def __init__(self, **kwargs): super(ProxyResource, self).__init__(**kwargs) +class QuotaLimit(Model): + """QuotaLimit. + + :param count: + :type count: float + :param renewal_period: + :type renewal_period: float + :param rules: + :type rules: list[~azure.mgmt.cognitiveservices.models.ThrottlingRule] + """ + + _attribute_map = { + 'count': {'key': 'count', 'type': 'float'}, + 'renewal_period': {'key': 'renewalPeriod', 'type': 'float'}, + 'rules': {'key': 'rules', 'type': '[ThrottlingRule]'}, + } + + def __init__(self, **kwargs): + super(QuotaLimit, self).__init__(**kwargs) + self.count = kwargs.get('count', None) + self.renewal_period = kwargs.get('renewal_period', None) + self.rules = kwargs.get('rules', None) + + class RegenerateKeyParameters(Model): """Regenerate key parameters. @@ -1077,37 +1245,45 @@ def __init__(self, **kwargs): self.key_name = kwargs.get('key_name', None) +class RequestMatchPattern(Model): + """RequestMatchPattern. + + :param path: + :type path: str + :param method: + :type method: str + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'method': {'key': 'method', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RequestMatchPattern, self).__init__(**kwargs) + self.path = kwargs.get('path', None) + self.method = kwargs.get('method', 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. + :param resource_type: The type of resource the SKU applies to. + :type resource_type: str + :param name: The name of SKU. + :type name: str + :param tier: Specifies the tier of Cognitive Services account. + :type tier: str + :param kind: The Kind of resources that are supported in this SKU. + :type kind: str + :param locations: The set of locations that the SKU is available. + :type locations: list[str] + :param restrictions: The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. - :vartype restrictions: + :type 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'}, @@ -1119,31 +1295,23 @@ class ResourceSku(Model): 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 + self.resource_type = kwargs.get('resource_type', None) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.kind = kwargs.get('kind', None) + self.locations = kwargs.get('locations', None) + self.restrictions = kwargs.get('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] + :param locations: Locations where the SKU is restricted + :type locations: list[str] + :param zones: List of availability zones where the SKU is restricted. + :type zones: list[str] """ - _validation = { - 'locations': {'readonly': True}, - 'zones': {'readonly': True}, - } - _attribute_map = { 'locations': {'key': 'locations', 'type': '[str]'}, 'zones': {'key': 'zones', 'type': '[str]'}, @@ -1151,40 +1319,31 @@ class ResourceSkuRestrictionInfo(Model): def __init__(self, **kwargs): super(ResourceSkuRestrictionInfo, self).__init__(**kwargs) - self.locations = None - self.zones = None + self.locations = kwargs.get('locations', None) + self.zones = kwargs.get('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 + :param type: The type of restrictions. Possible values include: + 'Location', 'Zone' + :type 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 + :param values: The value of restrictions. If the restriction type is set + to location. This would be different locations where the SKU is + restricted. + :type values: list[str] + :param restriction_info: The information about the restriction where the SKU cannot be used. - :vartype restriction_info: + :type restriction_info: ~azure.mgmt.cognitiveservices.models.ResourceSkuRestrictionInfo - :ivar reason_code: The reason for restriction. Possible values include: + :param reason_code: The reason for restriction. Possible values include: 'QuotaId', 'NotAvailableForSubscription' - :vartype reason_code: str or + :type 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]'}, @@ -1194,42 +1353,108 @@ class ResourceSkuRestrictions(Model): def __init__(self, **kwargs): super(ResourceSkuRestrictions, self).__init__(**kwargs) - self.type = None - self.values = None - self.restriction_info = None - self.reason_code = None + self.type = kwargs.get('type', None) + self.values = kwargs.get('values', None) + self.restriction_info = kwargs.get('restriction_info', None) + self.reason_code = kwargs.get('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. + """The resource model definition representing SKU. 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. + :param name: Required. The name of the SKU. Ex - P3. It is typically a + letter+number code :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 + :param tier: This field is required to be implemented by the Resource + Provider if the service has more than one tier, but is not required on a + PUT. Possible values include: 'Free', 'Basic', 'Standard', 'Premium', + 'Enterprise' + :type tier: str or ~azure.mgmt.cognitiveservices.models.SkuTier + :param size: The SKU size. When the name field is the combination of tier + and some other value, this would be the standalone code. + :type size: str + :param family: If the service has different generations of hardware, for + the same SKU, then that can be captured here. + :type family: str + :param capacity: If the SKU supports scale out/in then the capacity + integer should be included. If scale out/in is not possible for the + resource this may be omitted. + :type capacity: int """ _validation = { 'name': {'required': True}, - 'tier': {'readonly': True}, } _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'SkuTier'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, } def __init__(self, **kwargs): super(Sku, self).__init__(**kwargs) self.name = kwargs.get('name', None) - self.tier = None + self.tier = kwargs.get('tier', None) + self.size = kwargs.get('size', None) + self.family = kwargs.get('family', None) + self.capacity = kwargs.get('capacity', None) + + +class SkuAvailability(Model): + """SKU availability. + + :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(SkuAvailability, 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 SkuAvailabilityListResult(Model): + """Check SKU availability result list. + + :param value: Check SKU availability result list. + :type value: list[~azure.mgmt.cognitiveservices.models.SkuAvailability] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SkuAvailability]'}, + } + + def __init__(self, **kwargs): + super(SkuAvailabilityListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) class SkuCapability(Model): @@ -1252,21 +1477,127 @@ def __init__(self, **kwargs): self.value = kwargs.get('value', None) +class SkuChangeInfo(Model): + """Sku change info of account. + + :param count_of_downgrades: Gets the count of downgrades. + :type count_of_downgrades: float + :param count_of_upgrades_after_downgrades: Gets the count of upgrades + after downgrades. + :type count_of_upgrades_after_downgrades: float + :param last_change_date: Gets the last change date. + :type last_change_date: str + """ + + _attribute_map = { + 'count_of_downgrades': {'key': 'countOfDowngrades', 'type': 'float'}, + 'count_of_upgrades_after_downgrades': {'key': 'countOfUpgradesAfterDowngrades', 'type': 'float'}, + 'last_change_date': {'key': 'lastChangeDate', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SkuChangeInfo, self).__init__(**kwargs) + self.count_of_downgrades = kwargs.get('count_of_downgrades', None) + self.count_of_upgrades_after_downgrades = kwargs.get('count_of_upgrades_after_downgrades', None) + self.last_change_date = kwargs.get('last_change_date', None) + + +class SystemData(Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. + Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + :type created_by_type: str or + ~azure.mgmt.cognitiveservices.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the + resource. Possible values include: 'User', 'Application', + 'ManagedIdentity', 'Key' + :type last_modified_by_type: str or + ~azure.mgmt.cognitiveservices.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC) + :type last_modified_at: datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) + + +class ThrottlingRule(Model): + """ThrottlingRule. + + :param key: + :type key: str + :param renewal_period: + :type renewal_period: float + :param count: + :type count: float + :param min_count: + :type min_count: float + :param dynamic_throttling_enabled: + :type dynamic_throttling_enabled: bool + :param match_patterns: + :type match_patterns: + list[~azure.mgmt.cognitiveservices.models.RequestMatchPattern] + """ + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'renewal_period': {'key': 'renewalPeriod', 'type': 'float'}, + 'count': {'key': 'count', 'type': 'float'}, + 'min_count': {'key': 'minCount', 'type': 'float'}, + 'dynamic_throttling_enabled': {'key': 'dynamicThrottlingEnabled', 'type': 'bool'}, + 'match_patterns': {'key': 'matchPatterns', 'type': '[RequestMatchPattern]'}, + } + + def __init__(self, **kwargs): + super(ThrottlingRule, self).__init__(**kwargs) + self.key = kwargs.get('key', None) + self.renewal_period = kwargs.get('renewal_period', None) + self.count = kwargs.get('count', None) + self.min_count = kwargs.get('min_count', None) + self.dynamic_throttling_enabled = kwargs.get('dynamic_throttling_enabled', None) + self.match_patterns = kwargs.get('match_patterns', None) + + class TrackedResource(Resource): - """The resource model definition for a ARM tracked top level resource. + """Tracked Resource. + + The resource model definition for an Azure Resource Manager tracked top + level resource which has 'tags' and a 'location'. 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. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :param tags: Resource tags. :type tags: dict[str, str] @@ -1298,36 +1629,25 @@ def __init__(self, **kwargs): 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 name: The name information for the metric. + :type name: ~azure.mgmt.cognitiveservices.models.MetricName + :param quota_period: The quota period used to summarize the usage values. + :type quota_period: str + :param limit: Maximum value for this metric. + :type limit: float + :param current_value: Current value for this metric. + :type current_value: float + :param next_reset_time: Next reset time for current quota. + :type 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'}, @@ -1341,47 +1661,48 @@ class Usage(Model): 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.name = kwargs.get('name', None) + self.quota_period = kwargs.get('quota_period', None) + self.limit = kwargs.get('limit', None) + self.current_value = kwargs.get('current_value', None) + self.next_reset_time = kwargs.get('next_reset_time', None) self.status = kwargs.get('status', None) -class UsagesResult(Model): +class UsageListResult(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] + :param value: The list of usages for Cognitive Service account. + :type 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 + super(UsageListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) class UserAssignedIdentity(Model): """User-assigned managed identity. - :param principal_id: Azure Active Directory principal ID associated with + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: Azure Active Directory principal ID associated with this Identity. - :type principal_id: str - :param client_id: Client App Id associated with this identity. - :type client_id: str + :vartype principal_id: str + :ivar client_id: Client App Id associated with this identity. + :vartype client_id: str """ + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + _attribute_map = { 'principal_id': {'key': 'principalId', 'type': 'str'}, 'client_id': {'key': 'clientId', 'type': 'str'}, @@ -1389,8 +1710,8 @@ class UserAssignedIdentity(Model): def __init__(self, **kwargs): super(UserAssignedIdentity, self).__init__(**kwargs) - self.principal_id = kwargs.get('principal_id', None) - self.client_id = kwargs.get('client_id', None) + self.principal_id = None + self.client_id = None class UserOwnedStorage(Model): @@ -1398,15 +1719,19 @@ class UserOwnedStorage(Model): :param resource_id: Full resource id of a Microsoft.Storage resource. :type resource_id: str + :param identity_client_id: + :type identity_client_id: str """ _attribute_map = { 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'identity_client_id': {'key': 'identityClientId', 'type': 'str'}, } def __init__(self, **kwargs): super(UserOwnedStorage, self).__init__(**kwargs) self.resource_id = kwargs.get('resource_id', None) + self.identity_client_id = kwargs.get('identity_client_id', None) class VirtualNetworkRule(Model): 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 index e9f62af5bff9..094110823cdc 100644 --- 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 @@ -16,16 +16,19 @@ class Resource(Model): """Resource. + Common fields that are returned in the response for all Azure Resource + Manager resources. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str """ @@ -49,19 +52,21 @@ def __init__(self, **kwargs) -> None: class AzureEntityResource(Resource): - """The resource model definition for a Azure Resource Manager resource with an - etag. + """Entity Resource. + + The resource model definition for an Azure Resource Manager resource with + an etag. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -86,229 +91,279 @@ def __init__(self, **kwargs) -> None: self.etag = None -class CheckDomainAvailabilityParameter(Model): - """Check Domain availability parameter. +class Account(AzureEntityResource): + """Cognitive Services account is an Azure resource representing the + provisioned account, it's type, location and SKU. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when + sending a request. - :param subdomain_name: Required. The subdomain name to use. - :type subdomain_name: str - :param type: Required. The Type of the resource. - :type type: str + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param kind: The Kind of the resource. + :type kind: str + :param sku: + :type sku: ~azure.mgmt.cognitiveservices.models.Sku + :param identity: + :type identity: ~azure.mgmt.cognitiveservices.models.Identity + :ivar system_data: + :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: The geo-location where the resource lives + :type location: str + :param properties: Properties of Cognitive Services account. + :type properties: ~azure.mgmt.cognitiveservices.models.AccountProperties """ _validation = { - 'subdomain_name': {'required': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'subdomain_name': {'key': 'subdomainName', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'system_data': {'readonly': True}, } - 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'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'AccountProperties'}, } - 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 + def __init__(self, *, kind: str=None, sku=None, identity=None, tags=None, location: str=None, properties=None, **kwargs) -> None: + super(Account, self).__init__(**kwargs) + self.kind = kind + self.sku = sku + self.identity = identity + self.system_data = None + self.tags = tags + self.location = location + self.properties = properties -class CheckSkuAvailabilityParameter(Model): - """Check SKU availability parameter. +class AccountProperties(Model): + """Properties of Cognitive Services account. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when + sending a request. - :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 + :ivar provisioning_state: Gets the status of the cognitive services + account at the time the operation was called. Possible values include: + 'Accepted', 'Creating', 'Deleting', 'Moving', 'Failed', 'Succeeded', + 'ResolvingDNS' + :vartype provisioning_state: str or + ~azure.mgmt.cognitiveservices.models.ProvisioningState + :ivar endpoint: Endpoint of the created account. + :vartype endpoint: str + :ivar internal_id: The internal identifier (deprecated, do not use this + property). + :vartype internal_id: str + :ivar capabilities: Gets the capabilities of the cognitive services + account. Each item indicates the capability of a specific feature. The + values are read-only and for reference only. + :vartype capabilities: + list[~azure.mgmt.cognitiveservices.models.SkuCapability] + :ivar is_migrated: If the resource is migrated from an existing key. + :vartype is_migrated: bool + :param migration_token: Resource migration token. + :type migration_token: str + :ivar sku_change_info: Sku change info of account. + :vartype sku_change_info: + ~azure.mgmt.cognitiveservices.models.SkuChangeInfo + :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 encryption: The encryption properties for this resource. + :type encryption: ~azure.mgmt.cognitiveservices.models.Encryption + :param user_owned_storage: The storage accounts for this resource. + :type user_owned_storage: + list[~azure.mgmt.cognitiveservices.models.UserOwnedStorage] + :ivar private_endpoint_connections: The private endpoint connection + associated with the Cognitive Services account. + :vartype private_endpoint_connections: + list[~azure.mgmt.cognitiveservices.models.PrivateEndpointConnection] + :param public_network_access: Whether or not public endpoint access is + allowed for this account. Value is optional but if passed in, must be + 'Enabled' or 'Disabled'. Possible values include: 'Enabled', 'Disabled' + :type public_network_access: str or + ~azure.mgmt.cognitiveservices.models.PublicNetworkAccess + :param api_properties: The api properties for special APIs. + :type api_properties: ~azure.mgmt.cognitiveservices.models.ApiProperties + :ivar date_created: Gets the date of cognitive services account creation. + :vartype date_created: str + :ivar call_rate_limit: + :vartype call_rate_limit: + ~azure.mgmt.cognitiveservices.models.CallRateLimit + :ivar quota_limit: + :vartype quota_limit: ~azure.mgmt.cognitiveservices.models.QuotaLimit + :param restrict_outbound_network_access: + :type restrict_outbound_network_access: bool + :param allowed_fqdn_list: + :type allowed_fqdn_list: list[str] + :param disable_local_auth: + :type disable_local_auth: bool + :ivar endpoints: + :vartype endpoints: dict[str, str] + :param restore: + :type restore: bool """ _validation = { - 'skus': {'required': True}, - 'kind': {'required': True}, - 'type': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'endpoint': {'readonly': True}, + 'internal_id': {'readonly': True}, + 'capabilities': {'readonly': True}, + 'is_migrated': {'readonly': True}, + 'sku_change_info': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, + 'date_created': {'readonly': True}, + 'call_rate_limit': {'readonly': True}, + 'quota_limit': {'readonly': True}, + 'endpoints': {'readonly': 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 + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'endpoint': {'key': 'endpoint', 'type': 'str'}, + 'internal_id': {'key': 'internalId', 'type': 'str'}, + 'capabilities': {'key': 'capabilities', 'type': '[SkuCapability]'}, + 'is_migrated': {'key': 'isMigrated', 'type': 'bool'}, + 'migration_token': {'key': 'migrationToken', 'type': 'str'}, + 'sku_change_info': {'key': 'skuChangeInfo', 'type': 'SkuChangeInfo'}, + 'custom_sub_domain_name': {'key': 'customSubDomainName', 'type': 'str'}, + 'network_acls': {'key': 'networkAcls', 'type': 'NetworkRuleSet'}, + 'encryption': {'key': 'encryption', 'type': 'Encryption'}, + 'user_owned_storage': {'key': 'userOwnedStorage', 'type': '[UserOwnedStorage]'}, + 'private_endpoint_connections': {'key': 'privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, + 'api_properties': {'key': 'apiProperties', 'type': 'ApiProperties'}, + 'date_created': {'key': 'dateCreated', 'type': 'str'}, + 'call_rate_limit': {'key': 'callRateLimit', 'type': 'CallRateLimit'}, + 'quota_limit': {'key': 'quotaLimit', 'type': 'QuotaLimit'}, + 'restrict_outbound_network_access': {'key': 'restrictOutboundNetworkAccess', 'type': 'bool'}, + 'allowed_fqdn_list': {'key': 'allowedFqdnList', 'type': '[str]'}, + 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + 'endpoints': {'key': 'endpoints', 'type': '{str}'}, + 'restore': {'key': 'restore', 'type': 'bool'}, + } + + def __init__(self, *, migration_token: str=None, custom_sub_domain_name: str=None, network_acls=None, encryption=None, user_owned_storage=None, public_network_access=None, api_properties=None, restrict_outbound_network_access: bool=None, allowed_fqdn_list=None, disable_local_auth: bool=None, restore: bool=None, **kwargs) -> None: + super(AccountProperties, self).__init__(**kwargs) + self.provisioning_state = None + self.endpoint = None + self.internal_id = None + self.capabilities = None + self.is_migrated = None + self.migration_token = migration_token + self.sku_change_info = None + self.custom_sub_domain_name = custom_sub_domain_name + self.network_acls = network_acls + self.encryption = encryption + self.user_owned_storage = user_owned_storage + self.private_endpoint_connections = None + self.public_network_access = public_network_access + self.api_properties = api_properties + self.date_created = None + self.call_rate_limit = None + self.quota_limit = None + self.restrict_outbound_network_access = restrict_outbound_network_access + self.allowed_fqdn_list = allowed_fqdn_list + self.disable_local_auth = disable_local_auth + self.endpoints = None + self.restore = restore -class CheckSkuAvailabilityResult(Model): - """Check SKU availability result. +class AccountSku(Model): + """Cognitive Services resource type and SKU. - :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 + :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 = { - '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'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, } - 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 + def __init__(self, *, resource_type: str=None, sku=None, **kwargs) -> None: + super(AccountSku, self).__init__(**kwargs) + self.resource_type = resource_type + self.sku = sku -class CheckSkuAvailabilityResultList(Model): - """Check SKU availability result list. +class AccountSkuListResult(Model): + """The list of cognitive services accounts operation response. - :param value: Check SKU availability result list. - :type value: - list[~azure.mgmt.cognitiveservices.models.CheckSkuAvailabilityResult] + :param value: Gets the list of Cognitive Services accounts and their + properties. + :type value: list[~azure.mgmt.cognitiveservices.models.AccountSku] """ _attribute_map = { - 'value': {'key': 'value', 'type': '[CheckSkuAvailabilityResult]'}, + 'value': {'key': 'value', 'type': '[AccountSku]'}, } def __init__(self, *, value=None, **kwargs) -> None: - super(CheckSkuAvailabilityResultList, self).__init__(**kwargs) + super(AccountSkuListResult, 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. +class ApiKeys(Model): + """The access keys for the cognitive services account. - :ivar etag: Entity Tag - :vartype etag: str - :ivar id: The id of the created account - :vartype id: str - :param kind: The Kind of the resource. - :type kind: str - :param location: The location of the resource - :type location: str - :ivar name: The name of the created account - :vartype name: str - :param properties: Properties of Cognitive Services account. - :type properties: - ~azure.mgmt.cognitiveservices.models.CognitiveServicesAccountProperties - :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 - :param identity: The identity of Cognitive Services account. - :type identity: ~azure.mgmt.cognitiveservices.models.Identity + :param key1: Gets the value of key 1. + :type key1: str + :param key2: Gets the value of key 2. + :type key2: str """ - _validation = { - 'etag': {'readonly': True}, - 'id': {'readonly': True}, - 'name': {'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'}, - 'properties': {'key': 'properties', 'type': 'CognitiveServicesAccountProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, + 'key1': {'key': 'key1', 'type': 'str'}, + 'key2': {'key': 'key2', 'type': 'str'}, } - def __init__(self, *, kind: str=None, location: str=None, properties=None, sku=None, tags=None, identity=None, **kwargs) -> None: - super(CognitiveServicesAccount, self).__init__(**kwargs) - self.etag = None - self.id = None - self.kind = kind - self.location = location - self.name = None - self.properties = properties - self.sku = sku - self.tags = tags - self.type = None - self.identity = identity + def __init__(self, *, key1: str=None, key2: str=None, **kwargs) -> None: + super(ApiKeys, self).__init__(**kwargs) + self.key1 = key1 + self.key2 = key2 -class CognitiveServicesAccountApiProperties(Model): +class ApiProperties(Model): """The api properties for special APIs. + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] :param qna_runtime_endpoint: (QnAMaker Only) The runtime endpoint of QnAMaker. :type qna_runtime_endpoint: str + :param qna_azure_search_endpoint_key: (QnAMaker Only) The Azure Search + endpoint key of QnAMaker. + :type qna_azure_search_endpoint_key: str + :param qna_azure_search_endpoint_id: (QnAMaker Only) The Azure Search + endpoint id of QnAMaker. + :type qna_azure_search_endpoint_id: str :param statistics_enabled: (Bing Search Only) The flag to enable statistics of Bing Search. :type statistics_enabled: bool @@ -341,7 +396,10 @@ class CognitiveServicesAccountApiProperties(Model): } _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, 'qna_runtime_endpoint': {'key': 'qnaRuntimeEndpoint', 'type': 'str'}, + 'qna_azure_search_endpoint_key': {'key': 'qnaAzureSearchEndpointKey', 'type': 'str'}, + 'qna_azure_search_endpoint_id': {'key': 'qnaAzureSearchEndpointId', 'type': 'str'}, 'statistics_enabled': {'key': 'statisticsEnabled', 'type': 'bool'}, 'event_hub_connection_string': {'key': 'eventHubConnectionString', 'type': 'str'}, 'storage_account_connection_string': {'key': 'storageAccountConnectionString', 'type': 'str'}, @@ -351,9 +409,12 @@ class CognitiveServicesAccountApiProperties(Model): 'website_name': {'key': 'websiteName', 'type': 'str'}, } - def __init__(self, *, qna_runtime_endpoint: str=None, statistics_enabled: bool=None, event_hub_connection_string: str=None, storage_account_connection_string: str=None, aad_client_id: str=None, aad_tenant_id: str=None, super_user: str=None, website_name: str=None, **kwargs) -> None: - super(CognitiveServicesAccountApiProperties, self).__init__(**kwargs) + def __init__(self, *, additional_properties=None, qna_runtime_endpoint: str=None, qna_azure_search_endpoint_key: str=None, qna_azure_search_endpoint_id: str=None, statistics_enabled: bool=None, event_hub_connection_string: str=None, storage_account_connection_string: str=None, aad_client_id: str=None, aad_tenant_id: str=None, super_user: str=None, website_name: str=None, **kwargs) -> None: + super(ApiProperties, self).__init__(**kwargs) + self.additional_properties = additional_properties self.qna_runtime_endpoint = qna_runtime_endpoint + self.qna_azure_search_endpoint_key = qna_azure_search_endpoint_key + self.qna_azure_search_endpoint_id = qna_azure_search_endpoint_id self.statistics_enabled = statistics_enabled self.event_hub_connection_string = event_hub_connection_string self.storage_account_connection_string = storage_account_connection_string @@ -363,150 +424,124 @@ def __init__(self, *, qna_runtime_endpoint: str=None, statistics_enabled: bool=N self.website_name = website_name -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. +class CallRateLimit(Model): + """The call rate limit Cognitive Services account. - :ivar value: Gets the list of Cognitive Services accounts and their - properties. - :vartype value: - list[~azure.mgmt.cognitiveservices.models.CognitiveServicesResourceAndSku] + :param count: The count value of Call Rate Limit. + :type count: float + :param renewal_period: The renewal period in seconds of Call Rate Limit. + :type renewal_period: float + :param rules: + :type rules: list[~azure.mgmt.cognitiveservices.models.ThrottlingRule] """ - _validation = { - 'value': {'readonly': True}, - } - _attribute_map = { - 'value': {'key': 'value', 'type': '[CognitiveServicesResourceAndSku]'}, + 'count': {'key': 'count', 'type': 'float'}, + 'renewal_period': {'key': 'renewalPeriod', 'type': 'float'}, + 'rules': {'key': 'rules', 'type': '[ThrottlingRule]'}, } - def __init__(self, **kwargs) -> None: - super(CognitiveServicesAccountEnumerateSkusResult, self).__init__(**kwargs) - self.value = None + def __init__(self, *, count: float=None, renewal_period: float=None, rules=None, **kwargs) -> None: + super(CallRateLimit, self).__init__(**kwargs) + self.count = count + self.renewal_period = renewal_period + self.rules = rules -class CognitiveServicesAccountKeys(Model): - """The access keys for the cognitive services account. +class CheckDomainAvailabilityParameter(Model): + """Check Domain availability parameter. - :param key1: Gets the value of key 1. - :type key1: str - :param key2: Gets the value of key 2. - :type key2: str + 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 = { - 'key1': {'key': 'key1', 'type': 'str'}, - 'key2': {'key': 'key2', 'type': 'str'}, + 'subdomain_name': {'key': 'subdomainName', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, *, key1: str=None, key2: str=None, **kwargs) -> None: - super(CognitiveServicesAccountKeys, self).__init__(**kwargs) - self.key1 = key1 - self.key2 = key2 + def __init__(self, *, subdomain_name: str, type: str, **kwargs) -> None: + super(CheckDomainAvailabilityParameter, self).__init__(**kwargs) + self.subdomain_name = subdomain_name + self.type = type -class CognitiveServicesAccountProperties(Model): - """Properties of Cognitive Services account. +class CheckSkuAvailabilityParameter(Model): + """Check SKU availability parameter. - 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. - :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 - :ivar endpoint: Endpoint of the created account. - :vartype endpoint: str - :ivar internal_id: The internal identifier. - :vartype internal_id: str - :ivar capabilities: Gets the capabilities of the cognitive services - account. Each item indicates the capability of a specific feature. The - values are read-only and for reference only. - :vartype capabilities: - list[~azure.mgmt.cognitiveservices.models.SkuCapability] - :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 encryption: The encryption properties for this resource. - :type encryption: ~azure.mgmt.cognitiveservices.models.Encryption - :param user_owned_storage: The storage accounts for this resource. - :type user_owned_storage: - list[~azure.mgmt.cognitiveservices.models.UserOwnedStorage] - :param private_endpoint_connections: The private endpoint connection - associated with the Cognitive Services account. - :type private_endpoint_connections: - list[~azure.mgmt.cognitiveservices.models.PrivateEndpointConnection] - :param public_network_access: Whether or not public endpoint access is - allowed for this account. Value is optional but if passed in, must be - 'Enabled' or 'Disabled'. Possible values include: 'Enabled', 'Disabled' - :type public_network_access: str or - ~azure.mgmt.cognitiveservices.models.PublicNetworkAccess - :param api_properties: The api properties for special APIs. - :type api_properties: - ~azure.mgmt.cognitiveservices.models.CognitiveServicesAccountApiProperties + :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 = { - 'provisioning_state': {'readonly': True}, - 'endpoint': {'readonly': True}, - 'internal_id': {'readonly': True}, - 'capabilities': {'readonly': True}, + 'skus': {'required': True}, + 'kind': {'required': True}, + 'type': {'required': True}, } _attribute_map = { - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'internal_id': {'key': 'internalId', 'type': 'str'}, - 'capabilities': {'key': 'capabilities', 'type': '[SkuCapability]'}, - 'custom_sub_domain_name': {'key': 'customSubDomainName', 'type': 'str'}, - 'network_acls': {'key': 'networkAcls', 'type': 'NetworkRuleSet'}, - 'encryption': {'key': 'encryption', 'type': 'Encryption'}, - 'user_owned_storage': {'key': 'userOwnedStorage', 'type': '[UserOwnedStorage]'}, - 'private_endpoint_connections': {'key': 'privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'api_properties': {'key': 'apiProperties', 'type': 'CognitiveServicesAccountApiProperties'}, + 'skus': {'key': 'skus', 'type': '[str]'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, *, custom_sub_domain_name: str=None, network_acls=None, encryption=None, user_owned_storage=None, private_endpoint_connections=None, public_network_access=None, api_properties=None, **kwargs) -> None: - super(CognitiveServicesAccountProperties, self).__init__(**kwargs) - self.provisioning_state = None - self.endpoint = None - self.internal_id = None - self.capabilities = None - self.custom_sub_domain_name = custom_sub_domain_name - self.network_acls = network_acls - self.encryption = encryption - self.user_owned_storage = user_owned_storage - self.private_endpoint_connections = private_endpoint_connections - self.public_network_access = public_network_access - self.api_properties = api_properties + 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 CognitiveServicesResourceAndSku(Model): - """Cognitive Services resource type and SKU. +class CloudError(Model): + """CloudError. + """ - :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 = { + } + + +class DomainAvailability(Model): + """Domain availability. + + :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 = { - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + '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, *, resource_type: str=None, sku=None, **kwargs) -> None: - super(CognitiveServicesResourceAndSku, self).__init__(**kwargs) - self.resource_type = resource_type - self.sku = sku + def __init__(self, *, is_subdomain_available: bool=None, reason: str=None, subdomain_name: str=None, type: str=None, **kwargs) -> None: + super(DomainAvailability, self).__init__(**kwargs) + self.is_subdomain_available = is_subdomain_available + self.reason = reason + self.subdomain_name = subdomain_name + self.type = type class Encryption(Model): @@ -532,73 +567,123 @@ def __init__(self, *, key_vault_properties=None, key_source="Microsoft.KeyVault" self.key_source = key_source -class Error(Model): - """Cognitive Services error object. +class ErrorAdditionalInfo(Model): + """The resource management error additional info. - :param error: The error body. - :type error: ~azure.mgmt.cognitiveservices.models.ErrorBody + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object """ + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorBody'}, + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, } - def __init__(self, *, error=None, **kwargs) -> None: - super(Error, self).__init__(**kwargs) - self.error = error + def __init__(self, **kwargs) -> None: + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None -class ErrorException(HttpOperationError): - """Server responsed with exception of type: 'Error'. +class ErrorDetail(Model): + """The error detail. - :param deserialize: A deserializer - :param response: Server response to be deserialized. + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.cognitiveservices.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.cognitiveservices.models.ErrorAdditionalInfo] """ - def __init__(self, deserialize, response, *args): + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } - super(ErrorException, self).__init__(deserialize, response, 'Error', *args) + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + def __init__(self, **kwargs) -> None: + super(ErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None -class ErrorBody(Model): - """Cognitive Services error body. - All required parameters must be populated in order to send to Azure. +class ErrorResponse(Model): + """Error response. - :param code: Required. error code - :type code: str - :param message: Required. error message - :type message: str - """ + Common error response for all Azure Resource Manager APIs to return error + details for failed operations. (This also follows the OData error response + format.). - _validation = { - 'code': {'required': True}, - 'message': {'required': True}, - } + :param error: The error object. + :type error: ~azure.mgmt.cognitiveservices.models.ErrorDetail + """ _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ErrorDetail'}, } - def __init__(self, *, code: str, message: str, **kwargs) -> None: - super(ErrorBody, self).__init__(**kwargs) - self.code = code - self.message = message + def __init__(self, *, error=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) class Identity(Model): - """Managed service identity. + """Identity for the resource. Variables are only populated by the server, and will be ignored when sending a request. - :param type: Type of managed service identity. Possible values include: - 'None', 'SystemAssigned', 'UserAssigned' - :type type: str or ~azure.mgmt.cognitiveservices.models.IdentityType - :ivar tenant_id: Tenant of managed service identity. + :param type: The identity type. Possible values include: 'None', + 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned' + :type type: str or + ~azure.mgmt.cognitiveservices.models.ResourceIdentityType + :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str - :ivar principal_id: Principal Id of managed service identity. + :ivar principal_id: The principal ID of resource identity. :vartype principal_id: str :param user_assigned_identities: The list of user assigned identities associated with the resource. The user identity dictionary key references @@ -614,7 +699,7 @@ class Identity(Model): } _attribute_map = { - 'type': {'key': 'type', 'type': 'IdentityType'}, + 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, 'principal_id': {'key': 'principalId', 'type': 'str'}, 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, @@ -661,47 +746,43 @@ class KeyVaultProperties(Model): :type key_version: str :param key_vault_uri: Uri of KeyVault :type key_vault_uri: str + :param identity_client_id: + :type identity_client_id: str """ _attribute_map = { 'key_name': {'key': 'keyName', 'type': 'str'}, 'key_version': {'key': 'keyVersion', 'type': 'str'}, 'key_vault_uri': {'key': 'keyVaultUri', 'type': 'str'}, + 'identity_client_id': {'key': 'identityClientId', 'type': 'str'}, } - def __init__(self, *, key_name: str=None, key_version: str=None, key_vault_uri: str=None, **kwargs) -> None: + def __init__(self, *, key_name: str=None, key_version: str=None, key_vault_uri: str=None, identity_client_id: str=None, **kwargs) -> None: super(KeyVaultProperties, self).__init__(**kwargs) self.key_name = key_name self.key_version = key_version self.key_vault_uri = key_vault_uri + self.identity_client_id = identity_client_id 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 + :param value: The name of the metric. + :type value: str + :param localized_value: The friendly name of the metric. + :type 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: + def __init__(self, *, value: str=None, localized_value: str=None, **kwargs) -> None: super(MetricName, self).__init__(**kwargs) - self.value = None - self.localized_value = None + self.value = value + self.localized_value = localized_value class NetworkRuleSet(Model): @@ -732,61 +813,102 @@ def __init__(self, *, default_action=None, ip_rules=None, virtual_network_rules= self.virtual_network_rules = virtual_network_rules -class OperationDisplayInfo(Model): - """The operation supported by Cognitive Services. +class Operation(Model): + """REST API Operation. - :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 + Details of a REST API operation, returned from the Resource Provider + Operations API. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the operation, as per Resource-Based Access + Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", + "Microsoft.Compute/virtualMachines/capture/action" + :vartype name: str + :ivar is_data_action: Whether the operation applies to data-plane. This is + "true" for data-plane operations and "false" for ARM/control-plane + operations. + :vartype is_data_action: bool + :param display: Localized display information for this particular + operation. + :type display: ~azure.mgmt.cognitiveservices.models.OperationDisplay + :ivar origin: The intended executor of the operation; as in Resource Based + Access Control (RBAC) and audit logs UX. Default value is "user,system". + Possible values include: 'user', 'system', 'user,system' + :vartype origin: str or ~azure.mgmt.cognitiveservices.models.Origin + :ivar action_type: Enum. Indicates the action type. "Internal" refers to + actions that are for internal only APIs. Possible values include: + 'Internal' + :vartype action_type: str or + ~azure.mgmt.cognitiveservices.models.ActionType """ + _validation = { + 'name': {'readonly': True}, + 'is_data_action': {'readonly': True}, + 'origin': {'readonly': True}, + 'action_type': {'readonly': True}, + } + _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'action_type': {'key': 'actionType', '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 + def __init__(self, *, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = None + self.is_data_action = None + self.display = display + self.origin = None + self.action_type = None -class OperationEntity(Model): - """The operation supported by Cognitive Services. +class OperationDisplay(Model): + """Localized display information for this particular operation. - :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 + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: The localized friendly form of the resource provider name, + e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + :vartype provider: str + :ivar resource: The localized friendly name of the resource type related + to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + :vartype resource: str + :ivar operation: The concise, localized friendly name for the operation; + suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart + Virtual Machine". + :vartype operation: str + :ivar description: The short, localized friendly description of the + operation; suitable for tool tips and detailed views. + :vartype description: str """ + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + 'description': {'readonly': True}, + } + _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplayInfo'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'object'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, } - 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 + def __init__(self, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = None class PrivateEndpoint(Model): @@ -812,41 +934,54 @@ def __init__(self, **kwargs) -> None: self.id = None -class PrivateEndpointConnection(Resource): +class PrivateEndpointConnection(AzureEntityResource): """The Private Endpoint Connection resource. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str :param properties: Resource properties. :type properties: ~azure.mgmt.cognitiveservices.models.PrivateEndpointConnectionProperties + :ivar system_data: + :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData + :param location: The location of the private endpoint connection + :type location: str """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'system_data': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'PrivateEndpointConnectionProperties'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'location': {'key': 'location', 'type': 'str'}, } - def __init__(self, *, properties=None, **kwargs) -> None: + def __init__(self, *, properties=None, location: str=None, **kwargs) -> None: super(PrivateEndpointConnection, self).__init__(**kwargs) self.properties = properties + self.system_data = None + self.location = location class PrivateEndpointConnectionListResult(Model): @@ -879,6 +1014,11 @@ class PrivateEndpointConnectionProperties(Model): provider. :type private_link_service_connection_state: ~azure.mgmt.cognitiveservices.models.PrivateLinkServiceConnectionState + :param provisioning_state: The provisioning state of the private endpoint + connection resource. Possible values include: 'Succeeded', 'Creating', + 'Deleting', 'Failed' + :type provisioning_state: str or + ~azure.mgmt.cognitiveservices.models.PrivateEndpointConnectionProvisioningState :param group_ids: The private link resource group ids. :type group_ids: list[str] """ @@ -890,13 +1030,15 @@ class PrivateEndpointConnectionProperties(Model): _attribute_map = { 'private_endpoint': {'key': 'privateEndpoint', 'type': 'PrivateEndpoint'}, 'private_link_service_connection_state': {'key': 'privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, 'group_ids': {'key': 'groupIds', 'type': '[str]'}, } - def __init__(self, *, private_link_service_connection_state, private_endpoint=None, group_ids=None, **kwargs) -> None: + def __init__(self, *, private_link_service_connection_state, private_endpoint=None, provisioning_state=None, group_ids=None, **kwargs) -> None: super(PrivateEndpointConnectionProperties, self).__init__(**kwargs) self.private_endpoint = private_endpoint self.private_link_service_connection_state = private_link_service_connection_state + self.provisioning_state = provisioning_state self.group_ids = group_ids @@ -906,13 +1048,13 @@ class PrivateLinkResource(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :param properties: Resource properties. :type properties: @@ -962,34 +1104,34 @@ class PrivateLinkResourceProperties(Model): :ivar group_id: The private link resource group id. :vartype group_id: str - :ivar display_name: The private link resource display name. - :vartype display_name: str :ivar required_members: The private link resource required member names. :vartype required_members: list[str] :param required_zone_names: The private link resource Private link DNS zone name. :type required_zone_names: list[str] + :ivar display_name: The private link resource display name. + :vartype display_name: str """ _validation = { 'group_id': {'readonly': True}, - 'display_name': {'readonly': True}, 'required_members': {'readonly': True}, + 'display_name': {'readonly': True}, } _attribute_map = { 'group_id': {'key': 'groupId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, 'required_zone_names': {'key': 'requiredZoneNames', 'type': '[str]'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, } def __init__(self, *, required_zone_names=None, **kwargs) -> None: super(PrivateLinkResourceProperties, self).__init__(**kwargs) self.group_id = None - self.display_name = None self.required_members = None self.required_zone_names = required_zone_names + self.display_name = None class PrivateLinkServiceConnectionState(Model): @@ -998,43 +1140,45 @@ class PrivateLinkServiceConnectionState(Model): :param status: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values - include: 'Pending', 'Approved', 'Rejected', 'Disconnected' + include: 'Pending', 'Approved', 'Rejected' :type status: str or ~azure.mgmt.cognitiveservices.models.PrivateEndpointServiceConnectionStatus :param description: The reason for approval/rejection of the connection. :type description: str - :param action_required: A message indicating if changes on the service + :param actions_required: A message indicating if changes on the service provider require any updates on the consumer. - :type action_required: str + :type actions_required: str """ _attribute_map = { 'status': {'key': 'status', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, - 'action_required': {'key': 'actionRequired', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, } - def __init__(self, *, status=None, description: str=None, action_required: str=None, **kwargs) -> None: + def __init__(self, *, status=None, description: str=None, actions_required: str=None, **kwargs) -> None: super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) self.status = status self.description = description - self.action_required = action_required + self.actions_required = actions_required class ProxyResource(Resource): - """The resource model definition for a ARM proxy resource. It will have - everything other than required location and tags. + """Proxy Resource. + + The resource model definition for a Azure Resource Manager proxy resource. + It will not have tags and a location. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str """ @@ -1054,6 +1198,30 @@ def __init__(self, **kwargs) -> None: super(ProxyResource, self).__init__(**kwargs) +class QuotaLimit(Model): + """QuotaLimit. + + :param count: + :type count: float + :param renewal_period: + :type renewal_period: float + :param rules: + :type rules: list[~azure.mgmt.cognitiveservices.models.ThrottlingRule] + """ + + _attribute_map = { + 'count': {'key': 'count', 'type': 'float'}, + 'renewal_period': {'key': 'renewalPeriod', 'type': 'float'}, + 'rules': {'key': 'rules', 'type': '[ThrottlingRule]'}, + } + + def __init__(self, *, count: float=None, renewal_period: float=None, rules=None, **kwargs) -> None: + super(QuotaLimit, self).__init__(**kwargs) + self.count = count + self.renewal_period = renewal_period + self.rules = rules + + class RegenerateKeyParameters(Model): """Regenerate key parameters. @@ -1077,37 +1245,45 @@ def __init__(self, *, key_name, **kwargs) -> None: self.key_name = key_name +class RequestMatchPattern(Model): + """RequestMatchPattern. + + :param path: + :type path: str + :param method: + :type method: str + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'method': {'key': 'method', 'type': 'str'}, + } + + def __init__(self, *, path: str=None, method: str=None, **kwargs) -> None: + super(RequestMatchPattern, self).__init__(**kwargs) + self.path = path + self.method = method + + 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. + :param resource_type: The type of resource the SKU applies to. + :type resource_type: str + :param name: The name of SKU. + :type name: str + :param tier: Specifies the tier of Cognitive Services account. + :type tier: str + :param kind: The Kind of resources that are supported in this SKU. + :type kind: str + :param locations: The set of locations that the SKU is available. + :type locations: list[str] + :param restrictions: The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. - :vartype restrictions: + :type 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'}, @@ -1117,74 +1293,57 @@ class ResourceSku(Model): 'restrictions': {'key': 'restrictions', 'type': '[ResourceSkuRestrictions]'}, } - def __init__(self, **kwargs) -> None: + def __init__(self, *, resource_type: str=None, name: str=None, tier: str=None, kind: str=None, locations=None, restrictions=None, **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 + self.resource_type = resource_type + self.name = name + self.tier = tier + self.kind = kind + self.locations = locations + self.restrictions = restrictions 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] + :param locations: Locations where the SKU is restricted + :type locations: list[str] + :param zones: List of availability zones where the SKU is restricted. + :type 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: + def __init__(self, *, locations=None, zones=None, **kwargs) -> None: super(ResourceSkuRestrictionInfo, self).__init__(**kwargs) - self.locations = None - self.zones = None + self.locations = locations + self.zones = zones 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 + :param type: The type of restrictions. Possible values include: + 'Location', 'Zone' + :type 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 + :param values: The value of restrictions. If the restriction type is set + to location. This would be different locations where the SKU is + restricted. + :type values: list[str] + :param restriction_info: The information about the restriction where the SKU cannot be used. - :vartype restriction_info: + :type restriction_info: ~azure.mgmt.cognitiveservices.models.ResourceSkuRestrictionInfo - :ivar reason_code: The reason for restriction. Possible values include: + :param reason_code: The reason for restriction. Possible values include: 'QuotaId', 'NotAvailableForSubscription' - :vartype reason_code: str or + :type 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]'}, @@ -1192,44 +1351,110 @@ class ResourceSkuRestrictions(Model): 'reason_code': {'key': 'reasonCode', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__(self, *, type=None, values=None, restriction_info=None, reason_code=None, **kwargs) -> None: super(ResourceSkuRestrictions, self).__init__(**kwargs) - self.type = None - self.values = None - self.restriction_info = None - self.reason_code = None + self.type = type + self.values = values + self.restriction_info = restriction_info + self.reason_code = reason_code 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. + """The resource model definition representing SKU. 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. + :param name: Required. The name of the SKU. Ex - P3. It is typically a + letter+number code :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 + :param tier: This field is required to be implemented by the Resource + Provider if the service has more than one tier, but is not required on a + PUT. Possible values include: 'Free', 'Basic', 'Standard', 'Premium', + 'Enterprise' + :type tier: str or ~azure.mgmt.cognitiveservices.models.SkuTier + :param size: The SKU size. When the name field is the combination of tier + and some other value, this would be the standalone code. + :type size: str + :param family: If the service has different generations of hardware, for + the same SKU, then that can be captured here. + :type family: str + :param capacity: If the SKU supports scale out/in then the capacity + integer should be included. If scale out/in is not possible for the + resource this may be omitted. + :type capacity: int """ _validation = { 'name': {'required': True}, - 'tier': {'readonly': True}, } _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'SkuTier'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, } - def __init__(self, *, name: str, **kwargs) -> None: + def __init__(self, *, name: str, tier=None, size: str=None, family: str=None, capacity: int=None, **kwargs) -> None: super(Sku, self).__init__(**kwargs) self.name = name - self.tier = None + self.tier = tier + self.size = size + self.family = family + self.capacity = capacity + + +class SkuAvailability(Model): + """SKU availability. + + :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(SkuAvailability, 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 SkuAvailabilityListResult(Model): + """Check SKU availability result list. + + :param value: Check SKU availability result list. + :type value: list[~azure.mgmt.cognitiveservices.models.SkuAvailability] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SkuAvailability]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(SkuAvailabilityListResult, self).__init__(**kwargs) + self.value = value class SkuCapability(Model): @@ -1252,21 +1477,127 @@ def __init__(self, *, name: str=None, value: str=None, **kwargs) -> None: self.value = value +class SkuChangeInfo(Model): + """Sku change info of account. + + :param count_of_downgrades: Gets the count of downgrades. + :type count_of_downgrades: float + :param count_of_upgrades_after_downgrades: Gets the count of upgrades + after downgrades. + :type count_of_upgrades_after_downgrades: float + :param last_change_date: Gets the last change date. + :type last_change_date: str + """ + + _attribute_map = { + 'count_of_downgrades': {'key': 'countOfDowngrades', 'type': 'float'}, + 'count_of_upgrades_after_downgrades': {'key': 'countOfUpgradesAfterDowngrades', 'type': 'float'}, + 'last_change_date': {'key': 'lastChangeDate', 'type': 'str'}, + } + + def __init__(self, *, count_of_downgrades: float=None, count_of_upgrades_after_downgrades: float=None, last_change_date: str=None, **kwargs) -> None: + super(SkuChangeInfo, self).__init__(**kwargs) + self.count_of_downgrades = count_of_downgrades + self.count_of_upgrades_after_downgrades = count_of_upgrades_after_downgrades + self.last_change_date = last_change_date + + +class SystemData(Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. + Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + :type created_by_type: str or + ~azure.mgmt.cognitiveservices.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the + resource. Possible values include: 'User', 'Application', + 'ManagedIdentity', 'Key' + :type last_modified_by_type: str or + ~azure.mgmt.cognitiveservices.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC) + :type last_modified_at: datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__(self, *, created_by: str=None, created_by_type=None, created_at=None, last_modified_by: str=None, last_modified_by_type=None, last_modified_at=None, **kwargs) -> None: + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class ThrottlingRule(Model): + """ThrottlingRule. + + :param key: + :type key: str + :param renewal_period: + :type renewal_period: float + :param count: + :type count: float + :param min_count: + :type min_count: float + :param dynamic_throttling_enabled: + :type dynamic_throttling_enabled: bool + :param match_patterns: + :type match_patterns: + list[~azure.mgmt.cognitiveservices.models.RequestMatchPattern] + """ + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'renewal_period': {'key': 'renewalPeriod', 'type': 'float'}, + 'count': {'key': 'count', 'type': 'float'}, + 'min_count': {'key': 'minCount', 'type': 'float'}, + 'dynamic_throttling_enabled': {'key': 'dynamicThrottlingEnabled', 'type': 'bool'}, + 'match_patterns': {'key': 'matchPatterns', 'type': '[RequestMatchPattern]'}, + } + + def __init__(self, *, key: str=None, renewal_period: float=None, count: float=None, min_count: float=None, dynamic_throttling_enabled: bool=None, match_patterns=None, **kwargs) -> None: + super(ThrottlingRule, self).__init__(**kwargs) + self.key = key + self.renewal_period = renewal_period + self.count = count + self.min_count = min_count + self.dynamic_throttling_enabled = dynamic_throttling_enabled + self.match_patterns = match_patterns + + class TrackedResource(Resource): - """The resource model definition for a ARM tracked top level resource. + """Tracked Resource. + + The resource model definition for an Azure Resource Manager tracked top + level resource which has 'tags' and a 'location'. 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. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :param tags: Resource tags. :type tags: dict[str, str] @@ -1298,36 +1629,25 @@ def __init__(self, *, location: str, tags=None, **kwargs) -> 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 name: The name information for the metric. + :type name: ~azure.mgmt.cognitiveservices.models.MetricName + :param quota_period: The quota period used to summarize the usage values. + :type quota_period: str + :param limit: Maximum value for this metric. + :type limit: float + :param current_value: Current value for this metric. + :type current_value: float + :param next_reset_time: Next reset time for current quota. + :type 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'}, @@ -1338,59 +1658,60 @@ class Usage(Model): 'status': {'key': 'status', 'type': 'str'}, } - def __init__(self, *, unit=None, status=None, **kwargs) -> None: + def __init__(self, *, unit=None, name=None, quota_period: str=None, limit: float=None, current_value: float=None, next_reset_time: str=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.name = name + self.quota_period = quota_period + self.limit = limit + self.current_value = current_value + self.next_reset_time = next_reset_time self.status = status -class UsagesResult(Model): +class UsageListResult(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] + :param value: The list of usages for Cognitive Service account. + :type 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 + def __init__(self, *, value=None, **kwargs) -> None: + super(UsageListResult, self).__init__(**kwargs) + self.value = value class UserAssignedIdentity(Model): """User-assigned managed identity. - :param principal_id: Azure Active Directory principal ID associated with + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: Azure Active Directory principal ID associated with this Identity. - :type principal_id: str - :param client_id: Client App Id associated with this identity. - :type client_id: str + :vartype principal_id: str + :ivar client_id: Client App Id associated with this identity. + :vartype client_id: str """ + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + _attribute_map = { 'principal_id': {'key': 'principalId', 'type': 'str'}, 'client_id': {'key': 'clientId', 'type': 'str'}, } - def __init__(self, *, principal_id: str=None, client_id: str=None, **kwargs) -> None: + def __init__(self, **kwargs) -> None: super(UserAssignedIdentity, self).__init__(**kwargs) - self.principal_id = principal_id - self.client_id = client_id + self.principal_id = None + self.client_id = None class UserOwnedStorage(Model): @@ -1398,15 +1719,19 @@ class UserOwnedStorage(Model): :param resource_id: Full resource id of a Microsoft.Storage resource. :type resource_id: str + :param identity_client_id: + :type identity_client_id: str """ _attribute_map = { 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'identity_client_id': {'key': 'identityClientId', 'type': 'str'}, } - def __init__(self, *, resource_id: str=None, **kwargs) -> None: + def __init__(self, *, resource_id: str=None, identity_client_id: str=None, **kwargs) -> None: super(UserOwnedStorage, self).__init__(**kwargs) self.resource_id = resource_id + self.identity_client_id = identity_client_id class VirtualNetworkRule(Model): diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/_paged_models.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/_paged_models.py index 312ad7c70438..81de6fae3f8a 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/_paged_models.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/_paged_models.py @@ -12,19 +12,19 @@ from msrest.paging import Paged -class CognitiveServicesAccountPaged(Paged): +class AccountPaged(Paged): """ - A paging container for iterating over a list of :class:`CognitiveServicesAccount ` object + A paging container for iterating over a list of :class:`Account ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[CognitiveServicesAccount]'} + 'current_page': {'key': 'value', 'type': '[Account]'} } def __init__(self, *args, **kwargs): - super(CognitiveServicesAccountPaged, self).__init__(*args, **kwargs) + super(AccountPaged, self).__init__(*args, **kwargs) class ResourceSkuPaged(Paged): """ A paging container for iterating over a list of :class:`ResourceSku ` object @@ -38,16 +38,16 @@ class ResourceSkuPaged(Paged): def __init__(self, *args, **kwargs): super(ResourceSkuPaged, self).__init__(*args, **kwargs) -class OperationEntityPaged(Paged): +class OperationPaged(Paged): """ - A paging container for iterating over a list of :class:`OperationEntity ` object + A paging container for iterating over a list of :class:`Operation ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[OperationEntity]'} + 'current_page': {'key': 'value', 'type': '[Operation]'} } def __init__(self, *args, **kwargs): - super(OperationEntityPaged, self).__init__(*args, **kwargs) + super(OperationPaged, self).__init__(*args, **kwargs) 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 c5b73fb2d0fc..979807552b6f 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 @@ -10,6 +10,7 @@ # -------------------------------------------------------------------------- from ._accounts_operations import AccountsOperations +from ._deleted_accounts_operations import DeletedAccountsOperations from ._resource_skus_operations import ResourceSkusOperations from ._operations import Operations from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations @@ -18,6 +19,7 @@ __all__ = [ 'AccountsOperations', + 'DeletedAccountsOperations', 'ResourceSkusOperations', 'Operations', 'PrivateEndpointConnectionsOperations', 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 index e7923920621b..526b5e33ca9a 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 @@ -11,6 +11,8 @@ import uuid from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +26,7 @@ class AccountsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2017-04-18". + :ivar api_version: The API version to use for this operation. Constant value: "2021-04-30". """ models = models @@ -34,35 +36,13 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-04-18" + self.api_version = "2021-04-30" self.config = config - def create( - self, resource_group_name, account_name, account, custom_headers=None, raw=False, **operation_config): - """Create Cognitive Services Account. Accounts is a resource group wide - resource type. It holds the keys for developer to access intelligent - APIs. It's also the resource type for billing. - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. - :type account_name: str - :param account: The parameters to provide for the created account. - :type account: - ~azure.mgmt.cognitiveservices.models.CognitiveServicesAccount - :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: CognitiveServicesAccount or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.cognitiveservices.models.CognitiveServicesAccount - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorException` - """ + def _create_initial( + self, resource_group_name, account_name, account, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.create.metadata['url'] path_format_arguments = { @@ -88,33 +68,35 @@ def create( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(account, 'CognitiveServicesAccount') + body_content = self._serialize.body(account, 'Account') # Construct and send request request = self._client.put(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201, 202]: - raise models.ErrorException(self._deserialize, response) + raise models.ErrorResponseException(self._deserialize, response) deserialized = None + if response.status_code == 200: - deserialized = self._deserialize('CognitiveServicesAccount', response) + deserialized = self._deserialize('Account', response) if response.status_code == 201: - deserialized = self._deserialize('CognitiveServicesAccount', response) + deserialized = self._deserialize('Account', response) if response.status_code == 202: - deserialized = self._deserialize('CognitiveServicesAccount', response) + deserialized = self._deserialize('Account', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}'} - def update( - self, resource_group_name, account_name, account, custom_headers=None, raw=False, **operation_config): - """Updates a Cognitive Services account. + def create( + self, resource_group_name, account_name, account, custom_headers=None, raw=False, polling=True, **operation_config): + """Create Cognitive Services Account. Accounts is a resource group wide + resource type. It holds the keys for developer to access intelligent + APIs. It's also the resource type for billing. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -122,19 +104,51 @@ def update( :param account_name: The name of Cognitive Services account. :type account_name: str :param account: The parameters to provide for the created account. - :type account: - ~azure.mgmt.cognitiveservices.models.CognitiveServicesAccount + :type account: ~azure.mgmt.cognitiveservices.models.Account :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: CognitiveServicesAccount or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.cognitiveservices.models.CognitiveServicesAccount - or ~msrest.pipeline.ClientRawResponse + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Account or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cognitiveservices.models.Account] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cognitiveservices.models.Account]] :raises: - :class:`ErrorException` + :class:`ErrorResponseException` """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + account_name=account_name, + account=account, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Account', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}'} + + + def _update_initial( + self, resource_group_name, account_name, account, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.update.metadata['url'] path_format_arguments = { @@ -160,47 +174,83 @@ def update( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(account, 'CognitiveServicesAccount') + body_content = self._serialize.body(account, 'Account') # Construct and send request request = self._client.patch(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: - raise models.ErrorException(self._deserialize, response) + raise models.ErrorResponseException(self._deserialize, response) deserialized = None + if response.status_code == 200: - deserialized = self._deserialize('CognitiveServicesAccount', response) + deserialized = self._deserialize('Account', response) if response.status_code == 202: - deserialized = self._deserialize('CognitiveServicesAccount', response) + deserialized = self._deserialize('Account', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}'} - def delete( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Deletes a Cognitive Services account from the resource group. . + def update( + self, resource_group_name, account_name, account, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a Cognitive Services account. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param account_name: The name of Cognitive Services account. :type account_name: str + :param account: The parameters to provide for the created account. + :type account: ~azure.mgmt.cognitiveservices.models.Account :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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Account or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cognitiveservices.models.Account] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cognitiveservices.models.Account]] :raises: - :class:`ErrorException` + :class:`ErrorResponseException` """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + account_name=account_name, + account=account, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Account', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}'} + + + def _delete_initial( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.delete.metadata['url'] path_format_arguments = { @@ -228,14 +278,56 @@ def delete( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202, 204]: - raise models.ErrorException(self._deserialize, response) + raise models.ErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + + def delete( + self, resource_group_name, account_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a Cognitive Services account from the resource group. . + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. + :type account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}'} - def get_properties( + def get( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): """Returns a Cognitive Services account specified by the parameters. @@ -249,14 +341,14 @@ def get_properties( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: CognitiveServicesAccount or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.cognitiveservices.models.CognitiveServicesAccount - or ~msrest.pipeline.ClientRawResponse + :return: Account or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.cognitiveservices.models.Account or + ~msrest.pipeline.ClientRawResponse :raises: - :class:`ErrorException` + :class:`ErrorResponseException` """ # Construct URL - url = self.get_properties.metadata['url'] + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), @@ -283,18 +375,18 @@ def get_properties( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('CognitiveServicesAccount', response) + deserialized = self._deserialize('Account', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -309,11 +401,11 @@ def list_by_resource_group( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of CognitiveServicesAccount + :return: An iterator like instance of Account :rtype: - ~azure.mgmt.cognitiveservices.models.CognitiveServicesAccountPaged[~azure.mgmt.cognitiveservices.models.CognitiveServicesAccount] + ~azure.mgmt.cognitiveservices.models.AccountPaged[~azure.mgmt.cognitiveservices.models.Account] :raises: - :class:`ErrorException` + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -353,7 +445,7 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) + raise models.ErrorResponseException(self._deserialize, response) return response @@ -361,7 +453,7 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.CognitiveServicesAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.AccountPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts'} @@ -376,11 +468,11 @@ def list( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of CognitiveServicesAccount + :return: An iterator like instance of Account :rtype: - ~azure.mgmt.cognitiveservices.models.CognitiveServicesAccountPaged[~azure.mgmt.cognitiveservices.models.CognitiveServicesAccount] + ~azure.mgmt.cognitiveservices.models.AccountPaged[~azure.mgmt.cognitiveservices.models.Account] :raises: - :class:`ErrorException` + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -419,7 +511,7 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) + raise models.ErrorResponseException(self._deserialize, response) return response @@ -427,7 +519,7 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.CognitiveServicesAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.AccountPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/accounts'} @@ -446,12 +538,11 @@ def list_keys( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: CognitiveServicesAccountKeys or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.cognitiveservices.models.CognitiveServicesAccountKeys or + :return: ApiKeys or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.cognitiveservices.models.ApiKeys or ~msrest.pipeline.ClientRawResponse :raises: - :class:`ErrorException` + :class:`ErrorResponseException` """ # Construct URL url = self.list_keys.metadata['url'] @@ -481,11 +572,11 @@ def list_keys( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('CognitiveServicesAccountKeys', response) + deserialized = self._deserialize('ApiKeys', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -512,12 +603,11 @@ def regenerate_key( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: CognitiveServicesAccountKeys or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.cognitiveservices.models.CognitiveServicesAccountKeys or + :return: ApiKeys or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.cognitiveservices.models.ApiKeys or ~msrest.pipeline.ClientRawResponse :raises: - :class:`ErrorException` + :class:`ErrorResponseException` """ parameters = models.RegenerateKeyParameters(key_name=key_name) @@ -553,11 +643,11 @@ def regenerate_key( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('CognitiveServicesAccountKeys', response) + deserialized = self._deserialize('ApiKeys', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -580,13 +670,11 @@ def list_skus( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: CognitiveServicesAccountEnumerateSkusResult or - ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.cognitiveservices.models.CognitiveServicesAccountEnumerateSkusResult - or ~msrest.pipeline.ClientRawResponse + :return: AccountSkuListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.cognitiveservices.models.AccountSkuListResult or + ~msrest.pipeline.ClientRawResponse :raises: - :class:`ErrorException` + :class:`ErrorResponseException` """ # Construct URL url = self.list_skus.metadata['url'] @@ -616,11 +704,11 @@ def list_skus( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('CognitiveServicesAccountEnumerateSkusResult', response) + deserialized = self._deserialize('AccountSkuListResult', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -629,7 +717,7 @@ def list_skus( return deserialized list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/skus'} - def get_usages( + def list_usages( self, resource_group_name, account_name, filter=None, custom_headers=None, raw=False, **operation_config): """Get usages for the requested Cognitive Services account. @@ -647,14 +735,14 @@ def get_usages( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: UsagesResult or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.cognitiveservices.models.UsagesResult or + :return: UsageListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.cognitiveservices.models.UsageListResult or ~msrest.pipeline.ClientRawResponse :raises: - :class:`ErrorException` + :class:`ErrorResponseException` """ # Construct URL - url = self.get_usages.metadata['url'] + url = self.list_usages.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), @@ -683,15 +771,15 @@ def get_usages( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('UsagesResult', response) + deserialized = self._deserialize('UsageListResult', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/usages'} + list_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/usages'} 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 index a27dde40b0ef..6185ee591923 100644 --- 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 @@ -10,7 +10,8 @@ # -------------------------------------------------------------------------- from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models import uuid @@ -34,12 +35,11 @@ def check_sku_availability( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: CheckSkuAvailabilityResultList or ClientRawResponse if - raw=true - :rtype: - ~azure.mgmt.cognitiveservices.models.CheckSkuAvailabilityResultList or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :return: SkuAvailabilityListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.cognitiveservices.models.SkuAvailabilityListResult + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` """ parameters = models.CheckSkuAvailabilityParameter(skus=skus, kind=kind, type=type) @@ -74,13 +74,11 @@ def check_sku_availability( 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 + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('CheckSkuAvailabilityResultList', response) + deserialized = self._deserialize('SkuAvailabilityListResult', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -102,12 +100,11 @@ def check_domain_availability( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: CheckDomainAvailabilityResult or ClientRawResponse if - raw=true - :rtype: - ~azure.mgmt.cognitiveservices.models.CheckDomainAvailabilityResult or + :return: DomainAvailability or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.cognitiveservices.models.DomainAvailability or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ parameters = models.CheckDomainAvailabilityParameter(subdomain_name=subdomain_name, type=type) @@ -141,13 +138,11 @@ def check_domain_availability( 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 + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('CheckDomainAvailabilityResult', response) + deserialized = self._deserialize('DomainAvailability', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/_deleted_accounts_operations.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/_deleted_accounts_operations.py new file mode 100644 index 000000000000..964a205be1cf --- /dev/null +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/_deleted_accounts_operations.py @@ -0,0 +1,254 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class DeletedAccountsOperations(object): + """DeletedAccountsOperations 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. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2021-04-30". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-04-30" + + self.config = config + + def get( + self, location, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Returns a Cognitive Services account specified by the parameters. + + :param location: Resource location. + :type location: str + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. + :type account_name: 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: Account or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.cognitiveservices.models.Account or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Account', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/resourceGroups/{resourceGroupName}/deletedAccounts/{accountName}'} + + + def _purge_initial( + self, location, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.purge.metadata['url'] + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def purge( + self, location, resource_group_name, account_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a Cognitive Services account from the resource group. . + + :param location: Resource location. + :type location: str + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. + :type account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._purge_initial( + location=location, + resource_group_name=resource_group_name, + account_name=account_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + purge.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/resourceGroups/{resourceGroupName}/deletedAccounts/{accountName}'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Returns all the resources of a particular type belonging to a + subscription. + + :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: An iterator like instance of Account + :rtype: + ~azure.mgmt.cognitiveservices.models.AccountPaged[~azure.mgmt.cognitiveservices.models.Account] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + 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]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.AccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/deletedAccounts'} 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 index 9a80a1c0ce81..d49a2a773857 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 @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -25,7 +24,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2017-04-18". + :ivar api_version: The API version to use for this operation. Constant value: "2021-04-30". """ models = models @@ -35,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-04-18" + self.api_version = "2021-04-30" self.config = config @@ -48,10 +47,11 @@ def list( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of OperationEntity + :return: An iterator like instance of Operation :rtype: - ~azure.mgmt.cognitiveservices.models.OperationEntityPaged[~azure.mgmt.cognitiveservices.models.OperationEntity] - :raises: :class:`CloudError` + ~azure.mgmt.cognitiveservices.models.OperationPaged[~azure.mgmt.cognitiveservices.models.Operation] + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -86,9 +86,7 @@ def internal_paging(next_link=None): 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 + raise models.ErrorResponseException(self._deserialize, response) return response @@ -96,7 +94,7 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.OperationEntityPaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.OperationPaged(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/_private_endpoint_connections_operations.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/_private_endpoint_connections_operations.py index ad6609e69cb2..65b1a8b222a3 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/_private_endpoint_connections_operations.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/_private_endpoint_connections_operations.py @@ -11,7 +11,8 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -25,7 +26,7 @@ class PrivateEndpointConnectionsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2017-04-18". + :ivar api_version: The API version to use for this operation. Constant value: "2021-04-30". """ models = models @@ -35,7 +36,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-04-18" + self.api_version = "2021-04-30" self.config = config @@ -60,7 +61,7 @@ def list( ~azure.mgmt.cognitiveservices.models.PrivateEndpointConnectionListResult or ~msrest.pipeline.ClientRawResponse :raises: - :class:`ErrorException` + :class:`ErrorResponseException` """ # Construct URL url = self.list.metadata['url'] @@ -90,7 +91,7 @@ def list( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -124,7 +125,8 @@ def get( :return: PrivateEndpointConnection or ClientRawResponse if raw=true :rtype: ~azure.mgmt.cognitiveservices.models.PrivateEndpointConnection or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.get.metadata['url'] @@ -155,9 +157,7 @@ def get( 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 + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -170,33 +170,10 @@ def get( return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} - def create_or_update( - self, resource_group_name, account_name, private_endpoint_connection_name, properties=None, custom_headers=None, raw=False, **operation_config): - """Update the state of specified private endpoint connection associated - with the Cognitive Services account. - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. - :type account_name: str - :param private_endpoint_connection_name: The name of the private - endpoint connection associated with the Cognitive Services Account - :type private_endpoint_connection_name: str - :param properties: Resource properties. - :type properties: - ~azure.mgmt.cognitiveservices.models.PrivateEndpointConnectionProperties - :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: PrivateEndpointConnection or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.cognitiveservices.models.PrivateEndpointConnection - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - properties1 = models.PrivateEndpointConnection(properties=properties) + def _create_or_update_initial( + self, resource_group_name, account_name, private_endpoint_connection_name, properties=None, location=None, custom_headers=None, raw=False, **operation_config): + properties1 = models.PrivateEndpointConnection(properties=properties, location=location) # Construct URL url = self.create_or_update.metadata['url'] @@ -230,26 +207,26 @@ def create_or_update( request = self._client.put(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 + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) deserialized = None + if response.status_code == 200: deserialized = self._deserialize('PrivateEndpointConnection', response) + if response.status_code == 202: + deserialized = self._deserialize('PrivateEndpointConnection', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} - def delete( - self, resource_group_name, account_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): - """Deletes the specified private endpoint connection associated with the - Cognitive Services account. + def create_or_update( + self, resource_group_name, account_name, private_endpoint_connection_name, properties=None, location=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Update the state of specified private endpoint connection associated + with the Cognitive Services account. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -259,15 +236,58 @@ def delete( :param private_endpoint_connection_name: The name of the private endpoint connection associated with the Cognitive Services Account :type private_endpoint_connection_name: str + :param properties: Resource properties. + :type properties: + ~azure.mgmt.cognitiveservices.models.PrivateEndpointConnectionProperties + :param location: The location of the private endpoint connection + :type location: 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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + PrivateEndpointConnection or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cognitiveservices.models.PrivateEndpointConnection] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cognitiveservices.models.PrivateEndpointConnection]] + :raises: + :class:`ErrorResponseException` """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + account_name=account_name, + private_endpoint_connection_name=private_endpoint_connection_name, + properties=properties, + location=location, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('PrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} + + + def _delete_initial( + self, resource_group_name, account_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.delete.metadata['url'] path_format_arguments = { @@ -295,12 +315,57 @@ def delete( request = self._client.delete(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + if response.status_code not in [200, 202, 204]: + raise models.ErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + + def delete( + self, resource_group_name, account_name, private_endpoint_connection_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the specified private endpoint connection associated with the + Cognitive Services account. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. + :type account_name: str + :param private_endpoint_connection_name: The name of the private + endpoint connection associated with the Cognitive Services Account + :type private_endpoint_connection_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + private_endpoint_connection_name=private_endpoint_connection_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/_private_link_resources_operations.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/_private_link_resources_operations.py index 2830c1d84ffb..956a45a88a71 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/_private_link_resources_operations.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/_private_link_resources_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -25,7 +24,7 @@ class PrivateLinkResourcesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2017-04-18". + :ivar api_version: The API version to use for this operation. Constant value: "2021-04-30". """ models = models @@ -35,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-04-18" + self.api_version = "2021-04-30" self.config = config @@ -59,7 +58,8 @@ def list( :rtype: ~azure.mgmt.cognitiveservices.models.PrivateLinkResourceListResult or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.list.metadata['url'] @@ -89,9 +89,7 @@ def list( 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 + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: 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 index c90936a27a0f..bea342ca765e 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 @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -25,7 +24,7 @@ class ResourceSkusOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2017-04-18". + :ivar api_version: The API version to use for this operation. Constant value: "2021-04-30". """ models = models @@ -35,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-04-18" + self.api_version = "2021-04-30" self.config = config @@ -52,7 +51,8 @@ def list( :return: An iterator like instance of ResourceSku :rtype: ~azure.mgmt.cognitiveservices.models.ResourceSkuPaged[~azure.mgmt.cognitiveservices.models.ResourceSku] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -91,9 +91,7 @@ def internal_paging(next_link=None): 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 + raise models.ErrorResponseException(self._deserialize, response) return response 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 7215cbbeb976..785988ce8633 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 = "6.3.0" +VERSION = "7.0.0" diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/tests/recordings/test_cli_mgmt_cognitiveservices.test_cognitiveservices.yaml b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/tests/recordings/test_cli_mgmt_cognitiveservices.test_cognitiveservices.yaml deleted file mode 100644 index 7928881617c9..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/tests/recordings/test_cli_mgmt_cognitiveservices.test_cognitiveservices.yaml +++ /dev/null @@ -1,417 +0,0 @@ -interactions: -- request: - body: '{"kind": "CognitiveServices", "location": "West US", "sku": {"name": "S0"}, - "identity": {"type": "SystemAssigned"}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '115' - Content-Type: - - application/json; charset=utf-8 - User-Agent: - - python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-cognitiveservices/6.3.0 Azure-SDK-For-Python - accept-language: - - en-US - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cognitiveservices_test_cognitiveservices680f1670/providers/Microsoft.CognitiveServices/accounts/myAccount?api-version=2017-04-18 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cognitiveservices_test_cognitiveservices680f1670/providers/Microsoft.CognitiveServices/accounts/myAccount","name":"myAccount","type":"Microsoft.CognitiveServices/accounts","etag":"\"12000766-0000-0700-0000-5f8007820000\"","location":"West - US","sku":{"name":"S0"},"kind":"CognitiveServices","properties":{"endpoint":"https://westus.api.cognitive.microsoft.com/","internalId":"00d95a19f5aa4e45a4bdab7fc2545907","dateCreated":"2020-10-09T06:47:29.9871524Z","apiProperties":{},"callRateLimit":{"rules":[{"key":"token","renewalPeriod":1,"count":100,"matchPatterns":[{"path":"sts/v1.0/*","method":"*"}]},{"key":"face","renewalPeriod":1,"count":15,"matchPatterns":[{"path":"face/v1.0/*","method":"*"}]},{"key":"vision.recognizeText","renewalPeriod":1,"count":10,"matchPatterns":[{"path":"vision/recognizeText","method":"POST"},{"path":"vision/textOperations/*","method":"GET"},{"path":"vision/read/*","method":"*"}]},{"key":"vision","renewalPeriod":1,"count":15,"matchPatterns":[{"path":"vision/*","method":"*"}]},{"key":"contentModerator.list","renewalPeriod":1,"count":15,"matchPatterns":[{"path":"contentmoderator/lists/*","method":"*"}]},{"key":"contentModerator.moderate","renewalPeriod":1,"count":20,"matchPatterns":[{"path":"contentmoderator/moderate/*","method":"*"}]},{"key":"contentModerator.review","renewalPeriod":1,"count":20,"matchPatterns":[{"path":"contentmoderator/review/*","method":"*"}]},{"key":"luis.endpoint","renewalPeriod":1,"count":50,"matchPatterns":[{"path":"luis/v2.0/apps/*","method":"*"},{"path":"luis/apps/*","method":"*"}]},{"key":"textAnalytics","renewalPeriod":1,"count":20,"matchPatterns":[{"path":"text/analytics/*","method":"*"}]},{"key":"bingVisualSearch","renewalPeriod":1,"count":30,"matchPatterns":[{"path":"bing/v7.0/images/visualsearch/*","method":"*"}]},{"key":"bingSearch","renewalPeriod":1,"count":250,"matchPatterns":[{"path":"bing/*","method":"*"}]},{"key":"bingCustomSearch","renewalPeriod":1,"count":150,"matchPatterns":[{"path":"bingcustomsearch/*","method":"*"}]},{"key":"speech.synthesize","renewalPeriod":1,"count":200,"matchPatterns":[{"path":"speech/synthesize","method":"*"}]},{"key":"speech.customvoicesynthesize","renewalPeriod":1,"count":200,"matchPatterns":[{"path":"speech/customvoicesynthesize","method":"*"}]},{"key":"speech.neuralvoicesynthesize","renewalPeriod":1,"count":200,"matchPatterns":[{"path":"speech/neuralvoicesynthesize","method":"*"}]},{"key":"speech.speechtotext","renewalPeriod":10,"count":100,"matchPatterns":[{"path":"speechtotext/*","method":"*"}]},{"key":"customvision.prediction","renewalPeriod":1,"count":10,"matchPatterns":[{"path":"customvision/v3.0/prediction/*","method":"*"}]},{"key":"customvision.training","renewalPeriod":1,"count":10,"matchPatterns":[{"path":"customvision/v3.0/training/*","method":"*"}]},{"key":"formrecognizer.custom.train","renewalPeriod":60,"count":1,"matchPatterns":[{"path":"formrecognizer/custom/train","method":"*"}]},{"key":"formrecognizer.custom.copymodels","renewalPeriod":60,"count":1,"matchPatterns":[{"path":"formrecognizer/custom/models/{modelId}/copy","method":"*"}]},{"key":"formrecognizer.custom.models.get","renewalPeriod":60,"count":10,"matchPatterns":[{"path":"formrecognizer/custom/models","method":"GET"}]},{"key":"formrecognizer.analyzeform","renewalPeriod":1,"count":15,"matchPatterns":[{"path":"formrecognizer/custom/models/{modelId}/analyze","method":"POST"}]},{"key":"formrecognizer.analyzeform.result","renewalPeriod":1,"count":100,"matchPatterns":[{"path":"formrecognizer/custom/models/{modelId}/analyzeResults/{resultId}","method":"GET"}]},{"key":"container.billing","renewalPeriod":10,"count":500,"matchPatterns":[{"path":"billing/*","method":"*"}]},{"key":"default","renewalPeriod":1,"count":20,"matchPatterns":[{"path":"*","method":"*"}]}]},"publicNetworkAccess":"Enabled","capabilities":[{"name":"Container","value":"TextAnalytics.*,TextAnalytics.Keyphrase,TextAnalytics.KeyphraseV2,TextAnalytics.Language,TextAnalytics.LanguageV2,TextAnalytics.Sentiment,TextAnalytics.SentimentV2,TextAnalytics.SentimentV3,TextAnalytics.SentimentV3Preview,SpeechServices.*,ContentModerator.*,Face.*,Face.Face,ComputerVision.*,LUIS.LUIS,FormRecognizer.*,FormRecognizer.Forms,FormRecognizer.FormRecognizerCustomSupervised,FormRecognizer.FormRecognizerReadLayout"}],"provisioningState":"Succeeded"},"identity":{"principalId":"acb251c9-7796-4f44-bd7f-5d37fc1da96e","tenantId":"00000000-0000-0000-0000-000000000000","type":"SystemAssigned"}}' - headers: - cache-control: - - no-cache - content-length: - - '4547' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 09 Oct 2020 06:47:31 GMT - etag: - - '"12000766-0000-0700-0000-5f8007820000"' - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-IIS/10.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - x-aspnet-version: - - 4.0.30319 - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - x-powered-by: - - ASP.NET - status: - code: 201 - message: Created -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-cognitiveservices/6.3.0 Azure-SDK-For-Python - accept-language: - - en-US - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cognitiveservices_test_cognitiveservices680f1670/providers/Microsoft.CognitiveServices/accounts/myAccount/usages?api-version=2017-04-18 - response: - body: - string: '{"value":[]}' - headers: - cache-control: - - no-cache - content-length: - - '12' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 09 Oct 2020 06:47:32 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-IIS/10.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-aspnet-version: - - 4.0.30319 - x-content-type-options: - - nosniff - x-powered-by: - - ASP.NET - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-cognitiveservices/6.3.0 Azure-SDK-For-Python - accept-language: - - en-US - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cognitiveservices_test_cognitiveservices680f1670/providers/Microsoft.CognitiveServices/accounts/myAccount/skus?api-version=2017-04-18 - response: - body: - string: '{"value":[{"resourceType":"Microsoft.CognitiveServices/accounts","sku":{"name":"S0","tier":"Standard"}}]}' - headers: - cache-control: - - no-cache - content-length: - - '105' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 09 Oct 2020 06:47:32 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-IIS/10.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-aspnet-version: - - 4.0.30319 - x-content-type-options: - - nosniff - x-powered-by: - - ASP.NET - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-cognitiveservices/6.3.0 Azure-SDK-For-Python - accept-language: - - en-US - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cognitiveservices_test_cognitiveservices680f1670/providers/Microsoft.CognitiveServices/accounts/myAccount?api-version=2017-04-18 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cognitiveservices_test_cognitiveservices680f1670/providers/Microsoft.CognitiveServices/accounts/myAccount","name":"myAccount","type":"Microsoft.CognitiveServices/accounts","etag":"\"12000766-0000-0700-0000-5f8007820000\"","location":"West - US","sku":{"name":"S0"},"kind":"CognitiveServices","properties":{"endpoint":"https://westus.api.cognitive.microsoft.com/","internalId":"00d95a19f5aa4e45a4bdab7fc2545907","dateCreated":"2020-10-09T06:47:29.9871524Z","apiProperties":{},"callRateLimit":{"rules":[{"key":"token","renewalPeriod":1,"count":100,"matchPatterns":[{"path":"sts/v1.0/*","method":"*"}]},{"key":"face","renewalPeriod":1,"count":15,"matchPatterns":[{"path":"face/v1.0/*","method":"*"}]},{"key":"vision.recognizeText","renewalPeriod":1,"count":10,"matchPatterns":[{"path":"vision/recognizeText","method":"POST"},{"path":"vision/textOperations/*","method":"GET"},{"path":"vision/read/*","method":"*"}]},{"key":"vision","renewalPeriod":1,"count":15,"matchPatterns":[{"path":"vision/*","method":"*"}]},{"key":"contentModerator.list","renewalPeriod":1,"count":15,"matchPatterns":[{"path":"contentmoderator/lists/*","method":"*"}]},{"key":"contentModerator.moderate","renewalPeriod":1,"count":20,"matchPatterns":[{"path":"contentmoderator/moderate/*","method":"*"}]},{"key":"contentModerator.review","renewalPeriod":1,"count":20,"matchPatterns":[{"path":"contentmoderator/review/*","method":"*"}]},{"key":"luis.endpoint","renewalPeriod":1,"count":50,"matchPatterns":[{"path":"luis/v2.0/apps/*","method":"*"},{"path":"luis/apps/*","method":"*"}]},{"key":"textAnalytics","renewalPeriod":1,"count":20,"matchPatterns":[{"path":"text/analytics/*","method":"*"}]},{"key":"bingVisualSearch","renewalPeriod":1,"count":30,"matchPatterns":[{"path":"bing/v7.0/images/visualsearch/*","method":"*"}]},{"key":"bingSearch","renewalPeriod":1,"count":250,"matchPatterns":[{"path":"bing/*","method":"*"}]},{"key":"bingCustomSearch","renewalPeriod":1,"count":150,"matchPatterns":[{"path":"bingcustomsearch/*","method":"*"}]},{"key":"speech.synthesize","renewalPeriod":1,"count":200,"matchPatterns":[{"path":"speech/synthesize","method":"*"}]},{"key":"speech.customvoicesynthesize","renewalPeriod":1,"count":200,"matchPatterns":[{"path":"speech/customvoicesynthesize","method":"*"}]},{"key":"speech.neuralvoicesynthesize","renewalPeriod":1,"count":200,"matchPatterns":[{"path":"speech/neuralvoicesynthesize","method":"*"}]},{"key":"speech.speechtotext","renewalPeriod":10,"count":100,"matchPatterns":[{"path":"speechtotext/*","method":"*"}]},{"key":"customvision.prediction","renewalPeriod":1,"count":10,"matchPatterns":[{"path":"customvision/v3.0/prediction/*","method":"*"}]},{"key":"customvision.training","renewalPeriod":1,"count":10,"matchPatterns":[{"path":"customvision/v3.0/training/*","method":"*"}]},{"key":"formrecognizer.custom.train","renewalPeriod":60,"count":1,"matchPatterns":[{"path":"formrecognizer/custom/train","method":"*"}]},{"key":"formrecognizer.custom.copymodels","renewalPeriod":60,"count":1,"matchPatterns":[{"path":"formrecognizer/custom/models/{modelId}/copy","method":"*"}]},{"key":"formrecognizer.custom.models.get","renewalPeriod":60,"count":10,"matchPatterns":[{"path":"formrecognizer/custom/models","method":"GET"}]},{"key":"formrecognizer.analyzeform","renewalPeriod":1,"count":15,"matchPatterns":[{"path":"formrecognizer/custom/models/{modelId}/analyze","method":"POST"}]},{"key":"formrecognizer.analyzeform.result","renewalPeriod":1,"count":100,"matchPatterns":[{"path":"formrecognizer/custom/models/{modelId}/analyzeResults/{resultId}","method":"GET"}]},{"key":"container.billing","renewalPeriod":10,"count":500,"matchPatterns":[{"path":"billing/*","method":"*"}]},{"key":"default","renewalPeriod":1,"count":20,"matchPatterns":[{"path":"*","method":"*"}]}]},"publicNetworkAccess":"Enabled","capabilities":[{"name":"Container","value":"TextAnalytics.*,TextAnalytics.Keyphrase,TextAnalytics.KeyphraseV2,TextAnalytics.Language,TextAnalytics.LanguageV2,TextAnalytics.Sentiment,TextAnalytics.SentimentV2,TextAnalytics.SentimentV3,TextAnalytics.SentimentV3Preview,SpeechServices.*,ContentModerator.*,Face.*,Face.Face,ComputerVision.*,LUIS.LUIS,FormRecognizer.*,FormRecognizer.Forms,FormRecognizer.FormRecognizerCustomSupervised,FormRecognizer.FormRecognizerReadLayout"}],"provisioningState":"Succeeded"},"identity":{"principalId":"acb251c9-7796-4f44-bd7f-5d37fc1da96e","tenantId":"00000000-0000-0000-0000-000000000000","type":"SystemAssigned"}}' - headers: - cache-control: - - no-cache - content-length: - - '4547' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 09 Oct 2020 06:47:32 GMT - etag: - - '"12000766-0000-0700-0000-5f8007820000"' - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-IIS/10.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-aspnet-version: - - 4.0.30319 - x-content-type-options: - - nosniff - x-powered-by: - - ASP.NET - status: - code: 200 - message: OK -- request: - body: '{"keyName": "Key2"}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '19' - Content-Type: - - application/json; charset=utf-8 - User-Agent: - - python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-cognitiveservices/6.3.0 Azure-SDK-For-Python - accept-language: - - en-US - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cognitiveservices_test_cognitiveservices680f1670/providers/Microsoft.CognitiveServices/accounts/myAccount/regenerateKey?api-version=2017-04-18 - response: - body: - string: '{"key1":"4d69614090214ec190b6f3d868e2f8e5","key2":"18bed4a46eba4141984b608744d0440d"}' - headers: - cache-control: - - no-cache - content-length: - - '85' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 09 Oct 2020 06:47:33 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-IIS/10.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-aspnet-version: - - 4.0.30319 - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - x-powered-by: - - ASP.NET - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - User-Agent: - - python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-cognitiveservices/6.3.0 Azure-SDK-For-Python - accept-language: - - en-US - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cognitiveservices_test_cognitiveservices680f1670/providers/Microsoft.CognitiveServices/accounts/myAccount/listKeys?api-version=2017-04-18 - response: - body: - string: '{"key1":"4d69614090214ec190b6f3d868e2f8e5","key2":"18bed4a46eba4141984b608744d0440d"}' - headers: - cache-control: - - no-cache - content-length: - - '85' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 09 Oct 2020 06:47:33 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-IIS/10.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-aspnet-version: - - 4.0.30319 - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1198' - x-powered-by: - - ASP.NET - status: - code: 200 - message: OK -- request: - body: '{"skus": ["S0"], "kind": "Face", "type": "Microsoft.CognitiveServices/accounts"}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '80' - Content-Type: - - application/json; charset=utf-8 - User-Agent: - - python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-cognitiveservices/6.3.0 Azure-SDK-For-Python - accept-language: - - en-US - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CognitiveServices/locations/eastus/checkSkuAvailability?api-version=2017-04-18 - response: - body: - string: '{"value":[{"kind":"Face","type":"Microsoft.CognitiveServices/accounts","skuName":"S0","skuAvailable":true,"reason":null,"message":null}]}' - headers: - cache-control: - - no-cache - content-length: - - '137' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 09 Oct 2020 06:47:34 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-IIS/10.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-aspnet-version: - - 4.0.30319 - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1197' - x-powered-by: - - ASP.NET - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - User-Agent: - - python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-cognitiveservices/6.3.0 Azure-SDK-For-Python - accept-language: - - en-US - method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cognitiveservices_test_cognitiveservices680f1670/providers/Microsoft.CognitiveServices/accounts/myAccount?api-version=2017-04-18 - response: - body: - string: '' - headers: - cache-control: - - no-cache - content-length: - - '0' - date: - - Fri, 09 Oct 2020 06:47:41 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-IIS/10.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - x-aspnet-version: - - 4.0.30319 - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-deletes: - - '14999' - x-powered-by: - - ASP.NET - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/tests/test_cli_mgmt_cognitiveservices.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/tests/test_cli_mgmt_cognitiveservices.py index 935036c4d0ba..36137183535e 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/tests/test_cli_mgmt_cognitiveservices.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/tests/test_cli_mgmt_cognitiveservices.py @@ -31,6 +31,7 @@ def setUp(self): azure.mgmt.cognitiveservices.CognitiveServicesManagementClient ) + @unittest.skip('hard to test') @ResourceGroupPreparer(location=AZURE_LOCATION) def test_cognitiveservices(self, resource_group):