azure_mgmt_synapse 0.17.2 → 0.17.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse.rb +126 -69
  3. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/big_data_pools.rb +2 -2
  4. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/data_masking_policies.rb +253 -0
  5. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/data_masking_rules.rb +267 -0
  6. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/extended_sql_pool_blob_auditing_policies.rb +483 -0
  7. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/integration_runtime_auth_keys_operations.rb +6 -6
  8. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/integration_runtime_connection_infos.rb +3 -3
  9. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/integration_runtime_credentials.rb +3 -3
  10. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/integration_runtime_monitoring_data_operations.rb +8 -8
  11. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/integration_runtime_node_ip_address_operations.rb +3 -3
  12. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/integration_runtime_nodes.rb +9 -9
  13. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/integration_runtime_object_metadata.rb +62 -14
  14. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/integration_runtime_status_operations.rb +3 -3
  15. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/integration_runtimes.rb +586 -118
  16. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/ip_firewall_rules.rb +3 -3
  17. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/keys.rb +569 -0
  18. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/azure_entity_resource.rb +3 -1
  19. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/big_data_pool_resource_info.rb +47 -1
  20. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/customer_managed_key_details.rb +59 -0
  21. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/data_masking_function.rb +20 -0
  22. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/data_masking_policy.rb +153 -0
  23. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/data_masking_rule.rb +243 -0
  24. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/data_masking_rule_list_result.rb +56 -0
  25. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/data_masking_rule_state.rb +16 -0
  26. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/data_masking_state.rb +16 -0
  27. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/encryption_details.rb +59 -0
  28. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/error_response.rb +5 -1
  29. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/extended_server_blob_auditing_policy.rb +292 -0
  30. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/extended_server_blob_auditing_policy_list_result.rb +102 -0
  31. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/extended_sql_pool_blob_auditing_policy.rb +292 -0
  32. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/extended_sql_pool_blob_auditing_policy_list_result.rb +102 -0
  33. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/geo_backup_policy_list_result.rb +55 -0
  34. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/key.rb +85 -0
  35. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/key_info_list_result.rb +98 -0
  36. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/list_sql_pool_security_alert_policies.rb +100 -0
  37. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/managed_identity.rb +1 -1
  38. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/managed_virtual_network_settings.rb +76 -0
  39. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/metadata_sync_config.rb +11 -0
  40. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/node_size.rb +3 -0
  41. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/private_endpoint_connection_for_private_link_hub.rb +95 -0
  42. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/private_endpoint_connection_for_private_link_hub_basic.rb +86 -0
  43. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/private_endpoint_connection_for_private_link_hub_resource_collection_response.rb +103 -0
  44. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/private_link_hub.rb +23 -3
  45. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/private_link_service_connection_state.rb +1 -2
  46. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/proxy_resource.rb +4 -2
  47. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/{resource_move_definition.rb → purview_configuration.rb} +10 -10
  48. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/recoverable_sql_pool.rb +111 -0
  49. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/recoverable_sql_pool_list_result.rb +100 -0
  50. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/resource.rb +8 -5
  51. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/restorable_dropped_sql_pool.rb +171 -0
  52. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/restorable_dropped_sql_pool_list_result.rb +56 -0
  53. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/self_hosted_integration_runtime.rb +2 -1
  54. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/self_hosted_integration_runtime_status.rb +12 -0
  55. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sensitivity_label_source.rb +16 -0
  56. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/server_blob_auditing_policy.rb +280 -0
  57. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/server_blob_auditing_policy_list_result.rb +100 -0
  58. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/server_security_alert_policy.rb +179 -0
  59. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/server_security_alert_policy_list_result.rb +100 -0
  60. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/server_usage.rb +119 -0
  61. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/server_usage_list_result.rb +99 -0
  62. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/server_vulnerability_assessment.rb +114 -0
  63. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/server_vulnerability_assessment_list_result.rb +101 -0
  64. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sku.rb +13 -0
  65. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool.rb +2 -2
  66. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_blob_auditing_policy_list_result.rb +100 -0
  67. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_patch_info.rb +2 -2
  68. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sub_resource.rb +2 -14
  69. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/tracked_resource.rb +4 -1
  70. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/transparent_data_encryption_list_result.rb +100 -0
  71. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/workload_classifier.rb +128 -0
  72. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/workload_classifier_list_result.rb +100 -0
  73. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/workload_group.rb +128 -0
  74. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/workload_group_list_result.rb +100 -0
  75. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/workspace.rb +87 -2
  76. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/workspace_key_details.rb +57 -0
  77. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/workspace_patch_info.rb +37 -0
  78. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/workspace_repository_configuration.rb +114 -0
  79. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/operations.rb +5 -15
  80. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/private_endpoint_connections.rb +48 -30
  81. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/private_endpoint_connections_private_link_hub.rb +244 -0
  82. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/private_link_hubs.rb +123 -83
  83. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/private_link_resources.rb +3 -3
  84. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/restorable_dropped_sql_pools.rb +236 -0
  85. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_blob_auditing_policies.rb +220 -0
  86. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_columns.rb +143 -0
  87. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_connection_policies.rb +1 -1
  88. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_geo_backup_policies.rb +113 -1
  89. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_operation_results.rb +2 -2
  90. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_replication_links.rb +118 -2
  91. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_restore_points.rb +211 -2
  92. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_schemas.rb +110 -0
  93. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_security_alert_policies.rb +234 -0
  94. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_sensitivity_labels.rb +127 -2
  95. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_tables.rb +114 -0
  96. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_transparent_data_encryptions.rb +236 -2
  97. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_usages.rb +2 -2
  98. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_vulnerability_assessment_rule_baselines.rb +124 -0
  99. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_vulnerability_assessment_scans.rb +114 -0
  100. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_vulnerability_assessments.rb +1 -1
  101. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_workload_classifier.rb +741 -0
  102. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_workload_group.rb +715 -0
  103. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pools.rb +6 -121
  104. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/synapse_management_client.rb +73 -1
  105. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/workspace_aad_admins.rb +2 -2
  106. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/workspace_managed_identity_sql_control_settings.rb +1 -1
  107. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/workspace_managed_sql_server_blob_auditing_policies.rb +536 -0
  108. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/workspace_managed_sql_server_extended_blob_auditing_policies.rb +540 -0
  109. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/workspace_managed_sql_server_recoverable_sqlpools.rb +366 -0
  110. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/workspace_managed_sql_server_security_alert_policy.rb +536 -0
  111. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/workspace_managed_sql_server_usages.rb +254 -0
  112. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/workspace_managed_sql_server_vulnerability_assessments.rb +601 -0
  113. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/workspace_sql_aad_admins.rb +432 -0
  114. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/workspaces.rb +4 -4
  115. data/lib/profiles/latest/modules/synapse_profile_module.rb +404 -208
  116. data/lib/version.rb +1 -1
  117. metadata +61 -4
