azure_mgmt_datashare 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare.rb +117 -0
  4. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/accounts.rb +981 -0
  5. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/consumer_invitations.rb +442 -0
  6. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/consumer_source_data_sets.rb +254 -0
  7. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/data_set_mappings.rb +603 -0
  8. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/data_sets.rb +587 -0
  9. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/data_share_management_client.rb +175 -0
  10. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/invitations.rb +587 -0
  11. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/account.rb +135 -0
  12. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/account_list.rb +99 -0
  13. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/account_update_parameters.rb +54 -0
  14. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/adlsgen1file_data_set.rb +144 -0
  15. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/adlsgen1folder_data_set.rb +133 -0
  16. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/adlsgen2file_data_set.rb +144 -0
  17. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/adlsgen2file_data_set_mapping.rb +167 -0
  18. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/adlsgen2file_system_data_set.rb +133 -0
  19. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/adlsgen2file_system_data_set_mapping.rb +144 -0
  20. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/adlsgen2folder_data_set.rb +144 -0
  21. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/adlsgen2folder_data_set_mapping.rb +155 -0
  22. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/blob_container_data_set.rb +133 -0
  23. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/blob_container_data_set_mapping.rb +144 -0
  24. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/blob_data_set.rb +144 -0
  25. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/blob_data_set_mapping.rb +167 -0
  26. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/blob_folder_data_set.rb +144 -0
  27. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/blob_folder_data_set_mapping.rb +155 -0
  28. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/consumer_invitation.rb +194 -0
  29. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/consumer_invitation_list.rb +99 -0
  30. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/consumer_source_data_set.rb +101 -0
  31. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/consumer_source_data_set_list.rb +99 -0
  32. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/data_set.rb +71 -0
  33. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/data_set_list.rb +101 -0
  34. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/data_set_mapping.rb +71 -0
  35. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/data_set_mapping_list.rb +101 -0
  36. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/data_set_mapping_status.rb +16 -0
  37. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/data_set_type.rb +24 -0
  38. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/data_share_error.rb +47 -0
  39. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/data_share_error_info.rb +88 -0
  40. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/default_dto.rb +101 -0
  41. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/dimension_properties.rb +57 -0
  42. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/identity.rb +70 -0
  43. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/invitation.rb +159 -0
  44. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/invitation_list.rb +99 -0
  45. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/invitation_status.rb +18 -0
  46. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/operation_list.rb +99 -0
  47. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/operation_meta_log_specification.rb +68 -0
  48. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/operation_meta_metric_specification.rb +181 -0
  49. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/operation_meta_service_specification.rb +77 -0
  50. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/operation_model.rb +81 -0
  51. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/operation_model_properties.rb +79 -0
  52. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/operation_response.rb +82 -0
  53. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/output_type.rb +16 -0
  54. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/provider_share_subscription.rb +148 -0
  55. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/provider_share_subscription_list.rb +99 -0
  56. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/provisioning_state.rb +19 -0
  57. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/proxy_dto.rb +71 -0
  58. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/recurrence_interval.rb +16 -0
  59. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/scheduled_source_synchronization_setting.rb +73 -0
  60. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/scheduled_synchronization_setting.rb +140 -0
  61. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/scheduled_trigger.rb +162 -0
  62. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/share.rb +133 -0
  63. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/share_kind.rb +15 -0
  64. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/share_list.rb +98 -0
  65. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/share_subscription.rb +197 -0
  66. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/share_subscription_list.rb +99 -0
  67. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/share_subscription_status.rb +18 -0
  68. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/share_subscription_synchronization.rb +106 -0
  69. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/share_subscription_synchronization_list.rb +99 -0
  70. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/share_synchronization.rb +123 -0
  71. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/share_synchronization_list.rb +99 -0
  72. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/source_share_synchronization_setting.rb +46 -0
  73. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/source_share_synchronization_setting_list.rb +101 -0
  74. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/sql_dbtable_data_set.rb +122 -0
  75. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/sql_dbtable_data_set_mapping.rb +133 -0
  76. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/sql_dwtable_data_set.rb +122 -0
  77. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/sql_dwtable_data_set_mapping.rb +133 -0
  78. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/status.rb +20 -0
  79. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/synchronization_details.rb +221 -0
  80. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/synchronization_details_list.rb +99 -0
  81. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/synchronization_mode.rb +16 -0
  82. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/synchronization_setting.rb +71 -0
  83. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/synchronization_setting_list.rb +101 -0
  84. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/synchronize.rb +48 -0
  85. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/trigger.rb +71 -0
  86. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/trigger_list.rb +101 -0
  87. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/trigger_status.rb +17 -0
  88. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/models/type.rb +15 -0
  89. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/module_definition.rb +9 -0
  90. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/operations.rb +232 -0
  91. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/provider_share_subscriptions.rb +636 -0
  92. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/share_subscriptions.rb +1685 -0
  93. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/shares.rb +1101 -0
  94. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/synchronization_settings.rb +667 -0
  95. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/triggers.rb +701 -0
  96. data/lib/azure_mgmt_datashare.rb +6 -0
  97. data/lib/module_definition.rb +7 -0
  98. data/lib/profiles/latest/datashare_latest_profile_client.rb +40 -0
  99. data/lib/profiles/latest/datashare_module_definition.rb +8 -0
  100. data/lib/profiles/latest/modules/datashare_profile_module.rb +395 -0
  101. data/lib/version.rb +7 -0
  102. metadata +217 -0
