Skip to content

Commit

Permalink
CodeGen from PR 14316 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
[Hub Generated] Review request for Microsoft.Maps to add version preview/2021-07-01-preview (Azure#14316)

* Adds base for updating Microsoft.Maps from version stable/2021-02-01 to version 2021-07-01-preview

* Updates readme

* Updates API version in new specs and examples

* managed identities

* updates based on design review

* fixes for examples

* adding description

* updated example request responses
  • Loading branch information
SDKAuto committed May 21, 2021
1 parent bdaea28 commit 52d392d
Show file tree
Hide file tree
Showing 9 changed files with 309 additions and 16 deletions.
2 changes: 1 addition & 1 deletion sdk/maps/azure-mgmt-maps/_meta.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"autorest": "V2",
"use": "@microsoft.azure/autorest.python@~4.0.71",
"commit": "5e6a5758c2bd7128984f131be88200cd4d2d1a17",
"commit": "bab6fe198f7b2bd46aaaa87380e60c6bb346f484",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/maps/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 [email protected]/autorest.python@~4.0.71 --version=V2",
"readme": "specification/maps/resource-manager/readme.md"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __init__(
super(AzureMapsManagementClient, 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 = '2021-02-01'
self.api_version = '2021-07-01-preview'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

Expand Down
11 changes: 11 additions & 0 deletions sdk/maps/azure-mgmt-maps/azure/mgmt/maps/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
from ._models_py3 import ErrorAdditionalInfo
from ._models_py3 import ErrorDetail
from ._models_py3 import ErrorResponse, ErrorResponseException
from ._models_py3 import LinkedResource
from ._models_py3 import ManagedServiceIdentity
from ._models_py3 import ManagedServiceIdentityUserAssignedIdentitiesValue
from ._models_py3 import MapsAccount
from ._models_py3 import MapsAccountKeys
from ._models_py3 import MapsAccountProperties
Expand All @@ -41,6 +44,9 @@
from ._models import ErrorAdditionalInfo
from ._models import ErrorDetail
from ._models import ErrorResponse, ErrorResponseException
from ._models import LinkedResource
from ._models import ManagedServiceIdentity
from ._models import ManagedServiceIdentityUserAssignedIdentitiesValue
from ._models import MapsAccount
from ._models import MapsAccountKeys
from ._models import MapsAccountProperties
Expand All @@ -62,6 +68,7 @@
Name,
Kind,
CreatedByType,
ResourceIdentityType,
KeyType,
)

Expand All @@ -74,6 +81,9 @@
'ErrorAdditionalInfo',
'ErrorDetail',
'ErrorResponse', 'ErrorResponseException',
'LinkedResource',
'ManagedServiceIdentity',
'ManagedServiceIdentityUserAssignedIdentitiesValue',
'MapsAccount',
'MapsAccountKeys',
'MapsAccountProperties',
Expand All @@ -94,5 +104,6 @@
'Name',
'Kind',
'CreatedByType',
'ResourceIdentityType',
'KeyType',
]
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ class CreatedByType(str, Enum):
key = "Key"


class ResourceIdentityType(str, Enum):

system_assigned = "SystemAssigned"
user_assigned = "UserAssigned"
system_assigned_user_assigned = "SystemAssigned, UserAssigned"
none = "None"


class KeyType(str, Enum):

primary = "primary"
Expand Down
141 changes: 139 additions & 2 deletions sdk/maps/azure-mgmt-maps/azure/mgmt/maps/models/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,17 +272,34 @@ class Dimension(Model):
:type name: str
:param display_name: Display name of dimension.
:type display_name: str
:param internal_name: Internal name of the dimension.
:type internal_name: str
:param internal_metric_name: Internal metric name of the dimension.
:type internal_metric_name: str
:param source_mdm_namespace: Source Mdm Namespace of the dimension.
:type source_mdm_namespace: str
:param to_be_exported_to_shoebox: Flag to indicate exporting to Azure
Monitor.
:type to_be_exported_to_shoebox: bool
"""

_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'display_name': {'key': 'displayName', 'type': 'str'},
'internal_name': {'key': 'internalName', 'type': 'str'},
'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'},
'source_mdm_namespace': {'key': 'sourceMdmNamespace', 'type': 'str'},
'to_be_exported_to_shoebox': {'key': 'toBeExportedToShoebox', 'type': 'bool'},
}

def __init__(self, **kwargs):
super(Dimension, self).__init__(**kwargs)
self.name = kwargs.get('name', None)
self.display_name = kwargs.get('display_name', None)
self.internal_name = kwargs.get('internal_name', None)
self.internal_metric_name = kwargs.get('internal_metric_name', None)
self.source_mdm_namespace = kwargs.get('source_mdm_namespace', None)
self.to_be_exported_to_shoebox = kwargs.get('to_be_exported_to_shoebox', None)


class ErrorAdditionalInfo(Model):
Expand Down Expand Up @@ -389,6 +406,106 @@ def __init__(self, deserialize, response, *args):
super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args)


class LinkedResource(Model):
"""Linked resource is reference to a resource deployed in an Azure
subscription, add the linked resource `uniqueName` value as an optional
parameter for operations on Azure Maps Geospatial REST APIs.
All required parameters must be populated in order to send to Azure.
:param unique_name: Required. A provided name which uniquely identifies
the linked resource.
:type unique_name: str
:param id: Required. ARM resource id in the form:
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/accounts/{storageName}'.
:type id: str
"""

_validation = {
'unique_name': {'required': True},
'id': {'required': True},
}

_attribute_map = {
'unique_name': {'key': 'uniqueName', 'type': 'str'},
'id': {'key': 'id', 'type': 'str'},
}

def __init__(self, **kwargs):
super(LinkedResource, self).__init__(**kwargs)
self.unique_name = kwargs.get('unique_name', None)
self.id = kwargs.get('id', None)


class ManagedServiceIdentity(Model):
"""Identity for the resource.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar principal_id: The principal ID of resource identity.
:vartype principal_id: str
:ivar tenant_id: The tenant ID of resource.
:vartype tenant_id: str
:param type: The identity type. Possible values include: 'SystemAssigned',
'UserAssigned', 'SystemAssigned, UserAssigned', 'None'
:type type: str or ~azure.mgmt.maps.models.ResourceIdentityType
:param user_assigned_identities: The list of user identities associated
with the resource. The user identity dictionary key references will be ARM
resource ids in the form:
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
:type user_assigned_identities: dict[str,
~azure.mgmt.maps.models.ManagedServiceIdentityUserAssignedIdentitiesValue]
"""

_validation = {
'principal_id': {'readonly': True},
'tenant_id': {'readonly': True},
}

_attribute_map = {
'principal_id': {'key': 'principalId', 'type': 'str'},
'tenant_id': {'key': 'tenantId', 'type': 'str'},
'type': {'key': 'type', 'type': 'ResourceIdentityType'},
'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ManagedServiceIdentityUserAssignedIdentitiesValue}'},
}

def __init__(self, **kwargs):
super(ManagedServiceIdentity, self).__init__(**kwargs)
self.principal_id = None
self.tenant_id = None
self.type = kwargs.get('type', None)
self.user_assigned_identities = kwargs.get('user_assigned_identities', None)


class ManagedServiceIdentityUserAssignedIdentitiesValue(Model):
"""ManagedServiceIdentityUserAssignedIdentitiesValue.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar principal_id: The principal id of user assigned identity.
:vartype principal_id: str
:ivar client_id: The client id of user assigned 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, **kwargs):
super(ManagedServiceIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs)
self.principal_id = None
self.client_id = None


