azure_mgmt_datashare 0.17.0 → 0.17.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2018-11-01-preview/generated/azure_mgmt_datashare/data_share_management_client.rb +1 -1
  3. data/lib/2019-11-01/generated/azure_mgmt_datashare.rb +121 -0
  4. data/lib/2019-11-01/generated/azure_mgmt_datashare/accounts.rb +981 -0
  5. data/lib/2019-11-01/generated/azure_mgmt_datashare/consumer_invitations.rb +442 -0
  6. data/lib/2019-11-01/generated/azure_mgmt_datashare/consumer_source_data_sets.rb +254 -0
  7. data/lib/2019-11-01/generated/azure_mgmt_datashare/data_set_mappings.rb +603 -0
  8. data/lib/2019-11-01/generated/azure_mgmt_datashare/data_sets.rb +631 -0
  9. data/lib/2019-11-01/generated/azure_mgmt_datashare/data_share_management_client.rb +175 -0
  10. data/lib/2019-11-01/generated/azure_mgmt_datashare/invitations.rb +587 -0
  11. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/account.rb +147 -0
  12. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/account_list.rb +99 -0
  13. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/account_update_parameters.rb +54 -0
  14. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/adlsgen1file_data_set.rb +144 -0
  15. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/adlsgen1folder_data_set.rb +133 -0
  16. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/adlsgen2file_data_set.rb +144 -0
  17. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/adlsgen2file_data_set_mapping.rb +182 -0
  18. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/adlsgen2file_system_data_set.rb +133 -0
  19. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/adlsgen2file_system_data_set_mapping.rb +159 -0
  20. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/adlsgen2folder_data_set.rb +144 -0
  21. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/adlsgen2folder_data_set_mapping.rb +170 -0
  22. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/blob_container_data_set.rb +133 -0
  23. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/blob_container_data_set_mapping.rb +159 -0
  24. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/blob_data_set.rb +144 -0
  25. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/blob_data_set_mapping.rb +182 -0
  26. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/blob_folder_data_set.rb +144 -0
  27. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/blob_folder_data_set_mapping.rb +170 -0
  28. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/consumer_invitation.rb +230 -0
  29. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/consumer_invitation_list.rb +99 -0
  30. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/consumer_source_data_set.rb +125 -0
  31. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/consumer_source_data_set_list.rb +99 -0
  32. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/data_set.rb +71 -0
  33. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/data_set_list.rb +101 -0
  34. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/data_set_mapping.rb +71 -0
  35. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/data_set_mapping_list.rb +101 -0
  36. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/data_set_mapping_status.rb +16 -0
  37. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/data_set_type.rb +26 -0
  38. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/data_share_error.rb +47 -0
  39. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/data_share_error_info.rb +88 -0
  40. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/default_dto.rb +101 -0
  41. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/dimension_properties.rb +57 -0
  42. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/identity.rb +70 -0
  43. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/invitation.rb +171 -0
  44. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/invitation_list.rb +99 -0
  45. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/invitation_status.rb +18 -0
  46. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/kusto_cluster_data_set.rb +126 -0
  47. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/kusto_cluster_data_set_mapping.rb +138 -0
  48. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/kusto_database_data_set.rb +126 -0
  49. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/kusto_database_data_set_mapping.rb +138 -0
  50. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/operation_list.rb +99 -0
  51. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/operation_meta_log_specification.rb +68 -0
  52. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/operation_meta_metric_specification.rb +181 -0
  53. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/operation_meta_service_specification.rb +77 -0
  54. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/operation_model.rb +81 -0
  55. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/operation_model_properties.rb +79 -0
  56. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/operation_response.rb +82 -0
  57. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/output_type.rb +16 -0
  58. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/provider_share_subscription.rb +175 -0
  59. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/provider_share_subscription_list.rb +99 -0
  60. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/provisioning_state.rb +19 -0
  61. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/proxy_dto.rb +71 -0
  62. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/recurrence_interval.rb +16 -0
  63. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/scheduled_source_synchronization_setting.rb +73 -0
  64. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/scheduled_synchronization_setting.rb +140 -0
  65. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/scheduled_trigger.rb +162 -0
  66. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/share.rb +146 -0
  67. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/share_kind.rb +16 -0
  68. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/share_list.rb +98 -0
  69. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/share_subscription.rb +233 -0
  70. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/share_subscription_list.rb +99 -0
  71. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/share_subscription_status.rb +18 -0
  72. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/share_subscription_synchronization.rb +119 -0
  73. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/share_subscription_synchronization_list.rb +99 -0
  74. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/share_synchronization.rb +148 -0
  75. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/share_synchronization_list.rb +99 -0
  76. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/source_share_synchronization_setting.rb +46 -0
  77. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/source_share_synchronization_setting_list.rb +101 -0
  78. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/sql_dbtable_data_set.rb +133 -0
  79. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/sql_dbtable_data_set_mapping.rb +159 -0
  80. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/sql_dwtable_data_set.rb +133 -0
  81. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/sql_dwtable_data_set_mapping.rb +159 -0
  82. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/status.rb +20 -0
  83. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/synchronization_details.rb +221 -0
  84. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/synchronization_details_list.rb +99 -0
  85. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/synchronization_mode.rb +16 -0
  86. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/synchronization_setting.rb +71 -0
  87. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/synchronization_setting_list.rb +101 -0
  88. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/synchronize.rb +48 -0
  89. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/trigger.rb +71 -0
  90. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/trigger_list.rb +101 -0
  91. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/trigger_status.rb +17 -0
  92. data/lib/2019-11-01/generated/azure_mgmt_datashare/models/type.rb +15 -0
  93. data/lib/2019-11-01/generated/azure_mgmt_datashare/module_definition.rb +9 -0
  94. data/lib/2019-11-01/generated/azure_mgmt_datashare/operations.rb +232 -0
  95. data/lib/2019-11-01/generated/azure_mgmt_datashare/provider_share_subscriptions.rb +636 -0
  96. data/lib/2019-11-01/generated/azure_mgmt_datashare/share_subscriptions.rb +1685 -0
  97. data/lib/2019-11-01/generated/azure_mgmt_datashare/shares.rb +1101 -0
  98. data/lib/2019-11-01/generated/azure_mgmt_datashare/synchronization_settings.rb +664 -0
  99. data/lib/2019-11-01/generated/azure_mgmt_datashare/triggers.rb +701 -0
  100. data/lib/azure_mgmt_datashare.rb +1 -0
  101. data/lib/profiles/latest/modules/datashare_profile_module.rb +212 -196
  102. data/lib/version.rb +1 -1
  103. metadata +99 -2
