azure_mgmt_synapse 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,246 @@
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 WorkspaceManagedIdentitySqlControlSettings
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the WorkspaceManagedIdentitySqlControlSettings 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 Managed Identity Sql Control Settings
26
+ #
27
+ # @param resource_group_name [String] The name of the resource group. The name
28
+ # is case insensitive.
29
+ # @param workspace_name [String] The name of the workspace
30
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
+ # will be added to the HTTP request.
32
+ #
33
+ # @return [ManagedIdentitySqlControlSettingsModel] operation results.
34
+ #
35
+ def get(resource_group_name, workspace_name, custom_headers:nil)
36
+ response = get_async(resource_group_name, workspace_name, custom_headers:custom_headers).value!
37
+ response.body unless response.nil?
38
+ end
39
+
40
+ #
41
+ # Get Managed Identity Sql Control Settings
42
+ #
43
+ # @param resource_group_name [String] The name of the resource group. The name
44
+ # is case insensitive.
45
+ # @param workspace_name [String] The name of the workspace
46
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
47
+ # will be added to the HTTP request.
48
+ #
49
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
50
+ #
51
+ def get_with_http_info(resource_group_name, workspace_name, custom_headers:nil)
52
+ get_async(resource_group_name, workspace_name, custom_headers:custom_headers).value!
53
+ end
54
+
55
+ #
56
+ # Get Managed Identity Sql Control Settings
57
+ #
58
+ # @param resource_group_name [String] The name of the resource group. The name
59
+ # is case insensitive.
60
+ # @param workspace_name [String] The name of the workspace
61
+ # @param [Hash{String => String}] A hash of custom headers that will be added
62
+ # to the HTTP request.
63
+ #
64
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
65
+ #
66
+ def get_async(resource_group_name, workspace_name, custom_headers:nil)
67
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
68
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
69
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
70
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
71
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
72
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
73
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
74
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
75
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
76
+
77
+
78
+ request_headers = {}
79
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
80
+
81
+ # Set Headers
82
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
83
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
84
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/managedIdentitySqlControlSettings/default'
85
+
86
+ request_url = @base_url || @client.base_url
87
+
88
+ options = {
89
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
90
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name},
91
+ query_params: {'api-version' => @client.api_version},
92
+ headers: request_headers.merge(custom_headers || {}),
93
+ base_url: request_url
94
+ }
95
+ promise = @client.make_request_async(:get, path_template, options)
96
+
97
+ promise = promise.then do |result|
98
+ http_response = result.response
99
+ status_code = http_response.status
100
+ response_content = http_response.body
101
+ unless status_code == 200
102
+ error_model = JSON.load(response_content)
103
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
104
+ end
105
+
106
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
107
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
108
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
109
+ # Deserialize Response
110
+ if status_code == 200
111
+ begin
112
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
113
+ result_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::ManagedIdentitySqlControlSettingsModel.mapper()
114
+ result.body = @client.deserialize(result_mapper, parsed_response)
115
+ rescue Exception => e
116
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
117
+ end
118
+ end
119
+
120
+ result
121
+ end
122
+
123
+ promise.execute
124
+ end
125
+
126
+ #
127
+ # Create or update Managed Identity Sql Control Settings
128
+ #
129
+ # @param resource_group_name [String] The name of the resource group. The name
130
+ # is case insensitive.
131
+ # @param workspace_name [String] The name of the workspace
132
+ # @param managed_identity_sql_control_settings
133
+ # [ManagedIdentitySqlControlSettingsModel] Managed Identity Sql Control
134
+ # Settings
135
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
136
+ # will be added to the HTTP request.
137
+ #
138
+ # @return [ManagedIdentitySqlControlSettingsModel] operation results.
139
+ #
140
+ def create_or_update(resource_group_name, workspace_name, managed_identity_sql_control_settings, custom_headers:nil)
141
+ response = create_or_update_async(resource_group_name, workspace_name, managed_identity_sql_control_settings, custom_headers:custom_headers).value!
142
+ response.body unless response.nil?
143
+ end
144
+
145
+ #
146
+ # Create or update Managed Identity Sql Control Settings
147
+ #
148
+ # @param resource_group_name [String] The name of the resource group. The name
149
+ # is case insensitive.
150
+ # @param workspace_name [String] The name of the workspace
151
+ # @param managed_identity_sql_control_settings
152
+ # [ManagedIdentitySqlControlSettingsModel] Managed Identity Sql Control
153
+ # Settings
154
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
155
+ # will be added to the HTTP request.
156
+ #
157
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
158
+ #
159
+ def create_or_update_with_http_info(resource_group_name, workspace_name, managed_identity_sql_control_settings, custom_headers:nil)
160
+ create_or_update_async(resource_group_name, workspace_name, managed_identity_sql_control_settings, custom_headers:custom_headers).value!
161
+ end
162
+
163
+ #
164
+ # Create or update Managed Identity Sql Control Settings
165
+ #
166
+ # @param resource_group_name [String] The name of the resource group. The name
167
+ # is case insensitive.
168
+ # @param workspace_name [String] The name of the workspace
169
+ # @param managed_identity_sql_control_settings
170
+ # [ManagedIdentitySqlControlSettingsModel] Managed Identity Sql Control
171
+ # Settings
172
+ # @param [Hash{String => String}] A hash of custom headers that will be added
173
+ # to the HTTP request.
174
+ #
175
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
176
+ #
177
+ def create_or_update_async(resource_group_name, workspace_name, managed_identity_sql_control_settings, custom_headers:nil)
178
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
179
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
180
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
181
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
182
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
183
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
184
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
185
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
186
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
187
+ fail ArgumentError, 'managed_identity_sql_control_settings is nil' if managed_identity_sql_control_settings.nil?
188
+
189
+
190
+ request_headers = {}
191
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
192
+
193
+ # Set Headers
194
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
195
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
196
+
197
+ # Serialize Request
198
+ request_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::ManagedIdentitySqlControlSettingsModel.mapper()
199
+ request_content = @client.serialize(request_mapper, managed_identity_sql_control_settings)
200
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
201
+
202
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/managedIdentitySqlControlSettings/default'
203
+
204
+ request_url = @base_url || @client.base_url
205
+
206
+ options = {
207
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
208
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name},
209
+ query_params: {'api-version' => @client.api_version},
210
+ body: request_content,
211
+ headers: request_headers.merge(custom_headers || {}),
212
+ base_url: request_url
213
+ }
214
+ promise = @client.make_request_async(:put, path_template, options)
215
+
216
+ promise = promise.then do |result|
217
+ http_response = result.response
218
+ status_code = http_response.status
219
+ response_content = http_response.body
220
+ unless status_code == 200
221
+ error_model = JSON.load(response_content)
222
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
223
+ end
224
+
225
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
226
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
227
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
228
+ # Deserialize Response
229
+ if status_code == 200
230
+ begin
231
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
232
+ result_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::ManagedIdentitySqlControlSettingsModel.mapper()
233
+ result.body = @client.deserialize(result_mapper, parsed_response)
234
+ rescue Exception => e
235
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
236
+ end
237
+ end
238
+
239
+ result
240
+ end
241
+
242
+ promise.execute
243
+ end
244
+
245
+ end
246
+ end
@@ -0,0 +1,1026 @@
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 Workspaces
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Workspaces 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
+ # Returns a list of workspaces in a resource group
26
+ #
27
+ # @param resource_group_name [String] The name of the resource group. The name
28
+ # is case insensitive.
29
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
30
+ # will be added to the HTTP request.
31
+ #
32
+ # @return [Array<Workspace>] operation results.
33
+ #
34
+ def list_by_resource_group(resource_group_name, custom_headers:nil)
35
+ first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers:custom_headers)
36
+ first_page.get_all_items
37
+ end
38
+
39
+ #
40
+ # Returns a list of workspaces in a resource group
41
+ #
42
+ # @param resource_group_name [String] The name of the resource group. The name
43
+ # is case insensitive.
44
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
45
+ # will be added to the HTTP request.
46
+ #
47
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
48
+ #
49
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
50
+ list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
51
+ end
52
+
53
+ #
54
+ # Returns a list of workspaces in a resource group
55
+ #
56
+ # @param resource_group_name [String] The name of the resource group. The name
57
+ # is case insensitive.
58
+ # @param [Hash{String => String}] A hash of custom headers that will be added
59
+ # to the HTTP request.
60
+ #
61
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
62
+ #
63
+ def list_by_resource_group_async(resource_group_name, custom_headers:nil)
64
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
65
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
66
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
67
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
68
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
69
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
70
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
71
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
72
+
73
+
74
+ request_headers = {}
75
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
76
+
77
+ # Set Headers
78
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
79
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
80
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces'
81
+
82
+ request_url = @base_url || @client.base_url
83
+
84
+ options = {
85
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
86
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
87
+ query_params: {'api-version' => @client.api_version},
88
+ headers: request_headers.merge(custom_headers || {}),
89
+ base_url: request_url
90
+ }
91
+ promise = @client.make_request_async(:get, path_template, options)
92
+
93
+ promise = promise.then do |result|
94
+ http_response = result.response
95
+ status_code = http_response.status
96
+ response_content = http_response.body
97
+ unless status_code == 200
98
+ error_model = JSON.load(response_content)
99
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
100
+ end
101
+
102
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
103
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
104
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
105
+ # Deserialize Response
106
+ if status_code == 200
107
+ begin
108
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
109
+ result_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::WorkspaceInfoListResult.mapper()
110
+ result.body = @client.deserialize(result_mapper, parsed_response)
111
+ rescue Exception => e
112
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
113
+ end
114
+ end
115
+
116
+ result
117
+ end
118
+
119
+ promise.execute
120
+ end
121
+
122
+ #
123
+ # Gets a workspace
124
+ #
125
+ # @param resource_group_name [String] The name of the resource group. The name
126
+ # is case insensitive.
127
+ # @param workspace_name [String] The name of the workspace
128
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
129
+ # will be added to the HTTP request.
130
+ #
131
+ # @return [Workspace] operation results.
132
+ #
133
+ def get(resource_group_name, workspace_name, custom_headers:nil)
134
+ response = get_async(resource_group_name, workspace_name, custom_headers:custom_headers).value!
135
+ response.body unless response.nil?
136
+ end
137
+
138
+ #
139
+ # Gets a workspace
140
+ #
141
+ # @param resource_group_name [String] The name of the resource group. The name
142
+ # is case insensitive.
143
+ # @param workspace_name [String] The name of the workspace
144
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
145
+ # will be added to the HTTP request.
146
+ #
147
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
148
+ #
149
+ def get_with_http_info(resource_group_name, workspace_name, custom_headers:nil)
150
+ get_async(resource_group_name, workspace_name, custom_headers:custom_headers).value!
151
+ end
152
+
153
+ #
154
+ # Gets a workspace
155
+ #
156
+ # @param resource_group_name [String] The name of the resource group. The name
157
+ # is case insensitive.
158
+ # @param workspace_name [String] The name of the workspace
159
+ # @param [Hash{String => String}] A hash of custom headers that will be added
160
+ # to the HTTP request.
161
+ #
162
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
163
+ #
164
+ def get_async(resource_group_name, workspace_name, custom_headers:nil)
165
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
166
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
167
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
168
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
169
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
170
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
171
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
172
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
173
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
174
+
175
+
176
+ request_headers = {}
177
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
178
+
179
+ # Set Headers
180
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
181
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
182
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}'
183
+
184
+ request_url = @base_url || @client.base_url
185
+
186
+ options = {
187
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
188
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name},
189
+ query_params: {'api-version' => @client.api_version},
190
+ headers: request_headers.merge(custom_headers || {}),
191
+ base_url: request_url
192
+ }
193
+ promise = @client.make_request_async(:get, path_template, options)
194
+
195
+ promise = promise.then do |result|
196
+ http_response = result.response
197
+ status_code = http_response.status
198
+ response_content = http_response.body
199
+ unless status_code == 200
200
+ error_model = JSON.load(response_content)
201
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
202
+ end
203
+
204
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
205
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
206
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
207
+ # Deserialize Response
208
+ if status_code == 200
209
+ begin
210
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
211
+ result_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::Workspace.mapper()
212
+ result.body = @client.deserialize(result_mapper, parsed_response)
213
+ rescue Exception => e
214
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
215
+ end
216
+ end
217
+
218
+ result
219
+ end
220
+
221
+ promise.execute
222
+ end
223
+
224
+ #
225
+ # Updates a workspace
226
+ #
227
+ # @param resource_group_name [String] The name of the resource group. The name
228
+ # is case insensitive.
229
+ # @param workspace_name [String] The name of the workspace
230
+ # @param workspace_patch_info [WorkspacePatchInfo] Workspace patch request
231
+ # properties
232
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
233
+ # will be added to the HTTP request.
234
+ #
235
+ # @return [Workspace] operation results.
236
+ #
237
+ def update(resource_group_name, workspace_name, workspace_patch_info, custom_headers:nil)
238
+ response = update_async(resource_group_name, workspace_name, workspace_patch_info, custom_headers:custom_headers).value!
239
+ response.body unless response.nil?
240
+ end
241
+
242
+ #
243
+ # @param resource_group_name [String] The name of the resource group. The name
244
+ # is case insensitive.
245
+ # @param workspace_name [String] The name of the workspace
246
+ # @param workspace_patch_info [WorkspacePatchInfo] Workspace patch request
247
+ # properties
248
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
249
+ # will be added to the HTTP request.
250
+ #
251
+ # @return [Concurrent::Promise] promise which provides async access to http
252
+ # response.
253
+ #
254
+ def update_async(resource_group_name, workspace_name, workspace_patch_info, custom_headers:nil)
255
+ # Send request
256
+ promise = begin_update_async(resource_group_name, workspace_name, workspace_patch_info, custom_headers:custom_headers)
257
+
258
+ promise = promise.then do |response|
259
+ # Defining deserialization method.
260
+ deserialize_method = lambda do |parsed_response|
261
+ result_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::Workspace.mapper()
262
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
263
+ end
264
+
265
+ # Waiting for response.
266
+ @client.get_long_running_operation_result(response, deserialize_method)
267
+ end
268
+
269
+ promise
270
+ end
271
+
272
+ #
273
+ # Creates or updates a workspace
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 workspace_info [Workspace] Workspace create or update request
279
+ # properties
280
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
281
+ # will be added to the HTTP request.
282
+ #
283
+ # @return [Workspace] operation results.
284
+ #
285
+ def create_or_update(resource_group_name, workspace_name, workspace_info, custom_headers:nil)
286
+ response = create_or_update_async(resource_group_name, workspace_name, workspace_info, custom_headers:custom_headers).value!
287
+ response.body unless response.nil?
288
+ end
289
+
290
+ #
291
+ # @param resource_group_name [String] The name of the resource group. The name
292
+ # is case insensitive.
293
+ # @param workspace_name [String] The name of the workspace
294
+ # @param workspace_info [Workspace] Workspace create or update request
295
+ # properties
296
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
297
+ # will be added to the HTTP request.
298
+ #
299
+ # @return [Concurrent::Promise] promise which provides async access to http
300
+ # response.
301
+ #
302
+ def create_or_update_async(resource_group_name, workspace_name, workspace_info, custom_headers:nil)
303
+ # Send request
304
+ promise = begin_create_or_update_async(resource_group_name, workspace_name, workspace_info, custom_headers:custom_headers)
305
+
306
+ promise = promise.then do |response|
307
+ # Defining deserialization method.
308
+ deserialize_method = lambda do |parsed_response|
309
+ result_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::Workspace.mapper()
310
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
311
+ end
312
+
313
+ # Waiting for response.
314
+ @client.get_long_running_operation_result(response, deserialize_method)
315
+ end
316
+
317
+ promise
318
+ end
319
+
320
+ #
321
+ # Deletes a workspace
322
+ #
323
+ # @param resource_group_name [String] The name of the resource group. The name
324
+ # is case insensitive.
325
+ # @param workspace_name [String] The name of the workspace
326
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
327
+ # will be added to the HTTP request.
328
+ #
329
+ # @return [Object] operation results.
330
+ #
331
+ def delete(resource_group_name, workspace_name, custom_headers:nil)
332
+ response = delete_async(resource_group_name, workspace_name, custom_headers:custom_headers).value!
333
+ response.body unless response.nil?
334
+ end
335
+
336
+ #
337
+ # @param resource_group_name [String] The name of the resource group. The name
338
+ # is case insensitive.
339
+ # @param workspace_name [String] The name of the workspace
340
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
341
+ # will be added to the HTTP request.
342
+ #
343
+ # @return [Concurrent::Promise] promise which provides async access to http
344
+ # response.
345
+ #
346
+ def delete_async(resource_group_name, workspace_name, custom_headers:nil)
347
+ # Send request
348
+ promise = begin_delete_async(resource_group_name, workspace_name, custom_headers:custom_headers)
349
+
350
+ promise = promise.then do |response|
351
+ # Defining deserialization method.
352
+ deserialize_method = lambda do |parsed_response|
353
+ result_mapper = {
354
+ client_side_validation: true,
355
+ required: false,
356
+ serialized_name: 'parsed_response',
357
+ type: {
358
+ name: 'Object'
359
+ }
360
+ }
361
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
362
+ end
363
+
364
+ # Waiting for response.
365
+ @client.get_long_running_operation_result(response, deserialize_method)
366
+ end
367
+
368
+ promise
369
+ end
370
+
371
+ #
372
+ # Returns a list of workspaces in a subscription
373
+ #
374
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
375
+ # will be added to the HTTP request.
376
+ #
377
+ # @return [Array<Workspace>] operation results.
378
+ #
379
+ def list(custom_headers:nil)
380
+ first_page = list_as_lazy(custom_headers:custom_headers)
381
+ first_page.get_all_items
382
+ end
383
+
384
+ #
385
+ # Returns a list of workspaces in a subscription
386
+ #
387
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
388
+ # will be added to the HTTP request.
389
+ #
390
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
391
+ #
392
+ def list_with_http_info(custom_headers:nil)
393
+ list_async(custom_headers:custom_headers).value!
394
+ end
395
+
396
+ #
397
+ # Returns a list of workspaces in a subscription
398
+ #
399
+ # @param [Hash{String => String}] A hash of custom headers that will be added
400
+ # to the HTTP request.
401
+ #
402
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
403
+ #
404
+ def list_async(custom_headers:nil)
405
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
406
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
407
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
408
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
409
+
410
+
411
+ request_headers = {}
412
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
413
+
414
+ # Set Headers
415
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
416
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
417
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Synapse/workspaces'
418
+
419
+ request_url = @base_url || @client.base_url
420
+
421
+ options = {
422
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
423
+ path_params: {'subscriptionId' => @client.subscription_id},
424
+ query_params: {'api-version' => @client.api_version},
425
+ headers: request_headers.merge(custom_headers || {}),
426
+ base_url: request_url
427
+ }
428
+ promise = @client.make_request_async(:get, path_template, options)
429
+
430
+ promise = promise.then do |result|
431
+ http_response = result.response
432
+ status_code = http_response.status
433
+ response_content = http_response.body
434
+ unless status_code == 200
435
+ error_model = JSON.load(response_content)
436
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
437
+ end
438
+
439
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
440
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
441
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
442
+ # Deserialize Response
443
+ if status_code == 200
444
+ begin
445
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
446
+ result_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::WorkspaceInfoListResult.mapper()
447
+ result.body = @client.deserialize(result_mapper, parsed_response)
448
+ rescue Exception => e
449
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
450
+ end
451
+ end
452
+
453
+ result
454
+ end
455
+
456
+ promise.execute
457
+ end
458
+
459
+ #
460
+ # Updates a workspace
461
+ #
462
+ # @param resource_group_name [String] The name of the resource group. The name
463
+ # is case insensitive.
464
+ # @param workspace_name [String] The name of the workspace
465
+ # @param workspace_patch_info [WorkspacePatchInfo] Workspace patch request
466
+ # properties
467
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
468
+ # will be added to the HTTP request.
469
+ #
470
+ # @return [Workspace] operation results.
471
+ #
472
+ def begin_update(resource_group_name, workspace_name, workspace_patch_info, custom_headers:nil)
473
+ response = begin_update_async(resource_group_name, workspace_name, workspace_patch_info, custom_headers:custom_headers).value!
474
+ response.body unless response.nil?
475
+ end
476
+
477
+ #
478
+ # Updates a workspace
479
+ #
480
+ # @param resource_group_name [String] The name of the resource group. The name
481
+ # is case insensitive.
482
+ # @param workspace_name [String] The name of the workspace
483
+ # @param workspace_patch_info [WorkspacePatchInfo] Workspace patch request
484
+ # properties
485
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
486
+ # will be added to the HTTP request.
487
+ #
488
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
489
+ #
490
+ def begin_update_with_http_info(resource_group_name, workspace_name, workspace_patch_info, custom_headers:nil)
491
+ begin_update_async(resource_group_name, workspace_name, workspace_patch_info, custom_headers:custom_headers).value!
492
+ end
493
+
494
+ #
495
+ # Updates a workspace
496
+ #
497
+ # @param resource_group_name [String] The name of the resource group. The name
498
+ # is case insensitive.
499
+ # @param workspace_name [String] The name of the workspace
500
+ # @param workspace_patch_info [WorkspacePatchInfo] Workspace patch request
501
+ # properties
502
+ # @param [Hash{String => String}] A hash of custom headers that will be added
503
+ # to the HTTP request.
504
+ #
505
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
506
+ #
507
+ def begin_update_async(resource_group_name, workspace_name, workspace_patch_info, custom_headers:nil)
508
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
509
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
510
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
511
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
512
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
513
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
514
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
515
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
516
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
517
+ fail ArgumentError, 'workspace_patch_info is nil' if workspace_patch_info.nil?
518
+
519
+
520
+ request_headers = {}
521
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
522
+
523
+ # Set Headers
524
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
525
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
526
+
527
+ # Serialize Request
528
+ request_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::WorkspacePatchInfo.mapper()
529
+ request_content = @client.serialize(request_mapper, workspace_patch_info)
530
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
531
+
532
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}'
533
+
534
+ request_url = @base_url || @client.base_url
535
+
536
+ options = {
537
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
538
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name},
539
+ query_params: {'api-version' => @client.api_version},
540
+ body: request_content,
541
+ headers: request_headers.merge(custom_headers || {}),
542
+ base_url: request_url
543
+ }
544
+ promise = @client.make_request_async(:patch, path_template, options)
545
+
546
+ promise = promise.then do |result|
547
+ http_response = result.response
548
+ status_code = http_response.status
549
+ response_content = http_response.body
550
+ unless status_code == 200 || status_code == 201
551
+ error_model = JSON.load(response_content)
552
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
553
+ end
554
+
555
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
556
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
557
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
558
+ # Deserialize Response
559
+ if status_code == 200
560
+ begin
561
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
562
+ result_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::Workspace.mapper()
563
+ result.body = @client.deserialize(result_mapper, parsed_response)
564
+ rescue Exception => e
565
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
566
+ end
567
+ end
568
+ # Deserialize Response
569
+ if status_code == 201
570
+ begin
571
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
572
+ result_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::Workspace.mapper()
573
+ result.body = @client.deserialize(result_mapper, parsed_response)
574
+ rescue Exception => e
575
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
576
+ end
577
+ end
578
+
579
+ result
580
+ end
581
+
582
+ promise.execute
583
+ end
584
+
585
+ #
586
+ # Creates or updates a workspace
587
+ #
588
+ # @param resource_group_name [String] The name of the resource group. The name
589
+ # is case insensitive.
590
+ # @param workspace_name [String] The name of the workspace
591
+ # @param workspace_info [Workspace] Workspace create or update request
592
+ # properties
593
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
594
+ # will be added to the HTTP request.
595
+ #
596
+ # @return [Workspace] operation results.
597
+ #
598
+ def begin_create_or_update(resource_group_name, workspace_name, workspace_info, custom_headers:nil)
599
+ response = begin_create_or_update_async(resource_group_name, workspace_name, workspace_info, custom_headers:custom_headers).value!
600
+ response.body unless response.nil?
601
+ end
602
+
603
+ #
604
+ # Creates or updates a workspace
605
+ #
606
+ # @param resource_group_name [String] The name of the resource group. The name
607
+ # is case insensitive.
608
+ # @param workspace_name [String] The name of the workspace
609
+ # @param workspace_info [Workspace] Workspace create or update request
610
+ # properties
611
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
612
+ # will be added to the HTTP request.
613
+ #
614
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
615
+ #
616
+ def begin_create_or_update_with_http_info(resource_group_name, workspace_name, workspace_info, custom_headers:nil)
617
+ begin_create_or_update_async(resource_group_name, workspace_name, workspace_info, custom_headers:custom_headers).value!
618
+ end
619
+
620
+ #
621
+ # Creates or updates a workspace
622
+ #
623
+ # @param resource_group_name [String] The name of the resource group. The name
624
+ # is case insensitive.
625
+ # @param workspace_name [String] The name of the workspace
626
+ # @param workspace_info [Workspace] Workspace create or update request
627
+ # properties
628
+ # @param [Hash{String => String}] A hash of custom headers that will be added
629
+ # to the HTTP request.
630
+ #
631
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
632
+ #
633
+ def begin_create_or_update_async(resource_group_name, workspace_name, workspace_info, custom_headers:nil)
634
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
635
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
636
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
637
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
638
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
639
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
640
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
641
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
642
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
643
+ fail ArgumentError, 'workspace_info is nil' if workspace_info.nil?
644
+
645
+
646
+ request_headers = {}
647
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
648
+
649
+ # Set Headers
650
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
651
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
652
+
653
+ # Serialize Request
654
+ request_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::Workspace.mapper()
655
+ request_content = @client.serialize(request_mapper, workspace_info)
656
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
657
+
658
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}'
659
+
660
+ request_url = @base_url || @client.base_url
661
+
662
+ options = {
663
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
664
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name},
665
+ query_params: {'api-version' => @client.api_version},
666
+ body: request_content,
667
+ headers: request_headers.merge(custom_headers || {}),
668
+ base_url: request_url
669
+ }
670
+ promise = @client.make_request_async(:put, path_template, options)
671
+
672
+ promise = promise.then do |result|
673
+ http_response = result.response
674
+ status_code = http_response.status
675
+ response_content = http_response.body
676
+ unless status_code == 200 || status_code == 201
677
+ error_model = JSON.load(response_content)
678
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
679
+ end
680
+
681
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
682
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
683
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
684
+ # Deserialize Response
685
+ if status_code == 200
686
+ begin
687
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
688
+ result_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::Workspace.mapper()
689
+ result.body = @client.deserialize(result_mapper, parsed_response)
690
+ rescue Exception => e
691
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
692
+ end
693
+ end
694
+ # Deserialize Response
695
+ if status_code == 201
696
+ begin
697
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
698
+ result_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::Workspace.mapper()
699
+ result.body = @client.deserialize(result_mapper, parsed_response)
700
+ rescue Exception => e
701
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
702
+ end
703
+ end
704
+
705
+ result
706
+ end
707
+
708
+ promise.execute
709
+ end
710
+
711
+ #
712
+ # Deletes a workspace
713
+ #
714
+ # @param resource_group_name [String] The name of the resource group. The name
715
+ # is case insensitive.
716
+ # @param workspace_name [String] The name of the workspace
717
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
718
+ # will be added to the HTTP request.
719
+ #
720
+ # @return [Object] operation results.
721
+ #
722
+ def begin_delete(resource_group_name, workspace_name, custom_headers:nil)
723
+ response = begin_delete_async(resource_group_name, workspace_name, custom_headers:custom_headers).value!
724
+ response.body unless response.nil?
725
+ end
726
+
727
+ #
728
+ # Deletes a workspace
729
+ #
730
+ # @param resource_group_name [String] The name of the resource group. The name
731
+ # is case insensitive.
732
+ # @param workspace_name [String] The name of the workspace
733
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
734
+ # will be added to the HTTP request.
735
+ #
736
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
737
+ #
738
+ def begin_delete_with_http_info(resource_group_name, workspace_name, custom_headers:nil)
739
+ begin_delete_async(resource_group_name, workspace_name, custom_headers:custom_headers).value!
740
+ end
741
+
742
+ #
743
+ # Deletes a workspace
744
+ #
745
+ # @param resource_group_name [String] The name of the resource group. The name
746
+ # is case insensitive.
747
+ # @param workspace_name [String] The name of the workspace
748
+ # @param [Hash{String => String}] A hash of custom headers that will be added
749
+ # to the HTTP request.
750
+ #
751
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
752
+ #
753
+ def begin_delete_async(resource_group_name, workspace_name, custom_headers:nil)
754
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
755
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
756
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
757
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
758
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
759
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
760
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
761
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
762
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
763
+
764
+
765
+ request_headers = {}
766
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
767
+
768
+ # Set Headers
769
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
770
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
771
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}'
772
+
773
+ request_url = @base_url || @client.base_url
774
+
775
+ options = {
776
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
777
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name},
778
+ query_params: {'api-version' => @client.api_version},
779
+ headers: request_headers.merge(custom_headers || {}),
780
+ base_url: request_url
781
+ }
782
+ promise = @client.make_request_async(:delete, path_template, options)
783
+
784
+ promise = promise.then do |result|
785
+ http_response = result.response
786
+ status_code = http_response.status
787
+ response_content = http_response.body
788
+ unless status_code == 200 || status_code == 202 || status_code == 204
789
+ error_model = JSON.load(response_content)
790
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
791
+ end
792
+
793
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
794
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
795
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
796
+
797
+ result
798
+ end
799
+
800
+ promise.execute
801
+ end
802
+
803
+ #
804
+ # Returns a list of workspaces in a resource group
805
+ #
806
+ # @param next_page_link [String] The NextLink from the previous successful call
807
+ # to List operation.
808
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
809
+ # will be added to the HTTP request.
810
+ #
811
+ # @return [WorkspaceInfoListResult] operation results.
812
+ #
813
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
814
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
815
+ response.body unless response.nil?
816
+ end
817
+
818
+ #
819
+ # Returns a list of workspaces in a resource group
820
+ #
821
+ # @param next_page_link [String] The NextLink from the previous successful call
822
+ # to List operation.
823
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
824
+ # will be added to the HTTP request.
825
+ #
826
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
827
+ #
828
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
829
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
830
+ end
831
+
832
+ #
833
+ # Returns a list of workspaces in a resource group
834
+ #
835
+ # @param next_page_link [String] The NextLink from the previous successful call
836
+ # to List operation.
837
+ # @param [Hash{String => String}] A hash of custom headers that will be added
838
+ # to the HTTP request.
839
+ #
840
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
841
+ #
842
+ def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
843
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
844
+
845
+
846
+ request_headers = {}
847
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
848
+
849
+ # Set Headers
850
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
851
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
852
+ path_template = '{nextLink}'
853
+
854
+ request_url = @base_url || @client.base_url
855
+
856
+ options = {
857
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
858
+ skip_encoding_path_params: {'nextLink' => next_page_link},
859
+ headers: request_headers.merge(custom_headers || {}),
860
+ base_url: request_url
861
+ }
862
+ promise = @client.make_request_async(:get, path_template, options)
863
+
864
+ promise = promise.then do |result|
865
+ http_response = result.response
866
+ status_code = http_response.status
867
+ response_content = http_response.body
868
+ unless status_code == 200
869
+ error_model = JSON.load(response_content)
870
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
871
+ end
872
+
873
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
874
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
875
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
876
+ # Deserialize Response
877
+ if status_code == 200
878
+ begin
879
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
880
+ result_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::WorkspaceInfoListResult.mapper()
881
+ result.body = @client.deserialize(result_mapper, parsed_response)
882
+ rescue Exception => e
883
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
884
+ end
885
+ end
886
+
887
+ result
888
+ end
889
+
890
+ promise.execute
891
+ end
892
+
893
+ #
894
+ # Returns a list of workspaces in a subscription
895
+ #
896
+ # @param next_page_link [String] The NextLink from the previous successful call
897
+ # to List operation.
898
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
899
+ # will be added to the HTTP request.
900
+ #
901
+ # @return [WorkspaceInfoListResult] operation results.
902
+ #
903
+ def list_next(next_page_link, custom_headers:nil)
904
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
905
+ response.body unless response.nil?
906
+ end
907
+
908
+ #
909
+ # Returns a list of workspaces in a subscription
910
+ #
911
+ # @param next_page_link [String] The NextLink from the previous successful call
912
+ # to List operation.
913
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
914
+ # will be added to the HTTP request.
915
+ #
916
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
917
+ #
918
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
919
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
920
+ end
921
+
922
+ #
923
+ # Returns a list of workspaces in a subscription
924
+ #
925
+ # @param next_page_link [String] The NextLink from the previous successful call
926
+ # to List operation.
927
+ # @param [Hash{String => String}] A hash of custom headers that will be added
928
+ # to the HTTP request.
929
+ #
930
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
931
+ #
932
+ def list_next_async(next_page_link, custom_headers:nil)
933
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
934
+
935
+
936
+ request_headers = {}
937
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
938
+
939
+ # Set Headers
940
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
941
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
942
+ path_template = '{nextLink}'
943
+
944
+ request_url = @base_url || @client.base_url
945
+
946
+ options = {
947
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
948
+ skip_encoding_path_params: {'nextLink' => next_page_link},
949
+ headers: request_headers.merge(custom_headers || {}),
950
+ base_url: request_url
951
+ }
952
+ promise = @client.make_request_async(:get, path_template, options)
953
+
954
+ promise = promise.then do |result|
955
+ http_response = result.response
956
+ status_code = http_response.status
957
+ response_content = http_response.body
958
+ unless status_code == 200
959
+ error_model = JSON.load(response_content)
960
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
961
+ end
962
+
963
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
964
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
965
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
966
+ # Deserialize Response
967
+ if status_code == 200
968
+ begin
969
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
970
+ result_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::WorkspaceInfoListResult.mapper()
971
+ result.body = @client.deserialize(result_mapper, parsed_response)
972
+ rescue Exception => e
973
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
974
+ end
975
+ end
976
+
977
+ result
978
+ end
979
+
980
+ promise.execute
981
+ end
982
+
983
+ #
984
+ # Returns a list of workspaces in a resource group
985
+ #
986
+ # @param resource_group_name [String] The name of the resource group. The name
987
+ # is case insensitive.
988
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
989
+ # will be added to the HTTP request.
990
+ #
991
+ # @return [WorkspaceInfoListResult] which provide lazy access to pages of the
992
+ # response.
993
+ #
994
+ def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil)
995
+ response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
996
+ unless response.nil?
997
+ page = response.body
998
+ page.next_method = Proc.new do |next_page_link|
999
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
1000
+ end
1001
+ page
1002
+ end
1003
+ end
1004
+
1005
+ #
1006
+ # Returns a list of workspaces in a subscription
1007
+ #
1008
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1009
+ # will be added to the HTTP request.
1010
+ #
1011
+ # @return [WorkspaceInfoListResult] which provide lazy access to pages of the
1012
+ # response.
1013
+ #
1014
+ def list_as_lazy(custom_headers:nil)
1015
+ response = list_async(custom_headers:custom_headers).value!
1016
+ unless response.nil?
1017
+ page = response.body
1018
+ page.next_method = Proc.new do |next_page_link|
1019
+ list_next_async(next_page_link, custom_headers:custom_headers)
1020
+ end
1021
+ page
1022
+ end
1023
+ end
1024
+
1025
+ end
1026
+ end