@@ -307,6 +307,120 @@ module Azure::Synapse::Mgmt::V2019_06_01_preview
307
307
  promise.execute
308
308
  end
309
309
 
310
+ #
311
+ # Gets a vulnerability assessment scan record of a Sql pool.
312
+ #
313
+ # @param resource_group_name [String] The name of the resource group. The name
314
+ # is case insensitive.
315
+ # @param workspace_name [String] The name of the workspace
316
+ # @param sql_pool_name [String] SQL pool name
317
+ # @param scan_id [String] The vulnerability assessment scan Id of the scan to
318
+ # retrieve.
319
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
320
+ # will be added to the HTTP request.
321
+ #
322
+ # @return [VulnerabilityAssessmentScanRecord] operation results.
323
+ #
324
+ def get(resource_group_name, workspace_name, sql_pool_name, scan_id, custom_headers:nil)
325
+ response = get_async(resource_group_name, workspace_name, sql_pool_name, scan_id, custom_headers:custom_headers).value!
326
+ response.body unless response.nil?
327
+ end
328
+
329
+ #
330
+ # Gets a vulnerability assessment scan record of a Sql pool.
331
+ #
332
+ # @param resource_group_name [String] The name of the resource group. The name
333
+ # is case insensitive.
334
+ # @param workspace_name [String] The name of the workspace
335
+ # @param sql_pool_name [String] SQL pool name
336
+ # @param scan_id [String] The vulnerability assessment scan Id of the scan to
337
+ # retrieve.
338
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
339
+ # will be added to the HTTP request.
340
+ #
341
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
342
+ #
343
+ def get_with_http_info(resource_group_name, workspace_name, sql_pool_name, scan_id, custom_headers:nil)
344
+ get_async(resource_group_name, workspace_name, sql_pool_name, scan_id, custom_headers:custom_headers).value!
345
+ end
346
+
347
+ #
348
+ # Gets a vulnerability assessment scan record of a Sql pool.
349
+ #
350
+ # @param resource_group_name [String] The name of the resource group. The name
351
+ # is case insensitive.
352
+ # @param workspace_name [String] The name of the workspace
353
+ # @param sql_pool_name [String] SQL pool name
354
+ # @param scan_id [String] The vulnerability assessment scan Id of the scan to
355
+ # retrieve.
356
+ # @param [Hash{String => String}] A hash of custom headers that will be added
357
+ # to the HTTP request.
358
+ #
359
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
360
+ #
361
+ def get_async(resource_group_name, workspace_name, sql_pool_name, scan_id, custom_headers:nil)
362
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
363
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
364
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
365
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
366
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
367
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
368
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
369
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
370
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
371
+ fail ArgumentError, 'sql_pool_name is nil' if sql_pool_name.nil?
372
+ vulnerability_assessment_name = 'default'
373
+ fail ArgumentError, 'scan_id is nil' if scan_id.nil?
374
+
375
+
376
+ request_headers = {}
377
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
378
+
379
+ # Set Headers
380
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
381
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
382
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}'
383
+
384
+ request_url = @base_url || @client.base_url
385
+
386
+ options = {
387
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
388
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'sqlPoolName' => sql_pool_name,'vulnerabilityAssessmentName' => vulnerability_assessment_name,'scanId' => scan_id},
389
+ query_params: {'api-version' => @client.api_version},
390
+ headers: request_headers.merge(custom_headers || {}),
391
+ base_url: request_url
392
+ }
393
+ promise = @client.make_request_async(:get, path_template, options)
394
+
395
+ promise = promise.then do |result|
396
+ http_response = result.response
397
+ status_code = http_response.status
398
+ response_content = http_response.body
399
+ unless status_code == 200
400
+ error_model = JSON.load(response_content)
401
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
402
+ end
403
+
404
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
405
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
406
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
407
+ # Deserialize Response
408
+ if status_code == 200
409
+ begin
410
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
411
+ result_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::VulnerabilityAssessmentScanRecord.mapper()
412
+ result.body = @client.deserialize(result_mapper, parsed_response)
413
+ rescue Exception => e
414
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
415
+ end
416
+ end
417
+
418
+ result
419
+ end
420
+
421
+ promise.execute
422
+ end
423
+
310
424
  #
