azure_mgmt_edgegateway 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2019-03-01/generated/azure_mgmt_edgegateway.rb +137 -0
  4. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/alerts.rb +322 -0
  5. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/bandwidth_schedules.rb +611 -0
  6. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/data_box_edge_management_client.rb +175 -0
  7. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/devices.rb +1879 -0
  8. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/jobs.rb +121 -0
  9. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/account_type.rb +16 -0
  10. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/address.rb +112 -0
  11. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/alert.rb +156 -0
  12. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/alert_error_details.rb +71 -0
  13. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/alert_list.rb +100 -0
  14. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/alert_severity.rb +17 -0
  15. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/armbase_model.rb +71 -0
  16. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/asymmetric_encrypted_secret.rb +70 -0
  17. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/authentication.rb +47 -0
  18. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/authentication_type.rb +16 -0
  19. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/azure_container_data_format.rb +17 -0
  20. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/azure_container_info.rb +72 -0
  21. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/bandwidth_schedule.rb +115 -0
  22. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/bandwidth_schedules_list.rb +100 -0
  23. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/client_access_right.rb +59 -0
  24. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/client_permission_type.rb +17 -0
  25. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/contact_details.rb +87 -0
  26. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/data_box_edge_device.rb +287 -0
  27. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/data_box_edge_device_extended_info.rb +108 -0
  28. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/data_box_edge_device_list.rb +101 -0
  29. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/data_box_edge_device_patch.rb +55 -0
  30. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/data_box_edge_device_status.rb +20 -0
  31. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/data_policy.rb +16 -0
  32. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/day_of_week.rb +21 -0
  33. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/device_type.rb +15 -0
  34. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/download_phase.rb +18 -0
  35. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/encryption_algorithm.rb +17 -0
  36. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/file_event_trigger.rb +115 -0
  37. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/file_source_info.rb +46 -0
  38. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/install_reboot_behavior.rb +17 -0
  39. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/io_tdevice_info.rb +69 -0
  40. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/io_trole.rb +147 -0
  41. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/ipv4config.rb +71 -0
  42. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/ipv6config.rb +71 -0
  43. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/job.rb +242 -0
  44. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/job_error_details.rb +80 -0
  45. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/job_error_item.rb +79 -0
  46. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/job_status.rb +21 -0
  47. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/job_type.rb +19 -0
  48. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/metric_aggregation_type.rb +21 -0
  49. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/metric_category.rb +16 -0
  50. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/metric_dimension_v1.rb +68 -0
  51. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/metric_specification_v1.rb +187 -0
  52. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/metric_unit.rb +22 -0
  53. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/monitoring_status.rb +16 -0
  54. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/mount_point_map.rb +83 -0
  55. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/network_adapter.rb +229 -0
  56. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/network_adapter_dhcpstatus.rb +16 -0
  57. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/network_adapter_position.rb +60 -0
  58. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/network_adapter_rdmastatus.rb +16 -0
  59. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/network_adapter_status.rb +16 -0
  60. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/network_group.rb +17 -0
  61. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/network_settings.rb +83 -0
  62. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/operation.rb +81 -0
  63. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/operation_display.rb +80 -0
  64. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/operations_list.rb +99 -0
  65. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/order.rb +177 -0
  66. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/order_list.rb +100 -0
  67. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/order_state.rb +28 -0
  68. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/order_status.rb +74 -0
  69. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/periodic_timer_event_trigger.rb +115 -0
  70. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/periodic_timer_source_info.rb +71 -0
  71. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/platform_type.rb +16 -0
  72. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/refresh_details.rb +87 -0
  73. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/role.rb +71 -0
  74. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/role_list.rb +102 -0
  75. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/role_sink_info.rb +46 -0
  76. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/role_status.rb +16 -0
  77. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/role_types.rb +18 -0
  78. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/security_settings.rb +78 -0
  79. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/service_specification.rb +56 -0
  80. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/share.rb +208 -0
  81. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/share_access_protocol.rb +16 -0
  82. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/share_access_right.rb +59 -0
  83. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/share_access_type.rb +17 -0
  84. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/share_list.rb +100 -0
  85. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/share_status.rb +16 -0
  86. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/sku.rb +58 -0
  87. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/sku_name.rb +16 -0
  88. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/sku_tier.rb +15 -0
  89. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/sslstatus.rb +16 -0
  90. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/storage_account_credential.rb +143 -0
  91. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/storage_account_credential_list.rb +100 -0
  92. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/symmetric_key.rb +48 -0
  93. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/time_grain.rb +22 -0
  94. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/tracking_info.rb +79 -0
  95. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/trigger.rb +71 -0
  96. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/trigger_list.rb +102 -0
  97. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/update_download_progress.rb +108 -0
  98. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/update_install_progress.rb +71 -0
  99. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/update_operation.rb +18 -0
  100. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/update_operation_stage.rb +31 -0
  101. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/update_summary.rb +281 -0
  102. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/upload_certificate_request.rb +58 -0
  103. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/upload_certificate_response.rb +113 -0
  104. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/user.rb +96 -0
  105. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/user_access_right.rb +59 -0
  106. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/user_list.rb +100 -0
  107. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/module_definition.rb +9 -0
  108. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/operations.rb +214 -0
  109. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/operations_status.rb +121 -0
  110. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/orders.rb +584 -0
  111. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/roles.rb +600 -0
  112. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/shares.rb +725 -0
  113. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/storage_account_credentials.rb +606 -0
  114. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/triggers.rb +600 -0
  115. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/users.rb +604 -0
  116. data/lib/azure_mgmt_edgegateway.rb +6 -0
  117. data/lib/module_definition.rb +8 -0
  118. data/lib/profiles/latest/edgegateway_latest_profile_client.rb +40 -0
  119. data/lib/profiles/latest/edgegateway_module_definition.rb +8 -0
  120. data/lib/profiles/latest/modules/edgegateway_profile_module.rb +475 -0
  121. data/lib/version.rb +7 -0
  122. metadata +238 -0
