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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from .cognitive_services_management_client import CognitiveServicesManagementClient
from .version import VERSION

__all__ = ['CognitiveServicesManagementClient']

__version__ = VERSION

Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.service_client import SDKClient
from msrest import Serializer, Deserializer
from msrestazure import AzureConfiguration
from .version import VERSION
from .operations.accounts_operations import AccountsOperations
from .operations.resource_skus_operations import ResourceSkusOperations
from .operations.operations import Operations
from .operations.check_sku_availability_operations import CheckSkuAvailabilityOperations
from . import models


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

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

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

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

super(CognitiveServicesManagementClientConfiguration, self).__init__(base_url)

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

self.credentials = credentials
self.subscription_id = subscription_id


class CognitiveServicesManagementClient(SDKClient):
"""Cognitive Services Management Client

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

:ivar accounts: Accounts operations
:vartype accounts: azure.mgmt.cognitiveservices.operations.AccountsOperations
:ivar resource_skus: ResourceSkus operations
:vartype resource_skus: azure.mgmt.cognitiveservices.operations.ResourceSkusOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.cognitiveservices.operations.Operations
:ivar check_sku_availability: CheckSkuAvailability operations
: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 str base_url: Service URL
"""

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

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

self.accounts = AccountsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.resource_skus = ResourceSkusOperations(
self._client, self.config, self._serialize, self._deserialize)
self.operations = Operations(
self._client, self.config, self._serialize, self._deserialize)
self.check_sku_availability = CheckSkuAvailabilityOperations(
self._client, self.config, self._serialize, self._deserialize)
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

try:
from .sku_py3 import Sku
from .cognitive_services_account_create_parameters_py3 import CognitiveServicesAccountCreateParameters
from .cognitive_services_account_update_parameters_py3 import CognitiveServicesAccountUpdateParameters
from .ip_rule_py3 import IpRule
from .virtual_network_rule_py3 import VirtualNetworkRule
from .network_rule_set_py3 import NetworkRuleSet
from .cognitive_services_account_py3 import CognitiveServicesAccount
from .cognitive_services_account_keys_py3 import CognitiveServicesAccountKeys
from .regenerate_key_parameters_py3 import RegenerateKeyParameters
from .cognitive_services_resource_and_sku_py3 import CognitiveServicesResourceAndSku
from .cognitive_services_account_enumerate_skus_result_py3 import CognitiveServicesAccountEnumerateSkusResult
from .metric_name_py3 import MetricName
from .usage_py3 import Usage
from .usages_result_py3 import UsagesResult
from .error_body_py3 import ErrorBody
from .error_py3 import Error, ErrorException
from .operation_display_info_py3 import OperationDisplayInfo
from .operation_entity_py3 import OperationEntity
from .check_sku_availability_parameter_py3 import CheckSkuAvailabilityParameter
from .check_sku_availability_result_py3 import CheckSkuAvailabilityResult
from .check_sku_availability_result_list_py3 import CheckSkuAvailabilityResultList
from .resource_sku_restriction_info_py3 import ResourceSkuRestrictionInfo
from .resource_sku_restrictions_py3 import ResourceSkuRestrictions
from .resource_sku_py3 import ResourceSku
except (SyntaxError, ImportError):
from .sku import Sku
from .cognitive_services_account_create_parameters import CognitiveServicesAccountCreateParameters
from .cognitive_services_account_update_parameters import CognitiveServicesAccountUpdateParameters
from .ip_rule import IpRule
from .virtual_network_rule import VirtualNetworkRule
from .network_rule_set import NetworkRuleSet
from .cognitive_services_account import CognitiveServicesAccount
from .cognitive_services_account_keys import CognitiveServicesAccountKeys
from .regenerate_key_parameters import RegenerateKeyParameters
from .cognitive_services_resource_and_sku import CognitiveServicesResourceAndSku
from .cognitive_services_account_enumerate_skus_result import CognitiveServicesAccountEnumerateSkusResult
from .metric_name import MetricName
from .usage import Usage
from .usages_result import UsagesResult
from .error_body import ErrorBody
from .error import Error, ErrorException
from .operation_display_info import OperationDisplayInfo
from .operation_entity import OperationEntity
from .check_sku_availability_parameter import CheckSkuAvailabilityParameter
from .check_sku_availability_result import CheckSkuAvailabilityResult
from .check_sku_availability_result_list import CheckSkuAvailabilityResultList
from .resource_sku_restriction_info import ResourceSkuRestrictionInfo
from .resource_sku_restrictions import ResourceSkuRestrictions
from .resource_sku import ResourceSku
from .cognitive_services_account_paged import CognitiveServicesAccountPaged
from .resource_sku_paged import ResourceSkuPaged
from .operation_entity_paged import OperationEntityPaged
from .cognitive_services_management_client_enums import (
SkuTier,
ProvisioningState,
NetworkRuleBypassOptions,
NetworkRuleAction,
KeyName,
UnitType,
QuotaUsageStatus,
ResourceSkuRestrictionsType,
ResourceSkuRestrictionsReasonCode,
)

