azure_mgmt_synapse 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse.rb +154 -0
  4. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/big_data_pools.rb +842 -0
  5. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/ip_firewall_rules.rb +728 -0
  6. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/auto_pause_properties.rb +61 -0
  7. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/auto_scale_properties.rb +73 -0
  8. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/available_rp_operation.rb +94 -0
  9. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/available_rp_operation_display_info.rb +79 -0
  10. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/azure_entity_resource.rb +75 -0
  11. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/big_data_pool_patch_info.rb +56 -0
  12. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/big_data_pool_resource_info.rb +219 -0
  13. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/big_data_pool_resource_info_list_result.rb +98 -0
  14. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/blob_auditing_policy_state.rb +16 -0
  15. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/check_name_availability_request.rb +59 -0
  16. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/check_name_availability_response.rb +81 -0
  17. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/column_data_type.rb +48 -0
  18. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/create_sql_pool_restore_point_definition.rb +47 -0
  19. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/data_lake_storage_account_details.rb +57 -0
  20. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/data_warehouse_user_activities.rb +74 -0
  21. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/error_additional_info.rb +59 -0
  22. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/error_contract.rb +49 -0
  23. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/error_detail.rb +68 -0
  24. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/error_response.rb +113 -0
  25. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/geo_backup_policy.rb +112 -0
  26. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/geo_backup_policy_state.rb +16 -0
  27. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/ip_firewall_rule_info.rb +100 -0
  28. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/ip_firewall_rule_info_list_result.rb +98 -0
  29. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/ip_firewall_rule_properties.rb +73 -0
  30. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/library_requirements.rb +72 -0
  31. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/managed_identity.rb +72 -0
  32. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/managed_identity_sql_control_settings_model.rb +78 -0
  33. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/managed_identity_sql_control_settings_model_properties_grant_sql_control_to_managed_identity.rb +62 -0
  34. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/management_operation_state.rb +20 -0
  35. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/metadata_sync_config.rb +76 -0
  36. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/node_size.rb +18 -0
  37. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/node_size_family.rb +16 -0
  38. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/operation_meta_log_specification.rb +68 -0
  39. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/operation_meta_metric_dimension_specification.rb +69 -0
  40. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/operation_meta_metric_specification.rb +167 -0
  41. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/operation_meta_service_specification.rb +77 -0
  42. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/operation_resource.rb +125 -0
  43. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/operation_status.rb +18 -0
  44. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/provisioning_state.rb +19 -0
  45. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/proxy_resource.rb +63 -0
  46. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/query_aggregation_function.rb +18 -0
  47. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/query_execution_type.rb +19 -0
  48. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/query_interval.rb +83 -0
  49. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/query_metric.rb +85 -0
  50. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/query_metric_unit.rb +17 -0
  51. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/query_observed_metric_type.rb +19 -0
  52. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/query_statistic.rb +68 -0
  53. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/replace_all_firewall_rules_operation_response.rb +46 -0
  54. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/replace_all_ip_firewall_rules_request.rb +56 -0
  55. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/replication_link.rb +206 -0
  56. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/replication_link_list_result.rb +100 -0
  57. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/replication_role.rb +19 -0
  58. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/replication_state.rb +18 -0
  59. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/resource.rb +83 -0
  60. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/resource_identity_type.rb +16 -0
  61. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/resource_move_definition.rb +46 -0
  62. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/restore_point.rb +125 -0
  63. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/restore_point_list_result.rb +100 -0
  64. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/restore_point_type.rb +16 -0
  65. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/security_alert_policy_state.rb +17 -0
  66. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sensitivity_label.rb +121 -0
  67. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sensitivity_label_list_result.rb +100 -0
  68. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sku.rb +59 -0
  69. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool.rb +199 -0
  70. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_blob_auditing_policy.rb +269 -0
  71. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_blob_auditing_policy_sql_pool_operation_list_result.rb +102 -0
  72. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_column.rb +79 -0
  73. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_column_list_result.rb +100 -0
  74. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_connection_policy.rb +163 -0
  75. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_info_list_result.rb +98 -0
  76. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_operation.rb +233 -0
  77. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_patch_info.rb +178 -0
  78. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_schema.rb +62 -0
  79. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_schema_list_result.rb +100 -0
  80. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_security_alert_policy.rb +179 -0
  81. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_table.rb +62 -0
  82. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_table_list_result.rb +100 -0
  83. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_usage.rb +120 -0
  84. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_usage_list_result.rb +99 -0
  85. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_vulnerability_assessment.rb +115 -0
  86. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_vulnerability_assessment_list_result.rb +101 -0
  87. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_vulnerability_assessment_rule_baseline.rb +84 -0
  88. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_vulnerability_assessment_rule_baseline_item.rb +56 -0
  89. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_vulnerability_assessment_scans_export.rb +76 -0
  90. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/top_queries.rb +152 -0
  91. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/top_queries_list_result.rb +55 -0
  92. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/tracked_resource.rb +92 -0
  93. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/transparent_data_encryption.rb +88 -0
  94. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/transparent_data_encryption_status.rb +16 -0
  95. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/virtual_network_profile.rb +46 -0
  96. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/vulnerability_assessment_policy_baseline_name.rb +16 -0
  97. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/vulnerability_assessment_recurring_scans_properties.rb +80 -0
  98. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/vulnerability_assessment_scan_error.rb +59 -0
  99. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/vulnerability_assessment_scan_record.rb +169 -0
  100. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/vulnerability_assessment_scan_record_list_result.rb +102 -0
  101. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/vulnerability_assessment_scan_state.rb +18 -0
  102. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/vulnerability_assessment_scan_trigger_type.rb +16 -0
  103. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/workspace.rb +188 -0
  104. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/workspace_aad_admin_info.rb +108 -0
  105. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/workspace_info_list_result.rb +98 -0
  106. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/workspace_patch_info.rb +89 -0
  107. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/module_definition.rb +9 -0
  108. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/operations.rb +457 -0
  109. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_blob_auditing_policies.rb +275 -0
  110. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_connection_policies.rb +138 -0
  111. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_data_warehouse_user_activities.rb +141 -0
  112. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_geo_backup_policies.rb +138 -0
  113. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_metadata_sync_configs.rb +263 -0
  114. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_operation_results.rb +131 -0
  115. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_operations.rb +260 -0
  116. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_replication_links.rb +259 -0
  117. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_restore_points.rb +439 -0
  118. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_schemas.rb +267 -0
  119. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_security_alert_policies.rb +275 -0
  120. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_sensitivity_labels.rb +992 -0
  121. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_table_columns.rb +277 -0
  122. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_tables.rb +272 -0
  123. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_transparent_data_encryptions.rb +275 -0
  124. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_usages.rb +259 -0
  125. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_vulnerability_assessment_rule_baselines.rb +276 -0
  126. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_vulnerability_assessment_scans.rb +536 -0
  127. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_vulnerability_assessments.rb +608 -0
  128. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pools.rb +1248 -0
  129. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/synapse_management_client.rb +237 -0
  130. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/workspace_aad_admins.rb +432 -0
  131. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/workspace_managed_identity_sql_control_settings.rb +246 -0
  132. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/workspaces.rb +1026 -0
  133. data/lib/azure_mgmt_synapse.rb +6 -0
  134. data/lib/module_definition.rb +7 -0
  135. data/lib/profiles/latest/modules/synapse_profile_module.rb +515 -0
  136. data/lib/profiles/latest/synapse_latest_profile_client.rb +40 -0
  137. data/lib/profiles/latest/synapse_module_definition.rb +8 -0
  138. data/lib/version.rb +7 -0
  139. metadata +254 -0
