Skip to content

Commit 51154e2

Browse files
author
SDKAuto
committed
CodeGen from PR 11405 in Azure/azure-rest-api-specs
Swagger Correctness for Cognitive Services (Azure#11405) * Swagger Correctness * Undo changes in 2016-02-01-preview * Move location of field * change enum type to string for Sku.tier
1 parent 022e775 commit 51154e2

File tree

3 files changed

+81
-50
lines changed

3 files changed

+81
-50
lines changed

sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/_cognitive_services_management_client_enums.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class SkuTier(str, Enum):
1717
free = "Free"
1818
standard = "Standard"
1919
premium = "Premium"
20+
enterprise = "Enterprise"
2021

2122

2223
class ProvisioningState(str, Enum):

sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/_models.py

Lines changed: 40 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,19 @@
1616
class Resource(Model):
1717
"""Resource.
1818
19+
Common fields that are returned in the response for all Azure Resource
20+
Manager resources.
21+
1922
Variables are only populated by the server, and will be ignored when
2023
sending a request.
2124
22-
:ivar id: Fully qualified resource Id for the resource. Ex -
25+
:ivar id: Fully qualified resource ID for the resource. Ex -
2326
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
2427
:vartype id: str
2528
:ivar name: The name of the resource
2629
:vartype name: str
27-
:ivar type: The type of the resource. Ex-
28-
Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
30+
:ivar type: The type of the resource. E.g.
31+
"Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
2932
:vartype type: str
3033
"""
3134

@@ -49,19 +52,21 @@ def __init__(self, **kwargs):
4952

5053

5154
class AzureEntityResource(Resource):
52-
"""The resource model definition for a Azure Resource Manager resource with an
53-
etag.
55+
"""Entity Resource.
56+
57+
The resource model definition for an Azure Resource Manager resource with
58+
an etag.
5459
5560
Variables are only populated by the server, and will be ignored when
5661
sending a request.
5762
58-
:ivar id: Fully qualified resource Id for the resource. Ex -
63+
:ivar id: Fully qualified resource ID for the resource. Ex -
5964
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
6065
:vartype id: str
6166
:ivar name: The name of the resource
6267
:vartype name: str
63-
:ivar type: The type of the resource. Ex-
64-
Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
68+
:ivar type: The type of the resource. E.g.
69+
"Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
6570
:vartype type: str
6671
:ivar etag: Resource Etag.
6772
:vartype etag: str
@@ -451,13 +456,16 @@ class CognitiveServicesAccountProperties(Model):
451456
:param api_properties: The api properties for special APIs.
452457
:type api_properties:
453458
~azure.mgmt.cognitiveservices.models.CognitiveServicesAccountApiProperties
459+
:ivar date_created: Gets the date of cognitive services account creation.
460+
:vartype date_created: str
454461
"""
455462

456463
_validation = {
457464
'provisioning_state': {'readonly': True},
458465
'endpoint': {'readonly': True},
459466
'internal_id': {'readonly': True},
460467
'capabilities': {'readonly': True},
468+
'date_created': {'readonly': True},
461469
}
462470

463471
_attribute_map = {
@@ -472,6 +480,7 @@ class CognitiveServicesAccountProperties(Model):
472480
'private_endpoint_connections': {'key': 'privateEndpointConnections', 'type': '[PrivateEndpointConnection]'},
473481
'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'},
474482
'api_properties': {'key': 'apiProperties', 'type': 'CognitiveServicesAccountApiProperties'},
483+
'date_created': {'key': 'dateCreated', 'type': 'str'},
475484
}
476485

477486
def __init__(self, **kwargs):
@@ -487,6 +496,7 @@ def __init__(self, **kwargs):
487496
self.private_endpoint_connections = kwargs.get('private_endpoint_connections', None)
488497
self.public_network_access = kwargs.get('public_network_access', None)
489498
self.api_properties = kwargs.get('api_properties', None)
499+
self.date_created = None
490500

491501

492502
class CognitiveServicesResourceAndSku(Model):
@@ -818,13 +828,13 @@ class PrivateEndpointConnection(Resource):
818828
Variables are only populated by the server, and will be ignored when
819829
sending a request.
820830
821-
:ivar id: Fully qualified resource Id for the resource. Ex -
831+
:ivar id: Fully qualified resource ID for the resource. Ex -
822832
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
823833
:vartype id: str
824834
:ivar name: The name of the resource
825835
:vartype name: str
826-
:ivar type: The type of the resource. Ex-
827-
Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
836+
:ivar type: The type of the resource. E.g.
837+
"Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
828838
:vartype type: str
829839
:param properties: Resource properties.
830840
:type properties:
@@ -906,13 +916,13 @@ class PrivateLinkResource(Resource):
906916
Variables are only populated by the server, and will be ignored when
907917
sending a request.
908918
909-
:ivar id: Fully qualified resource Id for the resource. Ex -
919+
:ivar id: Fully qualified resource ID for the resource. Ex -
910920
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
911921
:vartype id: str
912922
:ivar name: The name of the resource
913923
:vartype name: str
914-
:ivar type: The type of the resource. Ex-
915-
Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
924+
:ivar type: The type of the resource. E.g.
925+
"Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
916926
:vartype type: str
917927
:param properties: Resource properties.
918928
:type properties:
@@ -1022,19 +1032,21 @@ def __init__(self, **kwargs):
10221032

10231033

10241034
class ProxyResource(Resource):
1025-
"""The resource model definition for a ARM proxy resource. It will have
1026-
everything other than required location and tags.
1035+
"""Proxy Resource.
1036+
1037+
The resource model definition for a Azure Resource Manager proxy resource.
1038+
It will not have tags and a location.
10271039
10281040
Variables are only populated by the server, and will be ignored when
10291041
sending a request.
10301042
1031-
:ivar id: Fully qualified resource Id for the resource. Ex -
1043+
:ivar id: Fully qualified resource ID for the resource. Ex -
10321044
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
10331045
:vartype id: str
10341046
:ivar name: The name of the resource
10351047
:vartype name: str
1036-
:ivar type: The type of the resource. Ex-
1037-
Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
1048+
:ivar type: The type of the resource. E.g.
1049+
"Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
10381050
:vartype type: str
10391051
"""
10401052

@@ -1212,7 +1224,7 @@ class Sku(Model):
12121224
creation, optional for update.
12131225
:type name: str
12141226
:ivar tier: Gets the sku tier. This is based on the SKU name. Possible
1215-
values include: 'Free', 'Standard', 'Premium'
1227+
values include: 'Free', 'Standard', 'Premium', 'Enterprise'
12161228
:vartype tier: str or ~azure.mgmt.cognitiveservices.models.SkuTier
12171229
"""
12181230

@@ -1223,7 +1235,7 @@ class Sku(Model):
12231235

12241236
_attribute_map = {
12251237
'name': {'key': 'name', 'type': 'str'},
1226-
'tier': {'key': 'tier', 'type': 'SkuTier'},
1238+
'tier': {'key': 'tier', 'type': 'str'},
12271239
}
12281240

12291241
def __init__(self, **kwargs):
@@ -1253,20 +1265,23 @@ def __init__(self, **kwargs):
12531265

12541266

12551267
class TrackedResource(Resource):
1256-
"""The resource model definition for a ARM tracked top level resource.
1268+
"""Tracked Resource.
1269+
1270+
The resource model definition for an Azure Resource Manager tracked top
1271+
level resource which has 'tags' and a 'location'.
12571272
12581273
Variables are only populated by the server, and will be ignored when
12591274
sending a request.
12601275
12611276
All required parameters must be populated in order to send to Azure.
12621277
1263-
:ivar id: Fully qualified resource Id for the resource. Ex -
1278+
:ivar id: Fully qualified resource ID for the resource. Ex -
12641279
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
12651280
:vartype id: str
12661281
:ivar name: The name of the resource
12671282
:vartype name: str
1268-
:ivar type: The type of the resource. Ex-
1269-
Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
1283+
:ivar type: The type of the resource. E.g.
1284+
"Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
12701285
:vartype type: str
12711286
:param tags: Resource tags.
12721287
:type tags: dict[str, str]

sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/_models_py3.py

Lines changed: 40 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,19 @@
1616
class Resource(Model):
1717
"""Resource.
1818
19+
Common fields that are returned in the response for all Azure Resource
20+
Manager resources.
21+
1922
Variables are only populated by the server, and will be ignored when
2023
sending a request.
2124
22-
:ivar id: Fully qualified resource Id for the resource. Ex -
25+
:ivar id: Fully qualified resource ID for the resource. Ex -
2326
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
2427
:vartype id: str
2528
:ivar name: The name of the resource
2629
:vartype name: str
27-
:ivar type: The type of the resource. Ex-
28-
Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
30+
:ivar type: The type of the resource. E.g.
31+
"Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
2932
:vartype type: str
3033
"""
3134

@@ -49,19 +52,21 @@ def __init__(self, **kwargs) -> None:
4952

5053

5154
class AzureEntityResource(Resource):
52-
"""The resource model definition for a Azure Resource Manager resource with an
53-
etag.
55+
"""Entity Resource.
56+
57+
The resource model definition for an Azure Resource Manager resource with
58+
an etag.
5459
5560
Variables are only populated by the server, and will be ignored when
5661
sending a request.
5762
58-
:ivar id: Fully qualified resource Id for the resource. Ex -
63+
:ivar id: Fully qualified resource ID for the resource. Ex -
5964
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
6065
:vartype id: str
6166
:ivar name: The name of the resource
6267
:vartype name: str
63-
:ivar type: The type of the resource. Ex-
64-
Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
68+
:ivar type: The type of the resource. E.g.
69+
"Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
6570
:vartype type: str
6671
:ivar etag: Resource Etag.
6772
:vartype etag: str
@@ -451,13 +456,16 @@ class CognitiveServicesAccountProperties(Model):
451456
:param api_properties: The api properties for special APIs.
452457
:type api_properties:
453458
~azure.mgmt.cognitiveservices.models.CognitiveServicesAccountApiProperties
459+
:ivar date_created: Gets the date of cognitive services account creation.
460+
:vartype date_created: str
454461
"""
455462

456463
_validation = {
457464
'provisioning_state': {'readonly': True},
458465
'endpoint': {'readonly': True},
459466
'internal_id': {'readonly': True},
460467
'capabilities': {'readonly': True},
468+
'date_created': {'readonly': True},
461469
}
462470

463471
_attribute_map = {
@@ -472,6 +480,7 @@ class CognitiveServicesAccountProperties(Model):
472480
'private_endpoint_connections': {'key': 'privateEndpointConnections', 'type': '[PrivateEndpointConnection]'},
473481
'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'},
474482
'api_properties': {'key': 'apiProperties', 'type': 'CognitiveServicesAccountApiProperties'},
483+
'date_created': {'key': 'dateCreated', 'type': 'str'},
475484
}
476485