__all__ = [
'Sku',
'CognitiveServicesAccountCreateParameters',
'CognitiveServicesAccountUpdateParameters',
'IpRule',
'VirtualNetworkRule',
'NetworkRuleSet',
'CognitiveServicesAccount',
'CognitiveServicesAccountKeys',
'RegenerateKeyParameters',
'CognitiveServicesResourceAndSku',
'CognitiveServicesAccountEnumerateSkusResult',
'MetricName',
'Usage',
'UsagesResult',
'ErrorBody',
'Error', 'ErrorException',
'OperationDisplayInfo',
'OperationEntity',
'CheckSkuAvailabilityParameter',
'CheckSkuAvailabilityResult',
'CheckSkuAvailabilityResultList',
'ResourceSkuRestrictionInfo',
'ResourceSkuRestrictions',
'ResourceSku',
'CognitiveServicesAccountPaged',
'ResourceSkuPaged',
'OperationEntityPaged',
'SkuTier',
'ProvisioningState',
'NetworkRuleBypassOptions',
'NetworkRuleAction',
'KeyName',
'UnitType',
'QuotaUsageStatus',
'ResourceSkuRestrictionsType',
'ResourceSkuRestrictionsReasonCode',
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class CheckSkuAvailabilityParameter(Model):
"""Check SKU availability parameter.

All required parameters must be populated in order to send to Azure.

:param skus: Required. The SKU of the resource.
:type skus: list[str]
:param kind: Required. The Kind of the resource.
:type kind: str
:param type: Required. The Type of the resource.
:type type: str
"""

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

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

def __init__(self, **kwargs):
super(CheckSkuAvailabilityParameter, self).__init__(**kwargs)
self.skus = kwargs.get('skus', None)
self.kind = kwargs.get('kind', None)
self.type = kwargs.get('type', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class CheckSkuAvailabilityParameter(Model):
"""Check SKU availability parameter.

All required parameters must be populated in order to send to Azure.

:param skus: Required. The SKU of the resource.
:type skus: list[str]
:param kind: Required. The Kind of the resource.
:type kind: str
:param type: Required. The Type of the resource.
:type type: str
"""

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

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

def __init__(self, *, skus, kind: str, type: str, **kwargs) -> None:
super(CheckSkuAvailabilityParameter, self).__init__(**kwargs)
self.skus = skus
self.kind = kind
self.type = type
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class CheckSkuAvailabilityResult(Model):
"""Check SKU availability result.

:param kind: The Kind of the resource.
:type kind: str
:param type: The Type of the resource.
:type type: str
:param sku_name: The SKU of Cognitive Services account.
:type sku_name: str
:param sku_available: Indicates the given SKU is available or not.
:type sku_available: bool
:param reason: Reason why the SKU is not available.
:type reason: str
:param message: Additional error message.
:type message: str
"""

_attribute_map = {
'kind': {'key': 'kind', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'sku_name': {'key': 'skuName', 'type': 'str'},
'sku_available': {'key': 'skuAvailable', 'type': 'bool'},
'reason': {'key': 'reason', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
}

def __init__(self, **kwargs):
super(CheckSkuAvailabilityResult, self).__init__(**kwargs)
self.kind = kwargs.get('kind', None)
self.type = kwargs.get('type', None)
self.sku_name = kwargs.get('sku_name', None)
self.sku_available = kwargs.get('sku_available', None)
self.reason = kwargs.get('reason', None)
self.message = kwargs.get('message', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class CheckSkuAvailabilityResultList(Model):
"""Check SKU availability result list.

:param value: Check SKU availability result list.
:type value:
list[~azure.mgmt.cognitiveservices.models.CheckSkuAvailabilityResult]
"""

_attribute_map = {
'value': {'key': 'value', 'type': '[CheckSkuAvailabilityResult]'},
}

def __init__(self, **kwargs):
super(CheckSkuAvailabilityResultList, self).__init__(**kwargs)
self.value = kwargs.get('value', None)
Loading