Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR azure-mgmt-cognitiveservices] Fix json format by prettier #32

Merged
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
Expand Up @@ -17,7 +17,6 @@
from .operations import AccountsOperations
from .operations import ResourceSkusOperations
from .operations import Operations
from .operations import CheckSkuAvailabilityOperations
from . import models


Expand All @@ -33,8 +32,6 @@ class CognitiveServicesManagementClient(CognitiveServicesManagementClientOperati
: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
Expand All @@ -61,5 +58,3 @@ def __init__(
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
Expand Up @@ -16,10 +16,10 @@
from ._models_py3 import CheckSkuAvailabilityResult
from ._models_py3 import CheckSkuAvailabilityResultList
from ._models_py3 import CognitiveServicesAccount
from ._models_py3 import CognitiveServicesAccountCreateParameters
from ._models_py3 import CognitiveServicesAccountApiProperties
from ._models_py3 import CognitiveServicesAccountEnumerateSkusResult
from ._models_py3 import CognitiveServicesAccountKeys
from ._models_py3 import CognitiveServicesAccountUpdateParameters
from ._models_py3 import CognitiveServicesAccountProperties
from ._models_py3 import CognitiveServicesResourceAndSku
from ._models_py3 import Error, ErrorException
from ._models_py3 import ErrorBody
Expand All @@ -43,10 +43,10 @@
from ._models import CheckSkuAvailabilityResult
from ._models import CheckSkuAvailabilityResultList
from ._models import CognitiveServicesAccount
from ._models import CognitiveServicesAccountCreateParameters
from ._models import CognitiveServicesAccountApiProperties
from ._models import CognitiveServicesAccountEnumerateSkusResult
from ._models import CognitiveServicesAccountKeys
from ._models import CognitiveServicesAccountUpdateParameters
from ._models import CognitiveServicesAccountProperties
from ._models import CognitiveServicesResourceAndSku
from ._models import Error, ErrorException
from ._models import ErrorBody
Expand All @@ -69,7 +69,6 @@
from ._cognitive_services_management_client_enums import (
SkuTier,
ProvisioningState,
NetworkRuleBypassOptions,
NetworkRuleAction,
KeyName,
UnitType,
Expand All @@ -85,10 +84,10 @@
'CheckSkuAvailabilityResult',
'CheckSkuAvailabilityResultList',
'CognitiveServicesAccount',
'CognitiveServicesAccountCreateParameters',
'CognitiveServicesAccountApiProperties',
'CognitiveServicesAccountEnumerateSkusResult',
'CognitiveServicesAccountKeys',
'CognitiveServicesAccountUpdateParameters',
'CognitiveServicesAccountProperties',
'CognitiveServicesResourceAndSku',
'Error', 'ErrorException',
'ErrorBody',
Expand All @@ -110,7 +109,6 @@
'OperationEntityPaged',
'SkuTier',
'ProvisioningState',
'NetworkRuleBypassOptions',
'NetworkRuleAction',
'KeyName',
'UnitType',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ class ProvisioningState(str, Enum):
failed = "Failed"


class NetworkRuleBypassOptions(str, Enum):

azure_services = "AzureServices"
none = "None"


class NetworkRuleAction(str, Enum):

allow = "Allow"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,31 +169,19 @@ class CognitiveServicesAccount(Model):
Variables are only populated by the server, and will be ignored when
sending a request.

:param etag: Entity Tag
:type etag: str
:ivar etag: Entity Tag
:vartype etag: str
:ivar id: The id of the created account
:vartype id: str
:param kind: Type of cognitive service account.
: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
:ivar provisioning_state: Gets the status of the cognitive services
account at the time the operation was called. Possible values include:
'Creating', 'ResolvingDNS', 'Moving', 'Deleting', 'Succeeded', 'Failed'
:vartype provisioning_state: str or
~azure.mgmt.cognitiveservices.models.ProvisioningState
:param endpoint: Endpoint of the created account.
:type endpoint: str
:param internal_id: The internal identifier.
:type internal_id: str
:param custom_sub_domain_name: Optional subdomain name used for
token-based authentication.
:type custom_sub_domain_name: str
:param network_acls: A collection of rules governing the accessibility
from specific network locations.
:type network_acls: ~azure.mgmt.cognitiveservices.models.NetworkRuleSet
:param 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
Expand All @@ -207,9 +195,9 @@ class CognitiveServicesAccount(Model):
"""

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

Expand All @@ -219,81 +207,60 @@ class CognitiveServicesAccount(Model):
'kind': {'key': 'kind', 'type': 'str'},
'location': {'key': 'location', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
'endpoint': {'key': 'properties.endpoint', 'type': 'str'},
'internal_id': {'key': 'properties.internalId', 'type': 'str'},
'custom_sub_domain_name': {'key': 'properties.customSubDomainName', 'type': 'str'},
'network_acls': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'},
'properties': {'key': 'properties', 'type': 'CognitiveServicesAccountProperties'},
'sku': {'key': 'sku', 'type': 'Sku'},
'tags': {'key': 'tags', 'type': '{str}'},
'type': {'key': 'type', 'type': 'str'},
}

def __init__(self, **kwargs):
super(CognitiveServicesAccount, self).__init__(**kwargs)
self.etag = kwargs.get('etag', None)
self.etag = None
self.id = None
self.kind = kwargs.get('kind', None)
self.location = kwargs.get('location', None)
self.name = None
self.provisioning_state = None
self.endpoint = kwargs.get('endpoint', None)
self.internal_id = kwargs.get('internal_id', None)
self.custom_sub_domain_name = kwargs.get('custom_sub_domain_name', None)
self.network_acls = kwargs.get('network_acls', None)
self.properties = kwargs.get('properties', None)
self.sku = kwargs.get('sku', None)
self.tags = kwargs.get('tags', None)
self.type = None


class CognitiveServicesAccountCreateParameters(Model):
"""The parameters to provide for the account.

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

:param sku: Required. Required. Gets or sets the SKU of the resource.
:type sku: ~azure.mgmt.cognitiveservices.models.Sku
:param kind: Required. Required. Gets or sets the Kind of the resource.
:type kind: str
:param location: Required. Required. Gets or sets the location of the
resource. This will be one of the supported and registered Azure Geo
Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a
resource cannot be changed once it is created, but if an identical geo
region is specified on update the request will succeed.
:type location: str
:param tags: Gets or sets a list of key value pairs that describe the
resource. These tags can be used in viewing and grouping this resource
(across resource groups). A maximum of 15 tags can be provided for a
resource. Each tag must have a key no greater than 128 characters and
value no greater than 256 characters.
:type tags: dict[str, str]
:param properties: Required. Must exist in the request. Must be an empty
object. Must not be null.
:type properties: object
class CognitiveServicesAccountApiProperties(Model):
"""The api properties for special APIs.

:param qna_runtime_endpoint: (QnAMaker Only) The runtime endpoint of
QnAMaker.
:type qna_runtime_endpoint: str
:param statistics_enabled: (Bing Search Only) The flag to enable
statistics of Bing Search.
:type statistics_enabled: bool
:param event_hub_connection_string: (Personalization Only) The flag to
enable statistics of Bing Search.
:type event_hub_connection_string: str
:param storage_account_connection_string: (Personalization Only) The
storage account connection string.
:type storage_account_connection_string: str
"""

_validation = {
'sku': {'required': True},
'kind': {'required': True},
'location': {'required': True},
'properties': {'required': True},
'event_hub_connection_string': {'max_length': 1000, 'pattern': r'^( *)Endpoint=sb://(.*);( *)SharedAccessKeyName=(.*);( *)SharedAccessKey=(.*)$'},
'storage_account_connection_string': {'max_length': 1000, 'pattern': r'^(( *)DefaultEndpointsProtocol=(http|https)( *);( *))?AccountName=(.*)AccountKey=(.*)EndpointSuffix=(.*)$'},
}

_attribute_map = {
'sku': {'key': 'sku', 'type': 'Sku'},
'kind': {'key': 'kind', 'type': 'str'},
'location': {'key': 'location', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
'properties': {'key': 'properties', 'type': 'object'},
'qna_runtime_endpoint': {'key': 'qnaRuntimeEndpoint', 'type': 'str'},
'statistics_enabled': {'key': 'statisticsEnabled', 'type': 'bool'},
'event_hub_connection_string': {'key': 'eventHubConnectionString', 'type': 'str'},
'storage_account_connection_string': {'key': 'storageAccountConnectionString', 'type': 'str'},
}

def __init__(self, **kwargs):
super(CognitiveServicesAccountCreateParameters, self).__init__(**kwargs)
self.sku = kwargs.get('sku', None)
self.kind = kwargs.get('kind', None)
self.location = kwargs.get('location', None)
self.tags = kwargs.get('tags', None)
self.properties = kwargs.get('properties', None)
super(CognitiveServicesAccountApiProperties, self).__init__(**kwargs)
self.qna_runtime_endpoint = kwargs.get('qna_runtime_endpoint', 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)


class CognitiveServicesAccountEnumerateSkusResult(Model):
Expand Down Expand Up @@ -341,33 +308,55 @@ def __init__(self, **kwargs):
self.key2 = kwargs.get('key2', None)


class CognitiveServicesAccountUpdateParameters(Model):
"""The parameters to provide for the account.
class CognitiveServicesAccountProperties(Model):
"""Properties of Cognitive Services account.

:param sku: Gets or sets the SKU of the resource.
:type sku: ~azure.mgmt.cognitiveservices.models.Sku
:param tags: Gets or sets a list of key value pairs that describe the
resource. These tags can be used in viewing and grouping this resource
(across resource groups). A maximum of 15 tags can be provided for a
resource. Each tag must have a key no greater than 128 characters and
value no greater than 256 characters.
:type tags: dict[str, str]
:param properties: Additional properties for Account. Only provided fields
will be updated.
:type properties: object
Variables are only populated by the server, and will be ignored when
sending a request.

: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
: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 api_properties: The api properties for special APIs.
:type api_properties:
~azure.mgmt.cognitiveservices.models.CognitiveServicesAccountApiProperties
"""

_validation = {
'provisioning_state': {'readonly': True},
'endpoint': {'readonly': True},
'internal_id': {'readonly': True},
}

_attribute_map = {
'sku': {'key': 'sku', 'type': 'Sku'},
'tags': {'key': 'tags', 'type': '{str}'},
'properties': {'key': 'properties', 'type': 'object'},
'provisioning_state': {'key': 'provisioningState', 'type': 'str'},
'endpoint': {'key': 'endpoint', 'type': 'str'},
'internal_id': {'key': 'internalId', 'type': 'str'},
'custom_sub_domain_name': {'key': 'customSubDomainName', 'type': 'str'},
'network_acls': {'key': 'networkAcls', 'type': 'NetworkRuleSet'},
'api_properties': {'key': 'apiProperties', 'type': 'CognitiveServicesAccountApiProperties'},
}

def __init__(self, **kwargs):
super(CognitiveServicesAccountUpdateParameters, self).__init__(**kwargs)
self.sku = kwargs.get('sku', None)
self.tags = kwargs.get('tags', None)
self.properties = kwargs.get('properties', None)
super(CognitiveServicesAccountProperties, self).__init__(**kwargs)
self.provisioning_state = None
self.endpoint = None
self.internal_id = None
self.custom_sub_domain_name = kwargs.get('custom_sub_domain_name', None)
self.network_acls = kwargs.get('network_acls', None)
self.api_properties = kwargs.get('api_properties', None)


class CognitiveServicesResourceAndSku(Model):
Expand Down Expand Up @@ -500,11 +489,6 @@ def __init__(self, **kwargs):
class NetworkRuleSet(Model):
"""A set of rules governing the network accessibility.

:param bypass: Tells what traffic can bypass network rules. This can be
'AzureServices' or 'None'. If not specified the default is
'AzureServices'. Possible values include: 'AzureServices', 'None'
:type bypass: str or
~azure.mgmt.cognitiveservices.models.NetworkRuleBypassOptions
:param default_action: The default action when no rule from ipRules and
from virtualNetworkRules match. This is only used after the bypass
property has been evaluated. Possible values include: 'Allow', 'Deny'
Expand All @@ -518,15 +502,13 @@ class NetworkRuleSet(Model):
"""

_attribute_map = {
'bypass': {'key': 'bypass', 'type': 'str'},
'default_action': {'key': 'defaultAction', 'type': 'str'},
'ip_rules': {'key': 'ipRules', 'type': '[IpRule]'},
'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'},
}

def __init__(self, **kwargs):
super(NetworkRuleSet, self).__init__(**kwargs)
self.bypass = kwargs.get('bypass', None)
self.default_action = kwargs.get('default_action', None)
self.ip_rules = kwargs.get('ip_rules', None)
self.virtual_network_rules = kwargs.get('virtual_network_rules', None)
Expand Down
Loading