@@ -0,0 +1,442 @@
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::V2019_11_01
7
+ #
8
+ # Creates a Microsoft.DataShare management client.
9
+ #
10
+ class ConsumerInvitations
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the ConsumerInvitations 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
+ # Rejects the invitation identified by invitationId
26
+ #
27
+ # Reject an invitation
28
+ #
29
+ # @param location [String] Location of the invitation
30
+ # @param invitation [ConsumerInvitation] An invitation payload
31
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
32
+ # will be added to the HTTP request.
33
+ #
34
+ # @return [ConsumerInvitation] operation results.
35
+ #
36
+ def reject_invitation(location, invitation, custom_headers:nil)
37
+ response = reject_invitation_async(location, invitation, custom_headers:custom_headers).value!
38
+ response.body unless response.nil?
39
+ end
40
+
41
+ #
42
+ # Rejects the invitation identified by invitationId
43
+ #
44
+ # Reject an invitation
45
+ #
46
+ # @param location [String] Location of the invitation
47
+ # @param invitation [ConsumerInvitation] An invitation payload
48
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
49
+ # will be added to the HTTP request.
50
+ #
51
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
52
+ #
53
+ def reject_invitation_with_http_info(location, invitation, custom_headers:nil)
54
+ reject_invitation_async(location, invitation, custom_headers:custom_headers).value!
55
+ end
56
+
57
+ #
58
+ # Rejects the invitation identified by invitationId
59
+ #
60
+ # Reject an invitation
61
+ #
62
+ # @param location [String] Location of the invitation
63
+ # @param invitation [ConsumerInvitation] An invitation payload
64
+ # @param [Hash{String => String}] A hash of custom headers that will be added
65
+ # to the HTTP request.
66
+ #
67
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
68
+ #
69
+ def reject_invitation_async(location, invitation, custom_headers:nil)
70
+ fail ArgumentError, 'location is nil' if location.nil?
71
+ fail ArgumentError, 'invitation is nil' if invitation.nil?
72
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
73
+
74
+
75
+ request_headers = {}
76
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
77
+
78
+ # Set Headers
79
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
80
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
81
+
82
+ # Serialize Request
83
+ request_mapper = Azure::DataShare::Mgmt::V2019_11_01::Models::ConsumerInvitation.mapper()
84
+ request_content = @client.serialize(request_mapper, invitation)
85
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
86
+
87
+ path_template = 'providers/Microsoft.DataShare/locations/{location}/RejectInvitation'
88
+
89
+ request_url = @base_url || @client.base_url
90
+
91
+ options = {
92
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
93
+ path_params: {'location' => location},
94
+ query_params: {'api-version' => @client.api_version},
95
+ body: request_content,
96
+ headers: request_headers.merge(custom_headers || {}),
97
+ base_url: request_url
98
+ }
99
+ promise = @client.make_request_async(:post, path_template, options)
100
+
101
+ promise = promise.then do |result|
102
+ http_response = result.response
103
+ status_code = http_response.status
104
+ response_content = http_response.body
105
+ unless status_code == 200
106
+ error_model = JSON.load(response_content)
107
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
108
+ end
109
+
110
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
111
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
112
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
113
+ # Deserialize Response
114
+ if status_code == 200
115
+ begin
116
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
117
+ result_mapper = Azure::DataShare::Mgmt::V2019_11_01::Models::ConsumerInvitation.mapper()
118
+ result.body = @client.deserialize(result_mapper, parsed_response)
119
+ rescue Exception => e
120
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
121
+ end
122
+ end
123
+
124
+ result
125
+ end
126
+
127
+ promise.execute
128
+ end
129
+
130
+ #
131
+ # Gets the invitation identified by invitationId
132
+ #
133
+ # Get an invitation
134
+ #
135
+ # @param location [String] Location of the invitation
136
+ # @param invitation_id [String] An invitation id
137
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
138
+ # will be added to the HTTP request.
139
+ #
140
+ # @return [ConsumerInvitation] operation results.
141
+ #
142
+ def get(location, invitation_id, custom_headers:nil)
143
+ response = get_async(location, invitation_id, custom_headers:custom_headers).value!
144
+ response.body unless response.nil?
145
+ end
146
+
147
+ #
148
+ # Gets the invitation identified by invitationId
149
+ #
150
+ # Get an invitation
151
+ #
152
+ # @param location [String] Location of the invitation
153
+ # @param invitation_id [String] An invitation id
154
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
155
+ # will be added to the HTTP request.
156
+ #
157
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
158
+ #
159
+ def get_with_http_info(location, invitation_id, custom_headers:nil)
160
+ get_async(location, invitation_id, custom_headers:custom_headers).value!
161
+ end
162
+
163
+ #
164
+ # Gets the invitation identified by invitationId
165
+ #
166
+ # Get an invitation
167
+ #
168
+ # @param location [String] Location of the invitation
169
+ # @param invitation_id [String] An invitation id
170
+ # @param [Hash{String => String}] A hash of custom headers that will be added
171
+ # to the HTTP request.
172
+ #
173
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
174
+ #
175
+ def get_async(location, invitation_id, custom_headers:nil)
176
+ fail ArgumentError, 'location is nil' if location.nil?
177
+ fail ArgumentError, 'invitation_id is nil' if invitation_id.nil?
178
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
179
+
180
+
181
+ request_headers = {}
182
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
183
+
184
+ # Set Headers
185
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
186
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
187
+ path_template = 'providers/Microsoft.DataShare/locations/{location}/consumerInvitations/{invitationId}'
188
+
189
+ request_url = @base_url || @client.base_url
190
+
191
+ options = {
192
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
193
+ path_params: {'location' => location,'invitationId' => invitation_id},
194
+ query_params: {'api-version' => @client.api_version},
195
+ headers: request_headers.merge(custom_headers || {}),
196
+ base_url: request_url
197
+ }
198
+ promise = @client.make_request_async(:get, path_template, options)
199
+
200
+ promise = promise.then do |result|
201
+ http_response = result.response
202
+ status_code = http_response.status
203
+ response_content = http_response.body
204
+ unless status_code == 200
205
+ error_model = JSON.load(response_content)
206
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
207
+ end
208
+
209
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
210
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
211
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
212
+ # Deserialize Response
213
+ if status_code == 200
214
+ begin
215
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
216
+ result_mapper = Azure::DataShare::Mgmt::V2019_11_01::Models::ConsumerInvitation.mapper()
217
+ result.body = @client.deserialize(result_mapper, parsed_response)
218
+ rescue Exception => e
219
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
220
+ end
221
+ end
222
+
223
+ result
224
+ end
225
+
226
+ promise.execute
227
+ end
228
+
229
+ #
230
+ # List the invitations
231
+ #
232
+ # Lists invitations
233
+ #
234
+ # @param skip_token [String] The continuation token
235
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
236
+ # will be added to the HTTP request.
237
+ #
238
+ # @return [Array<ConsumerInvitation>] operation results.
239
+ #
240
+ def list_invitations(skip_token:nil, custom_headers:nil)
241
+ first_page = list_invitations_as_lazy(skip_token:skip_token, custom_headers:custom_headers)
242
+ first_page.get_all_items
243
+ end
244
+
245
+ #
246
+ # List the invitations
247
+ #
248
+ # Lists invitations
249
+ #
250
+ # @param skip_token [String] The continuation token
251
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
252
+ # will be added to the HTTP request.
253
+ #
254
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
255
+ #
256
+ def list_invitations_with_http_info(skip_token:nil, custom_headers:nil)
257
+ list_invitations_async(skip_token:skip_token, custom_headers:custom_headers).value!
258
+ end
259
+
260
+ #
261
+ # List the invitations
262
+ #
263
+ # Lists invitations
264
+ #
265
+ # @param skip_token [String] The continuation token
266
+ # @param [Hash{String => String}] A hash of custom headers that will be added
267
+ # to the HTTP request.
268
+ #
269
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
270
+ #
271
+ def list_invitations_async(skip_token:nil, custom_headers:nil)
272
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
273
+
274
+
275
+ request_headers = {}
276
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
277
+
278
+ # Set Headers
279
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
280
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
281
+ path_template = 'providers/Microsoft.DataShare/ListInvitations'
282
+
283
+ request_url = @base_url || @client.base_url
284
+
285
+ options = {
286
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
287
+ query_params: {'api-version' => @client.api_version,'$skipToken' => skip_token},
288
+ headers: request_headers.merge(custom_headers || {}),
289
+ base_url: request_url
290
+ }
291
+ promise = @client.make_request_async(:get, path_template, options)
292
+
293
+ promise = promise.then do |result|
294
+ http_response = result.response
295
+ status_code = http_response.status
296
+ response_content = http_response.body
297
+ unless status_code == 200
298
+ error_model = JSON.load(response_content)
299
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
300
+ end
301
+
302
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
303
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
304
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
305
+ # Deserialize Response
306
+ if status_code == 200
307
+ begin
308
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
309
+ result_mapper = Azure::DataShare::Mgmt::V2019_11_01::Models::ConsumerInvitationList.mapper()
310
+ result.body = @client.deserialize(result_mapper, parsed_response)
311
+ rescue Exception => e
312
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
313
+ end
314
+ end
315
+
316
+ result
317
+ end
318
+
319
+ promise.execute
320
+ end
321
+
322
+ #
323
+ # List the invitations
324
+ #
325
+ # Lists invitations
326
+ #
327
+ # @param next_page_link [String] The NextLink from the previous successful call
328
+ # to List operation.
329
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
330
+ # will be added to the HTTP request.
331
+ #
332
+ # @return [ConsumerInvitationList] operation results.
333
+ #
334
+ def list_invitations_next(next_page_link, custom_headers:nil)
335
+ response = list_invitations_next_async(next_page_link, custom_headers:custom_headers).value!
336
+ response.body unless response.nil?
337
+ end
338
+
339
+ #
340
+ # List the invitations
341
+ #
342
+ # Lists invitations
343
+ #
344
+ # @param next_page_link [String] The NextLink from the previous successful call
345
+ # to List operation.
346
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
347
+ # will be added to the HTTP request.
348
+ #
349
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
350
+ #
351
+ def list_invitations_next_with_http_info(next_page_link, custom_headers:nil)
352
+ list_invitations_next_async(next_page_link, custom_headers:custom_headers).value!
353
+ end
354
+
355
+ #
356
+ # List the invitations
357
+ #
358
+ # Lists invitations
359
+ #
360
+ # @param next_page_link [String] The NextLink from the previous successful call
361
+ # to List operation.
362
+ # @param [Hash{String => String}] A hash of custom headers that will be added
363
+ # to the HTTP request.
364
+ #
365
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
366
+ #
367
+ def list_invitations_next_async(next_page_link, custom_headers:nil)
368
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
369
+
370
+
371
+ request_headers = {}
372
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
373
+
374
+ # Set Headers
375
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
376
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
377
+ path_template = '{nextLink}'
378
+
379
+ request_url = @base_url || @client.base_url
380
+
381
+ options = {
382
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
383
+ skip_encoding_path_params: {'nextLink' => next_page_link},
384
+ headers: request_headers.merge(custom_headers || {}),
385
+ base_url: request_url
386
+ }
387
+ promise = @client.make_request_async(:get, path_template, options)
388
+
389
+ promise = promise.then do |result|
390
+ http_response = result.response
391
+ status_code = http_response.status
392
+ response_content = http_response.body
393
+ unless status_code == 200
394
+ error_model = JSON.load(response_content)
395
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
396
+ end
397
+
398
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
399
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
400
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
401
+ # Deserialize Response
402
+ if status_code == 200
403
+ begin
404
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
405
+ result_mapper = Azure::DataShare::Mgmt::V2019_11_01::Models::ConsumerInvitationList.mapper()
406
+ result.body = @client.deserialize(result_mapper, parsed_response)
407
+ rescue Exception => e
408
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
409
+ end
410
+ end
411
+
412
+ result
413
+ end
414
+
415
+ promise.execute
416
+ end
417
+
418
+ #
419
+ # List the invitations
420
+ #
421
+ # Lists invitations
422
+ #
423
+ # @param skip_token [String] The continuation token
424
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
425
+ # will be added to the HTTP request.
426
+ #
427
+ # @return [ConsumerInvitationList] which provide lazy access to pages of the
428
+ # response.
429
+ #
430
+ def list_invitations_as_lazy(skip_token:nil, custom_headers:nil)
431
+ response = list_invitations_async(skip_token:skip_token, custom_headers:custom_headers).value!
432
+ unless response.nil?
433
+ page = response.body
434
+ page.next_method = Proc.new do |next_page_link|
435
+ list_invitations_next_async(next_page_link, custom_headers:custom_headers)
436
+ end
437
+ page
438
+ end
439
+ end
440
+
441
+ end
442
+ end
@@ -0,0 +1,254 @@
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::V2019_11_01
7
+ #
8
+ # Creates a Microsoft.DataShare management client.
9
+ #
10
+ class ConsumerSourceDataSets
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the ConsumerSourceDataSets 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 source dataSets of a shareSubscription.
26
+ #
27
+ # Get source dataSets of 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 skip_token [String] Continuation token
33
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
34
+ # will be added to the HTTP request.
35
+ #
36
+ # @return [Array<ConsumerSourceDataSet>] operation results.
37
+ #
38
+ def list_by_share_subscription(resource_group_name, account_name, share_subscription_name, skip_token:nil, custom_headers:nil)
39
+ first_page = list_by_share_subscription_as_lazy(resource_group_name, account_name, share_subscription_name, skip_token:skip_token, custom_headers:custom_headers)
40
+ first_page.get_all_items
41
+ end
42
+
43
+ #
44
+ # Get source dataSets of a shareSubscription.
45
+ #
46
+ # Get source dataSets of 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 skip_token [String] Continuation token
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 list_by_share_subscription_with_http_info(resource_group_name, account_name, share_subscription_name, skip_token:nil, custom_headers:nil)
58
+ list_by_share_subscription_async(resource_group_name, account_name, share_subscription_name, skip_token:skip_token, custom_headers:custom_headers).value!
59
+ end
60
+
61
+ #
62
+ # Get source dataSets of a shareSubscription.
63
+ #
64
+ # Get source dataSets of 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 skip_token [String] Continuation token
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 list_by_share_subscription_async(resource_group_name, account_name, share_subscription_name, skip_token:nil, 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, '@client.api_version is nil' if @client.api_version.nil?
81
+
82
+
83
+ request_headers = {}
84
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
85
+
86
+ # Set Headers
87
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
88
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
89
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/ConsumerSourceDataSets'
90
+
91
+ request_url = @base_url || @client.base_url
92
+
93
+ options = {
94
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
95
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'shareSubscriptionName' => share_subscription_name},
96
+ query_params: {'api-version' => @client.api_version,'$skipToken' => skip_token},
97
+ headers: request_headers.merge(custom_headers || {}),
98
+ base_url: request_url
99
+ }
100
+ promise = @client.make_request_async(:get, path_template, options)
101
+
102
+ promise = promise.then do |result|
103
+ http_response = result.response
104
+ status_code = http_response.status
105
+ response_content = http_response.body
106
+ unless status_code == 200
107
+ error_model = JSON.load(response_content)
108
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
109
+ end
110
+
111
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
112
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
113
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
114
+ # Deserialize Response
115
+ if status_code == 200
116
+ begin
117
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
118
+ result_mapper = Azure::DataShare::Mgmt::V2019_11_01::Models::ConsumerSourceDataSetList.mapper()
119
+ result.body = @client.deserialize(result_mapper, parsed_response)
120
+ rescue Exception => e
121
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
122
+ end
123
+ end
124
+
125
+ result
126
+ end
127
+
128
+ promise.execute
129
+ end
130
+
131
+ #
132
+ # Get source dataSets of a shareSubscription.
133
+ #
134
+ # Get source dataSets of a shareSubscription
135
+ #
136
+ # @param next_page_link [String] The NextLink from the previous successful call
137
+ # to List operation.
138
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
139
+ # will be added to the HTTP request.
140
+ #
141
+ # @return [ConsumerSourceDataSetList] operation results.
142
+ #
143
+ def list_by_share_subscription_next(next_page_link, custom_headers:nil)
144
+ response = list_by_share_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
145
+ response.body unless response.nil?
146
+ end
147
+
148
+ #
149
+ # Get source dataSets of a shareSubscription.
150
+ #
151
+ # Get source dataSets of a shareSubscription
152
+ #
153
+ # @param next_page_link [String] The NextLink from the previous successful call
154
+ # to List operation.
155
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
156
+ # will be added to the HTTP request.
157
+ #
158
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
159
+ #
160
+ def list_by_share_subscription_next_with_http_info(next_page_link, custom_headers:nil)
161
+ list_by_share_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
162
+ end
163
+
164
+ #
165
+ # Get source dataSets of a shareSubscription.
166
+ #
167
+ # Get source dataSets of a shareSubscription
168
+ #
169
+ # @param next_page_link [String] The NextLink from the previous successful call
170
+ # to List operation.
171
+ # @param [Hash{String => String}] A hash of custom headers that will be added
172
+ # to the HTTP request.
173
+ #
174
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
175
+ #
176
+ def list_by_share_subscription_next_async(next_page_link, custom_headers:nil)
177
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
178
+
179
+
180
+ request_headers = {}
181
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
182
+
183
+ # Set Headers
184
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
185
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
186
+ path_template = '{nextLink}'
187
+
188
+ request_url = @base_url || @client.base_url
189
+
190
+ options = {
191
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
192
+ skip_encoding_path_params: {'nextLink' => next_page_link},
193
+ headers: request_headers.merge(custom_headers || {}),
194
+ base_url: request_url
195
+ }
196
+ promise = @client.make_request_async(:get, path_template, options)
197
+
198
+ promise = promise.then do |result|
199
+ http_response = result.response
200
+ status_code = http_response.status
201
+ response_content = http_response.body
202
+ unless status_code == 200
203
+ error_model = JSON.load(response_content)
204
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
205
+ end
206
+
207
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
208
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
209
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
210
+ # Deserialize Response
211
+ if status_code == 200
212
+ begin
213
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
214
+ result_mapper = Azure::DataShare::Mgmt::V2019_11_01::Models::ConsumerSourceDataSetList.mapper()
215
+ result.body = @client.deserialize(result_mapper, parsed_response)
216
+ rescue Exception => e
217
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
218
+ end
219
+ end
220
+
221
+ result
222
+ end
223
+
224
+ promise.execute
225
+ end
226
+
227
+ #
228
+ # Get source dataSets of a shareSubscription.
229
+ #
230
+ # Get source dataSets of a shareSubscription
231
+ #
232
+ # @param resource_group_name [String] The resource group name.
233
+ # @param account_name [String] The name of the share account.
234
+ # @param share_subscription_name [String] The name of the shareSubscription.
235
+ # @param skip_token [String] Continuation token
236
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
237
+ # will be added to the HTTP request.
238
+ #
239
+ # @return [ConsumerSourceDataSetList] which provide lazy access to pages of the
240
+ # response.
241
+ #
242
+ def list_by_share_subscription_as_lazy(resource_group_name, account_name, share_subscription_name, skip_token:nil, custom_headers:nil)
243
+ response = list_by_share_subscription_async(resource_group_name, account_name, share_subscription_name, skip_token:skip_token, custom_headers:custom_headers).value!
244
+ unless response.nil?
245
+ page = response.body
246
+ page.next_method = Proc.new do |next_page_link|
247
+ list_by_share_subscription_next_async(next_page_link, custom_headers:custom_headers)
248
+ end
249
+ page
250
+ end
251
+ end
252
+
253
+ end
254
+ end