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