Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
26 changes: 6 additions & 20 deletions ...mt-cognitiveservices/azure/mgmt/cognitiveservices/cognitive_services_management_client.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from msrest import Serializer, Deserializer
from msrestazure import AzureConfiguration
from .version import VERSION
from .operations.cognitive_services_accounts_operations import CognitiveServicesAccountsOperations
from .operations.accounts_operations import AccountsOperations
from .operations.operations import Operations
from .operations.check_sku_availability_operations import CheckSkuAvailabilityOperations
Expand All @@ -30,24 +29,18 @@ class CognitiveServicesManagementClientConfiguration(AzureConfiguration):
object<msrestazure.azure_active_directory>`
:param subscription_id: Azure Subscription ID.
:type subscription_id: str
:param location: Resource location.
:type location: str
:param str base_url: Service URL
"""

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

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

Expand All @@ -58,7 +51,6 @@ def __init__(

self.credentials = credentials
self.subscription_id = subscription_id
self.location = location


class CognitiveServicesManagementClient(object):
Expand All @@ -67,38 +59,32 @@ class CognitiveServicesManagementClient(object):
:ivar config: Configuration for client.
:vartype config: CognitiveServicesManagementClientConfiguration

:ivar cognitive_services_accounts: CognitiveServicesAccounts operations
:vartype cognitive_services_accounts: .operations.CognitiveServicesAccountsOperations
:ivar accounts: Accounts operations
:vartype accounts: .operations.AccountsOperations
:vartype accounts: azure.mgmt.cognitiveservices.operations.AccountsOperations
:ivar operations: Operations operations
:vartype operations: .operations.Operations
:vartype operations: azure.mgmt.cognitiveservices.operations.Operations
:ivar check_sku_availability: CheckSkuAvailability operations
:vartype check_sku_availability: .operations.CheckSkuAvailabilityOperations
:vartype check_sku_availability: azure.mgmt.cognitiveservices.operations.CheckSkuAvailabilityOperations

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

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

self.config = CognitiveServicesManagementClientConfiguration(credentials, subscription_id, location, base_url)
self.config = CognitiveServicesManagementClientConfiguration(credentials, subscription_id, base_url)
self._client = ServiceClient(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._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

self.cognitive_services_accounts = CognitiveServicesAccountsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.accounts = AccountsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.operations = Operations(
Expand Down
Empty file.
13 changes: 10 additions & 3 deletions ...cognitiveservices/azure/mgmt/cognitiveservices/models/check_sku_availability_parameter.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ class CheckSkuAvailabilityParameter(Model):
"""Check SKU availability parameter.

:param skus: The SKU of the resource.
:type skus: list of :class:`Sku <azure.mgmt.cognitiveservices.models.Sku>`
:type skus: list of str or :class:`SkuName
<azure.mgmt.cognitiveservices.models.SkuName>`
:param kind: The Kind of the resource. Possible values include:
'Academic', 'Bing.Autosuggest', 'Bing.Search', 'Bing.Speech',
'Bing.SpellCheck', 'ComputerVision', 'ContentModerator', 'CustomSpeech',
Expand All @@ -28,13 +29,19 @@ class CheckSkuAvailabilityParameter(Model):
:type type: str
"""

_validation = {
'skus': {'required': True},
'kind': {'required': True},
'type': {'required': True},
}

_attribute_map = {
'skus': {'key': 'skus', 'type': '[Sku]'},
'skus': {'key': 'skus', 'type': '[str]'},
'kind': {'key': 'kind', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
}

def __init__(self, skus=None, kind=None, type=None):
def __init__(self, skus, kind, type):
self.skus = skus
self.kind = kind
self.type = type
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ class CheckSkuAvailabilityResult(Model):
<azure.mgmt.cognitiveservices.models.Kind>`
:param type: The Type of the resource.
:type type: str
:param sku_name: The SKU of Cognitive Services account.
:type sku_name: :class:`Sku <azure.mgmt.cognitiveservices.models.Sku>`
:param sku_name: The SKU of Cognitive Services account. Possible values
include: 'F0', 'P0', 'P1', 'P2', 'S0', 'S1', 'S2', 'S3', 'S4', 'S5', 'S6'
:type sku_name: str or :class:`SkuName
<azure.mgmt.cognitiveservices.models.SkuName>`
:param sku_available: Indicates the given SKU is available or not.
:type sku_available: bool
:param reason: Reason why the SKU is not available.
Expand All @@ -37,7 +39,7 @@ class CheckSkuAvailabilityResult(Model):
_attribute_map = {
'kind': {'key': 'kind', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'sku_name': {'key': 'skuName', 'type': 'Sku'},
'sku_name': {'key': 'skuName', 'type': 'str'},
'sku_available': {'key': 'skuAvailable', 'type': 'bool'},
'reason': {'key': 'reason', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
Expand Down
Empty file.
23 changes: 13 additions & 10 deletions ...-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ class CognitiveServicesAccount(Model):

:param etag: Entity Tag
:type etag: str
:param id: The id of the created account
:type id: str
:ivar id: The id of the created account
:vartype id: str
:param kind: Type of cognitive service account.
:type kind: str
:param location: The location of the resource
:type location: str
:param name: The name of the created account
:type name: str
:ivar name: The name of the created account
:vartype name: str
:ivar provisioning_state: Gets the status of the cognitive services
account at the time the operation was called. Possible values include:
'Creating', 'ResolvingDNS', 'Succeeded', 'Failed'
Expand All @@ -46,12 +46,15 @@ class CognitiveServicesAccount(Model):
resource. Each tag must have a key no greater than 128 characters and
value no greater than 256 characters.
:type tags: dict
:param type: Resource type
:type type: str
:ivar type: Resource type
:vartype type: str
"""

_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'provisioning_state': {'readonly': True},
'type': {'readonly': True},
}

_attribute_map = {
Expand All @@ -68,15 +71,15 @@ class CognitiveServicesAccount(Model):
'type': {'key': 'type', 'type': 'str'},
}

def __init__(self, etag=None, id=None, kind=None, location=None, name=None, endpoint=None, internal_id=None, sku=None, tags=None, type=None):
def __init__(self, etag=None, kind=None, location=None, endpoint=None, internal_id=None, sku=None, tags=None):
self.etag = etag
self.id = id
self.id = None
self.kind = kind
self.location = location
self.name = name
self.name = None
self.provisioning_state = None
self.endpoint = endpoint
self.internal_id = internal_id
self.sku = sku
self.tags = tags
self.type = type
self.type = None
Empty file.
Empty file.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

class CognitiveServicesAccountPaged(Paged):
"""
A paging container for iterating over a list of CognitiveServicesAccount object
A paging container for iterating over a list of :class:`CognitiveServicesAccount <azure.mgmt.cognitiveservices.models.CognitiveServicesAccount>` object
"""

_attribute_map = {
Expand Down
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

class OperationEntityPaged(Paged):
"""
A paging container for iterating over a list of OperationEntity object
A paging container for iterating over a list of :class:`OperationEntity <azure.mgmt.cognitiveservices.models.OperationEntity>` object
"""

_attribute_map = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@ class RegenerateKeyParameters(Model):
<azure.mgmt.cognitiveservices.models.KeyName>`
"""

_validation = {
'key_name': {'required': True},
}

_attribute_map = {
'key_name': {'key': 'keyName', 'type': 'KeyName'},
}

def __init__(self, key_name=None):
def __init__(self, key_name):
self.key_name = key_name
Empty file.
2 changes: 0 additions & 2 deletions azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/__init__.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@
# regenerated.
# --------------------------------------------------------------------------

from .cognitive_services_accounts_operations import CognitiveServicesAccountsOperations
from .accounts_operations import AccountsOperations
from .operations import Operations
from .check_sku_availability_operations import CheckSkuAvailabilityOperations

__all__ = [
'CognitiveServicesAccountsOperations',
'AccountsOperations',
'Operations',
'CheckSkuAvailabilityOperations',
Expand Down
Loading