@@ -0,0 +1,275 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::Synapse::Mgmt::V2019_06_01_preview
7
+ #
8
+ # Azure Synapse Analytics Management Client
9
+ #
10
+ class SqlPoolSecurityAlertPolicies
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the SqlPoolSecurityAlertPolicies class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [SynapseManagementClient] reference to the SynapseManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Get a Sql pool's security alert policy
26
+ #
27
+ # Get a Sql pool's security alert policy.
28
+ #
29
+ # @param resource_group_name [String] The name of the resource group. The name
30
+ # is case insensitive.
31
+ # @param workspace_name [String] The name of the workspace
32
+ # @param sql_pool_name [String] SQL pool name
33
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
34
+ # will be added to the HTTP request.
35
+ #
36
+ # @return [SqlPoolSecurityAlertPolicy] operation results.
37
+ #
38
+ def get(resource_group_name, workspace_name, sql_pool_name, custom_headers:nil)
39
+ response = get_async(resource_group_name, workspace_name, sql_pool_name, custom_headers:custom_headers).value!
40
+ response.body unless response.nil?
41
+ end
42
+
43
+ #
44
+ # Get a Sql pool's security alert policy
45
+ #
46
+ # Get a Sql pool's security alert policy.
47
+ #
48
+ # @param resource_group_name [String] The name of the resource group. The name
49
+ # is case insensitive.
50
+ # @param workspace_name [String] The name of the workspace
51
+ # @param sql_pool_name [String] SQL pool name
52
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
53
+ # will be added to the HTTP request.
54
+ #
55
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
56
+ #
57
+ def get_with_http_info(resource_group_name, workspace_name, sql_pool_name, custom_headers:nil)
58
+ get_async(resource_group_name, workspace_name, sql_pool_name, custom_headers:custom_headers).value!
59
+ end
60
+
61
+ #
62
+ # Get a Sql pool's security alert policy
63
+ #
64
+ # Get a Sql pool's security alert policy.
65
+ #
66
+ # @param resource_group_name [String] The name of the resource group. The name
67
+ # is case insensitive.
68
+ # @param workspace_name [String] The name of the workspace
69
+ # @param sql_pool_name [String] SQL pool name
70
+ # @param [Hash{String => String}] A hash of custom headers that will be added
71
+ # to the HTTP request.
72
+ #
73
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
74
+ #
75
+ def get_async(resource_group_name, workspace_name, sql_pool_name, custom_headers:nil)
76
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
77
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
78
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
79
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
80
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
81
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
82
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
83
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
84
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
85
+ fail ArgumentError, 'sql_pool_name is nil' if sql_pool_name.nil?
86
+ security_alert_policy_name = 'default'
87
+
88
+
89
+ request_headers = {}
90
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
91
+
92
+ # Set Headers
93
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
94
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
95
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/securityAlertPolicies/{securityAlertPolicyName}'
96
+
97
+ request_url = @base_url || @client.base_url
98
+
99
+ options = {
100
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
101
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'sqlPoolName' => sql_pool_name,'securityAlertPolicyName' => security_alert_policy_name},
102
+ query_params: {'api-version' => @client.api_version},
103
+ headers: request_headers.merge(custom_headers || {}),
104
+ base_url: request_url
105
+ }
106
+ promise = @client.make_request_async(:get, path_template, options)
107
+
108
+ promise = promise.then do |result|
109
+ http_response = result.response
110
+ status_code = http_response.status
111
+ response_content = http_response.body
112
+ unless status_code == 200
113
+ error_model = JSON.load(response_content)
114
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
115
+ end
116
+
117
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
118
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
119
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
120
+ # Deserialize Response
121
+ if status_code == 200
122
+ begin
123
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
124
+ result_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::SqlPoolSecurityAlertPolicy.mapper()
125
+ result.body = @client.deserialize(result_mapper, parsed_response)
126
+ rescue Exception => e
127
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
128
+ end
129
+ end
130
+
131
+ result
132
+ end
133
+
134
+ promise.execute
135
+ end
136
+
137
+ #
138
+ # Create or update a Sql pool's security alert policy
139
+ #
140
+ # Create or update a Sql pool's security alert policy.
141
+ #
142
+ # @param resource_group_name [String] The name of the resource group. The name
143
+ # is case insensitive.
144
+ # @param workspace_name [String] The name of the workspace
145
+ # @param sql_pool_name [String] SQL pool name
146
+ # @param parameters [SqlPoolSecurityAlertPolicy] The Sql pool security alert
147
+ # policy.
148
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
149
+ # will be added to the HTTP request.
150
+ #
151
+ # @return [SqlPoolSecurityAlertPolicy] operation results.
152
+ #
153
+ def create_or_update(resource_group_name, workspace_name, sql_pool_name, parameters, custom_headers:nil)
154
+ response = create_or_update_async(resource_group_name, workspace_name, sql_pool_name, parameters, custom_headers:custom_headers).value!
155
+ response.body unless response.nil?
156
+ end
157
+
158
+ #
159
+ # Create or update a Sql pool's security alert policy
160
+ #
161
+ # Create or update a Sql pool's security alert policy.
162
+ #
163
+ # @param resource_group_name [String] The name of the resource group. The name
164
+ # is case insensitive.
165
+ # @param workspace_name [String] The name of the workspace
166
+ # @param sql_pool_name [String] SQL pool name
167
+ # @param parameters [SqlPoolSecurityAlertPolicy] The Sql pool security alert
168
+ # policy.
169
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
170
+ # will be added to the HTTP request.
171
+ #
172
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
173
+ #
174
+ def create_or_update_with_http_info(resource_group_name, workspace_name, sql_pool_name, parameters, custom_headers:nil)
175
+ create_or_update_async(resource_group_name, workspace_name, sql_pool_name, parameters, custom_headers:custom_headers).value!
176
+ end
177
+
178
+ #
179
+ # Create or update a Sql pool's security alert policy
180
+ #
181
+ # Create or update a Sql pool's security alert policy.
182
+ #
183
+ # @param resource_group_name [String] The name of the resource group. The name
184
+ # is case insensitive.
185
+ # @param workspace_name [String] The name of the workspace
186
+ # @param sql_pool_name [String] SQL pool name
187
+ # @param parameters [SqlPoolSecurityAlertPolicy] The Sql pool security alert
188
+ # policy.
189
+ # @param [Hash{String => String}] A hash of custom headers that will be added
190
+ # to the HTTP request.
191
+ #
192
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
193
+ #
194
+ def create_or_update_async(resource_group_name, workspace_name, sql_pool_name, parameters, custom_headers:nil)
195
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
196
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
197
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
198
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
199
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
200
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
201
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
202
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
203
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
204
+ fail ArgumentError, 'sql_pool_name is nil' if sql_pool_name.nil?
205
+ security_alert_policy_name = 'default'
206
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
207
+
208
+
209
+ request_headers = {}
210
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
211
+
212
+ # Set Headers
213
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
214
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
215
+
216
+ # Serialize Request
217
+ request_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::SqlPoolSecurityAlertPolicy.mapper()
218
+ request_content = @client.serialize(request_mapper, parameters)
219
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
220
+
221
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/securityAlertPolicies/{securityAlertPolicyName}'
222
+
223
+ request_url = @base_url || @client.base_url
224
+
225
+ options = {
226
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
227
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'sqlPoolName' => sql_pool_name,'securityAlertPolicyName' => security_alert_policy_name},
228
+ query_params: {'api-version' => @client.api_version},
229
+ body: request_content,
230
+ headers: request_headers.merge(custom_headers || {}),
231
+ base_url: request_url
232
+ }
233
+ promise = @client.make_request_async(:put, path_template, options)
234
+
235
+ promise = promise.then do |result|
236
+ http_response = result.response
237
+ status_code = http_response.status
238
+ response_content = http_response.body
239
+ unless status_code == 200 || status_code == 201
240
+ error_model = JSON.load(response_content)
241
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
242
+ end
243
+
244
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
245
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
246
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
247
+ # Deserialize Response
248
+ if status_code == 200
249
+ begin
250
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
251
+ result_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::SqlPoolSecurityAlertPolicy.mapper()
252
+ result.body = @client.deserialize(result_mapper, parsed_response)
253
+ rescue Exception => e
254
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
255
+ end
256
+ end
257
+ # Deserialize Response
258
+ if status_code == 201
259
+ begin
260
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
261
+ result_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::SqlPoolSecurityAlertPolicy.mapper()
262
+ result.body = @client.deserialize(result_mapper, parsed_response)
263
+ rescue Exception => e
264
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
265
+ end
266
+ end
267
+
268
+ result
269
+ end
270
+
271
+ promise.execute
272
+ end
273
+
274
+ end
275
+ end
@@ -0,0 +1,992 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::Synapse::Mgmt::V2019_06_01_preview
7
+ #
8
+ # Azure Synapse Analytics Management Client
9
+ #
10
+ class SqlPoolSensitivityLabels
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the SqlPoolSensitivityLabels class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [SynapseManagementClient] reference to the SynapseManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Gets SQL pool sensitivity labels
26
+ #
27
+ # Gets SQL pool sensitivity labels.
28
+ #
29
+ # @param resource_group_name [String] The name of the resource group. The name
30
+ # is case insensitive.
31
+ # @param workspace_name [String] The name of the workspace
32
+ # @param sql_pool_name [String] SQL pool name
33
+ # @param filter [String] An OData filter expression that filters elements in
34
+ # the collection.
35
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
36
+ # will be added to the HTTP request.
37
+ #
38
+ # @return [Array<SensitivityLabel>] operation results.
39
+ #
40
+ def list_current(resource_group_name, workspace_name, sql_pool_name, filter:nil, custom_headers:nil)
41
+ first_page = list_current_as_lazy(resource_group_name, workspace_name, sql_pool_name, filter:filter, custom_headers:custom_headers)
42
+ first_page.get_all_items
43
+ end
44
+
45
+ #
46
+ # Gets SQL pool sensitivity labels
47
+ #
48
+ # Gets SQL pool sensitivity labels.
49
+ #
50
+ # @param resource_group_name [String] The name of the resource group. The name
51
+ # is case insensitive.
52
+ # @param workspace_name [String] The name of the workspace
53
+ # @param sql_pool_name [String] SQL pool name
54
+ # @param filter [String] An OData filter expression that filters elements in
55
+ # the collection.
56
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
57
+ # will be added to the HTTP request.
58
+ #
59
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
60
+ #
61
+ def list_current_with_http_info(resource_group_name, workspace_name, sql_pool_name, filter:nil, custom_headers:nil)
62
+ list_current_async(resource_group_name, workspace_name, sql_pool_name, filter:filter, custom_headers:custom_headers).value!
63
+ end
64
+
65
+ #
66
+ # Gets SQL pool sensitivity labels
67
+ #
68
+ # Gets SQL pool sensitivity labels.
69
+ #
70
+ # @param resource_group_name [String] The name of the resource group. The name
71
+ # is case insensitive.
72
+ # @param workspace_name [String] The name of the workspace
73
+ # @param sql_pool_name [String] SQL pool name
74
+ # @param filter [String] An OData filter expression that filters elements in
75
+ # the collection.
76
+ # @param [Hash{String => String}] A hash of custom headers that will be added
77
+ # to the HTTP request.
78
+ #
79
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
80
+ #
81
+ def list_current_async(resource_group_name, workspace_name, sql_pool_name, filter:nil, custom_headers:nil)
82
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
83
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
84
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
85
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
86
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
87
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
88
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
89
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
90
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
91
+ fail ArgumentError, 'sql_pool_name is nil' if sql_pool_name.nil?
92
+
93
+
94
+ request_headers = {}
95
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
96
+
97
+ # Set Headers
98
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
99
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
100
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/currentSensitivityLabels'
101
+
102
+ request_url = @base_url || @client.base_url
103
+
104
+ options = {
105
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
106
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'sqlPoolName' => sql_pool_name},
107
+ query_params: {'api-version' => @client.api_version,'$filter' => filter},
108
+ headers: request_headers.merge(custom_headers || {}),
109
+ base_url: request_url
110
+ }
111
+ promise = @client.make_request_async(:get, path_template, options)
112
+
113
+ promise = promise.then do |result|
114
+ http_response = result.response
115
+ status_code = http_response.status
116
+ response_content = http_response.body
117
+ unless status_code == 200
118
+ error_model = JSON.load(response_content)
119
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
120
+ end
121
+
122
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
123
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
124
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
125
+ # Deserialize Response
126
+ if status_code == 200
127
+ begin
128
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
129
+ result_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::SensitivityLabelListResult.mapper()
130
+ result.body = @client.deserialize(result_mapper, parsed_response)
131
+ rescue Exception => e
132
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
133
+ end
134
+ end
135
+
136
+ result
137
+ end
138
+
139
+ promise.execute
140
+ end
141
+
142
+ #
143
+ # Gets sensitivity labels of a given SQL pool
144
+ #
145
+ # Gets sensitivity labels of a given SQL pool.
146
+ #
147
+ # @param resource_group_name [String] The name of the resource group. The name
148
+ # is case insensitive.
149
+ # @param workspace_name [String] The name of the workspace
150
+ # @param sql_pool_name [String] SQL pool name
151
+ # @param include_disabled_recommendations [Boolean] Specifies whether to
152
+ # include disabled recommendations or not.
153
+ # @param skip_token [String] An OData query option to indicate how many
154
+ # elements to skip in the collection.
155
+ # @param filter [String] An OData filter expression that filters elements in
156
+ # the collection.
157
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
158
+ # will be added to the HTTP request.
159
+ #
160
+ # @return [Array<SensitivityLabel>] operation results.
161
+ #
162
+ def list_recommended(resource_group_name, workspace_name, sql_pool_name, include_disabled_recommendations:nil, skip_token:nil, filter:nil, custom_headers:nil)
163
+ first_page = list_recommended_as_lazy(resource_group_name, workspace_name, sql_pool_name, include_disabled_recommendations:include_disabled_recommendations, skip_token:skip_token, filter:filter, custom_headers:custom_headers)
164
+ first_page.get_all_items
165
+ end
166
+
167
+ #
168
+ # Gets sensitivity labels of a given SQL pool
169
+ #
170
+ # Gets sensitivity labels of a given SQL pool.
171
+ #
172
+ # @param resource_group_name [String] The name of the resource group. The name
173
+ # is case insensitive.
174
+ # @param workspace_name [String] The name of the workspace
175
+ # @param sql_pool_name [String] SQL pool name
176
+ # @param include_disabled_recommendations [Boolean] Specifies whether to
177
+ # include disabled recommendations or not.
178
+ # @param skip_token [String] An OData query option to indicate how many
179
+ # elements to skip in the collection.
180
+ # @param filter [String] An OData filter expression that filters elements in
181
+ # the collection.
182
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
183
+ # will be added to the HTTP request.
184
+ #
185
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
186
+ #
187
+ def list_recommended_with_http_info(resource_group_name, workspace_name, sql_pool_name, include_disabled_recommendations:nil, skip_token:nil, filter:nil, custom_headers:nil)
188
+ list_recommended_async(resource_group_name, workspace_name, sql_pool_name, include_disabled_recommendations:include_disabled_recommendations, skip_token:skip_token, filter:filter, custom_headers:custom_headers).value!
189
+ end
190
+
191
+ #
192
+ # Gets sensitivity labels of a given SQL pool
193
+ #
194
+ # Gets sensitivity labels of a given SQL pool.
195
+ #
196
+ # @param resource_group_name [String] The name of the resource group. The name
197
+ # is case insensitive.
198
+ # @param workspace_name [String] The name of the workspace
199
+ # @param sql_pool_name [String] SQL pool name
200
+ # @param include_disabled_recommendations [Boolean] Specifies whether to
201
+ # include disabled recommendations or not.
202
+ # @param skip_token [String] An OData query option to indicate how many
203
+ # elements to skip in the collection.
204
+ # @param filter [String] An OData filter expression that filters elements in
205
+ # the collection.
206
+ # @param [Hash{String => String}] A hash of custom headers that will be added
207
+ # to the HTTP request.
208
+ #
209
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
210
+ #
211
+ def list_recommended_async(resource_group_name, workspace_name, sql_pool_name, include_disabled_recommendations:nil, skip_token:nil, filter:nil, custom_headers:nil)
212
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
213
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
214
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
215
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
216
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
217
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
218
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
219
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
220
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
221
+ fail ArgumentError, 'sql_pool_name is nil' if sql_pool_name.nil?
222
+
223
+
224
+ request_headers = {}
225
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
226
+
227
+ # Set Headers
228
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
229
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
230
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/recommendedSensitivityLabels'
231
+
232
+ request_url = @base_url || @client.base_url
233
+
234
+ options = {
235
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
236
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'sqlPoolName' => sql_pool_name},
237
+ query_params: {'api-version' => @client.api_version,'includeDisabledRecommendations' => include_disabled_recommendations,'$skipToken' => skip_token,'$filter' => filter},
238
+ headers: request_headers.merge(custom_headers || {}),
239
+ base_url: request_url
240
+ }
241
+ promise = @client.make_request_async(:get, path_template, options)
242
+
243
+ promise = promise.then do |result|
244
+ http_response = result.response
245
+ status_code = http_response.status
246
+ response_content = http_response.body
247
+ unless status_code == 200
248
+ error_model = JSON.load(response_content)
249
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
250
+ end
251
+
252
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
253
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
254
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
255
+ # Deserialize Response
256
+ if status_code == 200
257
+ begin
258
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
259
+ result_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::SensitivityLabelListResult.mapper()
260
+ result.body = @client.deserialize(result_mapper, parsed_response)
261
+ rescue Exception => e
262
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
263
+ end
264
+ end
265
+
266
+ result
267
+ end
268
+
269
+ promise.execute
270
+ end
271
+
272
+ #
273
+ # Creates or updates the sensitivity label of a given column in a Sql pool
274
+ #
275
+ # @param resource_group_name [String] The name of the resource group. The name
276
+ # is case insensitive.
277
+ # @param workspace_name [String] The name of the workspace
278
+ # @param sql_pool_name [String] SQL pool name
279
+ # @param schema_name [String] The name of the schema.
280
+ # @param table_name [String] The name of the table.
281
+ # @param column_name [String] The name of the column.
282
+ # @param parameters [SensitivityLabel] The column sensitivity label resource.
283
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
284
+ # will be added to the HTTP request.
285
+ #
286
+ # @return [SensitivityLabel] operation results.
287
+ #
288
+ def create_or_update(resource_group_name, workspace_name, sql_pool_name, schema_name, table_name, column_name, parameters, custom_headers:nil)
289
+ response = create_or_update_async(resource_group_name, workspace_name, sql_pool_name, schema_name, table_name, column_name, parameters, custom_headers:custom_headers).value!
290
+ response.body unless response.nil?
291
+ end
292
+
293
+ #
294
+ # Creates or updates the sensitivity label of a given column in a Sql pool
295
+ #
296
+ # @param resource_group_name [String] The name of the resource group. The name
297
+ # is case insensitive.
298
+ # @param workspace_name [String] The name of the workspace
299
+ # @param sql_pool_name [String] SQL pool name
300
+ # @param schema_name [String] The name of the schema.
301
+ # @param table_name [String] The name of the table.
302
+ # @param column_name [String] The name of the column.
303
+ # @param parameters [SensitivityLabel] The column sensitivity label resource.
304
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
305
+ # will be added to the HTTP request.
306
+ #
307
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
308
+ #
309
+ def create_or_update_with_http_info(resource_group_name, workspace_name, sql_pool_name, schema_name, table_name, column_name, parameters, custom_headers:nil)
310
+ create_or_update_async(resource_group_name, workspace_name, sql_pool_name, schema_name, table_name, column_name, parameters, custom_headers:custom_headers).value!
311
+ end
312
+
313
+ #
314
+ # Creates or updates the sensitivity label of a given column in a Sql pool
315
+ #
316
+ # @param resource_group_name [String] The name of the resource group. The name
317
+ # is case insensitive.
318
+ # @param workspace_name [String] The name of the workspace
319
+ # @param sql_pool_name [String] SQL pool name
320
+ # @param schema_name [String] The name of the schema.
321
+ # @param table_name [String] The name of the table.
322
+ # @param column_name [String] The name of the column.
323
+ # @param parameters [SensitivityLabel] The column sensitivity label resource.
324
+ # @param [Hash{String => String}] A hash of custom headers that will be added
325
+ # to the HTTP request.
326
+ #
327
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
328
+ #
329
+ def create_or_update_async(resource_group_name, workspace_name, sql_pool_name, schema_name, table_name, column_name, parameters, custom_headers:nil)
330
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
331
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
332
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
333
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
334
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
335
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
336
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
337
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
338
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
339
+ fail ArgumentError, 'sql_pool_name is nil' if sql_pool_name.nil?
340
+ fail ArgumentError, 'schema_name is nil' if schema_name.nil?
341
+ fail ArgumentError, 'table_name is nil' if table_name.nil?
342
+ fail ArgumentError, 'column_name is nil' if column_name.nil?
343
+ sensitivity_label_source = 'current'
344
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
345
+
346
+
347
+ request_headers = {}
348
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
349
+
350
+ # Set Headers
351
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
352
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
353
+
354
+ # Serialize Request
355
+ request_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::SensitivityLabel.mapper()
356
+ request_content = @client.serialize(request_mapper, parameters)
357
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
358
+
359
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}'
360
+
361
+ request_url = @base_url || @client.base_url
362
+
363
+ options = {
364
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
365
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'sqlPoolName' => sql_pool_name,'schemaName' => schema_name,'tableName' => table_name,'columnName' => column_name,'sensitivityLabelSource' => sensitivity_label_source},
366
+ query_params: {'api-version' => @client.api_version},
367
+ body: request_content,
368
+ headers: request_headers.merge(custom_headers || {}),
369
+ base_url: request_url
370
+ }
371
+ promise = @client.make_request_async(:put, path_template, options)
372
+
373
+ promise = promise.then do |result|
374
+ http_response = result.response
375
+ status_code = http_response.status
376
+ response_content = http_response.body
377
+ unless status_code == 200 || status_code == 201
378
+ error_model = JSON.load(response_content)
379
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
380
+ end
381
+
382
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
383
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
384
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
385
+ # Deserialize Response
386
+ if status_code == 200
387
+ begin
388
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
389
+ result_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::SensitivityLabel.mapper()
390
+ result.body = @client.deserialize(result_mapper, parsed_response)
391
+ rescue Exception => e
392
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
393
+ end
394
+ end
395
+ # Deserialize Response
396
+ if status_code == 201
397
+ begin
398
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
399
+ result_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::SensitivityLabel.mapper()
400
+ result.body = @client.deserialize(result_mapper, parsed_response)
401
+ rescue Exception => e
402
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
403
+ end
404
+ end
405
+
406
+ result
407
+ end
408
+
409
+ promise.execute
410
+ end
411
+
412
+ #
413
+ # Deletes the sensitivity label of a given column in a Sql pool
414
+ #
415
+ # @param resource_group_name [String] The name of the resource group. The name
416
+ # is case insensitive.
417
+ # @param workspace_name [String] The name of the workspace
418
+ # @param sql_pool_name [String] SQL pool name
419
+ # @param schema_name [String] The name of the schema.
420
+ # @param table_name [String] The name of the table.
421
+ # @param column_name [String] The name of the column.
422
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
423
+ # will be added to the HTTP request.
424
+ #
425
+ #
426
+ def delete(resource_group_name, workspace_name, sql_pool_name, schema_name, table_name, column_name, custom_headers:nil)
427
+ response = delete_async(resource_group_name, workspace_name, sql_pool_name, schema_name, table_name, column_name, custom_headers:custom_headers).value!
428
+ nil
429
+ end
430
+
431
+ #
432
+ # Deletes the sensitivity label of a given column in a Sql pool
433
+ #
434
+ # @param resource_group_name [String] The name of the resource group. The name
435
+ # is case insensitive.
436
+ # @param workspace_name [String] The name of the workspace
437
+ # @param sql_pool_name [String] SQL pool name
438
+ # @param schema_name [String] The name of the schema.
439
+ # @param table_name [String] The name of the table.
440
+ # @param column_name [String] The name of the column.
441
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
442
+ # will be added to the HTTP request.
443
+ #
444
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
445
+ #
446
+ def delete_with_http_info(resource_group_name, workspace_name, sql_pool_name, schema_name, table_name, column_name, custom_headers:nil)
447
+ delete_async(resource_group_name, workspace_name, sql_pool_name, schema_name, table_name, column_name, custom_headers:custom_headers).value!
448
+ end
449
+
450
+ #
451
+ # Deletes the sensitivity label of a given column in a Sql pool
452
+ #
453
+ # @param resource_group_name [String] The name of the resource group. The name
454
+ # is case insensitive.
455
+ # @param workspace_name [String] The name of the workspace
456
+ # @param sql_pool_name [String] SQL pool name
457
+ # @param schema_name [String] The name of the schema.
458
+ # @param table_name [String] The name of the table.
459
+ # @param column_name [String] The name of the column.
460
+ # @param [Hash{String => String}] A hash of custom headers that will be added
461
+ # to the HTTP request.
462
+ #
463
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
464
+ #
465
+ def delete_async(resource_group_name, workspace_name, sql_pool_name, schema_name, table_name, column_name, custom_headers:nil)
466
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
467
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
468
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
469
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
470
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
471
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
472
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
473
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
474
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
475
+ fail ArgumentError, 'sql_pool_name is nil' if sql_pool_name.nil?
476
+ fail ArgumentError, 'schema_name is nil' if schema_name.nil?
477
+ fail ArgumentError, 'table_name is nil' if table_name.nil?
478
+ fail ArgumentError, 'column_name is nil' if column_name.nil?
479
+ sensitivity_label_source = 'current'
480
+
481
+
482
+ request_headers = {}
483
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
484
+
485
+ # Set Headers
486
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
487
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
488
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}'
489
+
490
+ request_url = @base_url || @client.base_url
491
+
492
+ options = {
493
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
494
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'sqlPoolName' => sql_pool_name,'schemaName' => schema_name,'tableName' => table_name,'columnName' => column_name,'sensitivityLabelSource' => sensitivity_label_source},
495
+ query_params: {'api-version' => @client.api_version},
496
+ headers: request_headers.merge(custom_headers || {}),
497
+ base_url: request_url
498
+ }
499
+ promise = @client.make_request_async(:delete, path_template, options)
500
+
501
+ promise = promise.then do |result|
502
+ http_response = result.response
503
+ status_code = http_response.status
504
+ response_content = http_response.body
505
+ unless status_code == 200
506
+ error_model = JSON.load(response_content)
507
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
508
+ end
509
+
510
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
511
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
512
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
513
+
514
+ result
515
+ end
516
+
517
+ promise.execute
518
+ end
519
+
520
+ #
521
+ # Enables sensitivity recommendations on a given column (recommendations are
522
+ # enabled by default on all columns)
523
+ #
524
+ # @param resource_group_name [String] The name of the resource group. The name
525
+ # is case insensitive.
526
+ # @param workspace_name [String] The name of the workspace
527
+ # @param sql_pool_name [String] SQL pool name
528
+ # @param schema_name [String] The name of the schema.
529
+ # @param table_name [String] The name of the table.
530
+ # @param column_name [String] The name of the column.
531
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
532
+ # will be added to the HTTP request.
533
+ #
534
+ #
535
+ def enable_recommendation(resource_group_name, workspace_name, sql_pool_name, schema_name, table_name, column_name, custom_headers:nil)
536
+ response = enable_recommendation_async(resource_group_name, workspace_name, sql_pool_name, schema_name, table_name, column_name, custom_headers:custom_headers).value!
537
+ nil
538
+ end
539
+
540
+ #
541
+ # Enables sensitivity recommendations on a given column (recommendations are
542
+ # enabled by default on all columns)
543
+ #
544
+ # @param resource_group_name [String] The name of the resource group. The name
545
+ # is case insensitive.
546
+ # @param workspace_name [String] The name of the workspace
547
+ # @param sql_pool_name [String] SQL pool name
548
+ # @param schema_name [String] The name of the schema.
549
+ # @param table_name [String] The name of the table.
550
+ # @param column_name [String] The name of the column.
551
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
552
+ # will be added to the HTTP request.
553
+ #
554
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
555
+ #
556
+ def enable_recommendation_with_http_info(resource_group_name, workspace_name, sql_pool_name, schema_name, table_name, column_name, custom_headers:nil)
557
+ enable_recommendation_async(resource_group_name, workspace_name, sql_pool_name, schema_name, table_name, column_name, custom_headers:custom_headers).value!
558
+ end
559
+
560
+ #
561
+ # Enables sensitivity recommendations on a given column (recommendations are
562
+ # enabled by default on all columns)
563
+ #
564
+ # @param resource_group_name [String] The name of the resource group. The name
565
+ # is case insensitive.
566
+ # @param workspace_name [String] The name of the workspace
567
+ # @param sql_pool_name [String] SQL pool name
568
+ # @param schema_name [String] The name of the schema.
569
+ # @param table_name [String] The name of the table.
570
+ # @param column_name [String] The name of the column.
571
+ # @param [Hash{String => String}] A hash of custom headers that will be added
572
+ # to the HTTP request.
573
+ #
574
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
575
+ #
576
+ def enable_recommendation_async(resource_group_name, workspace_name, sql_pool_name, schema_name, table_name, column_name, custom_headers:nil)
577
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
578
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
579
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
580
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
581
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
582
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
583
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
584
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
585
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
586
+ fail ArgumentError, 'sql_pool_name is nil' if sql_pool_name.nil?
587
+ fail ArgumentError, 'schema_name is nil' if schema_name.nil?
588
+ fail ArgumentError, 'table_name is nil' if table_name.nil?
589
+ fail ArgumentError, 'column_name is nil' if column_name.nil?
590
+ sensitivity_label_source = 'recommended'
591
+
592
+
593
+ request_headers = {}
594
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
595
+
596
+ # Set Headers
597
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
598
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
599
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable'
600
+
601
+ request_url = @base_url || @client.base_url
602
+
603
+ options = {
604
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
605
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'sqlPoolName' => sql_pool_name,'schemaName' => schema_name,'tableName' => table_name,'columnName' => column_name,'sensitivityLabelSource' => sensitivity_label_source},
606
+ query_params: {'api-version' => @client.api_version},
607
+ headers: request_headers.merge(custom_headers || {}),
608
+ base_url: request_url
609
+ }
610
+ promise = @client.make_request_async(:post, path_template, options)
611
+
612
+ promise = promise.then do |result|
613
+ http_response = result.response
614
+ status_code = http_response.status
615
+ response_content = http_response.body
616
+ unless status_code == 200
617
+ error_model = JSON.load(response_content)
618
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
619
+ end
620
+
621
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
622
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
623
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
624
+
625
+ result
626
+ end
627
+
628
+ promise.execute
629
+ end
630
+
631
+ #
632
+ # Disables sensitivity recommendations on a given column
633
+ #
634
+ # @param resource_group_name [String] The name of the resource group. The name
635
+ # is case insensitive.
636
+ # @param workspace_name [String] The name of the workspace
637
+ # @param sql_pool_name [String] SQL pool name
638
+ # @param schema_name [String] The name of the schema.
639
+ # @param table_name [String] The name of the table.
640
+ # @param column_name [String] The name of the column.
641
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
642
+ # will be added to the HTTP request.
643
+ #
644
+ #
645
+ def disable_recommendation(resource_group_name, workspace_name, sql_pool_name, schema_name, table_name, column_name, custom_headers:nil)
646
+ response = disable_recommendation_async(resource_group_name, workspace_name, sql_pool_name, schema_name, table_name, column_name, custom_headers:custom_headers).value!
647
+ nil
648
+ end
649
+
650
+ #
651
+ # Disables sensitivity recommendations on a given column
652
+ #
653
+ # @param resource_group_name [String] The name of the resource group. The name
654
+ # is case insensitive.
655
+ # @param workspace_name [String] The name of the workspace
656
+ # @param sql_pool_name [String] SQL pool name
657
+ # @param schema_name [String] The name of the schema.
658
+ # @param table_name [String] The name of the table.
659
+ # @param column_name [String] The name of the column.
660
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
661
+ # will be added to the HTTP request.
662
+ #
663
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
664
+ #
665
+ def disable_recommendation_with_http_info(resource_group_name, workspace_name, sql_pool_name, schema_name, table_name, column_name, custom_headers:nil)
666
+ disable_recommendation_async(resource_group_name, workspace_name, sql_pool_name, schema_name, table_name, column_name, custom_headers:custom_headers).value!
667
+ end
668
+
669
+ #
670
+ # Disables sensitivity recommendations on a given column
671
+ #
672
+ # @param resource_group_name [String] The name of the resource group. The name
673
+ # is case insensitive.
674
+ # @param workspace_name [String] The name of the workspace
675
+ # @param sql_pool_name [String] SQL pool name
676
+ # @param schema_name [String] The name of the schema.
677
+ # @param table_name [String] The name of the table.
678
+ # @param column_name [String] The name of the column.
679
+ # @param [Hash{String => String}] A hash of custom headers that will be added
680
+ # to the HTTP request.
681
+ #
682
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
683
+ #
684
+ def disable_recommendation_async(resource_group_name, workspace_name, sql_pool_name, schema_name, table_name, column_name, custom_headers:nil)
685
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
686
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
687
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
688
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
689
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
690
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
691
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
692
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
693
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
694
+ fail ArgumentError, 'sql_pool_name is nil' if sql_pool_name.nil?
695
+ fail ArgumentError, 'schema_name is nil' if schema_name.nil?
696
+ fail ArgumentError, 'table_name is nil' if table_name.nil?
697
+ fail ArgumentError, 'column_name is nil' if column_name.nil?
698
+ sensitivity_label_source = 'recommended'
699
+
700
+
701
+ request_headers = {}
702
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
703
+
704
+ # Set Headers
705
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
706
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
707
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/disable'
708
+
709
+ request_url = @base_url || @client.base_url
710
+
711
+ options = {
712
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
713
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'sqlPoolName' => sql_pool_name,'schemaName' => schema_name,'tableName' => table_name,'columnName' => column_name,'sensitivityLabelSource' => sensitivity_label_source},
714
+ query_params: {'api-version' => @client.api_version},
715
+ headers: request_headers.merge(custom_headers || {}),
716
+ base_url: request_url
717
+ }
718
+ promise = @client.make_request_async(:post, path_template, options)
719
+
720
+ promise = promise.then do |result|
721
+ http_response = result.response
722
+ status_code = http_response.status
723
+ response_content = http_response.body
724
+ unless status_code == 200
725
+ error_model = JSON.load(response_content)
726
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
727
+ end
728
+
729
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
730
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
731
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
732
+
733
+ result
734
+ end
735
+
736
+ promise.execute
737
+ end
738
+
739
+ #
740
+ # Gets SQL pool sensitivity labels
741
+ #
742
+ # Gets SQL pool sensitivity labels.
743
+ #
744
+ # @param next_page_link [String] The NextLink from the previous successful call
745
+ # to List operation.
746
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
747
+ # will be added to the HTTP request.
748
+ #
749
+ # @return [SensitivityLabelListResult] operation results.
750
+ #
751
+ def list_current_next(next_page_link, custom_headers:nil)
752
+ response = list_current_next_async(next_page_link, custom_headers:custom_headers).value!
753
+ response.body unless response.nil?
754
+ end
755
+
756
+ #
757
+ # Gets SQL pool sensitivity labels
758
+ #
759
+ # Gets SQL pool sensitivity labels.
760
+ #
761
+ # @param next_page_link [String] The NextLink from the previous successful call
762
+ # to List operation.
763
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
764
+ # will be added to the HTTP request.
765
+ #
766
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
767
+ #
768
+ def list_current_next_with_http_info(next_page_link, custom_headers:nil)
769
+ list_current_next_async(next_page_link, custom_headers:custom_headers).value!
770
+ end
771
+
772
+ #
773
+ # Gets SQL pool sensitivity labels
774
+ #
775
+ # Gets SQL pool sensitivity labels.
776
+ #
777
+ # @param next_page_link [String] The NextLink from the previous successful call
778
+ # to List operation.
779
+ # @param [Hash{String => String}] A hash of custom headers that will be added
780
+ # to the HTTP request.
781
+ #
782
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
783
+ #
784
+ def list_current_next_async(next_page_link, custom_headers:nil)
785
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
786
+
787
+
788
+ request_headers = {}
789
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
790
+
791
+ # Set Headers
792
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
793
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
794
+ path_template = '{nextLink}'
795
+
796
+ request_url = @base_url || @client.base_url
797
+
798
+ options = {
799
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
800
+ skip_encoding_path_params: {'nextLink' => next_page_link},
801
+ headers: request_headers.merge(custom_headers || {}),
802
+ base_url: request_url
803
+ }
804
+ promise = @client.make_request_async(:get, path_template, options)
805
+
806
+ promise = promise.then do |result|
807
+ http_response = result.response
808
+ status_code = http_response.status
809
+ response_content = http_response.body
810
+ unless status_code == 200
811
+ error_model = JSON.load(response_content)
812
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
813
+ end
814
+
815
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
816
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
817
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
818
+ # Deserialize Response
819
+ if status_code == 200
820
+ begin
821
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
822
+ result_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::SensitivityLabelListResult.mapper()
823
+ result.body = @client.deserialize(result_mapper, parsed_response)
824
+ rescue Exception => e
825
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
826
+ end
827
+ end
828
+
829
+ result
830
+ end
831
+
832
+ promise.execute
833
+ end
834
+
835
+ #
836
+ # Gets sensitivity labels of a given SQL pool
837
+ #
838
+ # Gets sensitivity labels of a given SQL pool.
839
+ #
840
+ # @param next_page_link [String] The NextLink from the previous successful call
841
+ # to List operation.
842
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
843
+ # will be added to the HTTP request.
844
+ #
845
+ # @return [SensitivityLabelListResult] operation results.
846
+ #
847
+ def list_recommended_next(next_page_link, custom_headers:nil)
848
+ response = list_recommended_next_async(next_page_link, custom_headers:custom_headers).value!
849
+ response.body unless response.nil?
850
+ end
851
+
852
+ #
853
+ # Gets sensitivity labels of a given SQL pool
854
+ #
855
+ # Gets sensitivity labels of a given SQL pool.
856
+ #
857
+ # @param next_page_link [String] The NextLink from the previous successful call
858
+ # to List operation.
859
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
860
+ # will be added to the HTTP request.
861
+ #
862
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
863
+ #
864
+ def list_recommended_next_with_http_info(next_page_link, custom_headers:nil)
865
+ list_recommended_next_async(next_page_link, custom_headers:custom_headers).value!
866
+ end
867
+
868
+ #
869
+ # Gets sensitivity labels of a given SQL pool
870
+ #
871
+ # Gets sensitivity labels of a given SQL pool.
872
+ #
873
+ # @param next_page_link [String] The NextLink from the previous successful call
874
+ # to List operation.
875
+ # @param [Hash{String => String}] A hash of custom headers that will be added
876
+ # to the HTTP request.
877
+ #
878
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
879
+ #
880
+ def list_recommended_next_async(next_page_link, custom_headers:nil)
881
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
882
+
883
+
884
+ request_headers = {}
885
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
886
+
887
+ # Set Headers
888
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
889
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
890
+ path_template = '{nextLink}'
891
+
892
+ request_url = @base_url || @client.base_url
893
+
894
+ options = {
895
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
896
+ skip_encoding_path_params: {'nextLink' => next_page_link},
897
+ headers: request_headers.merge(custom_headers || {}),
898
+ base_url: request_url
899
+ }
900
+ promise = @client.make_request_async(:get, path_template, options)
901
+
902
+ promise = promise.then do |result|
903
+ http_response = result.response
904
+ status_code = http_response.status
905
+ response_content = http_response.body
906
+ unless status_code == 200
907
+ error_model = JSON.load(response_content)
908
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
909
+ end
910
+
911
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
912
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
913
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
914
+ # Deserialize Response
915
+ if status_code == 200
916
+ begin
917
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
918
+ result_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::SensitivityLabelListResult.mapper()
919
+ result.body = @client.deserialize(result_mapper, parsed_response)
920
+ rescue Exception => e
921
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
922
+ end
923
+ end
924
+
925
+ result
926
+ end
927
+
928
+ promise.execute
929
+ end
930
+
931
+ #
932
+ # Gets SQL pool sensitivity labels
933
+ #
934
+ # Gets SQL pool sensitivity labels.
935
+ #
936
+ # @param resource_group_name [String] The name of the resource group. The name
937
+ # is case insensitive.
938
+ # @param workspace_name [String] The name of the workspace
939
+ # @param sql_pool_name [String] SQL pool name
940
+ # @param filter [String] An OData filter expression that filters elements in
941
+ # the collection.
942
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
943
+ # will be added to the HTTP request.
944
+ #
945
+ # @return [SensitivityLabelListResult] which provide lazy access to pages of
946
+ # the response.
947
+ #
948
+ def list_current_as_lazy(resource_group_name, workspace_name, sql_pool_name, filter:nil, custom_headers:nil)
949
+ response = list_current_async(resource_group_name, workspace_name, sql_pool_name, filter:filter, custom_headers:custom_headers).value!
950
+ unless response.nil?
951
+ page = response.body
952
+ page.next_method = Proc.new do |next_page_link|
953
+ list_current_next_async(next_page_link, custom_headers:custom_headers)
954
+ end
955
+ page
956
+ end
957
+ end
958
+
959
+ #
960
+ # Gets sensitivity labels of a given SQL pool
961
+ #
962
+ # Gets sensitivity labels of a given SQL pool.
963
+ #
964
+ # @param resource_group_name [String] The name of the resource group. The name
965
+ # is case insensitive.
966
+ # @param workspace_name [String] The name of the workspace
967
+ # @param sql_pool_name [String] SQL pool name
968
+ # @param include_disabled_recommendations [Boolean] Specifies whether to
969
+ # include disabled recommendations or not.
970
+ # @param skip_token [String] An OData query option to indicate how many
971
+ # elements to skip in the collection.
972
+ # @param filter [String] An OData filter expression that filters elements in
973
+ # the collection.
974
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
975
+ # will be added to the HTTP request.
976
+ #
977
+ # @return [SensitivityLabelListResult] which provide lazy access to pages of
978
+ # the response.
979
+ #
980
+ def list_recommended_as_lazy(resource_group_name, workspace_name, sql_pool_name, include_disabled_recommendations:nil, skip_token:nil, filter:nil, custom_headers:nil)
981
+ response = list_recommended_async(resource_group_name, workspace_name, sql_pool_name, include_disabled_recommendations:include_disabled_recommendations, skip_token:skip_token, filter:filter, custom_headers:custom_headers).value!
982
+ unless response.nil?
983
+ page = response.body
984
+ page.next_method = Proc.new do |next_page_link|
985
+ list_recommended_next_async(next_page_link, custom_headers:custom_headers)
986
+ end
987
+ page
988
+ end
989
+ end
990
+
991
+ end
992
+ end