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,587 @@
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 DataSets
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the DataSets 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 DataSet in a share.
26
+ #
27
+ # Get a DataSet in 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.
32
+ # @param data_set_name [String] The name of the dataSet.
33
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
34
+ # will be added to the HTTP request.
35
+ #
36
+ # @return [DataSet] operation results.
37
+ #
38
+ def get(resource_group_name, account_name, share_name, data_set_name, custom_headers:nil)
39
+ response = get_async(resource_group_name, account_name, share_name, data_set_name, custom_headers:custom_headers).value!
40
+ response.body unless response.nil?
41
+ end
42
+
43
+ #
44
+ # Get DataSet in a share.
45
+ #
46
+ # Get a DataSet in a share
47
+ #
48
+ # @param resource_group_name [String] The resource group name.
49
+ # @param account_name [String] The name of the share account.
50
+ # @param share_name [String] The name of the share.
51
+ # @param data_set_name [String] The name of the dataSet.
52
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
53
+ # will be added to the HTTP request.
54
+ #
55
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
56
+ #
57
+ def get_with_http_info(resource_group_name, account_name, share_name, data_set_name, custom_headers:nil)
58
+ get_async(resource_group_name, account_name, share_name, data_set_name, custom_headers:custom_headers).value!
59
+ end
60
+
61
+ #
62
+ # Get DataSet in a share.
63
+ #
64
+ # Get a DataSet in a share
65
+ #
66
+ # @param resource_group_name [String] The resource group name.
67
+ # @param account_name [String] The name of the share account.
68
+ # @param share_name [String] The name of the share.
69
+ # @param data_set_name [String] The name of the dataSet.
70
+ # @param [Hash{String => String}] A hash of custom headers that will be added
71
+ # to the HTTP request.
72
+ #
73
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
74
+ #
75
+ def get_async(resource_group_name, account_name, share_name, data_set_name, custom_headers:nil)
76
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
77
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
78
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
79
+ fail ArgumentError, 'share_name is nil' if share_name.nil?
80
+ fail ArgumentError, 'data_set_name is nil' if data_set_name.nil?
81
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
82
+
83
+
84
+ request_headers = {}
85
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
86
+
87
+ # Set Headers
88
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
89
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
90
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}'
91
+
92
+ request_url = @base_url || @client.base_url
93
+
94
+ options = {
95
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
96
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'shareName' => share_name,'dataSetName' => data_set_name},
97
+ query_params: {'api-version' => @client.api_version},
98
+ headers: request_headers.merge(custom_headers || {}),
99
+ base_url: request_url
100
+ }
101
+ promise = @client.make_request_async(:get, path_template, options)
102
+
103
+ promise = promise.then do |result|
104
+ http_response = result.response
105
+ status_code = http_response.status
106
+ response_content = http_response.body
107
+ unless status_code == 200
108
+ error_model = JSON.load(response_content)
109
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
110
+ end
111
+
112
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
113
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
114
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
115
+ # Deserialize Response
116
+ if status_code == 200
117
+ begin
118
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
119
+ result_mapper = Azure::DataShare::Mgmt::V2018_11_01_preview::Models::DataSet.mapper()
120
+ result.body = @client.deserialize(result_mapper, parsed_response)
121
+ rescue Exception => e
122
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
123
+ end
124
+ end
125
+
126
+ result
127
+ end
128
+
129
+ promise.execute
130
+ end
131
+
132
+ #
133
+ # Adds a new data set to an existing share or updates it if existing.
134
+ #
135
+ # Create a DataSet
136
+ #
137
+ # @param resource_group_name [String] The resource group name.
138
+ # @param account_name [String] The name of the share account.
139
+ # @param share_name [String] The name of the share to add the data set to.
140
+ # @param data_set_name [String] The name of the dataSet.
141
+ # @param data_set [DataSet] The new data set information.
142
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
143
+ # will be added to the HTTP request.
144
+ #
145
+ # @return [DataSet] operation results.
146
+ #
147
+ def create(resource_group_name, account_name, share_name, data_set_name, data_set, custom_headers:nil)
148
+ response = create_async(resource_group_name, account_name, share_name, data_set_name, data_set, custom_headers:custom_headers).value!
149
+ response.body unless response.nil?
150
+ end
151
+
152
+ #
153
+ # Adds a new data set to an existing share or updates it if existing.
154
+ #
155
+ # Create a DataSet
156
+ #
157
+ # @param resource_group_name [String] The resource group name.
158
+ # @param account_name [String] The name of the share account.
159
+ # @param share_name [String] The name of the share to add the data set to.
160
+ # @param data_set_name [String] The name of the dataSet.
161
+ # @param data_set [DataSet] The new data set information.
162
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
163
+ # will be added to the HTTP request.
164
+ #
165
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
166
+ #
167
+ def create_with_http_info(resource_group_name, account_name, share_name, data_set_name, data_set, custom_headers:nil)
168
+ create_async(resource_group_name, account_name, share_name, data_set_name, data_set, custom_headers:custom_headers).value!
169
+ end
170
+
171
+ #
172
+ # Adds a new data set to an existing share or updates it if existing.
173
+ #
174
+ # Create a DataSet
175
+ #
176
+ # @param resource_group_name [String] The resource group name.
177
+ # @param account_name [String] The name of the share account.
178
+ # @param share_name [String] The name of the share to add the data set to.
179
+ # @param data_set_name [String] The name of the dataSet.
180
+ # @param data_set [DataSet] The new data set information.
181
+ # @param [Hash{String => String}] A hash of custom headers that will be added
182
+ # to the HTTP request.
183
+ #
184
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
185
+ #
186
+ def create_async(resource_group_name, account_name, share_name, data_set_name, data_set, custom_headers:nil)
187
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
188
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
189
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
190
+ fail ArgumentError, 'share_name is nil' if share_name.nil?
191
+ fail ArgumentError, 'data_set_name is nil' if data_set_name.nil?
192
+ fail ArgumentError, 'data_set is nil' if data_set.nil?
193
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
194
+
195
+
196
+ request_headers = {}
197
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
198
+
199
+ # Set Headers
200
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
201
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
202
+
203
+ # Serialize Request
204
+ request_mapper = Azure::DataShare::Mgmt::V2018_11_01_preview::Models::DataSet.mapper()
205
+ request_content = @client.serialize(request_mapper, data_set)
206
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
207
+
208
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}'
209
+
210
+ request_url = @base_url || @client.base_url
211
+
212
+ options = {
213
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
214
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'shareName' => share_name,'dataSetName' => data_set_name},
215
+ query_params: {'api-version' => @client.api_version},
216
+ body: request_content,
217
+ headers: request_headers.merge(custom_headers || {}),
218
+ base_url: request_url
219
+ }
220
+ promise = @client.make_request_async(:put, path_template, options)
221
+
222
+ promise = promise.then do |result|
223
+ http_response = result.response
224
+ status_code = http_response.status
225
+ response_content = http_response.body
226
+ unless status_code == 201 || status_code == 200
227
+ error_model = JSON.load(response_content)
228
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
229
+ end
230
+
231
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
232
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
233
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
234
+ # Deserialize Response
235
+ if status_code == 201
236
+ begin
237
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
238
+ result_mapper = Azure::DataShare::Mgmt::V2018_11_01_preview::Models::DataSet.mapper()
239
+ result.body = @client.deserialize(result_mapper, parsed_response)
240
+ rescue Exception => e
241
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
242
+ end
243
+ end
244
+ # Deserialize Response
245
+ if status_code == 200
246
+ begin
247
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
248
+ result_mapper = Azure::DataShare::Mgmt::V2018_11_01_preview::Models::DataSet.mapper()
249
+ result.body = @client.deserialize(result_mapper, parsed_response)
250
+ rescue Exception => e
251
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
252
+ end
253
+ end
254
+
255
+ result
256
+ end
257
+
258
+ promise.execute
259
+ end
260
+
261
+ #
262
+ # Delete DataSet in a share.
263
+ #
264
+ # Delete a DataSet in a share
265
+ #
266
+ # @param resource_group_name [String] The resource group name.
267
+ # @param account_name [String] The name of the share account.
268
+ # @param share_name [String] The name of the share.
269
+ # @param data_set_name [String] The name of the dataSet.
270
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
271
+ # will be added to the HTTP request.
272
+ #
273
+ #
274
+ def delete(resource_group_name, account_name, share_name, data_set_name, custom_headers:nil)
275
+ response = delete_async(resource_group_name, account_name, share_name, data_set_name, custom_headers:custom_headers).value!
276
+ nil
277
+ end
278
+
279
+ #
280
+ # Delete DataSet in a share.
281
+ #
282
+ # Delete a DataSet in a share
283
+ #
284
+ # @param resource_group_name [String] The resource group name.
285
+ # @param account_name [String] The name of the share account.
286
+ # @param share_name [String] The name of the share.
287
+ # @param data_set_name [String] The name of the dataSet.
288
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
289
+ # will be added to the HTTP request.
290
+ #
291
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
292
+ #
293
+ def delete_with_http_info(resource_group_name, account_name, share_name, data_set_name, custom_headers:nil)
294
+ delete_async(resource_group_name, account_name, share_name, data_set_name, custom_headers:custom_headers).value!
295
+ end
296
+
297
+ #
298
+ # Delete DataSet in a share.
299
+ #
300
+ # Delete a DataSet in a share
301
+ #
302
+ # @param resource_group_name [String] The resource group name.
303
+ # @param account_name [String] The name of the share account.
304
+ # @param share_name [String] The name of the share.
305
+ # @param data_set_name [String] The name of the dataSet.
306
+ # @param [Hash{String => String}] A hash of custom headers that will be added
307
+ # to the HTTP request.
308
+ #
309
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
310
+ #
311
+ def delete_async(resource_group_name, account_name, share_name, data_set_name, custom_headers:nil)
312
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
313
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
314
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
315
+ fail ArgumentError, 'share_name is nil' if share_name.nil?
316
+ fail ArgumentError, 'data_set_name is nil' if data_set_name.nil?
317
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
318
+
319
+
320
+ request_headers = {}
321
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
322
+
323
+ # Set Headers
324
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
325
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
326
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}'
327
+
328
+ request_url = @base_url || @client.base_url
329
+
330
+ options = {
331
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
332
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'shareName' => share_name,'dataSetName' => data_set_name},
333
+ query_params: {'api-version' => @client.api_version},
334
+ headers: request_headers.merge(custom_headers || {}),
335
+ base_url: request_url
336
+ }
337
+ promise = @client.make_request_async(:delete, path_template, options)
338
+
339
+ promise = promise.then do |result|
340
+ http_response = result.response
341
+ status_code = http_response.status
342
+ response_content = http_response.body
343
+ unless status_code == 200 || status_code == 204
344
+ error_model = JSON.load(response_content)
345
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
346
+ end
347
+
348
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
349
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
350
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
351
+
352
+ result
353
+ end
354
+
355
+ promise.execute
356
+ end
357
+
358
+ #
359
+ # List DataSets in a share.
360
+ #
361
+ # List DataSets in a share
362
+ #
363
+ # @param resource_group_name [String] The resource group name.
364
+ # @param account_name [String] The name of the share account.
365
+ # @param share_name [String] The name of the share.
366
+ # @param skip_token [String] continuation token
367
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
368
+ # will be added to the HTTP request.
369
+ #
370
+ # @return [Array<DataSet>] operation results.
371
+ #
372
+ def list_by_share(resource_group_name, account_name, share_name, skip_token:nil, custom_headers:nil)
373
+ first_page = list_by_share_as_lazy(resource_group_name, account_name, share_name, skip_token:skip_token, custom_headers:custom_headers)
374
+ first_page.get_all_items
375
+ end
376
+
377
+ #
378
+ # List DataSets in a share.
379
+ #
380
+ # List DataSets in a share
381
+ #
382
+ # @param resource_group_name [String] The resource group name.
383
+ # @param account_name [String] The name of the share account.
384
+ # @param share_name [String] The name of the share.
385
+ # @param skip_token [String] continuation token
386
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
387
+ # will be added to the HTTP request.
388
+ #
389
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
390
+ #
391
+ def list_by_share_with_http_info(resource_group_name, account_name, share_name, skip_token:nil, custom_headers:nil)
392
+ list_by_share_async(resource_group_name, account_name, share_name, skip_token:skip_token, custom_headers:custom_headers).value!
393
+ end
394
+
395
+ #
396
+ # List DataSets in a share.
397
+ #
398
+ # List DataSets in a share
399
+ #
400
+ # @param resource_group_name [String] The resource group name.
401
+ # @param account_name [String] The name of the share account.
402
+ # @param share_name [String] The name of the share.
403
+ # @param skip_token [String] continuation token
404
+ # @param [Hash{String => String}] A hash of custom headers that will be added
405
+ # to the HTTP request.
406
+ #
407
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
408
+ #
409
+ def list_by_share_async(resource_group_name, account_name, share_name, skip_token:nil, custom_headers:nil)
410
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
411
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
412
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
413
+ fail ArgumentError, 'share_name is nil' if share_name.nil?
414
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
415
+
416
+
417
+ request_headers = {}
418
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
419
+
420
+ # Set Headers
421
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
422
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
423
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets'
424
+
425
+ request_url = @base_url || @client.base_url
426
+
427
+ options = {
428
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
429
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'shareName' => share_name},
430
+ query_params: {'api-version' => @client.api_version,'$skipToken' => skip_token},
431
+ headers: request_headers.merge(custom_headers || {}),
432
+ base_url: request_url
433
+ }
434
+ promise = @client.make_request_async(:get, path_template, options)
435
+
436
+ promise = promise.then do |result|
437
+ http_response = result.response
438
+ status_code = http_response.status
439
+ response_content = http_response.body
440
+ unless status_code == 200
441
+ error_model = JSON.load(response_content)
442
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
443
+ end
444
+
445
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
446
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
447
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
448
+ # Deserialize Response
449
+ if status_code == 200
450
+ begin
451
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
452
+ result_mapper = Azure::DataShare::Mgmt::V2018_11_01_preview::Models::DataSetList.mapper()
453
+ result.body = @client.deserialize(result_mapper, parsed_response)
454
+ rescue Exception => e
455
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
456
+ end
457
+ end
458
+
459
+ result
460
+ end
461
+
462
+ promise.execute
463
+ end
464
+
465
+ #
466
+ # List DataSets in a share.
467
+ #
468
+ # List DataSets in a share
469
+ #
470
+ # @param next_page_link [String] The NextLink from the previous successful call
471
+ # to List operation.
472
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
473
+ # will be added to the HTTP request.
474
+ #
475
+ # @return [DataSetList] operation results.
476
+ #
477
+ def list_by_share_next(next_page_link, custom_headers:nil)
478
+ response = list_by_share_next_async(next_page_link, custom_headers:custom_headers).value!
479
+ response.body unless response.nil?
480
+ end
481
+
482
+ #
483
+ # List DataSets in a share.
484
+ #
485
+ # List DataSets in a share
486
+ #
487
+ # @param next_page_link [String] The NextLink from the previous successful call
488
+ # to List operation.
489
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
490
+ # will be added to the HTTP request.
491
+ #
492
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
493
+ #
494
+ def list_by_share_next_with_http_info(next_page_link, custom_headers:nil)
495
+ list_by_share_next_async(next_page_link, custom_headers:custom_headers).value!
496
+ end
497
+
498
+ #
499
+ # List DataSets in a share.
500
+ #
501
+ # List DataSets in a share
502
+ #
503
+ # @param next_page_link [String] The NextLink from the previous successful call
504
+ # to List operation.
505
+ # @param [Hash{String => String}] A hash of custom headers that will be added
506
+ # to the HTTP request.
507
+ #
508
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
509
+ #
510
+ def list_by_share_next_async(next_page_link, custom_headers:nil)
511
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
512
+
513
+
514
+ request_headers = {}
515
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
516
+
517
+ # Set Headers
518
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
519
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
520
+ path_template = '{nextLink}'
521
+
522
+ request_url = @base_url || @client.base_url
523
+
524
+ options = {
525
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
526
+ skip_encoding_path_params: {'nextLink' => next_page_link},
527
+ headers: request_headers.merge(custom_headers || {}),
528
+ base_url: request_url
529
+ }
530
+ promise = @client.make_request_async(:get, path_template, options)
531
+
532
+ promise = promise.then do |result|
533
+ http_response = result.response
534
+ status_code = http_response.status
535
+ response_content = http_response.body
536
+ unless status_code == 200
537
+ error_model = JSON.load(response_content)
538
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
539
+ end
540
+
541
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
542
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
543
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
544
+ # Deserialize Response
545
+ if status_code == 200
546
+ begin
547
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
548
+ result_mapper = Azure::DataShare::Mgmt::V2018_11_01_preview::Models::DataSetList.mapper()
549
+ result.body = @client.deserialize(result_mapper, parsed_response)
550
+ rescue Exception => e
551
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
552
+ end
553
+ end
554
+
555
+ result
556
+ end
557
+
558
+ promise.execute
559
+ end
560
+
561
+ #
562
+ # List DataSets in a share.
563
+ #
564
+ # List DataSets in a share
565
+ #
566
+ # @param resource_group_name [String] The resource group name.
567
+ # @param account_name [String] The name of the share account.
568
+ # @param share_name [String] The name of the share.
569
+ # @param skip_token [String] continuation token
570
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
571
+ # will be added to the HTTP request.
572
+ #
573
+ # @return [DataSetList] which provide lazy access to pages of the response.
574
+ #
575
+ def list_by_share_as_lazy(resource_group_name, account_name, share_name, skip_token:nil, custom_headers:nil)
576
+ response = list_by_share_async(resource_group_name, account_name, share_name, skip_token:skip_token, custom_headers:custom_headers).value!
577
+ unless response.nil?
578
+ page = response.body
579
+ page.next_method = Proc.new do |next_page_link|
580
+ list_by_share_next_async(next_page_link, custom_headers:custom_headers)
581
+ end
582
+ page
583
+ end
584
+ end
585
+
586
+ end
587
+ end