1# --------------------------------------------------------------------------------------------
2# Copyright (c) Microsoft Corporation. All rights reserved.
3# Licensed under the MIT License. See License.txt in the project root for license information.
4# --------------------------------------------------------------------------------------------
5from azure.cli.core.commands import CliCommandType
6
7
8# pylint: disable=line-too-long, too-many-statements, too-many-locals
9def load_command_table(self, _):
10    from ._client_factory import cf_synapse_client_workspace_factory
11    from ._client_factory import cf_synapse_client_operations_factory
12    from ._client_factory import cf_synapse_client_bigdatapool_factory
13    from ._client_factory import cf_synapse_client_sqlpool_factory
14    from ._client_factory import cf_synapse_client_ipfirewallrules_factory
15    from ._client_factory import cf_synapse_client_cmk_factory
16    from ._client_factory import cf_synapse_client_sqlpool_sensitivity_labels_factory
17    from ._client_factory import cf_synapse_client_restorable_dropped_sqlpools_factory
18    from ._client_factory import cf_synapse_client_sqlpool_transparent_data_encryptions_factory
19    from ._client_factory import cf_synapse_client_sqlpool_security_alert_policies_factory
20    from ._client_factory import cf_synapse_client_sqlpool_blob_auditing_policies_factory
21    from ._client_factory import cf_synapse_client_managed_identity_sqlcontrol_factory
22    from ._client_factory import cf_synapse_client_workspace_aad_admins_factory
23    from ._client_factory import cf_synapse_client_sqlserver_blob_auditing_policies_factory
24    from ._client_factory import cf_synapse_client_integrationruntimes_factory
25    from ._client_factory import cf_synapse_client_integrationruntimeauthkeys_factory
26    from ._client_factory import cf_synapse_client_integrationruntimemonitoringdata_factory
27    from ._client_factory import cf_synapse_client_integrationruntimenodeipaddress_factory
28    from ._client_factory import cf_synapse_client_integrationruntimenodes_factory
29    from ._client_factory import cf_synapse_client_integrationruntimecredentials_factory
30    from ._client_factory import cf_synapse_client_integrationruntimeconnectioninfos_factory
31    from ._client_factory import cf_synapse_client_integrationruntimestatus_factory
32
33    def get_custom_sdk(custom_module, client_factory):
34        return CliCommandType(
35            operations_tmpl='azure.cli.command_modules.synapse.operations.{}#'.format(custom_module) + '{}',
36            client_factory=client_factory,
37        )
38
39    synapse_workspace_sdk = CliCommandType(
40        operations_tmpl='azure.mgmt.synapse.operations#WorkspacesOperations.{}',
41        client_factory=cf_synapse_client_workspace_factory)
42
43    synapse_operations_sdk = CliCommandType(
44        operations_tmpl='azure.mgmt.synapse.operations#Operations.{}',
45        client_factory=cf_synapse_client_operations_factory)
46
47    synapse_bigdatapool_sdk = CliCommandType(
48        operations_tmpl='azure.mgmt.synapse.operations#BigDataPoolsOperations.{}',
49        client_factory=cf_synapse_client_bigdatapool_factory)
50
51    synapse_workspace_aad_admin_sdk = CliCommandType(
52        operations_tmpl='azure.mgmt.synapse.operations#WorkspaceAadAdminsOperations.{}'
53    )
54
55    synapse_sqlpool_sdk = CliCommandType(
56        operations_tmpl='azure.mgmt.synapse.operations#SqlPoolsOperations.{}',
57        client_factory=cf_synapse_client_sqlpool_factory)
58
59    # Classification operation
60    synapse_sqlpool_sensitivity_labels_sdk = CliCommandType(
61        operations_tmpl='azure.mgmt.synapse.operations#SqlPoolSensitivityLabelsOperations.{}',
62        client_factory=cf_synapse_client_sqlpool_sensitivity_labels_factory)
63
64    # List deleted
65    synapse_restorable_dropped_sqlpools_sdk = CliCommandType(
66        operations_tmpl='azure.mgmt.synapse.operations#RestorableDroppedSqlPoolsOperations.{}',
67        client_factory=cf_synapse_client_restorable_dropped_sqlpools_factory)
68
69    # Tde operation
70    synapse_sqlpool_transparent_data_encryptions_sdk = CliCommandType(
71        operations_tmpl='azure.mgmt.synapse.operations#SqlPoolTransparentDataEncryptionsOperations.{}',
72        client_factory=cf_synapse_client_sqlpool_transparent_data_encryptions_factory)
73
74    # Threat policy operation
75    synapse_sqlpool_security_alert_policies_sdk = CliCommandType(
76        operations_tmpl='azure.mgmt.synapse.operations#SqlPoolSecurityAlertPoliciesOperations.{}',
77        client_factory=cf_synapse_client_sqlpool_security_alert_policies_factory)
78
79    # Audit policy operation
80    synapse_sqlpool_blob_auditing_policies_sdk = CliCommandType(
81        operations_tmpl='azure.mgmt.synapse.operations#SqlPoolBlobAuditingPoliciesOperations.{}',
82        client_factory=cf_synapse_client_sqlpool_blob_auditing_policies_factory)
83
84    # Workspace managed sql server audit policy operation
85    synapse_workspace_managed_sqlserver_blob_auditing_policies_sdk = CliCommandType(
86        operations_tmpl='azure.mgmt.synapse.operations#WorkspaceManagedSqlServerBlobAuditingPoliciesOperations.{}',
87        client_factory=cf_synapse_client_sqlserver_blob_auditing_policies_factory)
88
89    synapse_firewallrules_sdk = CliCommandType(
90        operations_tmpl='azure.mgmt.synapse.operations#IpFirewallRulesOperations.{}',
91        client_factory=cf_synapse_client_ipfirewallrules_factory)
92
93    synapse_cmk_sdk = CliCommandType(
94        operations_tmpl='azure.mgmt.synapse.operations#KeysOperations.{}',
95        client_factory=cf_synapse_client_cmk_factory)
96
97    synapse_managedidentitysqlcontrol_sdk = CliCommandType(
98        operations_tmpl='azure.mgmt.synapse.operations#WorkspaceManagedIdentitySqlControlSettingsOperations.{}',
99        client_factory=cf_synapse_client_managed_identity_sqlcontrol_factory)
100
101    synapse_integrationruntimes_sdk = CliCommandType(
102        operations_tmpl='azure.mgmt.synapse.operations#IntegrationRuntimesOperations.{}',
103        client_factory=cf_synapse_client_integrationruntimes_factory)
104
105    synapse_integrationruntimeauthkeys_sdk = CliCommandType(
106        operations_tmpl='azure.mgmt.synapse.operations#IntegrationRuntimeAuthKeysOperations.{}',
107        client_factory=cf_synapse_client_integrationruntimeauthkeys_factory)
108
109    synapse_integrationruntimemonitoringdata_sdk = CliCommandType(
110        operations_tmpl='azure.mgmt.synapse.operations#IntegrationRuntimeMonitoringDataOperations.{}',
111        client_factory=cf_synapse_client_integrationruntimemonitoringdata_factory)
112
113    synapse_integrationruntimenodes_sdk = CliCommandType(
114        operations_tmpl='azure.mgmt.synapse.operations#IntegrationRuntimeNodesOperations.{}',
115        client_factory=cf_synapse_client_integrationruntimenodes_factory)
116
117    synapse_integrationruntimenodeipaddress_sdk = CliCommandType(
118        operations_tmpl='azure.mgmt.synapse.operations#IntegrationRuntimeNodeIpAddressOperations.{}',
119        client_factory=cf_synapse_client_integrationruntimenodeipaddress_factory)
120
121    synapse_integrationruntimecredentials_sdk = CliCommandType(
122        operations_tmpl='azure.mgmt.synapse.operations#IntegrationRuntimeCredentialsOperations.{}',
123        client_factory=cf_synapse_client_integrationruntimecredentials_factory)
124
125    synapse_integrationruntimeconnectioninfos_sdk = CliCommandType(
126        operations_tmpl='azure.mgmt.synapse.operations#IntegrationRuntimeConnectionInfosOperations.{}',
127        client_factory=cf_synapse_client_integrationruntimeconnectioninfos_factory)
128
129    synapse_integrationruntimestatus_sdk = CliCommandType(
130        operations_tmpl='azure.mgmt.synapse.operations#IntegrationRuntimeStatusOperations.{}',
131        client_factory=cf_synapse_client_integrationruntimestatus_factory)
132
133    synapse_spark_session_sdk = CliCommandType(
134        operations_tmpl='azure.synapse.spark.operations#SparkSessionOperations.{}',
135        client_factory=None)
136
137    synapse_spark_batch_sdk = CliCommandType(
138        operations_tmpl='azure.synapse.spark.operations#SparkBatchOperations.{}',
139        client_factory=None)
140
141    synapse_role_assignment_sdk = CliCommandType(
142        operations_tmpl='azure.synapse.accesscontrol.operations#RoleAssignmentsOperations.{}',
143        client_factory=None)
144
145    synapse_role_definitions_sdk = CliCommandType(
146        operations_tmpl='azure.synapse.accesscontrol.operations#RoleDefinitionsOperations.{}',
147        client_factory=None)
148
149    synapse_linked_service_sdk = CliCommandType(
150        operation_tmpl='azure.synapse.artifacts.operations#LinkedServiceOperations.{}',
151        client_factory=None)
152
153    synapse_dataset_sdk = CliCommandType(
154        operation_tmpl='azure.synapse.artifacts.operations#DatasetOperations.{}',
155        client_factory=None)
156
157    synapse_pipeline_sdk = CliCommandType(
158        operation_tmpl='azure.synapse.artifacts.operations#PipelineOperations.{}',
159        client_factory=None)
160
161    synapse_pipeline_run_sdk = CliCommandType(
162        operation_tmpl='azure.synapse.artifacts.operations#PipelineRunOperations.{}',
163        client_factory=None)
164
165    synapse_trigger_sdk = CliCommandType(
166        operations_tmpl='azure.synapse.artifacts.operations#TriggerOperations.{}',
167        client_factory=None)
168
169    synapse_data_flow_sdk = CliCommandType(
170        operation_tmpl='azure.synapse.artifacts.operations#DataFlowOperations.{}',
171        client_factory=None)
172
173    synapse_trigger_run_sdk = CliCommandType(
174        operation_tmpl='azure.synapse.artifacts.operations#TriggerRunOperations.{}',
175        client_factory=None)
176
177    synapse_notebook_sdk = CliCommandType(
178        operation_tmpl='azure.synapse.artifacts.operations#NotebookOperations.{}',
179        client_factory=None)
180
181    synapse_library_sdk = CliCommandType(
182        operation_tmpl='azure.synapse.artifacts.operations#LibraryOperations.{}',
183        client_factory=None)
184
185    synapse_managed_private_endpoints_sdk = CliCommandType(
186        operations_tmpl='azure.synapse.managedprivateendpoints.operations#ManagedPrivateEndpoints.{}',
187        client_factory=None)
188
189    synapse_spark_job_definition_sdk = CliCommandType(
190        operations_tmpl='azure.synapse.artifacts.operations#SparkJobDefinitionOperations.{}',
191        client_factory=None)
192
193    # Management Plane Commands --Workspace
194    with self.command_group('synapse workspace', command_type=synapse_workspace_sdk,
195                            custom_command_type=get_custom_sdk('workspace', cf_synapse_client_workspace_factory),
196                            client_factory=cf_synapse_client_workspace_factory) as g:
197        g.show_command('show', 'get')
198        g.custom_command('list', 'list_workspaces')
199        g.custom_command('create', 'create_workspace', supports_no_wait=True)
200        g.custom_command('update', 'update_workspace', supports_no_wait=True)
201        g.custom_command('check-name', 'custom_check_name_availability',
202                         command_type=synapse_operations_sdk,
203                         client_factory=cf_synapse_client_operations_factory)
204        g.command('delete', 'begin_delete', confirmation=True, supports_no_wait=True)
205        g.custom_command('activate', 'activate_workspace', command_type=synapse_cmk_sdk, client_factory=cf_synapse_client_cmk_factory, supports_no_wait=True)
206        g.wait_command('wait')
207
208    # Management Plane Commands --SparkPool
209    with self.command_group('synapse spark pool', command_type=synapse_bigdatapool_sdk,
210                            custom_command_type=get_custom_sdk('sparkpool', cf_synapse_client_bigdatapool_factory),
211                            client_factory=cf_synapse_client_bigdatapool_factory) as g:
212        g.custom_show_command('show', 'get_spark_pool')
213        g.command('list', 'list_by_workspace')
214        g.custom_command('create', 'create_spark_pool', supports_no_wait=True)
215        g.custom_command('update', 'update_spark_pool', supports_no_wait=True)
216        g.custom_command('delete', 'delete_spark_pool', confirmation=True, supports_no_wait=True)
217        g.wait_command('wait')
218
219    # Management Plane Commands --SqlPool
220    with self.command_group('synapse sql pool', command_type=synapse_sqlpool_sdk,
221                            custom_command_type=get_custom_sdk('sqlpool', cf_synapse_client_sqlpool_factory),
222                            client_factory=cf_synapse_client_sqlpool_factory) as g:
223        g.show_command('show', 'get')
224        g.command('list', 'list_by_workspace')
225        g.custom_command('create', 'create_sql_pool', supports_no_wait=True)
226        g.command('delete', 'begin_delete', confirmation=True, supports_no_wait=True)
227        g.custom_command('update', 'update_sql_pool')
228        g.command('pause', 'begin_pause')
229        g.command('resume', 'begin_resume')
230        g.custom_command('restore', 'restore_sql_pool')
231        g.custom_command('show-connection-string', 'sql_pool_show_connection_string')
232        g.wait_command('wait')
233
234    # Management Plane Commands --SqlPool list-deleted
235    with self.command_group('synapse sql pool', command_type=synapse_restorable_dropped_sqlpools_sdk,
236                            client_factory=cf_synapse_client_restorable_dropped_sqlpools_factory) as g:
237        g.command('list-deleted', 'list_by_workspace')
238
239    #  Management Plane Commands --SqlPool Classification
240    with self.command_group('synapse sql pool classification', command_type=synapse_sqlpool_sensitivity_labels_sdk,
241                            custom_command_type=get_custom_sdk('sqlpoolsensitivitylabel',
242                                                               cf_synapse_client_sqlpool_sensitivity_labels_factory),
243                            client_factory=cf_synapse_client_sqlpool_sensitivity_labels_factory) as g:
244        g.custom_show_command('show', 'sqlpool_sensitivity_label_show')
245        g.command('list', 'list_current')
246        g.custom_command('create', 'sqlpool_sensitivity_label_create')
247        g.command('delete', 'delete')
248        g.custom_command('update', 'sqlpool_sensitivity_label_update')
249
250    with self.command_group('synapse sql pool classification recommendation',
251                            command_type=synapse_sqlpool_sensitivity_labels_sdk,
252                            custom_command_type=get_custom_sdk('sqlpoolsensitivitylabel',
253                                                               cf_synapse_client_sqlpool_sensitivity_labels_factory),
254                            client_factory=cf_synapse_client_sqlpool_sensitivity_labels_factory) as g:
255        g.command('list', 'list_recommended')
256        g.command('enable', 'enable_recommendation')
257        g.command('disable', 'disable_recommendation')
258
259    #  Management Plane Commands --SqlPool Tde
260    with self.command_group('synapse sql pool tde', command_type=synapse_sqlpool_transparent_data_encryptions_sdk,
261                            custom_command_type=get_custom_sdk('sqlpooltde',
262                                                               cf_synapse_client_sqlpool_transparent_data_encryptions_factory),
263                            client_factory=cf_synapse_client_sqlpool_transparent_data_encryptions_factory) as g:
264        g.custom_command('set', 'create_or_update')
265        g.show_command('show', 'get')
266
267    #  Management Plane Commands --SqlPool Threat-policy
268    with self.command_group('synapse sql pool threat-policy', command_type=synapse_sqlpool_security_alert_policies_sdk,
269                            custom_command_type=get_custom_sdk('sqlpoolsecurityalertpolicy',
270                                                               cf_synapse_client_sqlpool_security_alert_policies_factory),
271                            client_factory=cf_synapse_client_sqlpool_security_alert_policies_factory) as g:
272        g.show_command('show', 'get')
273        g.generic_update_command('update', custom_func_name='sqlpool_security_alert_policy_update')
274
275    #  Management Plane Commands --SqlPool Audit-policy
276    with self.command_group('synapse sql pool audit-policy', command_type=synapse_sqlpool_blob_auditing_policies_sdk,
277                            custom_command_type=get_custom_sdk('sqlpoolblobauditingpolicy',
278                                                               cf_synapse_client_sqlpool_blob_auditing_policies_factory),
279                            client_factory=cf_synapse_client_sqlpool_blob_auditing_policies_factory) as g:
280        g.custom_show_command('show', 'sqlpool_audit_policy_show')
281        g.generic_update_command('update', custom_func_name='sqlpool_blob_auditing_policy_update')
282
283    # Management Plane Commands --Sql Ad-Admin
284    with self.command_group('synapse sql ad-admin', command_type=synapse_workspace_aad_admin_sdk,
285                            custom_command_type=get_custom_sdk('workspacesqlaadadmin',
286                                                               cf_synapse_client_workspace_aad_admins_factory),
287                            client_factory=cf_synapse_client_workspace_aad_admins_factory) as g:
288        g.show_command('show', 'get')
289        g.custom_command('create', 'create_workspace_sql_aad_admin', supports_no_wait=True)
290        g.generic_update_command('update', setter_name='begin_create_or_update', custom_func_name='update_workspace_sql_aad_admin',
291                                 setter_arg_name='aad_admin_info', supports_no_wait=True)
292        g.command('delete', 'begin_delete', confirmation=True, supports_no_wait=True)
293        g.wait_command('wait')
294
295    # Management Plane Commands --Sql audit-policy
296    with self.command_group('synapse sql audit-policy',
297                            command_type=synapse_workspace_managed_sqlserver_blob_auditing_policies_sdk,
298                            custom_command_type=get_custom_sdk('sqlpoolblobauditingpolicy',
299                                                               cf_synapse_client_sqlserver_blob_auditing_policies_factory),
300                            client_factory=cf_synapse_client_sqlserver_blob_auditing_policies_factory) as g:
301        g.custom_show_command('show', 'workspace_audit_policy_show')
302        g.generic_update_command('update', setter_name='begin_create_or_update', custom_func_name='sqlserver_blob_auditing_policy_update',
303                                 supports_no_wait=True)
304        g.wait_command('wait')
305
306    # Management Plane Commands --FirewallRule
307    with self.command_group('synapse workspace firewall-rule', command_type=synapse_firewallrules_sdk,
308                            custom_command_type=get_custom_sdk('workspace', cf_synapse_client_ipfirewallrules_factory),
309                            client_factory=cf_synapse_client_ipfirewallrules_factory) as g:
310        g.command('list', 'list_by_workspace')
311        g.show_command('show', 'get')
312        g.custom_command('create', 'create_firewall_rule', supports_no_wait=True)
313        g.custom_command('update', 'update_firewall_rule', supports_no_wait=True)
314        g.command('delete', 'begin_delete', confirmation=True, supports_no_wait=True)
315        g.wait_command('wait')
316
317    # Management Plane Commands --IntegrationRuntime
318    with self.command_group('synapse integration-runtime', command_type=synapse_integrationruntimes_sdk,
319                            custom_command_type=get_custom_sdk('integrationruntime', cf_synapse_client_integrationruntimes_factory),
320                            client_factory=cf_synapse_client_integrationruntimes_factory) as g:
321        g.command('list', 'list_by_workspace')
322        g.show_command('show', 'get')
323        g.custom_command('create', 'create', deprecate_info=g.deprecate(redirect='managed create, self-hosted create'), supports_no_wait=True)
324        g.custom_command('managed create', 'Managed_Create', supports_no_wait=True)
325        g.custom_command('self-hosted create', 'Selfhosted_Create', supports_no_wait=True)
326        g.command('delete', 'begin_delete', confirmation=True, supports_no_wait=True)
327        g.custom_command('update', 'update')
328        g.command('start', 'begin_start', supports_no_wait=True)
329        g.command('stop', 'begin_stop', confirmation=True, supports_no_wait=True)
330        g.command('upgrade', 'upgrade')
331        g.command('list-auth-key', 'list', command_type=synapse_integrationruntimeauthkeys_sdk,
332                  client_factory=cf_synapse_client_integrationruntimeauthkeys_factory)
333        g.custom_command('regenerate-auth-key', 'regenerate', command_type=synapse_integrationruntimeauthkeys_sdk,
334                         client_factory=cf_synapse_client_integrationruntimeauthkeys_factory)
335        g.command('get-monitoring-data', 'list', command_type=synapse_integrationruntimemonitoringdata_sdk,
336                  client_factory=cf_synapse_client_integrationruntimemonitoringdata_factory)
337        g.command('sync-credentials', 'sync', command_type=synapse_integrationruntimecredentials_sdk,
338                  client_factory=cf_synapse_client_integrationruntimecredentials_factory)
339        g.command('get-connection-info', 'get', command_type=synapse_integrationruntimeconnectioninfos_sdk,
340                  client_factory=cf_synapse_client_integrationruntimeconnectioninfos_factory)
341        g.command('get-status', 'get', command_type=synapse_integrationruntimestatus_sdk,
342                  client_factory=cf_synapse_client_integrationruntimestatus_factory)
343        g.wait_command('wait')
344
345    # Management Plane Commands --Keys
346    with self.command_group('synapse workspace key', command_type=synapse_cmk_sdk,
347                            custom_command_type=get_custom_sdk('workspace', cf_synapse_client_cmk_factory),
348                            client_factory=cf_synapse_client_cmk_factory) as g:
349        g.command('list', 'list_by_workspace')
350        g.show_command('show', 'get')
351        g.custom_command('create', 'create_workspace_key', supports_no_wait=True)
352        g.command('delete', 'delete', confirmation=True, supports_no_wait=True)
353        g.wait_command('wait')
354
355    # Management Plane Commands --Managed-Identity
356    with self.command_group('synapse workspace managed-identity', command_type=synapse_managedidentitysqlcontrol_sdk,
357                            custom_command_type=get_custom_sdk('workspace', cf_synapse_client_managed_identity_sqlcontrol_factory),
358                            client_factory=cf_synapse_client_managed_identity_sqlcontrol_factory) as g:
359        g.show_command('show-sql-access', 'get')
360        g.custom_command('grant-sql-access', 'grant_sql_access_to_managed_identity', supports_no_wait=True)
361        g.custom_command('revoke-sql-access', 'revoke_sql_access_to_managed_identity', supports_no_wait=True)
362        g.wait_command('wait')
363
364    with self.command_group('synapse integration-runtime-node', command_type=synapse_integrationruntimenodes_sdk,
365                            custom_command_type=get_custom_sdk('integrationruntimenode',
366                                                               cf_synapse_client_integrationruntimenodes_factory),
367                            client_factory=cf_synapse_client_integrationruntimenodes_factory) as g:
368        g.show_command('show', 'get')
369        g.custom_command('update', 'update')
370        g.command('delete', 'delete', confirmation=True)
371        g.command('get-ip-address', 'get', command_type=synapse_integrationruntimenodeipaddress_sdk,
372                  client_factory=cf_synapse_client_integrationruntimenodeipaddress_factory)
373
374    # Data Plane Commands --Spark batch opertions
375    with self.command_group('synapse spark job', command_type=synapse_spark_batch_sdk,
376                            custom_command_type=get_custom_sdk('spark', None)) as g:
377        g.custom_command('submit', 'create_spark_batch_job')
378        g.custom_command('list', 'list_spark_batch_jobs')
379        g.custom_show_command('show', 'get_spark_batch_job')
380        g.custom_command('cancel', 'cancel_spark_batch_job', confirmation=True)
381
382    # Data Plane Commands --Spark session operations
383    with self.command_group('synapse spark session', synapse_spark_session_sdk,
384                            custom_command_type=get_custom_sdk('spark', None)) as g:
385        g.custom_command('create', 'create_spark_session_job')
386        g.custom_command('list', 'list_spark_session_jobs')
387        g.custom_show_command('show', 'get_spark_session_job')
388        g.custom_command('cancel', 'cancel_spark_session_job', confirmation=True)
389        g.custom_command('reset-timeout', 'reset_timeout')
390
391    # Data Plane Commands --Spark session statements operations
392    with self.command_group('synapse spark statement', synapse_spark_session_sdk,
393                            custom_command_type=get_custom_sdk('spark', None)) as g:
394        g.custom_command('invoke', 'create_spark_session_statement')
395        g.custom_command('list', 'list_spark_session_statements')
396        g.custom_show_command('show', 'get_spark_session_statement')
397        g.custom_command('cancel', 'cancel_spark_session_statement', confirmation=True)
398
399    # Data Plane Commands --Access control operations
400    with self.command_group('synapse role assignment', synapse_role_assignment_sdk,
401                            custom_command_type=get_custom_sdk('accesscontrol', None)) as g:
402        g.custom_command('create', 'create_role_assignment')
403        g.custom_command('list', 'list_role_assignments')
404        g.custom_show_command('show', 'get_role_assignment_by_id')
405        g.custom_command('delete', 'delete_role_assignment', confirmation=True)
406
407    with self.command_group('synapse role definition', synapse_role_definitions_sdk,
408                            custom_command_type=get_custom_sdk('accesscontrol', None)) as g:
409        g.custom_command('list', 'list_role_definitions')
410        g.custom_show_command('show', 'get_role_definition')
411
412    with self.command_group('synapse role scope', synapse_role_definitions_sdk,
413                            custom_command_type=get_custom_sdk('accesscontrol', None)) as g:
414        g.custom_command('list', 'list_scopes')
415
416    # Data Plane Commands --Artifacts Linked service operations
417    with self.command_group('synapse linked-service', synapse_linked_service_sdk,
418                            custom_command_type=get_custom_sdk('artifacts', None)) as g:
419        g.custom_command('create', 'create_or_update_linked_service', supports_no_wait=True)
420        g.custom_command('set', 'create_or_update_linked_service', deprecate_info=g.deprecate(redirect='update'), supports_no_wait=True)
421        g.custom_command('update', 'create_or_update_linked_service', supports_no_wait=True)
422        g.custom_command('list', 'list_linked_service')
423        g.custom_show_command('show', 'get_linked_service')
424        g.custom_command('delete', 'delete_linked_service', confirmation=True, supports_no_wait=True)
425
426    # Data Plane Commands --Artifacts dataset operations
427    with self.command_group('synapse dataset', synapse_dataset_sdk,
428                            custom_command_type=get_custom_sdk('artifacts', None)) as g:
429        g.custom_command('create', 'create_or_update_dataset', supports_no_wait=True)
430        g.custom_command('set', 'create_or_update_dataset', deprecate_info=g.deprecate(redirect='update'), supports_no_wait=True)
431        g.custom_command('update', 'create_or_update_dataset', supports_no_wait=True)
432        g.custom_command('list', 'list_datasets')
433        g.custom_show_command('show', 'get_dataset')
434        g.custom_command('delete', 'delete_dataset', confirmation=True, supports_no_wait=True)
435
436    # Data Plane Commands --Artifacts pipeline operations
437    with self.command_group('synapse pipeline', synapse_pipeline_sdk,
438                            custom_command_type=get_custom_sdk('artifacts', None)) as g:
439        g.custom_command('create', 'create_or_update_pipeline', supports_no_wait=True)
440        g.custom_command('set', 'create_or_update_pipeline', deprecate_info=g.deprecate(redirect='update'), supports_no_wait=True)
441        g.custom_command('update', 'create_or_update_pipeline', supports_no_wait=True)
442        g.custom_command('list', 'list_pipelines')
443        g.custom_show_command('show', 'get_pipeline')
444        g.custom_command('delete', 'delete_pipeline', confirmation=True, supports_no_wait=True)
445        g.custom_command('create-run', 'create_pipeline_run')
446
447    # Data Plane Commands --Artifacts pipeline run operations
448    with self.command_group('synapse pipeline-run', synapse_pipeline_run_sdk,
449                            custom_command_type=get_custom_sdk('artifacts', None)) as g:
450        g.custom_command('query-by-workspace', 'query_pipeline_runs_by_workspace')
451        g.custom_show_command('show', 'get_pipeline_run')
452        g.custom_command('cancel', 'cancel_pipeline_run', confirmation=True)
453
454    with self.command_group('synapse activity-run', synapse_pipeline_run_sdk,
455                            custom_command_type=get_custom_sdk('artifacts', None)) as g:
456        g.custom_command('query-by-pipeline-run', 'query_activity_runs')
457
458    # Data Plane Commands --Artifacts trigger operations
459    with self.command_group('synapse trigger', synapse_trigger_sdk,
460                            custom_command_type=get_custom_sdk('artifacts', None)) as g:
461        g.custom_command('create', 'create_or_update_trigger', supports_no_wait=True)
462        g.custom_command('set', 'create_or_update_trigger', deprecate_info=g.deprecate(redirect='update'), supports_no_wait=True)
463        g.custom_command('update', 'create_or_update_trigger', supports_no_wait=True)
464        g.custom_command('list', 'list_triggers')
465        g.custom_show_command('show', 'get_trigger')
466        g.custom_command('delete', 'delete_trigger', confirmation=True, supports_no_wait=True)
467        g.custom_command('subscribe-to-event', 'subscribe_trigger_to_events', supports_no_wait=True)
468        g.custom_command('get-event-subscription-status', 'get_event_subscription_status')
469        g.custom_command('unsubscribe-from-event', 'unsubscribe_trigger_from_events', supports_no_wait=True)
470        g.custom_command('start', 'start_trigger', supports_no_wait=True)
471        g.custom_command('stop', 'stop_trigger', supports_no_wait=True)
472        g.custom_wait_command('wait', 'get_trigger')
473
474    # Data Plane Commands --Artifacts trigger run operations
475    with self.command_group('synapse trigger-run', synapse_trigger_run_sdk,
476                            custom_command_type=get_custom_sdk('artifacts', None)) as g:
477        g.custom_command('rerun', 'rerun_trigger')
478        g.custom_command('cancel', 'cancel_trigger')
479        g.custom_command('query-by-workspace', 'query_trigger_runs_by_workspace')
480
481    # Data Plane Commands --Artifacts data flow operations
482    with self.command_group('synapse data-flow', synapse_data_flow_sdk,
483                            custom_command_type=get_custom_sdk('artifacts', None)) as g:
484        g.custom_command('create', 'create_or_update_data_flow', supports_no_wait=True)
485        g.custom_command('set', 'create_or_update_data_flow', supports_no_wait=True)
486        g.custom_command('list', 'list_data_flows')
487        g.custom_show_command('show', 'get_data_flow')
488        g.custom_command('delete', 'delete_data_flow', confirmation=True, supports_no_wait=True)
489
490    # Data Plane Commands --Artifacts notebook operations
491    with self.command_group('synapse notebook', synapse_notebook_sdk,
492                            custom_command_type=get_custom_sdk('artifacts', None)) as g:
493        g.custom_command('create', 'create_or_update_notebook', supports_no_wait=True)
494        g.custom_command('set', 'create_or_update_notebook', supports_no_wait=True)
495        g.custom_command('import', 'create_or_update_notebook', supports_no_wait=True)
496        g.custom_command('list', 'list_notebooks')
497        g.custom_show_command('show', 'get_notebook')
498        g.custom_command('export', 'export_notebook')
499        g.custom_command('delete', 'delete_notebook', confirmation=True, supports_no_wait=True)
500
501    # Data Plane Commands --Artifacts library operations
502    with self.command_group('synapse workspace-package', synapse_library_sdk,
503                            custom_command_type=get_custom_sdk('artifacts', None)) as g:
504        g.custom_command('upload', 'upload_workspace_package')
505        g.custom_command('upload-batch', 'workspace_package_upload_batch')
506        g.custom_command('list', 'list_workspace_package')
507        g.custom_show_command('show', 'get_workspace_package')
508        g.custom_command('delete', 'delete_workspace_package', confirmation=True, supports_no_wait=True)
509
510    # Data Plane Commands --Managed private endpoints operations
511    with self.command_group('synapse managed-private-endpoints', synapse_managed_private_endpoints_sdk,
512                            custom_command_type=get_custom_sdk('managedprivateendpoints', None)) as g:
513        g.custom_show_command('show', 'get_Managed_private_endpoints')
514        g.custom_command('create', 'create_Managed_private_endpoints')
515        g.custom_command('list', 'list_Managed_private_endpoints')
516        g.custom_command('delete', 'delete_Managed_private_endpoints', confirmation=True)
517
518    # Data Plane Commands --Artifacts Spark job definitions operations
519    with self.command_group('synapse spark-job-definition', synapse_spark_job_definition_sdk,
520                            custom_command_type=get_custom_sdk('artifacts', None)) as g:
521        g.custom_command('list', 'list_spark_job_definition')
522        g.custom_show_command('show', 'get_spark_job_definition')
523        g.custom_command('delete', 'delete_spark_job_definition', supports_no_wait=True)
524        g.custom_command('create', 'create_or_update_spark_job_definition', supports_no_wait=True)
525        g.custom_wait_command('wait', 'get_spark_job_definition')
526        g.custom_command('update', 'create_or_update_spark_job_definition', supports_no_wait=True)
527
528    with self.command_group('synapse', is_preview=True):
529        pass
530