477486
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:
@@ -487,6 +496,7 @@ def __init__(self, *, custom_sub_domain_name: str=None, network_acls=None, encry
487496
self.private_endpoint_connections = private_endpoint_connections
488497
self.public_network_access = public_network_access
489498
self.api_properties = api_properties
499+
self.date_created = None
490500

491501

492502
class CognitiveServicesResourceAndSku(Model):
@@ -818,13 +828,13 @@ class PrivateEndpointConnection(Resource):
818828
Variables are only populated by the server, and will be ignored when
819829
sending a request.
820830
821-
:ivar id: Fully qualified resource Id for the resource. Ex -
831+
:ivar id: Fully qualified resource ID for the resource. Ex -
822832
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
823833
:vartype id: str
824834
:ivar name: The name of the resource
825835
:vartype name: str
826-
:ivar type: The type of the resource. Ex-
827-
Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
836+
:ivar type: The type of the resource. E.g.
837+
"Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
828838
:vartype type: str
829839
:param properties: Resource properties.
830840
:type properties:
@@ -906,13 +916,13 @@ class PrivateLinkResource(Resource):
906916
Variables are only populated by the server, and will be ignored when
907917
sending a request.
908918
909-
:ivar id: Fully qualified resource Id for the resource. Ex -
919+
:ivar id: Fully qualified resource ID for the resource. Ex -
910920
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
911921
:vartype id: str
912922
:ivar name: The name of the resource
913923
:vartype name: str
914-
:ivar type: The type of the resource. Ex-
915-
Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
924+
:ivar type: The type of the resource. E.g.
925+
"Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
916926
:vartype type: str
917927
:param properties: Resource properties.
918928
:type properties:
@@ -1022,19 +1032,21 @@ def __init__(self, *, status=None, description: str=None, action_required: str=N
10221032

10231033

10241034
class ProxyResource(Resource):
1025-
"""The resource model definition for a ARM proxy resource. It will have
1026-
everything other than required location and tags.
1035+
"""Proxy Resource.
1036+
1037+
The resource model definition for a Azure Resource Manager proxy resource.
1038+
It will not have tags and a location.
10271039
10281040
Variables are only populated by the server, and will be ignored when
10291041
sending a request.
10301042
1031-
:ivar id: Fully qualified resource Id for the resource. Ex -
1043+
:ivar id: Fully qualified resource ID for the resource. Ex -
10321044
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
10331045
:vartype id: str
10341046
:ivar name: The name of the resource
10351047
:vartype name: str
1036-
:ivar type: The type of the resource. Ex-
1037-
Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
1048+
:ivar type: The type of the resource. E.g.
1049+
"Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
10381050
:vartype type: str
10391051
"""
10401052

@@ -1212,7 +1224,7 @@ class Sku(Model):
12121224
creation, optional for update.
12131225
:type name: str
12141226
:ivar tier: Gets the sku tier. This is based on the SKU name. Possible
1215-
values include: 'Free', 'Standard', 'Premium'
1227+
values include: 'Free', 'Standard', 'Premium', 'Enterprise'
12161228
:vartype tier: str or ~azure.mgmt.cognitiveservices.models.SkuTier
12171229
"""
12181230

@@ -1223,7 +1235,7 @@ class Sku(Model):
12231235

12241236
_attribute_map = {
12251237
'name': {'key': 'name', 'type': 'str'},
1226-
'tier': {'key': 'tier', 'type': 'SkuTier'},
1238+
'tier': {'key': 'tier', 'type': 'str'},
12271239
}
12281240

12291241
def __init__(self, *, name: str, **kwargs) -> None:
@@ -1253,20 +1265,23 @@ def __init__(self, *, name: str=None, value: str=None, **kwargs) -> None:
12531265

12541266

12551267
class TrackedResource(Resource):
1256-
"""The resource model definition for a ARM tracked top level resource.
1268+
"""Tracked Resource.
1269+
1270+
The resource model definition for an Azure Resource Manager tracked top
1271+
level resource which has 'tags' and a 'location'.
12571272
12581273
Variables are only populated by the server, and will be ignored when
12591274
sending a request.
12601275
12611276
All required parameters must be populated in order to send to Azure.
12621277
1263-
:ivar id: Fully qualified resource Id for the resource. Ex -
1278+
:ivar id: Fully qualified resource ID for the resource. Ex -
12641279
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
12651280
:vartype id: str
12661281
:ivar name: The name of the resource
12671282
:vartype name: str
1268-
:ivar type: The type of the resource. Ex-
1269-
Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
1283+
:ivar type: The type of the resource. E.g.
1284+
"Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
12701285
:vartype type: str
12711286
:param tags: Resource tags.
12721287
:type tags: dict[str, str]

0 commit comments

Comments
 (0)