311
425
  # Executes a Vulnerability Assessment database scan.
312
426
  #
@@ -467,7 +467,7 @@ module Azure::Synapse::Mgmt::V2019_06_01_preview
467
467
  http_response = result.response
468
468
  status_code = http_response.status
469
469
  response_content = http_response.body
470
- unless status_code == 200
470
+ unless status_code == 200 || status_code == 204
471
471
  error_model = JSON.load(response_content)
472
472
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
473
473
  end
@@ -0,0 +1,741 @@
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 SqlPoolWorkloadClassifier
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the SqlPoolWorkloadClassifier 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 workload classifier
26
+ #
27
+ # Get a workload classifier of Sql pool's workload group.
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 workload_group_name [String] The name of the workload group.
34
+ # @param workload_classifier_name [String] The name of the workload classifier.
35
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
36
+ # will be added to the HTTP request.
37
+ #
38
+ # @return [WorkloadClassifier] operation results.
39
+ #
40
+ def get(resource_group_name, workspace_name, sql_pool_name, workload_group_name, workload_classifier_name, custom_headers:nil)
41
+ response = get_async(resource_group_name, workspace_name, sql_pool_name, workload_group_name, workload_classifier_name, custom_headers:custom_headers).value!
42
+ response.body unless response.nil?
43
+ end
44
+
45
+ #
46
+ # Get workload classifier
47
+ #
48
+ # Get a workload classifier of Sql pool's workload group.
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 workload_group_name [String] The name of the workload group.
55
+ # @param workload_classifier_name [String] The name of the workload classifier.
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 get_with_http_info(resource_group_name, workspace_name, sql_pool_name, workload_group_name, workload_classifier_name, custom_headers:nil)
62
+ get_async(resource_group_name, workspace_name, sql_pool_name, workload_group_name, workload_classifier_name, custom_headers:custom_headers).value!
63
+ end
64
+
65
+ #
66
+ # Get workload classifier
67
+ #
68
+ # Get a workload classifier of Sql pool's workload group.
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 workload_group_name [String] The name of the workload group.
75
+ # @param workload_classifier_name [String] The name of the workload classifier.
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 get_async(resource_group_name, workspace_name, sql_pool_name, workload_group_name, workload_classifier_name, 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
+ fail ArgumentError, 'workload_group_name is nil' if workload_group_name.nil?
93
+ fail ArgumentError, 'workload_classifier_name is nil' if workload_classifier_name.nil?
94
+
95
+
96
+ request_headers = {}
97
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
98
+
99
+ # Set Headers
100
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
101
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
102
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}'
103
+
104
+ request_url = @base_url || @client.base_url
105
+
106
+ options = {
107
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
108
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'sqlPoolName' => sql_pool_name,'workloadGroupName' => workload_group_name,'workloadClassifierName' => workload_classifier_name},
109
+ query_params: {'api-version' => @client.api_version},
110
+ headers: request_headers.merge(custom_headers || {}),
111
+ base_url: request_url
112
+ }
113
+ promise = @client.make_request_async(:get, path_template, options)
114
+
115
+ promise = promise.then do |result|
116
+ http_response = result.response
117
+ status_code = http_response.status
118
+ response_content = http_response.body
119
+ unless status_code == 200
120
+ error_model = JSON.load(response_content)
121
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
122
+ end
123
+
124
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
125
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
126
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
127
+ # Deserialize Response
128
+ if status_code == 200
129
+ begin
130
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
131
+ result_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::WorkloadClassifier.mapper()
132
+ result.body = @client.deserialize(result_mapper, parsed_response)
133
+ rescue Exception => e
134
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
135
+ end
136
+ end
137
+
138
+ result
139
+ end
140
+
141
+ promise.execute
142
+ end
143
+
144
+ #
145
+ # Create Or Update workload classifier
146
+ #
147
+ # Create Or Update workload classifier for a Sql pool's workload group.
148
+ #
149
+ # @param resource_group_name [String] The name of the resource group. The name
150
+ # is case insensitive.
151
+ # @param workspace_name [String] The name of the workspace
152
+ # @param sql_pool_name [String] SQL pool name
153
+ # @param workload_group_name [String] The name of the workload group.
154
+ # @param workload_classifier_name [String] The name of the workload classifier.
155
+ # @param parameters [WorkloadClassifier] The properties of the workload
156
+ # classifier.
157
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
158
+ # will be added to the HTTP request.
159
+ #
160
+ # @return [WorkloadClassifier] operation results.
161
+ #
162
+ def create_or_update(resource_group_name, workspace_name, sql_pool_name, workload_group_name, workload_classifier_name, parameters, custom_headers:nil)
163
+ response = create_or_update_async(resource_group_name, workspace_name, sql_pool_name, workload_group_name, workload_classifier_name, parameters, custom_headers:custom_headers).value!
164
+ response.body unless response.nil?
165
+ end
166
+
167
+ #
168
+ # @param resource_group_name [String] The name of the resource group. The name
169
+ # is case insensitive.
170
+ # @param workspace_name [String] The name of the workspace
171
+ # @param sql_pool_name [String] SQL pool name
172
+ # @param workload_group_name [String] The name of the workload group.
173
+ # @param workload_classifier_name [String] The name of the workload classifier.
174
+ # @param parameters [WorkloadClassifier] The properties of the workload
175
+ # classifier.
176
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
177
+ # will be added to the HTTP request.
178
+ #
179
+ # @return [Concurrent::Promise] promise which provides async access to http
180
+ # response.
181
+ #
182
+ def create_or_update_async(resource_group_name, workspace_name, sql_pool_name, workload_group_name, workload_classifier_name, parameters, custom_headers:nil)
183
+ # Send request
184
+ promise = begin_create_or_update_async(resource_group_name, workspace_name, sql_pool_name, workload_group_name, workload_classifier_name, parameters, custom_headers:custom_headers)
185
+
186
+ promise = promise.then do |response|
187
+ # Defining deserialization method.
188
+ deserialize_method = lambda do |parsed_response|
189
+ result_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::WorkloadClassifier.mapper()
190
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
191
+ end
192
+
193
+ # Waiting for response.
194
+ @client.get_long_running_operation_result(response, deserialize_method)
195
+ end
196
+
197
+ promise
198
+ end
199
+
200
+ #
201
+ # Remove workload classifier
202
+ #
203
+ # Remove workload classifier of a Sql pool's workload group.
204
+ #
205
+ # @param resource_group_name [String] The name of the resource group. The name
206
+ # is case insensitive.
207
+ # @param workspace_name [String] The name of the workspace
208
+ # @param sql_pool_name [String] SQL pool name
209
+ # @param workload_group_name [String] The name of the workload group.
210
+ # @param workload_classifier_name [String] The name of the workload classifier.
211
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
212
+ # will be added to the HTTP request.
213
+ #
214
+ def delete(resource_group_name, workspace_name, sql_pool_name, workload_group_name, workload_classifier_name, custom_headers:nil)
215
+ response = delete_async(resource_group_name, workspace_name, sql_pool_name, workload_group_name, workload_classifier_name, custom_headers:custom_headers).value!
216
+ nil
217
+ end
218
+
219
+ #
220
+ # @param resource_group_name [String] The name of the resource group. The name
221
+ # is case insensitive.
222
+ # @param workspace_name [String] The name of the workspace
223
+ # @param sql_pool_name [String] SQL pool name
224
+ # @param workload_group_name [String] The name of the workload group.
225
+ # @param workload_classifier_name [String] The name of the workload classifier.
226
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
227
+ # will be added to the HTTP request.
228
+ #
229
+ # @return [Concurrent::Promise] promise which provides async access to http
230
+ # response.
231
+ #
232
+ def delete_async(resource_group_name, workspace_name, sql_pool_name, workload_group_name, workload_classifier_name, custom_headers:nil)
233
+ # Send request
234
+ promise = begin_delete_async(resource_group_name, workspace_name, sql_pool_name, workload_group_name, workload_classifier_name, custom_headers:custom_headers)
235
+
236
+ promise = promise.then do |response|
237
+ # Defining deserialization method.
238
+ deserialize_method = lambda do |parsed_response|
239
+ end
240
+
241
+ # Waiting for response.
242
+ @client.get_long_running_operation_result(response, deserialize_method)
243
+ end
244
+
245
+ promise
246
+ end
247
+
248
+ #
249
+ # Sql pool's workload classifier
250
+ #
251
+ # Get list of Sql pool's workload classifier for workload groups.
252
+ #
253
+ # @param resource_group_name [String] The name of the resource group. The name
254
+ # is case insensitive.
255
+ # @param workspace_name [String] The name of the workspace
256
+ # @param sql_pool_name [String] SQL pool name
257
+ # @param workload_group_name [String] The name of the workload group.
258
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
259
+ # will be added to the HTTP request.
260
+ #
261
+ # @return [Array<WorkloadClassifier>] operation results.
262
+ #
263
+ def list(resource_group_name, workspace_name, sql_pool_name, workload_group_name, custom_headers:nil)
264
+ first_page = list_as_lazy(resource_group_name, workspace_name, sql_pool_name, workload_group_name, custom_headers:custom_headers)
265
+ first_page.get_all_items
266
+ end
267
+
268
+ #
269
+ # Sql pool's workload classifier
270
+ #
271
+ # Get list of Sql pool's workload classifier for workload groups.
272
+ #
273
+ # @param resource_group_name [String] The name of the resource group. The name
274
+ # is case insensitive.
275
+ # @param workspace_name [String] The name of the workspace
276
+ # @param sql_pool_name [String] SQL pool name
277
+ # @param workload_group_name [String] The name of the workload group.
278
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
279
+ # will be added to the HTTP request.
280
+ #
281
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
282
+ #
283
+ def list_with_http_info(resource_group_name, workspace_name, sql_pool_name, workload_group_name, custom_headers:nil)
284
+ list_async(resource_group_name, workspace_name, sql_pool_name, workload_group_name, custom_headers:custom_headers).value!
285
+ end
286
+
287
+ #
288
+ # Sql pool's workload classifier
289
+ #
290
+ # Get list of Sql pool's workload classifier for workload groups.
291
+ #
292
+ # @param resource_group_name [String] The name of the resource group. The name
293
+ # is case insensitive.
294
+ # @param workspace_name [String] The name of the workspace
295
+ # @param sql_pool_name [String] SQL pool name
296
+ # @param workload_group_name [String] The name of the workload group.
297
+ # @param [Hash{String => String}] A hash of custom headers that will be added
298
+ # to the HTTP request.
299
+ #
300
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
301
+ #
302
+ def list_async(resource_group_name, workspace_name, sql_pool_name, workload_group_name, custom_headers:nil)
303
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
304
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
305
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
306
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
307
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
308
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
309
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
310
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
311
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
312
+ fail ArgumentError, 'sql_pool_name is nil' if sql_pool_name.nil?
313
+ fail ArgumentError, 'workload_group_name is nil' if workload_group_name.nil?
314
+
315
+
316
+ request_headers = {}
317
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
318
+
319
+ # Set Headers
320
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
321
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
322
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/workloadGroups/{workloadGroupName}/workloadClassifiers'
323
+
324
+ request_url = @base_url || @client.base_url
325
+
326
+ options = {
327
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
328
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'sqlPoolName' => sql_pool_name,'workloadGroupName' => workload_group_name},
329
+ query_params: {'api-version' => @client.api_version},
330
+ headers: request_headers.merge(custom_headers || {}),
331
+ base_url: request_url
332
+ }
333
+ promise = @client.make_request_async(:get, path_template, options)
334
+
335
+ promise = promise.then do |result|
336
+ http_response = result.response
337
+ status_code = http_response.status
338
+ response_content = http_response.body
339
+ unless status_code == 200
340
+ error_model = JSON.load(response_content)
341
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
342
+ end
343
+
344
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
345
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
346
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
347
+ # Deserialize Response
348
+ if status_code == 200
349
+ begin
350
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
351
+ result_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::WorkloadClassifierListResult.mapper()
352
+ result.body = @client.deserialize(result_mapper, parsed_response)
353
+ rescue Exception => e
354
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
355
+ end
356
+ end
357
+
358
+ result
359
+ end
360
+
361
+ promise.execute
362
+ end
363
+
364
+ #
365
+ # Create Or Update workload classifier
366
+ #
367
+ # Create Or Update workload classifier for a Sql pool's workload group.
368
+ #
369
+ # @param resource_group_name [String] The name of the resource group. The name
370
+ # is case insensitive.
371
+ # @param workspace_name [String] The name of the workspace
372
+ # @param sql_pool_name [String] SQL pool name
373
+ # @param workload_group_name [String] The name of the workload group.
374
+ # @param workload_classifier_name [String] The name of the workload classifier.
375
+ # @param parameters [WorkloadClassifier] The properties of the workload
376
+ # classifier.
377
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
378
+ # will be added to the HTTP request.
379
+ #
380
+ # @return [WorkloadClassifier] operation results.
381
+ #
382
+ def begin_create_or_update(resource_group_name, workspace_name, sql_pool_name, workload_group_name, workload_classifier_name, parameters, custom_headers:nil)
383
+ response = begin_create_or_update_async(resource_group_name, workspace_name, sql_pool_name, workload_group_name, workload_classifier_name, parameters, custom_headers:custom_headers).value!
384
+ response.body unless response.nil?
385
+ end
386
+
387
+ #
388
+ # Create Or Update workload classifier
389
+ #
390
+ # Create Or Update workload classifier for a Sql pool's workload group.
391
+ #
392
+ # @param resource_group_name [String] The name of the resource group. The name
393
+ # is case insensitive.
394
+ # @param workspace_name [String] The name of the workspace
395
+ # @param sql_pool_name [String] SQL pool name
396
+ # @param workload_group_name [String] The name of the workload group.
397
+ # @param workload_classifier_name [String] The name of the workload classifier.
398
+ # @param parameters [WorkloadClassifier] The properties of the workload
399
+ # classifier.
400
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
401
+ # will be added to the HTTP request.
402
+ #
403
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
404
+ #
405
+ def begin_create_or_update_with_http_info(resource_group_name, workspace_name, sql_pool_name, workload_group_name, workload_classifier_name, parameters, custom_headers:nil)
406
+ begin_create_or_update_async(resource_group_name, workspace_name, sql_pool_name, workload_group_name, workload_classifier_name, parameters, custom_headers:custom_headers).value!
407
+ end
408
+
409
+ #
410
+ # Create Or Update workload classifier
411
+ #
412
+ # Create Or Update workload classifier for a Sql pool's workload group.
413
+ #
414
+ # @param resource_group_name [String] The name of the resource group. The name
415
+ # is case insensitive.
416
+ # @param workspace_name [String] The name of the workspace
417
+ # @param sql_pool_name [String] SQL pool name
418
+ # @param workload_group_name [String] The name of the workload group.
419
+ # @param workload_classifier_name [String] The name of the workload classifier.
420
+ # @param parameters [WorkloadClassifier] The properties of the workload
421
+ # classifier.
422
+ # @param [Hash{String => String}] A hash of custom headers that will be added
423
+ # to the HTTP request.
424
+ #
425
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
426
+ #
427
+ def begin_create_or_update_async(resource_group_name, workspace_name, sql_pool_name, workload_group_name, workload_classifier_name, parameters, custom_headers:nil)
428
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
429
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
430
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
431
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
432
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
433
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
434
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
435
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
436
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
437
+ fail ArgumentError, 'sql_pool_name is nil' if sql_pool_name.nil?
438
+ fail ArgumentError, 'workload_group_name is nil' if workload_group_name.nil?
439
+ fail ArgumentError, 'workload_classifier_name is nil' if workload_classifier_name.nil?
440
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
441
+
442
+
443
+ request_headers = {}
444
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
445
+
446
+ # Set Headers
447
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
448
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
449
+
450
+ # Serialize Request
451
+ request_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::WorkloadClassifier.mapper()
452
+ request_content = @client.serialize(request_mapper, parameters)
453
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
454
+
455
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}'
456
+
457
+ request_url = @base_url || @client.base_url
458
+
459
+ options = {
460
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
461
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'sqlPoolName' => sql_pool_name,'workloadGroupName' => workload_group_name,'workloadClassifierName' => workload_classifier_name},
462
+ query_params: {'api-version' => @client.api_version},
463
+ body: request_content,
464
+ headers: request_headers.merge(custom_headers || {}),
465
+ base_url: request_url
466
+ }
467
+ promise = @client.make_request_async(:put, path_template, options)
468
+
469
+ promise = promise.then do |result|
470
+ http_response = result.response
471
+ status_code = http_response.status
472
+ response_content = http_response.body
473
+ unless status_code == 200 || status_code == 202 || status_code == 201
474
+ error_model = JSON.load(response_content)
475
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
476
+ end
477
+
478
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
479
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
480
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
481
+ # Deserialize Response
482
+ if status_code == 200
483
+ begin
484
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
485
+ result_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::WorkloadClassifier.mapper()
486
+ result.body = @client.deserialize(result_mapper, parsed_response)
487
+ rescue Exception => e
488
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
489
+ end
490
+ end
491
+ # Deserialize Response
492
+ if status_code == 201
493
+ begin
494
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
495
+ result_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::WorkloadClassifier.mapper()
496
+ result.body = @client.deserialize(result_mapper, parsed_response)
497
+ rescue Exception => e
498
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
499
+ end
500
+ end
501
+
502
+ result
503
+ end
504
+
505
+ promise.execute
506
+ end
507
+
508
+ #
509
+ # Remove workload classifier
510
+ #
511
+ # Remove workload classifier of a Sql pool's workload group.
512
+ #
513
+ # @param resource_group_name [String] The name of the resource group. The name
514
+ # is case insensitive.
515
+ # @param workspace_name [String] The name of the workspace
516
+ # @param sql_pool_name [String] SQL pool name
517
+ # @param workload_group_name [String] The name of the workload group.
518
+ # @param workload_classifier_name [String] The name of the workload classifier.
519
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
520
+ # will be added to the HTTP request.
521
+ #
522
+ #
523
+ def begin_delete(resource_group_name, workspace_name, sql_pool_name, workload_group_name, workload_classifier_name, custom_headers:nil)
524
+ response = begin_delete_async(resource_group_name, workspace_name, sql_pool_name, workload_group_name, workload_classifier_name, custom_headers:custom_headers).value!
525
+ nil
526
+ end
527
+
528
+ #
529
+ # Remove workload classifier
530
+ #
531
+ # Remove workload classifier of a Sql pool's workload group.
532
+ #
533
+ # @param resource_group_name [String] The name of the resource group. The name
534
+ # is case insensitive.
535
+ # @param workspace_name [String] The name of the workspace
536
+ # @param sql_pool_name [String] SQL pool name
537
+ # @param workload_group_name [String] The name of the workload group.
538
+ # @param workload_classifier_name [String] The name of the workload classifier.
539
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
540
+ # will be added to the HTTP request.
541
+ #
542
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
543
+ #
544
+ def begin_delete_with_http_info(resource_group_name, workspace_name, sql_pool_name, workload_group_name, workload_classifier_name, custom_headers:nil)
545
+ begin_delete_async(resource_group_name, workspace_name, sql_pool_name, workload_group_name, workload_classifier_name, custom_headers:custom_headers).value!
546
+ end
547
+
548
+ #
549
+ # Remove workload classifier
550
+ #
551
+ # Remove workload classifier of a Sql pool's workload group.
552
+ #
553
+ # @param resource_group_name [String] The name of the resource group. The name
554
+ # is case insensitive.
555
+ # @param workspace_name [String] The name of the workspace
556
+ # @param sql_pool_name [String] SQL pool name
557
+ # @param workload_group_name [String] The name of the workload group.
558
+ # @param workload_classifier_name [String] The name of the workload classifier.
559
+ # @param [Hash{String => String}] A hash of custom headers that will be added
560
+ # to the HTTP request.
561
+ #
562
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
563
+ #
564
+ def begin_delete_async(resource_group_name, workspace_name, sql_pool_name, workload_group_name, workload_classifier_name, custom_headers:nil)
565
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
566
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
567
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
568
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
569
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
570
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
571
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
572
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
573
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
574
+ fail ArgumentError, 'sql_pool_name is nil' if sql_pool_name.nil?
575
+ fail ArgumentError, 'workload_group_name is nil' if workload_group_name.nil?
576
+ fail ArgumentError, 'workload_classifier_name is nil' if workload_classifier_name.nil?
577
+
578
+
579
+ request_headers = {}
580
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
581
+
582
+ # Set Headers
583
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
584
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
585
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}'
586
+
587
+ request_url = @base_url || @client.base_url
588
+
589
+ options = {
590
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
591
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'sqlPoolName' => sql_pool_name,'workloadGroupName' => workload_group_name,'workloadClassifierName' => workload_classifier_name},
592
+ query_params: {'api-version' => @client.api_version},
593
+ headers: request_headers.merge(custom_headers || {}),
594
+ base_url: request_url
595
+ }
596
+ promise = @client.make_request_async(:delete, path_template, options)
597
+
598
+ promise = promise.then do |result|
599
+ http_response = result.response
600
+ status_code = http_response.status
601
+ response_content = http_response.body
602
+ unless status_code == 200 || status_code == 202 || status_code == 204
603
+ error_model = JSON.load(response_content)
604
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
605
+ end
606
+
607
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
608
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
609
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
610
+
611
+ result
612
+ end
613
+
614
+ promise.execute
615
+ end
616
+
617
+ #
618
+ # Sql pool's workload classifier
619
+ #
620
+ # Get list of Sql pool's workload classifier for workload groups.
621
+ #
622
+ # @param next_page_link [String] The NextLink from the previous successful call
623
+ # to List operation.
624
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
625
+ # will be added to the HTTP request.
626
+ #
627
+ # @return [WorkloadClassifierListResult] operation results.
628
+ #
629
+ def list_next(next_page_link, custom_headers:nil)
630
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
631
+ response.body unless response.nil?
632
+ end
633
+
634
+ #
635
+ # Sql pool's workload classifier
636
+ #
637
+ # Get list of Sql pool's workload classifier for workload groups.
638
+ #
639
+ # @param next_page_link [String] The NextLink from the previous successful call
640
+ # to List operation.
641
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
642
+ # will be added to the HTTP request.
643
+ #
644
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
645
+ #
646
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
647
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
648
+ end
649
+
650
+ #
651
+ # Sql pool's workload classifier
652
+ #
653
+ # Get list of Sql pool's workload classifier for workload groups.
654
+ #
655
+ # @param next_page_link [String] The NextLink from the previous successful call
656
+ # to List operation.
657
+ # @param [Hash{String => String}] A hash of custom headers that will be added
658
+ # to the HTTP request.
659
+ #
660
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
661
+ #
662
+ def list_next_async(next_page_link, custom_headers:nil)
663
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
664
+
665
+
666
+ request_headers = {}
667
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
668
+
669
+ # Set Headers
670
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
671
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
672
+ path_template = '{nextLink}'
673
+
674
+ request_url = @base_url || @client.base_url
675
+
676
+ options = {
677
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
678
+ skip_encoding_path_params: {'nextLink' => next_page_link},
679
+ headers: request_headers.merge(custom_headers || {}),
680
+ base_url: request_url
681
+ }
682
+ promise = @client.make_request_async(:get, path_template, options)
683
+
684
+ promise = promise.then do |result|
685
+ http_response = result.response
686
+ status_code = http_response.status
687
+ response_content = http_response.body
688
+ unless status_code == 200
689
+ error_model = JSON.load(response_content)
690
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
691
+ end
692
+
693
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
694
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
695
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
696
+ # Deserialize Response
697
+ if status_code == 200
698
+ begin
699
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
700
+ result_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::WorkloadClassifierListResult.mapper()
701
+ result.body = @client.deserialize(result_mapper, parsed_response)
702
+ rescue Exception => e
703
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
704
+ end
705
+ end
706
+
707
+ result
708
+ end
709
+
710
+ promise.execute
711
+ end
712
+
713
+ #
714
+ # Sql pool's workload classifier
715
+ #
716
+ # Get list of Sql pool's workload classifier for workload groups.
717
+ #
718
+ # @param resource_group_name [String] The name of the resource group. The name
719
+ # is case insensitive.
720
+ # @param workspace_name [String] The name of the workspace
721
+ # @param sql_pool_name [String] SQL pool name
722
+ # @param workload_group_name [String] The name of the workload group.
723
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
724
+ # will be added to the HTTP request.
725
+ #
726
+ # @return [WorkloadClassifierListResult] which provide lazy access to pages of
727
+ # the response.
728
+ #
729
+ def list_as_lazy(resource_group_name, workspace_name, sql_pool_name, workload_group_name, custom_headers:nil)
730
+ response = list_async(resource_group_name, workspace_name, sql_pool_name, workload_group_name, custom_headers:custom_headers).value!
731
+ unless response.nil?
732
+ page = response.body
733
+ page.next_method = Proc.new do |next_page_link|
734
+ list_next_async(next_page_link, custom_headers:custom_headers)
735
+ end
736
+ page
737
+ end
738
+ end
739
+
740
+ end
741
+ end