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-sql] SQL - Add Resource Identity swagger to common v2 #5616

Closed
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
2 changes: 1 addition & 1 deletion sdk/sql/azure-mgmt-sql/_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": "9107915e46d1f46b5f1eeacecc8bc1eb20898c79",
"commit": "9e2dd033ffa11043d8e8ecd0aa131697625bae1b",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/sql/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 --use=@microsoft.azure/autorest.python@~4.0.71 --version=V2",
"readme": "specification/sql/resource-manager/readme.md"
Expand Down
3 changes: 3 additions & 0 deletions sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@
from ._models_py3 import RecoverableManagedDatabase
from ._models_py3 import ReplicationLink
from ._models_py3 import Resource
from ._models_py3 import ResourceIdentity
from ._models_py3 import ResourceIdentityWithUserAssignedIdentities
from ._models_py3 import ResourceMoveDefinition
from ._models_py3 import ResourceWithWritableName
Expand Down Expand Up @@ -418,6 +419,7 @@
from ._models import RecoverableManagedDatabase
from ._models import ReplicationLink
from ._models import Resource
from ._models import ResourceIdentity
from ._models import ResourceIdentityWithUserAssignedIdentities
from ._models import ResourceMoveDefinition
from ._models import ResourceWithWritableName
Expand Down Expand Up @@ -870,6 +872,7 @@
'RecoverableManagedDatabase',
'ReplicationLink',
'Resource',
'ResourceIdentity',
'ResourceIdentityWithUserAssignedIdentities',
'ResourceMoveDefinition',
'ResourceWithWritableName',
Expand Down
61 changes: 49 additions & 12 deletions sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5996,8 +5996,7 @@ class ManagedInstance(TrackedResource):
:type tags: dict[str, str]
:param identity: The Azure Active Directory identity of the managed
instance.
:type identity:
~azure.mgmt.sql.models.ResourceIdentityWithUserAssignedIdentities
:type identity: ~azure.mgmt.sql.models.ResourceIdentity
:param sku: Managed instance SKU. Allowed values for sku.name: GP_Gen4,
GP_Gen5, BC_Gen4, BC_Gen5
:type sku: ~azure.mgmt.sql.models.Sku
Expand Down Expand Up @@ -6121,7 +6120,7 @@ class ManagedInstance(TrackedResource):
'type': {'key': 'type', 'type': 'str'},
'location': {'key': 'location', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
'identity': {'key': 'identity', 'type': 'ResourceIdentityWithUserAssignedIdentities'},
'identity': {'key': 'identity', 'type': 'ResourceIdentity'},
'sku': {'key': 'sku', 'type': 'Sku'},
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
'managed_instance_create_mode': {'key': 'properties.managedInstanceCreateMode', 'type': 'str'},
Expand Down Expand Up @@ -7164,8 +7163,7 @@ class ManagedInstanceUpdate(Model):
:param sku: Managed instance sku
:type sku: ~azure.mgmt.sql.models.Sku
:param identity: Managed instance identity
:type identity:
~azure.mgmt.sql.models.ResourceIdentityWithUserAssignedIdentities
:type identity: ~azure.mgmt.sql.models.ResourceIdentity
:ivar provisioning_state: Possible values include: 'Creating', 'Deleting',
'Updating', 'Unknown', 'Succeeded', 'Failed'
:vartype provisioning_state: str or ~azure.mgmt.sql.models.enum
Expand Down Expand Up @@ -7280,7 +7278,7 @@ class ManagedInstanceUpdate(Model):

_attribute_map = {
'sku': {'key': 'sku', 'type': 'Sku'},
'identity': {'key': 'identity', 'type': 'ResourceIdentityWithUserAssignedIdentities'},
'identity': {'key': 'identity', 'type': 'ResourceIdentity'},
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
'managed_instance_create_mode': {'key': 'properties.managedInstanceCreateMode', 'type': 'str'},
'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'},
Expand Down Expand Up @@ -9428,6 +9426,47 @@ def __init__(self, **kwargs):
self.link_type = None


class ResourceIdentity(Model):
"""Azure Active Directory identity configuration for a resource.

Variables are only populated by the server, and will be ignored when
sending a request.

:param user_assigned_identities: The resource ids of the user assigned
identities to use
:type user_assigned_identities: dict[str,
~azure.mgmt.sql.models.UserIdentity]
:ivar principal_id: The Azure Active Directory principal id.
:vartype principal_id: str
:param type: The identity type. Set this to 'SystemAssigned' in order to
automatically create and assign an Azure Active Directory principal for
the resource. Possible values include: 'None', 'SystemAssigned',
'UserAssigned'
:type type: str or ~azure.mgmt.sql.models.IdentityType
:ivar tenant_id: The Azure Active Directory tenant id.
:vartype tenant_id: str
"""

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

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

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


class ResourceIdentityWithUserAssignedIdentities(Model):
"""Azure Active Directory identity configuration for a resource.

Expand Down Expand Up @@ -10014,8 +10053,7 @@ class Server(TrackedResource):
:param tags: Resource tags.
:type tags: dict[str, str]
:param identity: The Azure Active Directory identity of the server.
:type identity:
~azure.mgmt.sql.models.ResourceIdentityWithUserAssignedIdentities
:type identity: ~azure.mgmt.sql.models.ResourceIdentity
:ivar kind: Kind of sql server. This is metadata used for the Azure portal
experience.
:vartype kind: str
Expand Down Expand Up @@ -10076,7 +10114,7 @@ class Server(TrackedResource):
'type': {'key': 'type', 'type': 'str'},
'location': {'key': 'location', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
'identity': {'key': 'identity', 'type': 'ResourceIdentityWithUserAssignedIdentities'},
'identity': {'key': 'identity', 'type': 'ResourceIdentity'},
'kind': {'key': 'kind', 'type': 'str'},
'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'},
'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'},
Expand Down Expand Up @@ -11077,8 +11115,7 @@ class ServerUpdate(Model):
sending a request.

:param identity: Server identity
:type identity:
~azure.mgmt.sql.models.ResourceIdentityWithUserAssignedIdentities
:type identity: ~azure.mgmt.sql.models.ResourceIdentity
:param administrator_login: Administrator username for the server. Once
created it cannot be changed.
:type administrator_login: str
Expand Down Expand Up @@ -11128,7 +11165,7 @@ class ServerUpdate(Model):
}

_attribute_map = {
'identity': {'key': 'identity', 'type': 'ResourceIdentityWithUserAssignedIdentities'},
'identity': {'key': 'identity', 'type': 'ResourceIdentity'},
'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'},
'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'},
'version': {'key': 'properties.version', 'type': 'str'},
Expand Down
61 changes: 49 additions & 12 deletions sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models_py3.py
Original file line number Diff line number Diff line change
Expand Up @@ -5996,8 +5996,7 @@ class ManagedInstance(TrackedResource):
:type tags: dict[str, str]
:param identity: The Azure Active Directory identity of the managed
instance.
:type identity:
~azure.mgmt.sql.models.ResourceIdentityWithUserAssignedIdentities
:type identity: ~azure.mgmt.sql.models.ResourceIdentity
:param sku: Managed instance SKU. Allowed values for sku.name: GP_Gen4,
GP_Gen5, BC_Gen4, BC_Gen5
:type sku: ~azure.mgmt.sql.models.Sku
Expand Down Expand Up @@ -6121,7 +6120,7 @@ class ManagedInstance(TrackedResource):
'type': {'key': 'type', 'type': 'str'},
'location': {'key': 'location', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
'identity': {'key': 'identity', 'type': 'ResourceIdentityWithUserAssignedIdentities'},
'identity': {'key': 'identity', 'type': 'ResourceIdentity'},
'sku': {'key': 'sku', 'type': 'Sku'},
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
'managed_instance_create_mode': {'key': 'properties.managedInstanceCreateMode', 'type': 'str'},
Expand Down Expand Up @@ -7164,8 +7163,7 @@ class ManagedInstanceUpdate(Model):
:param sku: Managed instance sku
:type sku: ~azure.mgmt.sql.models.Sku
:param identity: Managed instance identity
:type identity:
~azure.mgmt.sql.models.ResourceIdentityWithUserAssignedIdentities
:type identity: ~azure.mgmt.sql.models.ResourceIdentity
:ivar provisioning_state: Possible values include: 'Creating', 'Deleting',
'Updating', 'Unknown', 'Succeeded', 'Failed'
:vartype provisioning_state: str or ~azure.mgmt.sql.models.enum
Expand Down Expand Up @@ -7280,7 +7278,7 @@ class ManagedInstanceUpdate(Model):

_attribute_map = {
'sku': {'key': 'sku', 'type': 'Sku'},
'identity': {'key': 'identity', 'type': 'ResourceIdentityWithUserAssignedIdentities'},
'identity': {'key': 'identity', 'type': 'ResourceIdentity'},
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
'managed_instance_create_mode': {'key': 'properties.managedInstanceCreateMode', 'type': 'str'},
'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'},
Expand Down Expand Up @@ -9428,6 +9426,47 @@ def __init__(self, **kwargs) -> None:
self.link_type = None


class ResourceIdentity(Model):
"""Azure Active Directory identity configuration for a resource.

Variables are only populated by the server, and will be ignored when
sending a request.

:param user_assigned_identities: The resource ids of the user assigned
identities to use
:type user_assigned_identities: dict[str,
~azure.mgmt.sql.models.UserIdentity]
:ivar principal_id: The Azure Active Directory principal id.
:vartype principal_id: str
:param type: The identity type. Set this to 'SystemAssigned' in order to
automatically create and assign an Azure Active Directory principal for
the resource. Possible values include: 'None', 'SystemAssigned',
'UserAssigned'
:type type: str or ~azure.mgmt.sql.models.IdentityType
:ivar tenant_id: The Azure Active Directory tenant id.
:vartype tenant_id: str
"""

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

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

def __init__(self, *, user_assigned_identities=None, type=None, **kwargs) -> None:
super(ResourceIdentity, self).__init__(**kwargs)
self.user_assigned_identities = user_assigned_identities
self.principal_id = None
self.type = type
self.tenant_id = None


class ResourceIdentityWithUserAssignedIdentities(Model):
"""Azure Active Directory identity configuration for a resource.

Expand Down Expand Up @@ -10014,8 +10053,7 @@ class Server(TrackedResource):
:param tags: Resource tags.
:type tags: dict[str, str]
:param identity: The Azure Active Directory identity of the server.
:type identity:
~azure.mgmt.sql.models.ResourceIdentityWithUserAssignedIdentities
:type identity: ~azure.mgmt.sql.models.ResourceIdentity
:ivar kind: Kind of sql server. This is metadata used for the Azure portal
experience.
:vartype kind: str
Expand Down Expand Up @@ -10076,7 +10114,7 @@ class Server(TrackedResource):
'type': {'key': 'type', 'type': 'str'},
'location': {'key': 'location', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
'identity': {'key': 'identity', 'type': 'ResourceIdentityWithUserAssignedIdentities'},
'identity': {'key': 'identity', 'type': 'ResourceIdentity'},
'kind': {'key': 'kind', 'type': 'str'},
'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'},
'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'},
Expand Down Expand Up @@ -11077,8 +11115,7 @@ class ServerUpdate(Model):
sending a request.

:param identity: Server identity
:type identity:
~azure.mgmt.sql.models.ResourceIdentityWithUserAssignedIdentities
:type identity: ~azure.mgmt.sql.models.ResourceIdentity
:param administrator_login: Administrator username for the server. Once
created it cannot be changed.
:type administrator_login: str
Expand Down Expand Up @@ -11128,7 +11165,7 @@ class ServerUpdate(Model):
}

_attribute_map = {
'identity': {'key': 'identity', 'type': 'ResourceIdentityWithUserAssignedIdentities'},
'identity': {'key': 'identity', 'type': 'ResourceIdentity'},
'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'},
'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'},
'version': {'key': 'properties.version', 'type': 'str'},
Expand Down