class MapsAccount(TrackedResource):
"""An Azure resource which represents access to a suite of Maps REST APIs.
Expand Down Expand Up @@ -416,6 +533,8 @@ class MapsAccount(TrackedResource):
:type kind: str or ~azure.mgmt.maps.models.Kind
:ivar system_data: The system meta data relating to this resource.
:vartype system_data: ~azure.mgmt.maps.models.SystemData
:param identity: Sets the identity property for maps account.
:type identity: ~azure.mgmt.maps.models.ManagedServiceIdentity
:param properties: The map account properties.
:type properties: ~azure.mgmt.maps.models.MapsAccountProperties
"""
Expand All @@ -438,6 +557,7 @@ class MapsAccount(TrackedResource):
'sku': {'key': 'sku', 'type': 'Sku'},
'kind': {'key': 'kind', 'type': 'str'},
'system_data': {'key': 'systemData', 'type': 'SystemData'},
'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'},
'properties': {'key': 'properties', 'type': 'MapsAccountProperties'},
}

Expand All @@ -446,6 +566,7 @@ def __init__(self, **kwargs):
self.sku = kwargs.get('sku', None)
self.kind = kwargs.get('kind', "Gen1")
self.system_data = None
self.identity = kwargs.get('identity', None)
self.properties = kwargs.get('properties', None)