@@ -0,0 +1,1101 @@
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::DataShare::Mgmt::V2018_11_01_preview
7
+ #
8
+ # Creates a Microsoft.DataShare management client.
9
+ #
10
+ class Shares
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Shares class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [DataShareManagementClient] reference to the DataShareManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Get a specified share
26
+ #
27
+ # Get a share
28
+ #
29
+ # @param resource_group_name [String] The resource group name.
30
+ # @param account_name [String] The name of the share account.
31
+ # @param share_name [String] The name of the share to retrieve.
32
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
33
+ # will be added to the HTTP request.
34
+ #
35
+ # @return [Share] operation results.
36
+ #
37
+ def get(resource_group_name, account_name, share_name, custom_headers:nil)
38
+ response = get_async(resource_group_name, account_name, share_name, custom_headers:custom_headers).value!
39
+ response.body unless response.nil?
40
+ end
41
+
42
+ #
43
+ # Get a specified share
44
+ #
45
+ # Get a share
46
+ #
47
+ # @param resource_group_name [String] The resource group name.
48
+ # @param account_name [String] The name of the share account.
49
+ # @param share_name [String] The name of the share to retrieve.
50
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
51
+ # will be added to the HTTP request.
52
+ #
53
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
54
+ #
55
+ def get_with_http_info(resource_group_name, account_name, share_name, custom_headers:nil)
56
+ get_async(resource_group_name, account_name, share_name, custom_headers:custom_headers).value!
57
+ end
58
+
59
+ #
60
+ # Get a specified share
61
+ #
62
+ # Get a share
63
+ #
64
+ # @param resource_group_name [String] The resource group name.
65
+ # @param account_name [String] The name of the share account.
66
+ # @param share_name [String] The name of the share to retrieve.
67
+ # @param [Hash{String => String}] A hash of custom headers that will be added
68
+ # to the HTTP request.
69
+ #
70
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
71
+ #
72
+ def get_async(resource_group_name, account_name, share_name, custom_headers:nil)
73
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
74
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
75
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
76
+ fail ArgumentError, 'share_name is nil' if share_name.nil?
77
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
78
+
79
+
80
+ request_headers = {}
81
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
82
+
83
+ # Set Headers
84
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
85
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
86
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}'
87
+
88
+ request_url = @base_url || @client.base_url
89
+
90
+ options = {
91
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
92
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'shareName' => share_name},
93
+ query_params: {'api-version' => @client.api_version},
94
+ headers: request_headers.merge(custom_headers || {}),
95
+ base_url: request_url
96
+ }
97
+ promise = @client.make_request_async(:get, path_template, options)
98
+
99
+ promise = promise.then do |result|
100
+ http_response = result.response
101
+ status_code = http_response.status
102
+ response_content = http_response.body
103
+ unless status_code == 200
104
+ error_model = JSON.load(response_content)
105
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
106
+ end
107
+
108
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
109
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
110
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
111
+ # Deserialize Response
112
+ if status_code == 200
113
+ begin
114
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
115
+ result_mapper = Azure::DataShare::Mgmt::V2018_11_01_preview::Models::Share.mapper()
116
+ result.body = @client.deserialize(result_mapper, parsed_response)
117
+ rescue Exception => e
118
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
119
+ end
120
+ end
121
+
122
+ result
123
+ end
124
+
125
+ promise.execute
126
+ end
127
+
128
+ #
129
+ # Create a share in the given account.
130
+ #
131
+ # Create a share
132
+ #
133
+ # @param resource_group_name [String] The resource group name.
134
+ # @param account_name [String] The name of the share account.
135
+ # @param share_name [String] The name of the share.
136
+ # @param share [Share] The share payload
137
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
138
+ # will be added to the HTTP request.
139
+ #
140
+ # @return [Share] operation results.
141
+ #
142
+ def create(resource_group_name, account_name, share_name, share, custom_headers:nil)
143
+ response = create_async(resource_group_name, account_name, share_name, share, custom_headers:custom_headers).value!
144
+ response.body unless response.nil?
145
+ end
146
+
147
+ #
148
+ # Create a share in the given account.
149
+ #
150
+ # Create a share
151
+ #
152
+ # @param resource_group_name [String] The resource group name.
153
+ # @param account_name [String] The name of the share account.
154
+ # @param share_name [String] The name of the share.
155
+ # @param share [Share] The share payload
156
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
157
+ # will be added to the HTTP request.
158
+ #
159
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
160
+ #
161
+ def create_with_http_info(resource_group_name, account_name, share_name, share, custom_headers:nil)
162
+ create_async(resource_group_name, account_name, share_name, share, custom_headers:custom_headers).value!
163
+ end
164
+
165
+ #
166
+ # Create a share in the given account.
167
+ #
168
+ # Create a share
169
+ #
170
+ # @param resource_group_name [String] The resource group name.
171
+ # @param account_name [String] The name of the share account.
172
+ # @param share_name [String] The name of the share.
173
+ # @param share [Share] The share payload
174
+ # @param [Hash{String => String}] A hash of custom headers that will be added
175
+ # to the HTTP request.
176
+ #
177
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
178
+ #
179
+ def create_async(resource_group_name, account_name, share_name, share, custom_headers:nil)
180
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
181
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
182
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
183
+ fail ArgumentError, 'share_name is nil' if share_name.nil?
184
+ fail ArgumentError, 'share is nil' if share.nil?
185
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
186
+
187
+
188
+ request_headers = {}
189
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
190
+
191
+ # Set Headers
192
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
193
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
194
+
195
+ # Serialize Request
196
+ request_mapper = Azure::DataShare::Mgmt::V2018_11_01_preview::Models::Share.mapper()
197
+ request_content = @client.serialize(request_mapper, share)
198
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
199
+
200
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}'
201
+
202
+ request_url = @base_url || @client.base_url
203
+
204
+ options = {
205
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
206
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'shareName' => share_name},
207
+ query_params: {'api-version' => @client.api_version},
208
+ body: request_content,
209
+ headers: request_headers.merge(custom_headers || {}),
210
+ base_url: request_url
211
+ }
212
+ promise = @client.make_request_async(:put, path_template, options)
213
+
214
+ promise = promise.then do |result|
215
+ http_response = result.response
216
+ status_code = http_response.status
217
+ response_content = http_response.body
218
+ unless status_code == 201 || status_code == 200
219
+ error_model = JSON.load(response_content)
220
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
221
+ end
222
+
223
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
224
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
225
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
226
+ # Deserialize Response
227
+ if status_code == 201
228
+ begin
229
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
230
+ result_mapper = Azure::DataShare::Mgmt::V2018_11_01_preview::Models::Share.mapper()
231
+ result.body = @client.deserialize(result_mapper, parsed_response)
232
+ rescue Exception => e
233
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
234
+ end
235
+ end
236
+ # Deserialize Response
237
+ if status_code == 200
238
+ begin
239
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
240
+ result_mapper = Azure::DataShare::Mgmt::V2018_11_01_preview::Models::Share.mapper()
241
+ result.body = @client.deserialize(result_mapper, parsed_response)
242
+ rescue Exception => e
243
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
244
+ end
245
+ end
246
+
247
+ result
248
+ end
249
+
250
+ promise.execute
251
+ end
252
+
253
+ #
254
+ # Deletes a share
255
+ #
256
+ # Delete a share
257
+ #
258
+ # @param resource_group_name [String] The resource group name.
259
+ # @param account_name [String] The name of the share account.
260
+ # @param share_name [String] The name of the share.
261
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
262
+ # will be added to the HTTP request.
263
+ #
264
+ # @return [OperationResponse] operation results.
265
+ #
266
+ def delete(resource_group_name, account_name, share_name, custom_headers:nil)
267
+ response = delete_async(resource_group_name, account_name, share_name, custom_headers:custom_headers).value!
268
+ response.body unless response.nil?
269
+ end
270
+
271
+ #
272
+ # @param resource_group_name [String] The resource group name.
273
+ # @param account_name [String] The name of the share account.
274
+ # @param share_name [String] The name of the share.
275
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
276
+ # will be added to the HTTP request.
277
+ #
278
+ # @return [Concurrent::Promise] promise which provides async access to http
279
+ # response.
280
+ #
281
+ def delete_async(resource_group_name, account_name, share_name, custom_headers:nil)
282
+ # Send request
283
+ promise = begin_delete_async(resource_group_name, account_name, share_name, custom_headers:custom_headers)
284
+
285
+ promise = promise.then do |response|
286
+ # Defining deserialization method.
287
+ deserialize_method = lambda do |parsed_response|
288
+ result_mapper = Azure::DataShare::Mgmt::V2018_11_01_preview::Models::OperationResponse.mapper()
289
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
290
+ end
291
+
292
+ # Waiting for response.
293
+ @client.get_long_running_operation_result(response, deserialize_method)
294
+ end
295
+
296
+ promise
297
+ end
298
+
299
+ #
300
+ # List of available shares under an account.
301
+ #
302
+ # List shares in an account
303
+ #
304
+ # @param resource_group_name [String] The resource group name.
305
+ # @param account_name [String] The name of the share account.
306
+ # @param skip_token [String] Continuation Token
307
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
308
+ # will be added to the HTTP request.
309
+ #
310
+ # @return [Array<Share>] operation results.
311
+ #
312
+ def list_by_account(resource_group_name, account_name, skip_token:nil, custom_headers:nil)
313
+ first_page = list_by_account_as_lazy(resource_group_name, account_name, skip_token:skip_token, custom_headers:custom_headers)
314
+ first_page.get_all_items
315
+ end
316
+
317
+ #
318
+ # List of available shares under an account.
319
+ #
320
+ # List shares in an account
321
+ #
322
+ # @param resource_group_name [String] The resource group name.
323
+ # @param account_name [String] The name of the share account.
324
+ # @param skip_token [String] Continuation Token
325
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
326
+ # will be added to the HTTP request.
327
+ #
328
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
329
+ #
330
+ def list_by_account_with_http_info(resource_group_name, account_name, skip_token:nil, custom_headers:nil)
331
+ list_by_account_async(resource_group_name, account_name, skip_token:skip_token, custom_headers:custom_headers).value!
332
+ end
333
+
334
+ #
335
+ # List of available shares under an account.
336
+ #
337
+ # List shares in an account
338
+ #
339
+ # @param resource_group_name [String] The resource group name.
340
+ # @param account_name [String] The name of the share account.
341
+ # @param skip_token [String] Continuation Token
342
+ # @param [Hash{String => String}] A hash of custom headers that will be added
343
+ # to the HTTP request.
344
+ #
345
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
346
+ #
347
+ def list_by_account_async(resource_group_name, account_name, skip_token:nil, custom_headers:nil)
348
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
349
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
350
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
351
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
352
+
353
+
354
+ request_headers = {}
355
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
356
+
357
+ # Set Headers
358
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
359
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
360
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares'
361
+
362
+ request_url = @base_url || @client.base_url
363
+
364
+ options = {
365
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
366
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name},
367
+ query_params: {'api-version' => @client.api_version,'$skipToken' => skip_token},
368
+ headers: request_headers.merge(custom_headers || {}),
369
+ base_url: request_url
370
+ }
371
+ promise = @client.make_request_async(:get, path_template, options)
372
+
373
+ promise = promise.then do |result|
374
+ http_response = result.response
375
+ status_code = http_response.status
376
+ response_content = http_response.body
377
+ unless status_code == 200
378
+ error_model = JSON.load(response_content)
379
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
380
+ end
381
+
382
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
383
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
384
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
385
+ # Deserialize Response
386
+ if status_code == 200
387
+ begin
388
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
389
+ result_mapper = Azure::DataShare::Mgmt::V2018_11_01_preview::Models::ShareList.mapper()
390
+ result.body = @client.deserialize(result_mapper, parsed_response)
391
+ rescue Exception => e
392
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
393
+ end
394
+ end
395
+
396
+ result
397
+ end
398
+
399
+ promise.execute
400
+ end
401
+
402
+ #
403
+ # List Synchronizations in a share
404
+ #
405
+ # List synchronizations of a share
406
+ #
407
+ # @param resource_group_name [String] The resource group name.
408
+ # @param account_name [String] The name of the share account.
409
+ # @param share_name [String] The name of the share.
410
+ # @param skip_token [String] Continuation token
411
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
412
+ # will be added to the HTTP request.
413
+ #
414
+ # @return [Array<ShareSynchronization>] operation results.
415
+ #
416
+ def list_synchronizations(resource_group_name, account_name, share_name, skip_token:nil, custom_headers:nil)
417
+ first_page = list_synchronizations_as_lazy(resource_group_name, account_name, share_name, skip_token:skip_token, custom_headers:custom_headers)
418
+ first_page.get_all_items
419
+ end
420
+
421
+ #
422
+ # List Synchronizations in a share
423
+ #
424
+ # List synchronizations of a share
425
+ #
426
+ # @param resource_group_name [String] The resource group name.
427
+ # @param account_name [String] The name of the share account.
428
+ # @param share_name [String] The name of the share.
429
+ # @param skip_token [String] Continuation token
430
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
431
+ # will be added to the HTTP request.
432
+ #
433
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
434
+ #
435
+ def list_synchronizations_with_http_info(resource_group_name, account_name, share_name, skip_token:nil, custom_headers:nil)
436
+ list_synchronizations_async(resource_group_name, account_name, share_name, skip_token:skip_token, custom_headers:custom_headers).value!
437
+ end
438
+
439
+ #
440
+ # List Synchronizations in a share
441
+ #
442
+ # List synchronizations of a share
443
+ #
444
+ # @param resource_group_name [String] The resource group name.
445
+ # @param account_name [String] The name of the share account.
446
+ # @param share_name [String] The name of the share.
447
+ # @param skip_token [String] Continuation token
448
+ # @param [Hash{String => String}] A hash of custom headers that will be added
449
+ # to the HTTP request.
450
+ #
451
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
452
+ #
453
+ def list_synchronizations_async(resource_group_name, account_name, share_name, skip_token:nil, custom_headers:nil)
454
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
455
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
456
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
457
+ fail ArgumentError, 'share_name is nil' if share_name.nil?
458
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
459
+
460
+
461
+ request_headers = {}
462
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
463
+
464
+ # Set Headers
465
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
466
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
467
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/listSynchronizations'
468
+
469
+ request_url = @base_url || @client.base_url
470
+
471
+ options = {
472
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
473
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'shareName' => share_name},
474
+ query_params: {'api-version' => @client.api_version,'$skipToken' => skip_token},
475
+ headers: request_headers.merge(custom_headers || {}),
476
+ base_url: request_url
477
+ }
478
+ promise = @client.make_request_async(:post, path_template, options)
479
+
480
+ promise = promise.then do |result|
481
+ http_response = result.response
482
+ status_code = http_response.status
483
+ response_content = http_response.body
484
+ unless status_code == 200
485
+ error_model = JSON.load(response_content)
486
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
487
+ end
488
+
489
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
490
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
491
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
492
+ # Deserialize Response
493
+ if status_code == 200
494
+ begin
495
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
496
+ result_mapper = Azure::DataShare::Mgmt::V2018_11_01_preview::Models::ShareSynchronizationList.mapper()
497
+ result.body = @client.deserialize(result_mapper, parsed_response)
498
+ rescue Exception => e
499
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
500
+ end
501
+ end
502
+
503
+ result
504
+ end
505
+
506
+ promise.execute
507
+ end
508
+
509
+ #
510
+ # List data set level details for a share synchronization
511
+ #
512
+ # List synchronization details
513
+ #
514
+ # @param resource_group_name [String] The resource group name.
515
+ # @param account_name [String] The name of the share account.
516
+ # @param share_name [String] The name of the share.
517
+ # @param share_synchronization [ShareSynchronization] Share Synchronization
518
+ # payload.
519
+ # @param skip_token [String] Continuation token
520
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
521
+ # will be added to the HTTP request.
522
+ #
523
+ # @return [Array<SynchronizationDetails>] operation results.
524
+ #
525
+ def list_synchronization_details(resource_group_name, account_name, share_name, share_synchronization, skip_token:nil, custom_headers:nil)
526
+ first_page = list_synchronization_details_as_lazy(resource_group_name, account_name, share_name, share_synchronization, skip_token:skip_token, custom_headers:custom_headers)
527
+ first_page.get_all_items
528
+ end
529
+
530
+ #
531
+ # List data set level details for a share synchronization
532
+ #
533
+ # List synchronization details
534
+ #
535
+ # @param resource_group_name [String] The resource group name.
536
+ # @param account_name [String] The name of the share account.
537
+ # @param share_name [String] The name of the share.
538
+ # @param share_synchronization [ShareSynchronization] Share Synchronization
539
+ # payload.
540
+ # @param skip_token [String] Continuation token
541
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
542
+ # will be added to the HTTP request.
543
+ #
544
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
545
+ #
546
+ def list_synchronization_details_with_http_info(resource_group_name, account_name, share_name, share_synchronization, skip_token:nil, custom_headers:nil)
547
+ list_synchronization_details_async(resource_group_name, account_name, share_name, share_synchronization, skip_token:skip_token, custom_headers:custom_headers).value!
548
+ end
549
+
550
+ #
551
+ # List data set level details for a share synchronization
552
+ #
553
+ # List synchronization details
554
+ #
555
+ # @param resource_group_name [String] The resource group name.
556
+ # @param account_name [String] The name of the share account.
557
+ # @param share_name [String] The name of the share.
558
+ # @param share_synchronization [ShareSynchronization] Share Synchronization
559
+ # payload.
560
+ # @param skip_token [String] Continuation token
561
+ # @param [Hash{String => String}] A hash of custom headers that will be added
562
+ # to the HTTP request.
563
+ #
564
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
565
+ #
566
+ def list_synchronization_details_async(resource_group_name, account_name, share_name, share_synchronization, skip_token:nil, custom_headers:nil)
567
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
568
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
569
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
570
+ fail ArgumentError, 'share_name is nil' if share_name.nil?
571
+ fail ArgumentError, 'share_synchronization is nil' if share_synchronization.nil?
572
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
573
+
574
+
575
+ request_headers = {}
576
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
577
+
578
+ # Set Headers
579
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
580
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
581
+
582
+ # Serialize Request
583
+ request_mapper = Azure::DataShare::Mgmt::V2018_11_01_preview::Models::ShareSynchronization.mapper()
584
+ request_content = @client.serialize(request_mapper, share_synchronization)
585
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
586
+
587
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/listSynchronizationDetails'
588
+
589
+ request_url = @base_url || @client.base_url
590
+
591
+ options = {
592
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
593
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'shareName' => share_name},
594
+ query_params: {'api-version' => @client.api_version,'$skipToken' => skip_token},
595
+ body: request_content,
596
+ headers: request_headers.merge(custom_headers || {}),
597
+ base_url: request_url
598
+ }
599
+ promise = @client.make_request_async(:post, path_template, options)
600
+
601
+ promise = promise.then do |result|
602
+ http_response = result.response
603
+ status_code = http_response.status
604
+ response_content = http_response.body
605
+ unless status_code == 200
606
+ error_model = JSON.load(response_content)
607
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
608
+ end
609
+
610
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
611
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
612
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
613
+ # Deserialize Response
614
+ if status_code == 200
615
+ begin
616
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
617
+ result_mapper = Azure::DataShare::Mgmt::V2018_11_01_preview::Models::SynchronizationDetailsList.mapper()
618
+ result.body = @client.deserialize(result_mapper, parsed_response)
619
+ rescue Exception => e
620
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
621
+ end
622
+ end
623
+
624
+ result
625
+ end
626
+
627
+ promise.execute
628
+ end
629
+
630
+ #
631
+ # Deletes a share
632
+ #
633
+ # Delete a share
634
+ #
635
+ # @param resource_group_name [String] The resource group name.
636
+ # @param account_name [String] The name of the share account.
637
+ # @param share_name [String] The name of the share.
638
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
639
+ # will be added to the HTTP request.
640
+ #
641
+ # @return [OperationResponse] operation results.
642
+ #
643
+ def begin_delete(resource_group_name, account_name, share_name, custom_headers:nil)
644
+ response = begin_delete_async(resource_group_name, account_name, share_name, custom_headers:custom_headers).value!
645
+ response.body unless response.nil?
646
+ end
647
+
648
+ #
649
+ # Deletes a share
650
+ #
651
+ # Delete a share
652
+ #
653
+ # @param resource_group_name [String] The resource group name.
654
+ # @param account_name [String] The name of the share account.
655
+ # @param share_name [String] The name of the share.
656
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
657
+ # will be added to the HTTP request.
658
+ #
659
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
660
+ #
661
+ def begin_delete_with_http_info(resource_group_name, account_name, share_name, custom_headers:nil)
662
+ begin_delete_async(resource_group_name, account_name, share_name, custom_headers:custom_headers).value!
663
+ end
664
+
665
+ #
666
+ # Deletes a share
667
+ #
668
+ # Delete a share
669
+ #
670
+ # @param resource_group_name [String] The resource group name.
671
+ # @param account_name [String] The name of the share account.
672
+ # @param share_name [String] The name of the share.
673
+ # @param [Hash{String => String}] A hash of custom headers that will be added
674
+ # to the HTTP request.
675
+ #
676
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
677
+ #
678
+ def begin_delete_async(resource_group_name, account_name, share_name, custom_headers:nil)
679
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
680
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
681
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
682
+ fail ArgumentError, 'share_name is nil' if share_name.nil?
683
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
684
+
685
+
686
+ request_headers = {}
687
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
688
+
689
+ # Set Headers
690
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
691
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
692
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}'
693
+
694
+ request_url = @base_url || @client.base_url
695
+
696
+ options = {
697
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
698
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'shareName' => share_name},
699
+ query_params: {'api-version' => @client.api_version},
700
+ headers: request_headers.merge(custom_headers || {}),
701
+ base_url: request_url
702
+ }
703
+ promise = @client.make_request_async(:delete, path_template, options)
704
+
705
+ promise = promise.then do |result|
706
+ http_response = result.response
707
+ status_code = http_response.status
708
+ response_content = http_response.body
709
+ unless status_code == 200 || status_code == 202 || status_code == 204
710
+ error_model = JSON.load(response_content)
711
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
712
+ end
713
+
714
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
715
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
716
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
717
+ # Deserialize Response
718
+ if status_code == 200
719
+ begin
720
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
721
+ result_mapper = Azure::DataShare::Mgmt::V2018_11_01_preview::Models::OperationResponse.mapper()
722
+ result.body = @client.deserialize(result_mapper, parsed_response)
723
+ rescue Exception => e
724
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
725
+ end
726
+ end
727
+
728
+ result
729
+ end
730
+
731
+ promise.execute
732
+ end
733
+
734
+ #
735
+ # List of available shares under an account.
736
+ #
737
+ # List shares in an account
738
+ #
739
+ # @param next_page_link [String] The NextLink from the previous successful call
740
+ # to List operation.
741
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
742
+ # will be added to the HTTP request.
743
+ #
744
+ # @return [ShareList] operation results.
745
+ #
746
+ def list_by_account_next(next_page_link, custom_headers:nil)
747
+ response = list_by_account_next_async(next_page_link, custom_headers:custom_headers).value!
748
+ response.body unless response.nil?
749
+ end
750
+
751
+ #
752
+ # List of available shares under an account.
753
+ #
754
+ # List shares in an account
755
+ #
756
+ # @param next_page_link [String] The NextLink from the previous successful call
757
+ # to List operation.
758
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
759
+ # will be added to the HTTP request.
760
+ #
761
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
762
+ #
763
+ def list_by_account_next_with_http_info(next_page_link, custom_headers:nil)
764
+ list_by_account_next_async(next_page_link, custom_headers:custom_headers).value!
765
+ end
766
+
767
+ #
768
+ # List of available shares under an account.
769
+ #
770
+ # List shares in an account
771
+ #
772
+ # @param next_page_link [String] The NextLink from the previous successful call
773
+ # to List operation.
774
+ # @param [Hash{String => String}] A hash of custom headers that will be added
775
+ # to the HTTP request.
776
+ #
777
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
778
+ #
779
+ def list_by_account_next_async(next_page_link, custom_headers:nil)
780
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
781
+
782
+
783
+ request_headers = {}
784
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
785
+
786
+ # Set Headers
787
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
788
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
789
+ path_template = '{nextLink}'
790
+
791
+ request_url = @base_url || @client.base_url
792
+
793
+ options = {
794
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
795
+ skip_encoding_path_params: {'nextLink' => next_page_link},
796
+ headers: request_headers.merge(custom_headers || {}),
797
+ base_url: request_url
798
+ }
799
+ promise = @client.make_request_async(:get, path_template, options)
800
+
801
+ promise = promise.then do |result|
802
+ http_response = result.response
803
+ status_code = http_response.status
804
+ response_content = http_response.body
805
+ unless status_code == 200
806
+ error_model = JSON.load(response_content)
807
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
808
+ end
809
+
810
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
811
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
812
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
813
+ # Deserialize Response
814
+ if status_code == 200
815
+ begin
816
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
817
+ result_mapper = Azure::DataShare::Mgmt::V2018_11_01_preview::Models::ShareList.mapper()
818
+ result.body = @client.deserialize(result_mapper, parsed_response)
819
+ rescue Exception => e
820
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
821
+ end
822
+ end
823
+
824
+ result
825
+ end
826
+
827
+ promise.execute
828
+ end
829
+
830
+ #
831
+ # List Synchronizations in a share
832
+ #
833
+ # List synchronizations of a share
834
+ #
835
+ # @param next_page_link [String] The NextLink from the previous successful call
836
+ # to List operation.
837
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
838
+ # will be added to the HTTP request.
839
+ #
840
+ # @return [ShareSynchronizationList] operation results.
841
+ #
842
+ def list_synchronizations_next(next_page_link, custom_headers:nil)
843
+ response = list_synchronizations_next_async(next_page_link, custom_headers:custom_headers).value!
844
+ response.body unless response.nil?
845
+ end
846
+
847
+ #
848
+ # List Synchronizations in a share
849
+ #
850
+ # List synchronizations of a share
851
+ #
852
+ # @param next_page_link [String] The NextLink from the previous successful call
853
+ # to List operation.
854
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
855
+ # will be added to the HTTP request.
856
+ #
857
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
858
+ #
859
+ def list_synchronizations_next_with_http_info(next_page_link, custom_headers:nil)
860
+ list_synchronizations_next_async(next_page_link, custom_headers:custom_headers).value!
861
+ end
862
+
863
+ #
864
+ # List Synchronizations in a share
865
+ #
866
+ # List synchronizations of a share
867
+ #
868
+ # @param next_page_link [String] The NextLink from the previous successful call
869
+ # to List operation.
870
+ # @param [Hash{String => String}] A hash of custom headers that will be added
871
+ # to the HTTP request.
872
+ #
873
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
874
+ #
875
+ def list_synchronizations_next_async(next_page_link, custom_headers:nil)
876
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
877
+
878
+
879
+ request_headers = {}
880
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
881
+
882
+ # Set Headers
883
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
884
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
885
+ path_template = '{nextLink}'
886
+
887
+ request_url = @base_url || @client.base_url
888
+
889
+ options = {
890
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
891
+ skip_encoding_path_params: {'nextLink' => next_page_link},
892
+ headers: request_headers.merge(custom_headers || {}),
893
+ base_url: request_url
894
+ }
895
+ promise = @client.make_request_async(:post, path_template, options)
896
+
897
+ promise = promise.then do |result|
898
+ http_response = result.response
899
+ status_code = http_response.status
900
+ response_content = http_response.body
901
+ unless status_code == 200
902
+ error_model = JSON.load(response_content)
903
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
904
+ end
905
+
906
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
907
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
908
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
909
+ # Deserialize Response
910
+ if status_code == 200
911
+ begin
912
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
913
+ result_mapper = Azure::DataShare::Mgmt::V2018_11_01_preview::Models::ShareSynchronizationList.mapper()
914
+ result.body = @client.deserialize(result_mapper, parsed_response)
915
+ rescue Exception => e
916
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
917
+ end
918
+ end
919
+
920
+ result
921
+ end
922
+
923
+ promise.execute
924
+ end
925
+
926
+ #
927
+ # List data set level details for a share synchronization
928
+ #
929
+ # List synchronization details
930
+ #
931
+ # @param next_page_link [String] The NextLink from the previous successful call
932
+ # to List operation.
933
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
934
+ # will be added to the HTTP request.
935
+ #
936
+ # @return [SynchronizationDetailsList] operation results.
937
+ #
938
+ def list_synchronization_details_next(next_page_link, custom_headers:nil)
939
+ response = list_synchronization_details_next_async(next_page_link, custom_headers:custom_headers).value!
940
+ response.body unless response.nil?
941
+ end
942
+
943
+ #
944
+ # List data set level details for a share synchronization
945
+ #
946
+ # List synchronization details
947
+ #
948
+ # @param next_page_link [String] The NextLink from the previous successful call
949
+ # to List operation.
950
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
951
+ # will be added to the HTTP request.
952
+ #
953
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
954
+ #
955
+ def list_synchronization_details_next_with_http_info(next_page_link, custom_headers:nil)
956
+ list_synchronization_details_next_async(next_page_link, custom_headers:custom_headers).value!
957
+ end
958
+
959
+ #
960
+ # List data set level details for a share synchronization
961
+ #
962
+ # List synchronization details
963
+ #
964
+ # @param next_page_link [String] The NextLink from the previous successful call
965
+ # to List operation.
966
+ # @param [Hash{String => String}] A hash of custom headers that will be added
967
+ # to the HTTP request.
968
+ #
969
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
970
+ #
971
+ def list_synchronization_details_next_async(next_page_link, custom_headers:nil)
972
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
973
+
974
+
975
+ request_headers = {}
976
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
977
+
978
+ # Set Headers
979
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
980
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
981
+ path_template = '{nextLink}'
982
+
983
+ request_url = @base_url || @client.base_url
984
+
985
+ options = {
986
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
987
+ skip_encoding_path_params: {'nextLink' => next_page_link},
988
+ headers: request_headers.merge(custom_headers || {}),
989
+ base_url: request_url
990
+ }
991
+ promise = @client.make_request_async(:post, path_template, options)
992
+
993
+ promise = promise.then do |result|
994
+ http_response = result.response
995
+ status_code = http_response.status
996
+ response_content = http_response.body
997
+ unless status_code == 200
998
+ error_model = JSON.load(response_content)
999
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1000
+ end
1001
+
1002
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1003
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1004
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1005
+ # Deserialize Response
1006
+ if status_code == 200
1007
+ begin
1008
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1009
+ result_mapper = Azure::DataShare::Mgmt::V2018_11_01_preview::Models::SynchronizationDetailsList.mapper()
1010
+ result.body = @client.deserialize(result_mapper, parsed_response)
1011
+ rescue Exception => e
1012
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1013
+ end
1014
+ end
1015
+
1016
+ result
1017
+ end
1018
+
1019
+ promise.execute
1020
+ end
1021
+
1022
+ #
1023
+ # List of available shares under an account.
1024
+ #
1025
+ # List shares in an account
1026
+ #
1027
+ # @param resource_group_name [String] The resource group name.
1028
+ # @param account_name [String] The name of the share account.
1029
+ # @param skip_token [String] Continuation Token
1030
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1031
+ # will be added to the HTTP request.
1032
+ #
1033
+ # @return [ShareList] which provide lazy access to pages of the response.
1034
+ #
1035
+ def list_by_account_as_lazy(resource_group_name, account_name, skip_token:nil, custom_headers:nil)
1036
+ response = list_by_account_async(resource_group_name, account_name, skip_token:skip_token, custom_headers:custom_headers).value!
1037
+ unless response.nil?
1038
+ page = response.body
1039
+ page.next_method = Proc.new do |next_page_link|
1040
+ list_by_account_next_async(next_page_link, custom_headers:custom_headers)
1041
+ end
1042
+ page
1043
+ end
1044
+ end
1045
+
1046
+ #
1047
+ # List Synchronizations in a share
1048
+ #
1049
+ # List synchronizations of a share
1050
+ #
1051
+ # @param resource_group_name [String] The resource group name.
1052
+ # @param account_name [String] The name of the share account.
1053
+ # @param share_name [String] The name of the share.
1054
+ # @param skip_token [String] Continuation token
1055
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1056
+ # will be added to the HTTP request.
1057
+ #
1058
+ # @return [ShareSynchronizationList] which provide lazy access to pages of the
1059
+ # response.
1060
+ #
1061
+ def list_synchronizations_as_lazy(resource_group_name, account_name, share_name, skip_token:nil, custom_headers:nil)
1062
+ response = list_synchronizations_async(resource_group_name, account_name, share_name, skip_token:skip_token, custom_headers:custom_headers).value!
1063
+ unless response.nil?
1064
+ page = response.body
1065
+ page.next_method = Proc.new do |next_page_link|
1066
+ list_synchronizations_next_async(next_page_link, custom_headers:custom_headers)
1067
+ end
1068
+ page
1069
+ end
1070
+ end
1071
+
1072
+ #
1073
+ # List data set level details for a share synchronization
1074
+ #
1075
+ # List synchronization details
1076
+ #
1077
+ # @param resource_group_name [String] The resource group name.
1078
+ # @param account_name [String] The name of the share account.
1079
+ # @param share_name [String] The name of the share.
1080
+ # @param share_synchronization [ShareSynchronization] Share Synchronization
1081
+ # payload.
1082
+ # @param skip_token [String] Continuation token
1083
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1084
+ # will be added to the HTTP request.
1085
+ #
1086
+ # @return [SynchronizationDetailsList] which provide lazy access to pages of
1087
+ # the response.
1088
+ #
1089
+ def list_synchronization_details_as_lazy(resource_group_name, account_name, share_name, share_synchronization, skip_token:nil, custom_headers:nil)
1090
+ response = list_synchronization_details_async(resource_group_name, account_name, share_name, share_synchronization, skip_token:skip_token, custom_headers:custom_headers).value!
1091
+ unless response.nil?
1092
+ page = response.body
1093
+ page.next_method = Proc.new do |next_page_link|
1094
+ list_synchronization_details_next_async(next_page_link, custom_headers:custom_headers)
1095
+ end
1096
+ page
1097
+ end
1098
+ end
1099
+
1100
+ end
1101
+ end