Skip to content

Commit b94fb2d

Browse files
msyycSDKAutoEduardo Coronado
authored
[T1] synapse 2020 12 17 (Azure#15838)
* CodeGen from PR 12042 in Azure/azure-rest-api-specs Add Encryption to Synapse Workspace Patch properties (Azure#12042) * Add Patch Workspace properties * Update UpdateWorkspace.json Co-authored-by: Eduardo Coronado <[email protected]> * test,version,CHANGELOG Co-authored-by: SDKAuto <[email protected]> Co-authored-by: Eduardo Coronado <[email protected]>
1 parent b1ae36e commit b94fb2d

File tree

5 files changed

+86
-27
lines changed

5 files changed

+86
-27
lines changed

sdk/synapse/azure-mgmt-synapse/CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Release History
22

3+
## 0.6.0 (2020-12-17)
4+
5+
**Features**
6+
7+
- Model DataMaskingPolicy has a new parameter managed_by
8+
- Model WorkspacePatchInfo has a new parameter encryption
9+
310
## 0.5.0 (2020-11-23)
411

512
**Features**

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

+9
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,8 @@ class DataMaskingPolicy(ProxyResource):
717717
:ivar kind: The kind of data masking policy. Metadata, used for Azure
718718
portal.
719719
:vartype kind: str
720+
:ivar managed_by: Fully qualified resource ID of the sql pool
721+
:vartype managed_by: str
720722
"""
721723

722724
_validation = {
@@ -728,6 +730,7 @@ class DataMaskingPolicy(ProxyResource):
728730
'masking_level': {'readonly': True},
729731
'location': {'readonly': True},
730732
'kind': {'readonly': True},
733+
'managed_by': {'readonly': True},
731734
}
732735

733736
_attribute_map = {
@@ -740,6 +743,7 @@ class DataMaskingPolicy(ProxyResource):
740743
'masking_level': {'key': 'properties.maskingLevel', 'type': 'str'},
741744
'location': {'key': 'location', 'type': 'str'},
742745
'kind': {'key': 'kind', 'type': 'str'},
746+
'managed_by': {'key': 'managedBy', 'type': 'str'},
743747
}
744748

745749
def __init__(self, **kwargs):
@@ -750,6 +754,7 @@ def __init__(self, **kwargs):
750754
self.masking_level = None
751755
self.location = None
752756
self.kind = None
757+
self.managed_by = None
753758

754759

755760
class DataMaskingRule(ProxyResource):
@@ -6582,6 +6587,8 @@ class WorkspacePatchInfo(Model):
65826587
~azure.mgmt.synapse.models.PurviewConfiguration
65836588
:ivar provisioning_state: Resource provisioning state
65846589
:vartype provisioning_state: str
6590+
:param encryption: The encryption details of the workspace
6591+
:type encryption: ~azure.mgmt.synapse.models.EncryptionDetails
65856592
"""
65866593

65876594
_validation = {
@@ -6596,6 +6603,7 @@ class WorkspacePatchInfo(Model):
65966603
'workspace_repository_configuration': {'key': 'properties.workspaceRepositoryConfiguration', 'type': 'WorkspaceRepositoryConfiguration'},
65976604
'purview_configuration': {'key': 'properties.purviewConfiguration', 'type': 'PurviewConfiguration'},
65986605
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
6606+
'encryption': {'key': 'properties.encryption', 'type': 'EncryptionDetails'},
65996607
}
66006608

66016609
def __init__(self, **kwargs):
@@ -6607,6 +6615,7 @@ def __init__(self, **kwargs):
66076615
self.workspace_repository_configuration = kwargs.get('workspace_repository_configuration', None)
66086616
self.purview_configuration = kwargs.get('purview_configuration', None)
66096617
self.provisioning_state = None
6618+
self.encryption = kwargs.get('encryption', None)
66106619

66116620

66126621
class WorkspaceRepositoryConfiguration(Model):

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

+10-1
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,8 @@ class DataMaskingPolicy(ProxyResource):
717717
:ivar kind: The kind of data masking policy. Metadata, used for Azure
718718
portal.
719719
:vartype kind: str
720+
:ivar managed_by: Fully qualified resource ID of the sql pool
721+
:vartype managed_by: str
720722
"""
721723

722724
_validation = {
@@ -728,6 +730,7 @@ class DataMaskingPolicy(ProxyResource):
728730
'masking_level': {'readonly': True},
729731
'location': {'readonly': True},
730732
'kind': {'readonly': True},
733+
'managed_by': {'readonly': True},
731734
}
732735

733736
_attribute_map = {
@@ -740,6 +743,7 @@ class DataMaskingPolicy(ProxyResource):
740743
'masking_level': {'key': 'properties.maskingLevel', 'type': 'str'},
741744
'location': {'key': 'location', 'type': 'str'},
742745
'kind': {'key': 'kind', 'type': 'str'},
746+
'managed_by': {'key': 'managedBy', 'type': 'str'},
743747
}
744748

745749
def __init__(self, *, data_masking_state, exempt_principals: str=None, **kwargs) -> None:
@@ -750,6 +754,7 @@ def __init__(self, *, data_masking_state, exempt_principals: str=None, **kwargs)
750754
self.masking_level = None
751755
self.location = None
752756
self.kind = None
757+
self.managed_by = None
753758

754759

755760
class DataMaskingRule(ProxyResource):
@@ -6582,6 +6587,8 @@ class WorkspacePatchInfo(Model):
65826587
~azure.mgmt.synapse.models.PurviewConfiguration
65836588
:ivar provisioning_state: Resource provisioning state
65846589
:vartype provisioning_state: str
6590+
:param encryption: The encryption details of the workspace
6591+
:type encryption: ~azure.mgmt.synapse.models.EncryptionDetails
65856592
"""
65866593

65876594
_validation = {
@@ -6596,9 +6603,10 @@ class WorkspacePatchInfo(Model):
65966603
'workspace_repository_configuration': {'key': 'properties.workspaceRepositoryConfiguration', 'type': 'WorkspaceRepositoryConfiguration'},
65976604
'purview_configuration': {'key': 'properties.purviewConfiguration', 'type': 'PurviewConfiguration'},
65986605
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
6606+
'encryption': {'key': 'properties.encryption', 'type': 'EncryptionDetails'},
65996607
}
66006608

6601-
def __init__(self, *, tags=None, identity=None, sql_administrator_login_password: str=None, managed_virtual_network_settings=None, workspace_repository_configuration=None, purview_configuration=None, **kwargs) -> None:
6609+
def __init__(self, *, tags=None, identity=None, sql_administrator_login_password: str=None, managed_virtual_network_settings=None, workspace_repository_configuration=None, purview_configuration=None, encryption=None, **kwargs) -> None:
66026610
super(WorkspacePatchInfo, self).__init__(**kwargs)
66036611
self.tags = tags
66046612
self.identity = identity
@@ -6607,6 +6615,7 @@ def __init__(self, *, tags=None, identity=None, sql_administrator_login_password
66076615
self.workspace_repository_configuration = workspace_repository_configuration
66086616
self.purview_configuration = purview_configuration
66096617
self.provisioning_state = None
6618+
self.encryption = encryption
66106619

66116620

66126621
class WorkspaceRepositoryConfiguration(Model):

sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspace_managed_identity_sql_control_settings_operations.py

+59-25
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
import uuid
1313
from msrest.pipeline import ClientRawResponse
14+
from msrest.polling import LROPoller, NoPolling
15+
from msrestazure.polling.arm_polling import ARMPolling
1416

1517
from .. import models
1618

@@ -101,32 +103,9 @@ def get(
101103
return deserialized
102104
get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/managedIdentitySqlControlSettings/default'}
103105

104-
def create_or_update(
105-
self, resource_group_name, workspace_name, grant_sql_control_to_managed_identity=None, custom_headers=None, raw=False, **operation_config):
106-
"""Create or update Managed Identity Sql Control Settings.
107106

108-
:param resource_group_name: The name of the resource group. The name
109-
is case insensitive.
110-
:type resource_group_name: str
111-
:param workspace_name: The name of the workspace
112-
:type workspace_name: str
113-
:param grant_sql_control_to_managed_identity: Grant sql control to
114-
managed identity
115-
:type grant_sql_control_to_managed_identity:
116-
~azure.mgmt.synapse.models.ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentity
117-
:param dict custom_headers: headers that will be added to the request
118-
:param bool raw: returns the direct response alongside the
119-
deserialized response
120-
:param operation_config: :ref:`Operation configuration
121-
overrides<msrest:optionsforoperations>`.
122-
:return: ManagedIdentitySqlControlSettingsModel or ClientRawResponse
123-
if raw=true
124-
:rtype:
125-
~azure.mgmt.synapse.models.ManagedIdentitySqlControlSettingsModel or
126-
~msrest.pipeline.ClientRawResponse
127-
:raises:
128-
:class:`ErrorContractException<azure.mgmt.synapse.models.ErrorContractException>`
129-
"""
107+
def _create_or_update_initial(
108+
self, resource_group_name, workspace_name, grant_sql_control_to_managed_identity=None, custom_headers=None, raw=False, **operation_config):
130109
managed_identity_sql_control_settings = models.ManagedIdentitySqlControlSettingsModel(grant_sql_control_to_managed_identity=grant_sql_control_to_managed_identity)
131110

132111
# Construct URL
@@ -164,6 +143,7 @@ def create_or_update(
164143
raise models.ErrorContractException(self._deserialize, response)
165144

166145
deserialized = None
146+
167147
if response.status_code == 200:
168148
deserialized = self._deserialize('ManagedIdentitySqlControlSettingsModel', response)
169149

@@ -172,4 +152,58 @@ def create_or_update(
172152
return client_raw_response
173153

174154
return deserialized
155+
156+
def create_or_update(
157+
self, resource_group_name, workspace_name, grant_sql_control_to_managed_identity=None, custom_headers=None, raw=False, polling=True, **operation_config):
158+
"""Create or update Managed Identity Sql Control Settings.
159+
160+
:param resource_group_name: The name of the resource group. The name
161+
is case insensitive.
162+
:type resource_group_name: str
163+
:param workspace_name: The name of the workspace
164+
:type workspace_name: str
165+
:param grant_sql_control_to_managed_identity: Grant sql control to
166+
managed identity
167+
:type grant_sql_control_to_managed_identity:
168+
~azure.mgmt.synapse.models.ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentity
169+
:param dict custom_headers: headers that will be added to the request
170+
:param bool raw: The poller return type is ClientRawResponse, the
171+
direct response alongside the deserialized response
172+
:param polling: True for ARMPolling, False for no polling, or a
173+
polling object for personal polling strategy
174+
:return: An instance of LROPoller that returns
175+
ManagedIdentitySqlControlSettingsModel or
176+
ClientRawResponse<ManagedIdentitySqlControlSettingsModel> if raw==True
177+
:rtype:
178+
~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.synapse.models.ManagedIdentitySqlControlSettingsModel]
179+
or
180+
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.synapse.models.ManagedIdentitySqlControlSettingsModel]]
181+
:raises:
182+
:class:`ErrorContractException<azure.mgmt.synapse.models.ErrorContractException>`
183+
"""
184+
raw_result = self._create_or_update_initial(
185+
resource_group_name=resource_group_name,
186+
workspace_name=workspace_name,
187+
grant_sql_control_to_managed_identity=grant_sql_control_to_managed_identity,
188+
custom_headers=custom_headers,
189+
raw=True,
190+
**operation_config
191+
)
192+
193+
def get_long_running_output(response):
194+
deserialized = self._deserialize('ManagedIdentitySqlControlSettingsModel', response)
195+
196+
if raw:
197+
client_raw_response = ClientRawResponse(deserialized, response)
198+
return client_raw_response
199+
200+
return deserialized
201+
202+
lro_delay = operation_config.get(
203+
'long_running_operation_timeout',
204+
self.config.long_running_operation_timeout)
205+
if polling is True: polling_method = ARMPolling(lro_delay, **operation_config)
206+
elif polling is False: polling_method = NoPolling()
207+
else: polling_method = polling
208+
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
175209
create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/managedIdentitySqlControlSettings/default'}

sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
# regenerated.
1010
# --------------------------------------------------------------------------
1111

12-
VERSION = "0.5.0"
12+
VERSION = "0.6.0"
1313

0 commit comments

Comments
 (0)