@@ -0,0 +1,606 @@
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::EdgeGateway::Mgmt::V2019_03_01
7
+ #
8
+ # StorageAccountCredentials
9
+ #
10
+ class StorageAccountCredentials
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the StorageAccountCredentials class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [DataBoxEdgeManagementClient] reference to the DataBoxEdgeManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Gets all the storage account credentials in a data box edge/gateway device.
26
+ #
27
+ # @param device_name [String] The device name.
28
+ # @param resource_group_name [String] The resource group name.
29
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
30
+ # will be added to the HTTP request.
31
+ #
32
+ # @return [Array<StorageAccountCredential>] operation results.
33
+ #
34
+ def list_by_data_box_edge_device(device_name, resource_group_name, custom_headers:nil)
35
+ first_page = list_by_data_box_edge_device_as_lazy(device_name, resource_group_name, custom_headers:custom_headers)
36
+ first_page.get_all_items
37
+ end
38
+
39
+ #
40
+ # Gets all the storage account credentials in a data box edge/gateway device.
41
+ #
42
+ # @param device_name [String] The device name.
43
+ # @param resource_group_name [String] The resource group name.
44
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
45
+ # will be added to the HTTP request.
46
+ #
47
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
48
+ #
49
+ def list_by_data_box_edge_device_with_http_info(device_name, resource_group_name, custom_headers:nil)
50
+ list_by_data_box_edge_device_async(device_name, resource_group_name, custom_headers:custom_headers).value!
51
+ end
52
+
53
+ #
54
+ # Gets all the storage account credentials in a data box edge/gateway device.
55
+ #
56
+ # @param device_name [String] The device name.
57
+ # @param resource_group_name [String] The resource group name.
58
+ # @param [Hash{String => String}] A hash of custom headers that will be added
59
+ # to the HTTP request.
60
+ #
61
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
62
+ #
63
+ def list_by_data_box_edge_device_async(device_name, resource_group_name, custom_headers:nil)
64
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
65
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
66
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
67
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
68
+
69
+
70
+ request_headers = {}
71
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
72
+
73
+ # Set Headers
74
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
75
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
76
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials'
77
+
78
+ request_url = @base_url || @client.base_url
79
+
80
+ options = {
81
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
82
+ path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
83
+ query_params: {'api-version' => @client.api_version},
84
+ headers: request_headers.merge(custom_headers || {}),
85
+ base_url: request_url
86
+ }
87
+ promise = @client.make_request_async(:get, path_template, options)
88
+
89
+ promise = promise.then do |result|
90
+ http_response = result.response
91
+ status_code = http_response.status
92
+ response_content = http_response.body
93
+ unless status_code == 200
94
+ error_model = JSON.load(response_content)
95
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
96
+ end
97
+
98
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
99
+ # Deserialize Response
100
+ if status_code == 200
101
+ begin
102
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
103
+ result_mapper = Azure::EdgeGateway::Mgmt::V2019_03_01::Models::StorageAccountCredentialList.mapper()
104
+ result.body = @client.deserialize(result_mapper, parsed_response)
105
+ rescue Exception => e
106
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
107
+ end
108
+ end
109
+
110
+ result
111
+ end
112
+
113
+ promise.execute
114
+ end
115
+
116
+ #
117
+ # Gets the properties of the specified storage account credential.
118
+ #
119
+ # @param device_name [String] The device name.
120
+ # @param name [String] The storage account credential name.
121
+ # @param resource_group_name [String] The resource group name.
122
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
123
+ # will be added to the HTTP request.
124
+ #
125
+ # @return [StorageAccountCredential] operation results.
126
+ #
127
+ def get(device_name, name, resource_group_name, custom_headers:nil)
128
+ response = get_async(device_name, name, resource_group_name, custom_headers:custom_headers).value!
129
+ response.body unless response.nil?
130
+ end
131
+
132
+ #
133
+ # Gets the properties of the specified storage account credential.
134
+ #
135
+ # @param device_name [String] The device name.
136
+ # @param name [String] The storage account credential name.
137
+ # @param resource_group_name [String] The resource group name.
138
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
139
+ # will be added to the HTTP request.
140
+ #
141
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
142
+ #
143
+ def get_with_http_info(device_name, name, resource_group_name, custom_headers:nil)
144
+ get_async(device_name, name, resource_group_name, custom_headers:custom_headers).value!
145
+ end
146
+
147
+ #
148
+ # Gets the properties of the specified storage account credential.
149
+ #
150
+ # @param device_name [String] The device name.
151
+ # @param name [String] The storage account credential name.
152
+ # @param resource_group_name [String] The resource group name.
153
+ # @param [Hash{String => String}] A hash of custom headers that will be added
154
+ # to the HTTP request.
155
+ #
156
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
157
+ #
158
+ def get_async(device_name, name, resource_group_name, custom_headers:nil)
159
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
160
+ fail ArgumentError, 'name is nil' if name.nil?
161
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
162
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
163
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
164
+
165
+
166
+ request_headers = {}
167
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
168
+
169
+ # Set Headers
170
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
171
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
172
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}'
173
+
174
+ request_url = @base_url || @client.base_url
175
+
176
+ options = {
177
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
178
+ path_params: {'deviceName' => device_name,'name' => name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
179
+ query_params: {'api-version' => @client.api_version},
180
+ headers: request_headers.merge(custom_headers || {}),
181
+ base_url: request_url
182
+ }
183
+ promise = @client.make_request_async(:get, path_template, options)
184
+
185
+ promise = promise.then do |result|
186
+ http_response = result.response
187
+ status_code = http_response.status
188
+ response_content = http_response.body
189
+ unless status_code == 200
190
+ error_model = JSON.load(response_content)
191
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
192
+ end
193
+
194
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
195
+ # Deserialize Response
196
+ if status_code == 200
197
+ begin
198
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
199
+ result_mapper = Azure::EdgeGateway::Mgmt::V2019_03_01::Models::StorageAccountCredential.mapper()
200
+ result.body = @client.deserialize(result_mapper, parsed_response)
201
+ rescue Exception => e
202
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
203
+ end
204
+ end
205
+
206
+ result
207
+ end
208
+
209
+ promise.execute
210
+ end
211
+
212
+ #
213
+ # Creates or updates the storage account credential.
214
+ #
215
+ # @param device_name [String] The device name.
216
+ # @param name [String] The storage account credential name.
217
+ # @param storage_account_credential [StorageAccountCredential] The storage
218
+ # account credential.
219
+ # @param resource_group_name [String] The resource group name.
220
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
221
+ # will be added to the HTTP request.
222
+ #
223
+ # @return [StorageAccountCredential] operation results.
224
+ #
225
+ def create_or_update(device_name, name, storage_account_credential, resource_group_name, custom_headers:nil)
226
+ response = create_or_update_async(device_name, name, storage_account_credential, resource_group_name, custom_headers:custom_headers).value!
227
+ response.body unless response.nil?
228
+ end
229
+
230
+ #
231
+ # @param device_name [String] The device name.
232
+ # @param name [String] The storage account credential name.
233
+ # @param storage_account_credential [StorageAccountCredential] The storage
234
+ # account credential.
235
+ # @param resource_group_name [String] The resource group name.
236
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
237
+ # will be added to the HTTP request.
238
+ #
239
+ # @return [Concurrent::Promise] promise which provides async access to http
240
+ # response.
241
+ #
242
+ def create_or_update_async(device_name, name, storage_account_credential, resource_group_name, custom_headers:nil)
243
+ # Send request
244
+ promise = begin_create_or_update_async(device_name, name, storage_account_credential, resource_group_name, custom_headers:custom_headers)
245
+
246
+ promise = promise.then do |response|
247
+ # Defining deserialization method.
248
+ deserialize_method = lambda do |parsed_response|
249
+ result_mapper = Azure::EdgeGateway::Mgmt::V2019_03_01::Models::StorageAccountCredential.mapper()
250
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
251
+ end
252
+
253
+ # Waiting for response.
254
+ @client.get_long_running_operation_result(response, deserialize_method)
255
+ end
256
+
257
+ promise
258
+ end
259
+
260
+ #
261
+ # Deletes the storage account credential.
262
+ #
263
+ # @param device_name [String] The device name.
264
+ # @param name [String] The storage account credential name.
265
+ # @param resource_group_name [String] The resource group name.
266
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
267
+ # will be added to the HTTP request.
268
+ #
269
+ def delete(device_name, name, resource_group_name, custom_headers:nil)
270
+ response = delete_async(device_name, name, resource_group_name, custom_headers:custom_headers).value!
271
+ nil
272
+ end
273
+
274
+ #
275
+ # @param device_name [String] The device name.
276
+ # @param name [String] The storage account credential name.
277
+ # @param resource_group_name [String] The resource group name.
278
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
279
+ # will be added to the HTTP request.
280
+ #
281
+ # @return [Concurrent::Promise] promise which provides async access to http
282
+ # response.
283
+ #
284
+ def delete_async(device_name, name, resource_group_name, custom_headers:nil)
285
+ # Send request
286
+ promise = begin_delete_async(device_name, name, resource_group_name, custom_headers:custom_headers)
287
+
288
+ promise = promise.then do |response|
289
+ # Defining deserialization method.
290
+ deserialize_method = lambda do |parsed_response|
291
+ end
292
+
293
+ # Waiting for response.
294
+ @client.get_long_running_operation_result(response, deserialize_method)
295
+ end
296
+
297
+ promise
298
+ end
299
+
300
+ #
301
+ # Creates or updates the storage account credential.
302
+ #
303
+ # @param device_name [String] The device name.
304
+ # @param name [String] The storage account credential name.
305
+ # @param storage_account_credential [StorageAccountCredential] The storage
306
+ # account credential.
307
+ # @param resource_group_name [String] The resource group name.
308
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
309
+ # will be added to the HTTP request.
310
+ #
311
+ # @return [StorageAccountCredential] operation results.
312
+ #
313
+ def begin_create_or_update(device_name, name, storage_account_credential, resource_group_name, custom_headers:nil)
314
+ response = begin_create_or_update_async(device_name, name, storage_account_credential, resource_group_name, custom_headers:custom_headers).value!
315
+ response.body unless response.nil?
316
+ end
317
+
318
+ #
319
+ # Creates or updates the storage account credential.
320
+ #
321
+ # @param device_name [String] The device name.
322
+ # @param name [String] The storage account credential name.
323
+ # @param storage_account_credential [StorageAccountCredential] The storage
324
+ # account credential.
325
+ # @param resource_group_name [String] The resource group name.
326
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
327
+ # will be added to the HTTP request.
328
+ #
329
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
330
+ #
331
+ def begin_create_or_update_with_http_info(device_name, name, storage_account_credential, resource_group_name, custom_headers:nil)
332
+ begin_create_or_update_async(device_name, name, storage_account_credential, resource_group_name, custom_headers:custom_headers).value!
333
+ end
334
+
335
+ #
336
+ # Creates or updates the storage account credential.
337
+ #
338
+ # @param device_name [String] The device name.
339
+ # @param name [String] The storage account credential name.
340
+ # @param storage_account_credential [StorageAccountCredential] The storage
341
+ # account credential.
342
+ # @param resource_group_name [String] The resource group name.
343
+ # @param [Hash{String => String}] A hash of custom headers that will be added
344
+ # to the HTTP request.
345
+ #
346
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
347
+ #
348
+ def begin_create_or_update_async(device_name, name, storage_account_credential, resource_group_name, custom_headers:nil)
349
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
350
+ fail ArgumentError, 'name is nil' if name.nil?
351
+ fail ArgumentError, 'storage_account_credential is nil' if storage_account_credential.nil?
352
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
353
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
354
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
355
+
356
+
357
+ request_headers = {}
358
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
359
+
360
+ # Set Headers
361
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
362
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
363
+
364
+ # Serialize Request
365
+ request_mapper = Azure::EdgeGateway::Mgmt::V2019_03_01::Models::StorageAccountCredential.mapper()
366
+ request_content = @client.serialize(request_mapper, storage_account_credential)
367
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
368
+
369
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}'
370
+
371
+ request_url = @base_url || @client.base_url
372
+
373
+ options = {
374
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
375
+ path_params: {'deviceName' => device_name,'name' => name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
376
+ query_params: {'api-version' => @client.api_version},
377
+ body: request_content,
378
+ headers: request_headers.merge(custom_headers || {}),
379
+ base_url: request_url
380
+ }
381
+ promise = @client.make_request_async(:put, path_template, options)
382
+
383
+ promise = promise.then do |result|
384
+ http_response = result.response
385
+ status_code = http_response.status
386
+ response_content = http_response.body
387
+ unless status_code == 200 || status_code == 202
388
+ error_model = JSON.load(response_content)
389
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
390
+ end
391
+
392
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
393
+ # Deserialize Response
394
+ if status_code == 200
395
+ begin
396
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
397
+ result_mapper = Azure::EdgeGateway::Mgmt::V2019_03_01::Models::StorageAccountCredential.mapper()
398
+ result.body = @client.deserialize(result_mapper, parsed_response)
399
+ rescue Exception => e
400
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
401
+ end
402
+ end
403
+
404
+ result
405
+ end
406
+
407
+ promise.execute
408
+ end
409
+
410
+ #
411
+ # Deletes the storage account credential.
412
+ #
413
+ # @param device_name [String] The device name.
414
+ # @param name [String] The storage account credential name.
415
+ # @param resource_group_name [String] The resource group name.
416
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
417
+ # will be added to the HTTP request.
418
+ #
419
+ #
420
+ def begin_delete(device_name, name, resource_group_name, custom_headers:nil)
421
+ response = begin_delete_async(device_name, name, resource_group_name, custom_headers:custom_headers).value!
422
+ nil
423
+ end
424
+
425
+ #
426
+ # Deletes the storage account credential.
427
+ #
428
+ # @param device_name [String] The device name.
429
+ # @param name [String] The storage account credential name.
430
+ # @param resource_group_name [String] The resource group name.
431
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
432
+ # will be added to the HTTP request.
433
+ #
434
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
435
+ #
436
+ def begin_delete_with_http_info(device_name, name, resource_group_name, custom_headers:nil)
437
+ begin_delete_async(device_name, name, resource_group_name, custom_headers:custom_headers).value!
438
+ end
439
+
440
+ #
441
+ # Deletes the storage account credential.
442
+ #
443
+ # @param device_name [String] The device name.
444
+ # @param name [String] The storage account credential name.
445
+ # @param resource_group_name [String] The resource group name.
446
+ # @param [Hash{String => String}] A hash of custom headers that will be added
447
+ # to the HTTP request.
448
+ #
449
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
450
+ #
451
+ def begin_delete_async(device_name, name, resource_group_name, custom_headers:nil)
452
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
453
+ fail ArgumentError, 'name is nil' if name.nil?
454
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
455
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
456
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
457
+
458
+
459
+ request_headers = {}
460
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
461
+
462
+ # Set Headers
463
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
464
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
465
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}'
466
+
467
+ request_url = @base_url || @client.base_url
468
+
469
+ options = {
470
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
471
+ path_params: {'deviceName' => device_name,'name' => name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
472
+ query_params: {'api-version' => @client.api_version},
473
+ headers: request_headers.merge(custom_headers || {}),
474
+ base_url: request_url
475
+ }
476
+ promise = @client.make_request_async(:delete, path_template, options)
477
+
478
+ promise = promise.then do |result|
479
+ http_response = result.response
480
+ status_code = http_response.status
481
+ response_content = http_response.body
482
+ unless status_code == 200 || status_code == 202 || status_code == 204
483
+ error_model = JSON.load(response_content)
484
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
485
+ end
486
+
487
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
488
+
489
+ result
490
+ end
491
+
492
+ promise.execute
493
+ end
494
+
495
+ #
496
+ # Gets all the storage account credentials in a data box edge/gateway device.
497
+ #
498
+ # @param next_page_link [String] The NextLink from the previous successful call
499
+ # to List operation.
500
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
501
+ # will be added to the HTTP request.
502
+ #
503
+ # @return [StorageAccountCredentialList] operation results.
504
+ #
505
+ def list_by_data_box_edge_device_next(next_page_link, custom_headers:nil)
506
+ response = list_by_data_box_edge_device_next_async(next_page_link, custom_headers:custom_headers).value!
507
+ response.body unless response.nil?
508
+ end
509
+
510
+ #
511
+ # Gets all the storage account credentials in a data box edge/gateway device.
512
+ #
513
+ # @param next_page_link [String] The NextLink from the previous successful call
514
+ # to List operation.
515
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
516
+ # will be added to the HTTP request.
517
+ #
518
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
519
+ #
520
+ def list_by_data_box_edge_device_next_with_http_info(next_page_link, custom_headers:nil)
521
+ list_by_data_box_edge_device_next_async(next_page_link, custom_headers:custom_headers).value!
522
+ end
523
+
524
+ #
525
+ # Gets all the storage account credentials in a data box edge/gateway device.
526
+ #
527
+ # @param next_page_link [String] The NextLink from the previous successful call
528
+ # to List operation.
529
+ # @param [Hash{String => String}] A hash of custom headers that will be added
530
+ # to the HTTP request.
531
+ #
532
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
533
+ #
534
+ def list_by_data_box_edge_device_next_async(next_page_link, custom_headers:nil)
535
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
536
+
537
+
538
+ request_headers = {}
539
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
540
+
541
+ # Set Headers
542
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
543
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
544
+ path_template = '{nextLink}'
545
+
546
+ request_url = @base_url || @client.base_url
547
+
548
+ options = {
549
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
550
+ skip_encoding_path_params: {'nextLink' => next_page_link},
551
+ headers: request_headers.merge(custom_headers || {}),
552
+ base_url: request_url
553
+ }
554
+ promise = @client.make_request_async(:get, path_template, options)
555
+
556
+ promise = promise.then do |result|
557
+ http_response = result.response
558
+ status_code = http_response.status
559
+ response_content = http_response.body
560
+ unless status_code == 200
561
+ error_model = JSON.load(response_content)
562
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
563
+ end
564
+
565
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
566
+ # Deserialize Response
567
+ if status_code == 200
568
+ begin
569
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
570
+ result_mapper = Azure::EdgeGateway::Mgmt::V2019_03_01::Models::StorageAccountCredentialList.mapper()
571
+ result.body = @client.deserialize(result_mapper, parsed_response)
572
+ rescue Exception => e
573
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
574
+ end
575
+ end
576
+
577
+ result
578
+ end
579
+
580
+ promise.execute
581
+ end
582
+
583
+ #
584
+ # Gets all the storage account credentials in a data box edge/gateway device.
585
+ #
586
+ # @param device_name [String] The device name.
587
+ # @param resource_group_name [String] The resource group name.
588
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
589
+ # will be added to the HTTP request.
590
+ #
591
+ # @return [StorageAccountCredentialList] which provide lazy access to pages of
592
+ # the response.
593
+ #
594
+ def list_by_data_box_edge_device_as_lazy(device_name, resource_group_name, custom_headers:nil)
595
+ response = list_by_data_box_edge_device_async(device_name, resource_group_name, custom_headers:custom_headers).value!
596
+ unless response.nil?
597
+ page = response.body
598
+ page.next_method = Proc.new do |next_page_link|
599
+ list_by_data_box_edge_device_next_async(next_page_link, custom_headers:custom_headers)
600
+ end
601
+ page
602
+ end
603
+ end
604
+
605
+ end
606
+ end