Expand Down Expand Up @@ -502,8 +623,12 @@ class MapsAccountProperties(Model):
disable Azure Maps local authentication support. This will disable Shared
Keys authentication from any usage. Default value: False .
:type disable_local_auth: bool
:ivar provisioning_state: the state of the provisioning.
:ivar provisioning_state: The provisioning state of the Map account
resource.
:vartype provisioning_state: str
:param linked_resources: Sets the resources to be used for Managed
Identities based operations for the Map account resource.
:type linked_resources: list[~azure.mgmt.maps.models.LinkedResource]
"""

_validation = {
Expand All @@ -515,13 +640,15 @@ class MapsAccountProperties(Model):
'unique_id': {'key': 'uniqueId', 'type': 'str'},
'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'},
'provisioning_state': {'key': 'provisioningState', 'type': 'str'},
'linked_resources': {'key': 'linkedResources', 'type': '[LinkedResource]'},
}

def __init__(self, **kwargs):
super(MapsAccountProperties, self).__init__(**kwargs)
self.unique_id = None
self.disable_local_auth = kwargs.get('disable_local_auth', False)
self.provisioning_state = None
self.linked_resources = kwargs.get('linked_resources', None)


class MapsAccountUpdateParameters(Model):
Expand All @@ -541,14 +668,20 @@ class MapsAccountUpdateParameters(Model):
:type kind: str or ~azure.mgmt.maps.models.Kind
:param sku: The SKU of this account.
:type sku: ~azure.mgmt.maps.models.Sku
:param identity: Sets the identity property for maps account.
:type identity: ~azure.mgmt.maps.models.ManagedServiceIdentity
:ivar unique_id: A unique identifier for the maps account
:vartype unique_id: str
:param disable_local_auth: Allows toggle functionality on Azure Policy to
disable Azure Maps local authentication support. This will disable Shared
Keys authentication from any usage. Default value: False .
:type disable_local_auth: bool
:ivar provisioning_state: the state of the provisioning.
:ivar provisioning_state: The provisioning state of the Map account
resource.
:vartype provisioning_state: str
:param linked_resources: Sets the resources to be used for Managed
Identities based operations for the Map account resource.
:type linked_resources: list[~azure.mgmt.maps.models.LinkedResource]
"""

_validation = {
Expand All @@ -560,19 +693,23 @@ class MapsAccountUpdateParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
'kind': {'key': 'kind', 'type': 'str'},
'sku': {'key': 'sku', 'type': 'Sku'},
'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'},
'unique_id': {'key': 'properties.uniqueId', 'type': 'str'},
'disable_local_auth': {'key': 'properties.disableLocalAuth', 'type': 'bool'},
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
'linked_resources': {'key': 'properties.linkedResources', 'type': '[LinkedResource]'},
}

def __init__(self, **kwargs):
super(MapsAccountUpdateParameters, self).__init__(**kwargs)
self.tags = kwargs.get('tags', None)
self.kind = kwargs.get('kind', "Gen1")
self.sku = kwargs.get('sku', None)
self.identity = kwargs.get('identity', None)
self.unique_id = None
self.disable_local_auth = kwargs.get('disable_local_auth', False)
self.provisioning_state = None
self.linked_resources = kwargs.get('linked_resources', None)


class MapsKeySpecification(Model):
Expand Down
Loading

0 comments on commit 52d392d

Please sign in to comment.