azure_mgmt_iot_hub 0.14.0 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (172) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2016-02-03/generated/azure_mgmt_iot_hub.rb +67 -0
  3. data/lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_client.rb +129 -0
  4. data/lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb +3048 -0
  5. data/lib/{generated → 2016-02-03/generated}/azure_mgmt_iot_hub/models/access_rights.rb +1 -1
  6. data/lib/{generated → 2016-02-03/generated}/azure_mgmt_iot_hub/models/capabilities.rb +1 -1
  7. data/lib/{generated → 2016-02-03/generated}/azure_mgmt_iot_hub/models/cloud_to_device_properties.rb +1 -1
  8. data/lib/{generated → 2016-02-03/generated}/azure_mgmt_iot_hub/models/error_details.rb +1 -1
  9. data/lib/{generated → 2016-02-03/generated}/azure_mgmt_iot_hub/models/event_hub_consumer_group_info.rb +1 -1
  10. data/lib/{generated → 2016-02-03/generated}/azure_mgmt_iot_hub/models/event_hub_consumer_groups_list_result.rb +1 -1
  11. data/lib/2016-02-03/generated/azure_mgmt_iot_hub/models/event_hub_properties.rb +100 -0
  12. data/lib/{generated → 2016-02-03/generated}/azure_mgmt_iot_hub/models/export_devices_request.rb +1 -1
  13. data/lib/{generated → 2016-02-03/generated}/azure_mgmt_iot_hub/models/feedback_properties.rb +1 -1
  14. data/lib/{generated → 2016-02-03/generated}/azure_mgmt_iot_hub/models/import_devices_request.rb +1 -1
  15. data/lib/{generated → 2016-02-03/generated}/azure_mgmt_iot_hub/models/iot_hub_capacity.rb +1 -1
  16. data/lib/{generated → 2016-02-03/generated}/azure_mgmt_iot_hub/models/iot_hub_description.rb +1 -1
  17. data/lib/{generated → 2016-02-03/generated}/azure_mgmt_iot_hub/models/iot_hub_description_list_result.rb +1 -1
  18. data/lib/{generated → 2016-02-03/generated}/azure_mgmt_iot_hub/models/iot_hub_name_availability_info.rb +1 -1
  19. data/lib/{generated → 2016-02-03/generated}/azure_mgmt_iot_hub/models/iot_hub_name_unavailability_reason.rb +1 -1
  20. data/lib/2016-02-03/generated/azure_mgmt_iot_hub/models/iot_hub_properties.rb +210 -0
  21. data/lib/{generated → 2016-02-03/generated}/azure_mgmt_iot_hub/models/iot_hub_quota_metric_info.rb +1 -1
  22. data/lib/{generated → 2016-02-03/generated}/azure_mgmt_iot_hub/models/iot_hub_quota_metric_info_list_result.rb +1 -1
  23. data/lib/{generated → 2016-02-03/generated}/azure_mgmt_iot_hub/models/iot_hub_scale_type.rb +1 -1
  24. data/lib/{generated → 2016-02-03/generated}/azure_mgmt_iot_hub/models/iot_hub_sku.rb +1 -1
  25. data/lib/{generated → 2016-02-03/generated}/azure_mgmt_iot_hub/models/iot_hub_sku_description.rb +1 -1
  26. data/lib/{generated → 2016-02-03/generated}/azure_mgmt_iot_hub/models/iot_hub_sku_description_list_result.rb +1 -1
  27. data/lib/{generated → 2016-02-03/generated}/azure_mgmt_iot_hub/models/iot_hub_sku_info.rb +1 -1
  28. data/lib/{generated → 2016-02-03/generated}/azure_mgmt_iot_hub/models/iot_hub_sku_tier.rb +1 -1
  29. data/lib/{generated → 2016-02-03/generated}/azure_mgmt_iot_hub/models/ip_filter_action_type.rb +1 -1
  30. data/lib/{generated → 2016-02-03/generated}/azure_mgmt_iot_hub/models/ip_filter_rule.rb +1 -1
  31. data/lib/{generated → 2016-02-03/generated}/azure_mgmt_iot_hub/models/job_response.rb +1 -1
  32. data/lib/{generated → 2016-02-03/generated}/azure_mgmt_iot_hub/models/job_response_list_result.rb +1 -1
  33. data/lib/{generated → 2016-02-03/generated}/azure_mgmt_iot_hub/models/job_status.rb +1 -1
  34. data/lib/{generated → 2016-02-03/generated}/azure_mgmt_iot_hub/models/job_type.rb +1 -1
  35. data/lib/2016-02-03/generated/azure_mgmt_iot_hub/models/messaging_endpoint_properties.rb +73 -0
  36. data/lib/{generated → 2016-02-03/generated}/azure_mgmt_iot_hub/models/operation_inputs.rb +1 -1
  37. data/lib/{generated → 2016-02-03/generated}/azure_mgmt_iot_hub/models/operation_monitoring_level.rb +1 -1
  38. data/lib/2016-02-03/generated/azure_mgmt_iot_hub/models/operations_monitoring_properties.rb +53 -0
  39. data/lib/{generated → 2016-02-03/generated}/azure_mgmt_iot_hub/models/registry_statistics.rb +1 -1
  40. data/lib/{generated → 2016-02-03/generated}/azure_mgmt_iot_hub/models/resource.rb +1 -1
  41. data/lib/{generated → 2016-02-03/generated}/azure_mgmt_iot_hub/models/shared_access_signature_authorization_rule.rb +1 -1
  42. data/lib/{generated → 2016-02-03/generated}/azure_mgmt_iot_hub/models/shared_access_signature_authorization_rule_list_result.rb +1 -1
  43. data/lib/{generated → 2016-02-03/generated}/azure_mgmt_iot_hub/models/storage_endpoint_properties.rb +1 -1
  44. data/lib/2016-02-03/generated/azure_mgmt_iot_hub/module_definition.rb +9 -0
  45. data/lib/{generated → 2016-02-03/generated}/azure_mgmt_iot_hub/version.rb +2 -2
  46. data/lib/2017-01-19/generated/azure_mgmt_iot_hub.rb +75 -0
  47. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/iot_hub_client.rb +129 -0
  48. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/iot_hub_resource.rb +3048 -0
  49. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/access_rights.rb +29 -0
  50. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/capabilities.rb +16 -0
  51. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/cloud_to_device_properties.rb +73 -0
  52. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/error_details.rb +78 -0
  53. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/event_hub_consumer_group_info.rb +71 -0
  54. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/event_hub_consumer_groups_list_result.rb +96 -0
  55. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/event_hub_properties.rb +100 -0
  56. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/export_devices_request.rb +56 -0
  57. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/fallback_route_properties.rb +95 -0
  58. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/feedback_properties.rb +73 -0
  59. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/import_devices_request.rb +55 -0
  60. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/iot_hub_capacity.rb +84 -0
  61. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/iot_hub_description.rb +138 -0
  62. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/iot_hub_description_list_result.rb +96 -0
  63. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/iot_hub_name_availability_info.rb +69 -0
  64. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/iot_hub_name_unavailability_reason.rb +16 -0
  65. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/iot_hub_properties.rb +221 -0
  66. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/iot_hub_quota_metric_info.rb +67 -0
  67. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/iot_hub_quota_metric_info_list_result.rb +97 -0
  68. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/iot_hub_scale_type.rb +17 -0
  69. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/iot_hub_sku.rb +18 -0
  70. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/iot_hub_sku_description.rb +67 -0
  71. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/iot_hub_sku_description_list_result.rb +97 -0
  72. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/iot_hub_sku_info.rb +69 -0
  73. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/iot_hub_sku_tier.rb +16 -0
  74. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/ip_filter_action_type.rb +16 -0
  75. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/ip_filter_rule.rb +67 -0
  76. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/job_response.rb +128 -0
  77. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/job_response_list_result.rb +95 -0
  78. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/job_status.rb +20 -0
  79. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/job_type.rb +24 -0
  80. data/lib/{generated → 2017-01-19/generated}/azure_mgmt_iot_hub/models/messaging_endpoint_properties.rb +1 -1
  81. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/operation_inputs.rb +44 -0
  82. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/operation_monitoring_level.rb +18 -0
  83. data/lib/{generated → 2017-01-19/generated}/azure_mgmt_iot_hub/models/operations_monitoring_properties.rb +1 -1
  84. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/registry_statistics.rb +69 -0
  85. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/resource.rb +97 -0
  86. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/route_properties.rb +109 -0
  87. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/routing_endpoints.rb +97 -0
  88. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/routing_event_hub_properties.rb +82 -0
  89. data/lib/{generated → 2017-01-19/generated}/azure_mgmt_iot_hub/models/routing_properties.rb +1 -1
  90. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/routing_service_bus_queue_endpoint_properties.rb +85 -0
  91. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/routing_service_bus_topic_endpoint_properties.rb +85 -0
  92. data/lib/{generated → 2017-01-19/generated}/azure_mgmt_iot_hub/models/routing_source.rb +1 -1
  93. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/shared_access_signature_authorization_rule.rb +84 -0
  94. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/shared_access_signature_authorization_rule_list_result.rb +99 -0
  95. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/models/storage_endpoint_properties.rb +69 -0
  96. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/module_definition.rb +9 -0
  97. data/lib/{generated/azure_mgmt_iot_hub/module_definition.rb → 2017-01-19/generated/azure_mgmt_iot_hub/version.rb} +3 -3
  98. data/lib/2017-07-01/generated/azure_mgmt_iot_hub.rb +88 -0
  99. data/lib/{generated → 2017-07-01/generated}/azure_mgmt_iot_hub/certificates.rb +9 -9
  100. data/lib/{generated → 2017-07-01/generated}/azure_mgmt_iot_hub/iot_hub_client.rb +3 -3
  101. data/lib/{generated → 2017-07-01/generated}/azure_mgmt_iot_hub/iot_hub_resource.rb +34 -34
  102. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/models/access_rights.rb +29 -0
  103. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/models/capabilities.rb +16 -0
  104. data/lib/{generated → 2017-07-01/generated}/azure_mgmt_iot_hub/models/certificate_body_description.rb +1 -1
  105. data/lib/{generated → 2017-07-01/generated}/azure_mgmt_iot_hub/models/certificate_description.rb +1 -1
  106. data/lib/{generated → 2017-07-01/generated}/azure_mgmt_iot_hub/models/certificate_list_description.rb +1 -1
  107. data/lib/{generated → 2017-07-01/generated}/azure_mgmt_iot_hub/models/certificate_properties.rb +1 -1
  108. data/lib/{generated → 2017-07-01/generated}/azure_mgmt_iot_hub/models/certificate_properties_with_nonce.rb +1 -1
  109. data/lib/{generated → 2017-07-01/generated}/azure_mgmt_iot_hub/models/certificate_verification_description.rb +1 -1
  110. data/lib/{generated → 2017-07-01/generated}/azure_mgmt_iot_hub/models/certificate_with_nonce_description.rb +1 -1
  111. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/models/cloud_to_device_properties.rb +73 -0
  112. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/models/error_details.rb +78 -0
  113. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/models/event_hub_consumer_group_info.rb +71 -0
  114. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/models/event_hub_consumer_groups_list_result.rb +96 -0
  115. data/lib/{generated → 2017-07-01/generated}/azure_mgmt_iot_hub/models/event_hub_properties.rb +1 -1
  116. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/models/export_devices_request.rb +56 -0
  117. data/lib/{generated → 2017-07-01/generated}/azure_mgmt_iot_hub/models/fallback_route_properties.rb +1 -1
  118. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/models/feedback_properties.rb +73 -0
  119. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/models/import_devices_request.rb +55 -0
  120. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/models/iot_hub_capacity.rb +84 -0
  121. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/models/iot_hub_description.rb +138 -0
  122. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/models/iot_hub_description_list_result.rb +96 -0
  123. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/models/iot_hub_name_availability_info.rb +69 -0
  124. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/models/iot_hub_name_unavailability_reason.rb +16 -0
  125. data/lib/{generated → 2017-07-01/generated}/azure_mgmt_iot_hub/models/iot_hub_properties.rb +1 -1
  126. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/models/iot_hub_quota_metric_info.rb +67 -0
  127. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/models/iot_hub_quota_metric_info_list_result.rb +97 -0
  128. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/models/iot_hub_scale_type.rb +17 -0
  129. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/models/iot_hub_sku.rb +18 -0
  130. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/models/iot_hub_sku_description.rb +67 -0
  131. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/models/iot_hub_sku_description_list_result.rb +97 -0
  132. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/models/iot_hub_sku_info.rb +69 -0
  133. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/models/iot_hub_sku_tier.rb +16 -0
  134. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/models/ip_filter_action_type.rb +16 -0
  135. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/models/ip_filter_rule.rb +67 -0
  136. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/models/job_response.rb +128 -0
  137. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/models/job_response_list_result.rb +95 -0
  138. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/models/job_status.rb +20 -0
  139. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/models/job_type.rb +24 -0
  140. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/models/messaging_endpoint_properties.rb +73 -0
  141. data/lib/{generated → 2017-07-01/generated}/azure_mgmt_iot_hub/models/operation.rb +1 -1
  142. data/lib/{generated → 2017-07-01/generated}/azure_mgmt_iot_hub/models/operation_display.rb +1 -1
  143. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/models/operation_inputs.rb +44 -0
  144. data/lib/{generated → 2017-07-01/generated}/azure_mgmt_iot_hub/models/operation_list_result.rb +1 -1
  145. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/models/operation_monitoring_level.rb +18 -0
  146. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/models/operations_monitoring_properties.rb +55 -0
  147. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/models/registry_statistics.rb +69 -0
  148. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/models/resource.rb +97 -0
  149. data/lib/{generated → 2017-07-01/generated}/azure_mgmt_iot_hub/models/route_properties.rb +1 -1
  150. data/lib/{generated → 2017-07-01/generated}/azure_mgmt_iot_hub/models/routing_endpoints.rb +1 -1
  151. data/lib/{generated → 2017-07-01/generated}/azure_mgmt_iot_hub/models/routing_event_hub_properties.rb +1 -1
  152. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/models/routing_properties.rb +83 -0
  153. data/lib/{generated → 2017-07-01/generated}/azure_mgmt_iot_hub/models/routing_service_bus_queue_endpoint_properties.rb +1 -1
  154. data/lib/{generated → 2017-07-01/generated}/azure_mgmt_iot_hub/models/routing_service_bus_topic_endpoint_properties.rb +1 -1
  155. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/models/routing_source.rb +18 -0
  156. data/lib/{generated → 2017-07-01/generated}/azure_mgmt_iot_hub/models/routing_storage_container_properties.rb +1 -1
  157. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/models/shared_access_signature_authorization_rule.rb +84 -0
  158. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/models/shared_access_signature_authorization_rule_list_result.rb +99 -0
  159. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/models/storage_endpoint_properties.rb +69 -0
  160. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/module_definition.rb +9 -0
  161. data/lib/{generated → 2017-07-01/generated}/azure_mgmt_iot_hub/operations.rb +3 -3
  162. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/version.rb +8 -0
  163. data/lib/azure_mgmt_iot_hub.rb +4 -1
  164. data/lib/module_definition.rb +8 -0
  165. data/lib/profiles/common/configurable.rb +73 -0
  166. data/lib/profiles/common/default.rb +68 -0
  167. data/lib/profiles/latest/iothub_latest_profile_client.rb +33 -0
  168. data/lib/profiles/latest/iothub_module_definition.rb +9 -0
  169. data/lib/profiles/latest/modules/iothub_profile_module.rb +278 -0
  170. data/lib/version.rb +7 -0
  171. metadata +170 -67
  172. data/lib/generated/azure_mgmt_iot_hub.rb +0 -88
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ebf90ef0d386a9dab5d0cabe3480a35431357d5d
4
- data.tar.gz: 2baa00a2bac57fd6172d1c70b9ab5a6f2a759eee
3
+ metadata.gz: 4c1d8c03bd1e0558a13dc6a22c0e3b14ec6cbe4d
4
+ data.tar.gz: e4d7db49dab22363cca3c7407023ac79daa6310a
5
5
  SHA512:
6
- metadata.gz: 1d9236e248f75482b97428bf441aa03854aab57248a7a8f3edfafa8bf56c16896b46e2cbc54e244bbd053b90d959cf6601c447fbb765ce0f4fc12b0d827c88ab
7
- data.tar.gz: 5a2a2cea4c7c3505b82d0d460fa4e3619b3ea39ad9014590299099a5a65b52a400f966e561273c6d080d1d16fdba98372f267608b9909d0f1e388e3ffe6a8d24
6
+ metadata.gz: f28183c9fddec3ab075a6aa7122714d8dc0a14d45aef06b45c76f47d6edf91807d01a8a11a4aebfb258e7e7e4c1ea2826cf49e13b88b28a8cd4c7ba6efef430b
7
+ data.tar.gz: d13a65c424d5fcca4e4f2ead8f57f744758a4c42eaae827f740d4aec41a7df4eb2aed2875cafdd6e8c9705d7584b2ee5d3719f16aa82c924abeba6903d63dc51
@@ -0,0 +1,67 @@
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
+ require 'uri'
7
+ require 'cgi'
8
+ require 'date'
9
+ require 'json'
10
+ require 'base64'
11
+ require 'erb'
12
+ require 'securerandom'
13
+ require 'time'
14
+ require 'timeliness'
15
+ require 'faraday'
16
+ require 'faraday-cookie_jar'
17
+ require 'concurrent'
18
+ require 'ms_rest'
19
+ require '2016-02-03/generated/azure_mgmt_iot_hub/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::IotHub::Mgmt::V2016_02_03
23
+ autoload :IotHubResource, '2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb'
24
+ autoload :IotHubClient, '2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_client.rb'
25
+
26
+ module Models
27
+ autoload :IotHubQuotaMetricInfo, '2016-02-03/generated/azure_mgmt_iot_hub/models/iot_hub_quota_metric_info.rb'
28
+ autoload :IotHubQuotaMetricInfoListResult, '2016-02-03/generated/azure_mgmt_iot_hub/models/iot_hub_quota_metric_info_list_result.rb'
29
+ autoload :IpFilterRule, '2016-02-03/generated/azure_mgmt_iot_hub/models/ip_filter_rule.rb'
30
+ autoload :RegistryStatistics, '2016-02-03/generated/azure_mgmt_iot_hub/models/registry_statistics.rb'
31
+ autoload :StorageEndpointProperties, '2016-02-03/generated/azure_mgmt_iot_hub/models/storage_endpoint_properties.rb'
32
+ autoload :JobResponse, '2016-02-03/generated/azure_mgmt_iot_hub/models/job_response.rb'
33
+ autoload :FeedbackProperties, '2016-02-03/generated/azure_mgmt_iot_hub/models/feedback_properties.rb'
34
+ autoload :JobResponseListResult, '2016-02-03/generated/azure_mgmt_iot_hub/models/job_response_list_result.rb'
35
+ autoload :OperationsMonitoringProperties, '2016-02-03/generated/azure_mgmt_iot_hub/models/operations_monitoring_properties.rb'
36
+ autoload :IotHubCapacity, '2016-02-03/generated/azure_mgmt_iot_hub/models/iot_hub_capacity.rb'
37
+ autoload :IotHubSkuInfo, '2016-02-03/generated/azure_mgmt_iot_hub/models/iot_hub_sku_info.rb'
38
+ autoload :IotHubSkuDescription, '2016-02-03/generated/azure_mgmt_iot_hub/models/iot_hub_sku_description.rb'
39
+ autoload :Resource, '2016-02-03/generated/azure_mgmt_iot_hub/models/resource.rb'
40
+ autoload :EventHubConsumerGroupsListResult, '2016-02-03/generated/azure_mgmt_iot_hub/models/event_hub_consumer_groups_list_result.rb'
41
+ autoload :ErrorDetails, '2016-02-03/generated/azure_mgmt_iot_hub/models/error_details.rb'
42
+ autoload :EventHubConsumerGroupInfo, '2016-02-03/generated/azure_mgmt_iot_hub/models/event_hub_consumer_group_info.rb'
43
+ autoload :EventHubProperties, '2016-02-03/generated/azure_mgmt_iot_hub/models/event_hub_properties.rb'
44
+ autoload :IotHubSkuDescriptionListResult, '2016-02-03/generated/azure_mgmt_iot_hub/models/iot_hub_sku_description_list_result.rb'
45
+ autoload :CloudToDeviceProperties, '2016-02-03/generated/azure_mgmt_iot_hub/models/cloud_to_device_properties.rb'
46
+ autoload :IotHubDescriptionListResult, '2016-02-03/generated/azure_mgmt_iot_hub/models/iot_hub_description_list_result.rb'
47
+ autoload :SharedAccessSignatureAuthorizationRuleListResult, '2016-02-03/generated/azure_mgmt_iot_hub/models/shared_access_signature_authorization_rule_list_result.rb'
48
+ autoload :OperationInputs, '2016-02-03/generated/azure_mgmt_iot_hub/models/operation_inputs.rb'
49
+ autoload :MessagingEndpointProperties, '2016-02-03/generated/azure_mgmt_iot_hub/models/messaging_endpoint_properties.rb'
50
+ autoload :IotHubNameAvailabilityInfo, '2016-02-03/generated/azure_mgmt_iot_hub/models/iot_hub_name_availability_info.rb'
51
+ autoload :SharedAccessSignatureAuthorizationRule, '2016-02-03/generated/azure_mgmt_iot_hub/models/shared_access_signature_authorization_rule.rb'
52
+ autoload :ExportDevicesRequest, '2016-02-03/generated/azure_mgmt_iot_hub/models/export_devices_request.rb'
53
+ autoload :IotHubProperties, '2016-02-03/generated/azure_mgmt_iot_hub/models/iot_hub_properties.rb'
54
+ autoload :ImportDevicesRequest, '2016-02-03/generated/azure_mgmt_iot_hub/models/import_devices_request.rb'
55
+ autoload :IotHubDescription, '2016-02-03/generated/azure_mgmt_iot_hub/models/iot_hub_description.rb'
56
+ autoload :AccessRights, '2016-02-03/generated/azure_mgmt_iot_hub/models/access_rights.rb'
57
+ autoload :IpFilterActionType, '2016-02-03/generated/azure_mgmt_iot_hub/models/ip_filter_action_type.rb'
58
+ autoload :OperationMonitoringLevel, '2016-02-03/generated/azure_mgmt_iot_hub/models/operation_monitoring_level.rb'
59
+ autoload :Capabilities, '2016-02-03/generated/azure_mgmt_iot_hub/models/capabilities.rb'
60
+ autoload :IotHubSku, '2016-02-03/generated/azure_mgmt_iot_hub/models/iot_hub_sku.rb'
61
+ autoload :IotHubSkuTier, '2016-02-03/generated/azure_mgmt_iot_hub/models/iot_hub_sku_tier.rb'
62
+ autoload :JobType, '2016-02-03/generated/azure_mgmt_iot_hub/models/job_type.rb'
63
+ autoload :JobStatus, '2016-02-03/generated/azure_mgmt_iot_hub/models/job_status.rb'
64
+ autoload :IotHubScaleType, '2016-02-03/generated/azure_mgmt_iot_hub/models/iot_hub_scale_type.rb'
65
+ autoload :IotHubNameUnavailabilityReason, '2016-02-03/generated/azure_mgmt_iot_hub/models/iot_hub_name_unavailability_reason.rb'
66
+ end
67
+ end
@@ -0,0 +1,129 @@
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::IotHub::Mgmt::V2016_02_03
7
+ #
8
+ # A service client - single point of access to the REST API.
9
+ #
10
+ class IotHubClient < MsRestAzure::AzureServiceClient
11
+ include MsRestAzure
12
+ include MsRestAzure::Serialization
13
+
14
+ # @return [String] the base URI of the service.
15
+ attr_accessor :base_url
16
+
17
+ # @return Credentials needed for the client to connect to Azure.
18
+ attr_reader :credentials
19
+
20
+ # @return [String] The subscription identifier.
21
+ attr_accessor :subscription_id
22
+
23
+ # @return [String] The version of the API.
24
+ attr_reader :api_version
25
+
26
+ # @return [String] Gets or sets the preferred language for the response.
27
+ attr_accessor :accept_language
28
+
29
+ # @return [Integer] Gets or sets the retry timeout in seconds for Long
30
+ # Running Operations. Default value is 30.
31
+ attr_accessor :long_running_operation_retry_timeout
32
+
33
+ # @return [Boolean] When set to true a unique x-ms-client-request-id value
34
+ # is generated and included in each request. Default is true.
35
+ attr_accessor :generate_client_request_id
36
+
37
+ # @return [IotHubResource] iot_hub_resource
38
+ attr_reader :iot_hub_resource
39
+
40
+ #
41
+ # Creates initializes a new instance of the IotHubClient class.
42
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
43
+ # @param base_url [String] the base URI of the service.
44
+ # @param options [Array] filters to be applied to the HTTP requests.
45
+ #
46
+ def initialize(credentials = nil, base_url = nil, options = nil)
47
+ super(credentials, options)
48
+ @base_url = base_url || 'https://management.azure.com'
49
+
50
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
51
+ @credentials = credentials
52
+
53
+ @iot_hub_resource = IotHubResource.new(self)
54
+ @api_version = '2016-02-03'
55
+ @accept_language = 'en-US'
56
+ @long_running_operation_retry_timeout = 30
57
+ @generate_client_request_id = true
58
+ add_telemetry
59
+ end
60
+
61
+ #
62
+ # Makes a request and returns the body of the response.
63
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
64
+ # @param path [String] the path, relative to {base_url}.
65
+ # @param options [Hash{String=>String}] specifying any request options like :body.
66
+ # @return [Hash{String=>String}] containing the body of the response.
67
+ # Example:
68
+ #
69
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
70
+ # path = "/path"
71
+ # options = {
72
+ # body: request_content,
73
+ # query_params: {'api-version' => '2016-02-01'}
74
+ # }
75
+ # result = @client.make_request(:put, path, options)
76
+ #
77
+ def make_request(method, path, options = {})
78
+ result = make_request_with_http_info(method, path, options)
79
+ result.body unless result.nil?
80
+ end
81
+
82
+ #
83
+ # Makes a request and returns the operation response.
84
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
85
+ # @param path [String] the path, relative to {base_url}.
86
+ # @param options [Hash{String=>String}] specifying any request options like :body.
87
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
88
+ #
89
+ def make_request_with_http_info(method, path, options = {})
90
+ result = make_request_async(method, path, options).value!
91
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
92
+ result
93
+ end
94
+
95
+ #
96
+ # Makes a request asynchronously.
97
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
98
+ # @param path [String] the path, relative to {base_url}.
99
+ # @param options [Hash{String=>String}] specifying any request options like :body.
100
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
101
+ #
102
+ def make_request_async(method, path, options = {})
103
+ fail ArgumentError, 'method is nil' if method.nil?
104
+ fail ArgumentError, 'path is nil' if path.nil?
105
+
106
+ request_url = options[:base_url] || @base_url
107
+
108
+ request_headers = @request_headers
109
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
110
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
111
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
112
+
113
+ super(request_url, method, path, options)
114
+ end
115
+
116
+
117
+ private
118
+ #
119
+ # Adds telemetry information.
120
+ #
121
+ def add_telemetry
122
+ sdk_information = 'azure_mgmt_iot_hub'
123
+ if defined? Azure::IotHub::Mgmt::V2016_02_03::VERSION
124
+ sdk_information = "#{sdk_information}/#{Azure::IotHub::Mgmt::V2016_02_03::VERSION}"
125
+ end
126
+ add_user_agent_information(sdk_information)
127
+ end
128
+ end
129
+ end
@@ -0,0 +1,3048 @@
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::IotHub::Mgmt::V2016_02_03
7
+ #
8
+ # Use this API to manage the IoT hubs in your Azure subscription.
9
+ #
10
+ class IotHubResource
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the IotHubResource class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [IotHubClient] reference to the IotHubClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Get the non-security related metadata of an IoT hub.
26
+ #
27
+ # Get the non-security related metadata of an IoT hub.
28
+ #
29
+ # @param resource_group_name [String] The name of the resource group that
30
+ # contains the IoT hub.
31
+ # @param resource_name [String] The name of the IoT hub.
32
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
33
+ # will be added to the HTTP request.
34
+ #
35
+ # @return [IotHubDescription] operation results.
36
+ #
37
+ def get(resource_group_name, resource_name, custom_headers = nil)
38
+ response = get_async(resource_group_name, resource_name, custom_headers).value!
39
+ response.body unless response.nil?
40
+ end
41
+
42
+ #
43
+ # Get the non-security related metadata of an IoT hub.
44
+ #
45
+ # Get the non-security related metadata of an IoT hub.
46
+ #
47
+ # @param resource_group_name [String] The name of the resource group that
48
+ # contains the IoT hub.
49
+ # @param resource_name [String] The name of the IoT hub.
50
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
51
+ # will be added to the HTTP request.
52
+ #
53
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
54
+ #
55
+ def get_with_http_info(resource_group_name, resource_name, custom_headers = nil)
56
+ get_async(resource_group_name, resource_name, custom_headers).value!
57
+ end
58
+
59
+ #
60
+ # Get the non-security related metadata of an IoT hub.
61
+ #
62
+ # Get the non-security related metadata of an IoT hub.
63
+ #
64
+ # @param resource_group_name [String] The name of the resource group that
65
+ # contains the IoT hub.
66
+ # @param resource_name [String] The name of the IoT hub.
67
+ # @param [Hash{String => String}] A hash of custom headers that will be added
68
+ # to the HTTP request.
69
+ #
70
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
71
+ #
72
+ def get_async(resource_group_name, resource_name, custom_headers = nil)
73
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
74
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
75
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
76
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
77
+
78
+
79
+ request_headers = {}
80
+
81
+ # Set Headers
82
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
83
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
84
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}'
85
+
86
+ request_url = @base_url || @client.base_url
87
+
88
+ options = {
89
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
90
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
91
+ query_params: {'api-version' => @client.api_version},
92
+ headers: request_headers.merge(custom_headers || {}),
93
+ base_url: request_url
94
+ }
95
+ promise = @client.make_request_async(:get, path_template, options)
96
+
97
+ promise = promise.then do |result|
98
+ http_response = result.response
99
+ status_code = http_response.status
100
+ response_content = http_response.body
101
+ unless status_code == 200
102
+ error_model = JSON.load(response_content)
103
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
104
+ end
105
+
106
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
107
+ # Deserialize Response
108
+ if status_code == 200
109
+ begin
110
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
111
+ result_mapper = Azure::IotHub::Mgmt::V2016_02_03::Models::IotHubDescription.mapper()
112
+ result.body = @client.deserialize(result_mapper, parsed_response)
113
+ rescue Exception => e
114
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
115
+ end
116
+ end
117
+
118
+ result
119
+ end
120
+
121
+ promise.execute
122
+ end
123
+
124
+ #
125
+ # Create or update the metadata of an IoT hub.
126
+ #
127
+ # Create or update the metadata of an Iot hub. The usual pattern to modify a
128
+ # property is to retrieve the IoT hub metadata and security metadata, and then
129
+ # combine them with the modified values in a new body to update the IoT hub.
130
+ #
131
+ # @param resource_group_name [String] The name of the resource group that
132
+ # contains the IoT hub.
133
+ # @param resource_name [String] The name of the IoT hub to create or update.
134
+ # @param iot_hub_description [IotHubDescription] The IoT hub metadata and
135
+ # security metadata.
136
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
137
+ # will be added to the HTTP request.
138
+ #
139
+ # @return [IotHubDescription] operation results.
140
+ #
141
+ def create_or_update(resource_group_name, resource_name, iot_hub_description, custom_headers = nil)
142
+ response = create_or_update_async(resource_group_name, resource_name, iot_hub_description, custom_headers).value!
143
+ response.body unless response.nil?
144
+ end
145
+
146
+ #
147
+ # @param resource_group_name [String] The name of the resource group that
148
+ # contains the IoT hub.
149
+ # @param resource_name [String] The name of the IoT hub to create or update.
150
+ # @param iot_hub_description [IotHubDescription] The IoT hub metadata and
151
+ # security metadata.
152
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
153
+ # will be added to the HTTP request.
154
+ #
155
+ # @return [Concurrent::Promise] promise which provides async access to http
156
+ # response.
157
+ #
158
+ def create_or_update_async(resource_group_name, resource_name, iot_hub_description, custom_headers = nil)
159
+ # Send request
160
+ promise = begin_create_or_update_async(resource_group_name, resource_name, iot_hub_description, custom_headers)
161
+
162
+ promise = promise.then do |response|
163
+ # Defining deserialization method.
164
+ deserialize_method = lambda do |parsed_response|
165
+ result_mapper = Azure::IotHub::Mgmt::V2016_02_03::Models::IotHubDescription.mapper()
166
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
167
+ end
168
+
169
+ # Waiting for response.
170
+ @client.get_long_running_operation_result(response, deserialize_method)
171
+ end
172
+
173
+ promise
174
+ end
175
+
176
+ #
177
+ # Delete an IoT hub.
178
+ #
179
+ # Delete an IoT hub.
180
+ #
181
+ # @param resource_group_name [String] The name of the resource group that
182
+ # contains the IoT hub.
183
+ # @param resource_name [String] The name of the IoT hub to delete.
184
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
185
+ # will be added to the HTTP request.
186
+ #
187
+ # @return [Object] operation results.
188
+ #
189
+ def delete(resource_group_name, resource_name, custom_headers = nil)
190
+ response = delete_async(resource_group_name, resource_name, custom_headers).value!
191
+ response.body unless response.nil?
192
+ end
193
+
194
+ #
195
+ # @param resource_group_name [String] The name of the resource group that
196
+ # contains the IoT hub.
197
+ # @param resource_name [String] The name of the IoT hub to delete.
198
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
199
+ # will be added to the HTTP request.
200
+ #
201
+ # @return [Concurrent::Promise] promise which provides async access to http
202
+ # response.
203
+ #
204
+ def delete_async(resource_group_name, resource_name, custom_headers = nil)
205
+ # Send request
206
+ promise = begin_delete_async(resource_group_name, resource_name, custom_headers)
207
+
208
+ promise = promise.then do |response|
209
+ # Defining deserialization method.
210
+ deserialize_method = lambda do |parsed_response|
211
+ result_mapper = {
212
+ required: false,
213
+ serialized_name: 'parsed_response',
214
+ type: {
215
+ name: 'Object'
216
+ }
217
+ }
218
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
219
+ end
220
+
221
+ # Waiting for response.
222
+ @client.get_long_running_operation_result(response, deserialize_method)
223
+ end
224
+
225
+ promise
226
+ end
227
+
228
+ #
229
+ # Get all the IoT hubs in a subscription.
230
+ #
231
+ # Get all the IoT hubs in a subscription.
232
+ #
233
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
234
+ # will be added to the HTTP request.
235
+ #
236
+ # @return [Array<IotHubDescription>] operation results.
237
+ #
238
+ def list_by_subscription(custom_headers = nil)
239
+ first_page = list_by_subscription_as_lazy(custom_headers)
240
+ first_page.get_all_items
241
+ end
242
+
243
+ #
244
+ # Get all the IoT hubs in a subscription.
245
+ #
246
+ # Get all the IoT hubs in a subscription.
247
+ #
248
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
249
+ # will be added to the HTTP request.
250
+ #
251
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
252
+ #
253
+ def list_by_subscription_with_http_info(custom_headers = nil)
254
+ list_by_subscription_async(custom_headers).value!
255
+ end
256
+
257
+ #
258
+ # Get all the IoT hubs in a subscription.
259
+ #
260
+ # Get all the IoT hubs in a subscription.
261
+ #
262
+ # @param [Hash{String => String}] A hash of custom headers that will be added
263
+ # to the HTTP request.
264
+ #
265
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
266
+ #
267
+ def list_by_subscription_async(custom_headers = nil)
268
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
269
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
270
+
271
+
272
+ request_headers = {}
273
+
274
+ # Set Headers
275
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
276
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
277
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Devices/IotHubs'
278
+
279
+ request_url = @base_url || @client.base_url
280
+
281
+ options = {
282
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
283
+ path_params: {'subscriptionId' => @client.subscription_id},
284
+ query_params: {'api-version' => @client.api_version},
285
+ headers: request_headers.merge(custom_headers || {}),
286
+ base_url: request_url
287
+ }
288
+ promise = @client.make_request_async(:get, path_template, options)
289
+
290
+ promise = promise.then do |result|
291
+ http_response = result.response
292
+ status_code = http_response.status
293
+ response_content = http_response.body
294
+ unless status_code == 200
295
+ error_model = JSON.load(response_content)
296
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
297
+ end
298
+
299
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
300
+ # Deserialize Response
301
+ if status_code == 200
302
+ begin
303
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
304
+ result_mapper = Azure::IotHub::Mgmt::V2016_02_03::Models::IotHubDescriptionListResult.mapper()
305
+ result.body = @client.deserialize(result_mapper, parsed_response)
306
+ rescue Exception => e
307
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
308
+ end
309
+ end
310
+
311
+ result
312
+ end
313
+
314
+ promise.execute
315
+ end
316
+
317
+ #
318
+ # Get all the IoT hubs in a resource group.
319
+ #
320
+ # Get all the IoT hubs in a resource group.
321
+ #
322
+ # @param resource_group_name [String] The name of the resource group that
323
+ # contains the IoT hubs.
324
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
325
+ # will be added to the HTTP request.
326
+ #
327
+ # @return [Array<IotHubDescription>] operation results.
328
+ #
329
+ def list_by_resource_group(resource_group_name, custom_headers = nil)
330
+ first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers)
331
+ first_page.get_all_items
332
+ end
333
+
334
+ #
335
+ # Get all the IoT hubs in a resource group.
336
+ #
337
+ # Get all the IoT hubs in a resource group.
338
+ #
339
+ # @param resource_group_name [String] The name of the resource group that
340
+ # contains the IoT hubs.
341
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
342
+ # will be added to the HTTP request.
343
+ #
344
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
345
+ #
346
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers = nil)
347
+ list_by_resource_group_async(resource_group_name, custom_headers).value!
348
+ end
349
+
350
+ #
351
+ # Get all the IoT hubs in a resource group.
352
+ #
353
+ # Get all the IoT hubs in a resource group.
354
+ #
355
+ # @param resource_group_name [String] The name of the resource group that
356
+ # contains the IoT hubs.
357
+ # @param [Hash{String => String}] A hash of custom headers that will be added
358
+ # to the HTTP request.
359
+ #
360
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
361
+ #
362
+ def list_by_resource_group_async(resource_group_name, custom_headers = nil)
363
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
364
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
365
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
366
+
367
+
368
+ request_headers = {}
369
+
370
+ # Set Headers
371
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
372
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
373
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs'
374
+
375
+ request_url = @base_url || @client.base_url
376
+
377
+ options = {
378
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
379
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
380
+ query_params: {'api-version' => @client.api_version},
381
+ headers: request_headers.merge(custom_headers || {}),
382
+ base_url: request_url
383
+ }
384
+ promise = @client.make_request_async(:get, path_template, options)
385
+
386
+ promise = promise.then do |result|
387
+ http_response = result.response
388
+ status_code = http_response.status
389
+ response_content = http_response.body
390
+ unless status_code == 200
391
+ error_model = JSON.load(response_content)
392
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
393
+ end
394
+
395
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
396
+ # Deserialize Response
397
+ if status_code == 200
398
+ begin
399
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
400
+ result_mapper = Azure::IotHub::Mgmt::V2016_02_03::Models::IotHubDescriptionListResult.mapper()
401
+ result.body = @client.deserialize(result_mapper, parsed_response)
402
+ rescue Exception => e
403
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
404
+ end
405
+ end
406
+
407
+ result
408
+ end
409
+
410
+ promise.execute
411
+ end
412
+
413
+ #
414
+ # Get the statistics from an IoT hub.
415
+ #
416
+ # Get the statistics from an IoT hub.
417
+ #
418
+ # @param resource_group_name [String] The name of the resource group that
419
+ # contains the IoT hub.
420
+ # @param resource_name [String] The name of the IoT hub.
421
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
422
+ # will be added to the HTTP request.
423
+ #
424
+ # @return [RegistryStatistics] operation results.
425
+ #
426
+ def get_stats(resource_group_name, resource_name, custom_headers = nil)
427
+ response = get_stats_async(resource_group_name, resource_name, custom_headers).value!
428
+ response.body unless response.nil?
429
+ end
430
+
431
+ #
432
+ # Get the statistics from an IoT hub.
433
+ #
434
+ # Get the statistics from an IoT hub.
435
+ #
436
+ # @param resource_group_name [String] The name of the resource group that
437
+ # contains the IoT hub.
438
+ # @param resource_name [String] The name of the IoT hub.
439
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
440
+ # will be added to the HTTP request.
441
+ #
442
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
443
+ #
444
+ def get_stats_with_http_info(resource_group_name, resource_name, custom_headers = nil)
445
+ get_stats_async(resource_group_name, resource_name, custom_headers).value!
446
+ end
447
+
448
+ #
449
+ # Get the statistics from an IoT hub.
450
+ #
451
+ # Get the statistics from an IoT hub.
452
+ #
453
+ # @param resource_group_name [String] The name of the resource group that
454
+ # contains the IoT hub.
455
+ # @param resource_name [String] The name of the IoT hub.
456
+ # @param [Hash{String => String}] A hash of custom headers that will be added
457
+ # to the HTTP request.
458
+ #
459
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
460
+ #
461
+ def get_stats_async(resource_group_name, resource_name, custom_headers = nil)
462
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
463
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
464
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
465
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
466
+
467
+
468
+ request_headers = {}
469
+
470
+ # Set Headers
471
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
472
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
473
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/IotHubStats'
474
+
475
+ request_url = @base_url || @client.base_url
476
+
477
+ options = {
478
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
479
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
480
+ query_params: {'api-version' => @client.api_version},
481
+ headers: request_headers.merge(custom_headers || {}),
482
+ base_url: request_url
483
+ }
484
+ promise = @client.make_request_async(:get, path_template, options)
485
+
486
+ promise = promise.then do |result|
487
+ http_response = result.response
488
+ status_code = http_response.status
489
+ response_content = http_response.body
490
+ unless status_code == 200
491
+ error_model = JSON.load(response_content)
492
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
493
+ end
494
+
495
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
496
+ # Deserialize Response
497
+ if status_code == 200
498
+ begin
499
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
500
+ result_mapper = Azure::IotHub::Mgmt::V2016_02_03::Models::RegistryStatistics.mapper()
501
+ result.body = @client.deserialize(result_mapper, parsed_response)
502
+ rescue Exception => e
503
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
504
+ end
505
+ end
506
+
507
+ result
508
+ end
509
+
510
+ promise.execute
511
+ end
512
+
513
+ #
514
+ # Get the list of valid SKUs for an IoT hub.
515
+ #
516
+ # Get the list of valid SKUs for an IoT hub.
517
+ #
518
+ # @param resource_group_name [String] The name of the resource group that
519
+ # contains the IoT hub.
520
+ # @param resource_name [String] The name of the IoT hub.
521
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
522
+ # will be added to the HTTP request.
523
+ #
524
+ # @return [Array<IotHubSkuDescription>] operation results.
525
+ #
526
+ def get_valid_skus(resource_group_name, resource_name, custom_headers = nil)
527
+ first_page = get_valid_skus_as_lazy(resource_group_name, resource_name, custom_headers)
528
+ first_page.get_all_items
529
+ end
530
+
531
+ #
532
+ # Get the list of valid SKUs for an IoT hub.
533
+ #
534
+ # Get the list of valid SKUs for an IoT hub.
535
+ #
536
+ # @param resource_group_name [String] The name of the resource group that
537
+ # contains the IoT hub.
538
+ # @param resource_name [String] The name of the IoT hub.
539
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
540
+ # will be added to the HTTP request.
541
+ #
542
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
543
+ #
544
+ def get_valid_skus_with_http_info(resource_group_name, resource_name, custom_headers = nil)
545
+ get_valid_skus_async(resource_group_name, resource_name, custom_headers).value!
546
+ end
547
+
548
+ #
549
+ # Get the list of valid SKUs for an IoT hub.
550
+ #
551
+ # Get the list of valid SKUs for an IoT hub.
552
+ #
553
+ # @param resource_group_name [String] The name of the resource group that
554
+ # contains the IoT hub.
555
+ # @param resource_name [String] The name of the IoT hub.
556
+ # @param [Hash{String => String}] A hash of custom headers that will be added
557
+ # to the HTTP request.
558
+ #
559
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
560
+ #
561
+ def get_valid_skus_async(resource_group_name, resource_name, custom_headers = nil)
562
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
563
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
564
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
565
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
566
+
567
+
568
+ request_headers = {}
569
+
570
+ # Set Headers
571
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
572
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
573
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/skus'
574
+
575
+ request_url = @base_url || @client.base_url
576
+
577
+ options = {
578
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
579
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
580
+ query_params: {'api-version' => @client.api_version},
581
+ headers: request_headers.merge(custom_headers || {}),
582
+ base_url: request_url
583
+ }
584
+ promise = @client.make_request_async(:get, path_template, options)
585
+
586
+ promise = promise.then do |result|
587
+ http_response = result.response
588
+ status_code = http_response.status
589
+ response_content = http_response.body
590
+ unless status_code == 200
591
+ error_model = JSON.load(response_content)
592
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
593
+ end
594
+
595
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
596
+ # Deserialize Response
597
+ if status_code == 200
598
+ begin
599
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
600
+ result_mapper = Azure::IotHub::Mgmt::V2016_02_03::Models::IotHubSkuDescriptionListResult.mapper()
601
+ result.body = @client.deserialize(result_mapper, parsed_response)
602
+ rescue Exception => e
603
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
604
+ end
605
+ end
606
+
607
+ result
608
+ end
609
+
610
+ promise.execute
611
+ end
612
+
613
+ #
614
+ # Get a list of the consumer groups in the Event Hub-compatible device-to-cloud
615
+ # endpoint in an IoT hub.
616
+ #
617
+ # Get a list of the consumer groups in the Event Hub-compatible device-to-cloud
618
+ # endpoint in an IoT hub.
619
+ #
620
+ # @param resource_group_name [String] The name of the resource group that
621
+ # contains the IoT hub.
622
+ # @param resource_name [String] The name of the IoT hub.
623
+ # @param event_hub_endpoint_name [String] The name of the Event Hub-compatible
624
+ # endpoint.
625
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
626
+ # will be added to the HTTP request.
627
+ #
628
+ # @return [Array<String>] operation results.
629
+ #
630
+ def list_event_hub_consumer_groups(resource_group_name, resource_name, event_hub_endpoint_name, custom_headers = nil)
631
+ first_page = list_event_hub_consumer_groups_as_lazy(resource_group_name, resource_name, event_hub_endpoint_name, custom_headers)
632
+ first_page.get_all_items
633
+ end
634
+
635
+ #
636
+ # Get a list of the consumer groups in the Event Hub-compatible device-to-cloud
637
+ # endpoint in an IoT hub.
638
+ #
639
+ # Get a list of the consumer groups in the Event Hub-compatible device-to-cloud
640
+ # endpoint in an IoT hub.
641
+ #
642
+ # @param resource_group_name [String] The name of the resource group that
643
+ # contains the IoT hub.
644
+ # @param resource_name [String] The name of the IoT hub.
645
+ # @param event_hub_endpoint_name [String] The name of the Event Hub-compatible
646
+ # endpoint.
647
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
648
+ # will be added to the HTTP request.
649
+ #
650
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
651
+ #
652
+ def list_event_hub_consumer_groups_with_http_info(resource_group_name, resource_name, event_hub_endpoint_name, custom_headers = nil)
653
+ list_event_hub_consumer_groups_async(resource_group_name, resource_name, event_hub_endpoint_name, custom_headers).value!
654
+ end
655
+
656
+ #
657
+ # Get a list of the consumer groups in the Event Hub-compatible device-to-cloud
658
+ # endpoint in an IoT hub.
659
+ #
660
+ # Get a list of the consumer groups in the Event Hub-compatible device-to-cloud
661
+ # endpoint in an IoT hub.
662
+ #
663
+ # @param resource_group_name [String] The name of the resource group that
664
+ # contains the IoT hub.
665
+ # @param resource_name [String] The name of the IoT hub.
666
+ # @param event_hub_endpoint_name [String] The name of the Event Hub-compatible
667
+ # endpoint.
668
+ # @param [Hash{String => String}] A hash of custom headers that will be added
669
+ # to the HTTP request.
670
+ #
671
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
672
+ #
673
+ def list_event_hub_consumer_groups_async(resource_group_name, resource_name, event_hub_endpoint_name, custom_headers = nil)
674
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
675
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
676
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
677
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
678
+ fail ArgumentError, 'event_hub_endpoint_name is nil' if event_hub_endpoint_name.nil?
679
+
680
+
681
+ request_headers = {}
682
+
683
+ # Set Headers
684
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
685
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
686
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups'
687
+
688
+ request_url = @base_url || @client.base_url
689
+
690
+ options = {
691
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
692
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name,'eventHubEndpointName' => event_hub_endpoint_name},
693
+ query_params: {'api-version' => @client.api_version},
694
+ headers: request_headers.merge(custom_headers || {}),
695
+ base_url: request_url
696
+ }
697
+ promise = @client.make_request_async(:get, path_template, options)
698
+
699
+ promise = promise.then do |result|
700
+ http_response = result.response
701
+ status_code = http_response.status
702
+ response_content = http_response.body
703
+ unless status_code == 200
704
+ error_model = JSON.load(response_content)
705
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
706
+ end
707
+
708
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
709
+ # Deserialize Response
710
+ if status_code == 200
711
+ begin
712
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
713
+ result_mapper = Azure::IotHub::Mgmt::V2016_02_03::Models::EventHubConsumerGroupsListResult.mapper()
714
+ result.body = @client.deserialize(result_mapper, parsed_response)
715
+ rescue Exception => e
716
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
717
+ end
718
+ end
719
+
720
+ result
721
+ end
722
+
723
+ promise.execute
724
+ end
725
+
726
+ #
727
+ # Get a consumer group from the Event Hub-compatible device-to-cloud endpoint
728
+ # for an IoT hub.
729
+ #
730
+ # Get a consumer group from the Event Hub-compatible device-to-cloud endpoint
731
+ # for an IoT hub.
732
+ #
733
+ # @param resource_group_name [String] The name of the resource group that
734
+ # contains the IoT hub.
735
+ # @param resource_name [String] The name of the IoT hub.
736
+ # @param event_hub_endpoint_name [String] The name of the Event Hub-compatible
737
+ # endpoint in the IoT hub.
738
+ # @param name [String] The name of the consumer group to retrieve.
739
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
740
+ # will be added to the HTTP request.
741
+ #
742
+ # @return [EventHubConsumerGroupInfo] operation results.
743
+ #
744
+ def get_event_hub_consumer_group(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers = nil)
745
+ response = get_event_hub_consumer_group_async(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers).value!
746
+ response.body unless response.nil?
747
+ end
748
+
749
+ #
750
+ # Get a consumer group from the Event Hub-compatible device-to-cloud endpoint
751
+ # for an IoT hub.
752
+ #
753
+ # Get a consumer group from the Event Hub-compatible device-to-cloud endpoint
754
+ # for an IoT hub.
755
+ #
756
+ # @param resource_group_name [String] The name of the resource group that
757
+ # contains the IoT hub.
758
+ # @param resource_name [String] The name of the IoT hub.
759
+ # @param event_hub_endpoint_name [String] The name of the Event Hub-compatible
760
+ # endpoint in the IoT hub.
761
+ # @param name [String] The name of the consumer group to retrieve.
762
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
763
+ # will be added to the HTTP request.
764
+ #
765
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
766
+ #
767
+ def get_event_hub_consumer_group_with_http_info(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers = nil)
768
+ get_event_hub_consumer_group_async(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers).value!
769
+ end
770
+
771
+ #
772
+ # Get a consumer group from the Event Hub-compatible device-to-cloud endpoint
773
+ # for an IoT hub.
774
+ #
775
+ # Get a consumer group from the Event Hub-compatible device-to-cloud endpoint
776
+ # for an IoT hub.
777
+ #
778
+ # @param resource_group_name [String] The name of the resource group that
779
+ # contains the IoT hub.
780
+ # @param resource_name [String] The name of the IoT hub.
781
+ # @param event_hub_endpoint_name [String] The name of the Event Hub-compatible
782
+ # endpoint in the IoT hub.
783
+ # @param name [String] The name of the consumer group to retrieve.
784
+ # @param [Hash{String => String}] A hash of custom headers that will be added
785
+ # to the HTTP request.
786
+ #
787
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
788
+ #
789
+ def get_event_hub_consumer_group_async(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers = nil)
790
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
791
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
792
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
793
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
794
+ fail ArgumentError, 'event_hub_endpoint_name is nil' if event_hub_endpoint_name.nil?
795
+ fail ArgumentError, 'name is nil' if name.nil?
796
+
797
+
798
+ request_headers = {}
799
+
800
+ # Set Headers
801
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
802
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
803
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}'
804
+
805
+ request_url = @base_url || @client.base_url
806
+
807
+ options = {
808
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
809
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name,'eventHubEndpointName' => event_hub_endpoint_name,'name' => name},
810
+ query_params: {'api-version' => @client.api_version},
811
+ headers: request_headers.merge(custom_headers || {}),
812
+ base_url: request_url
813
+ }
814
+ promise = @client.make_request_async(:get, path_template, options)
815
+
816
+ promise = promise.then do |result|
817
+ http_response = result.response
818
+ status_code = http_response.status
819
+ response_content = http_response.body
820
+ unless status_code == 200
821
+ error_model = JSON.load(response_content)
822
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
823
+ end
824
+
825
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
826
+ # Deserialize Response
827
+ if status_code == 200
828
+ begin
829
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
830
+ result_mapper = Azure::IotHub::Mgmt::V2016_02_03::Models::EventHubConsumerGroupInfo.mapper()
831
+ result.body = @client.deserialize(result_mapper, parsed_response)
832
+ rescue Exception => e
833
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
834
+ end
835
+ end
836
+
837
+ result
838
+ end
839
+
840
+ promise.execute
841
+ end
842
+
843
+ #
844
+ # Add a consumer group to an Event Hub-compatible endpoint in an IoT hub.
845
+ #
846
+ # Add a consumer group to an Event Hub-compatible endpoint in an IoT hub.
847
+ #
848
+ # @param resource_group_name [String] The name of the resource group that
849
+ # contains the IoT hub.
850
+ # @param resource_name [String] The name of the IoT hub.
851
+ # @param event_hub_endpoint_name [String] The name of the Event Hub-compatible
852
+ # endpoint in the IoT hub.
853
+ # @param name [String] The name of the consumer group to add.
854
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
855
+ # will be added to the HTTP request.
856
+ #
857
+ # @return [EventHubConsumerGroupInfo] operation results.
858
+ #
859
+ def create_event_hub_consumer_group(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers = nil)
860
+ response = create_event_hub_consumer_group_async(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers).value!
861
+ response.body unless response.nil?
862
+ end
863
+
864
+ #
865
+ # Add a consumer group to an Event Hub-compatible endpoint in an IoT hub.
866
+ #
867
+ # Add a consumer group to an Event Hub-compatible endpoint in an IoT hub.
868
+ #
869
+ # @param resource_group_name [String] The name of the resource group that
870
+ # contains the IoT hub.
871
+ # @param resource_name [String] The name of the IoT hub.
872
+ # @param event_hub_endpoint_name [String] The name of the Event Hub-compatible
873
+ # endpoint in the IoT hub.
874
+ # @param name [String] The name of the consumer group to add.
875
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
876
+ # will be added to the HTTP request.
877
+ #
878
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
879
+ #
880
+ def create_event_hub_consumer_group_with_http_info(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers = nil)
881
+ create_event_hub_consumer_group_async(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers).value!
882
+ end
883
+
884
+ #
885
+ # Add a consumer group to an Event Hub-compatible endpoint in an IoT hub.
886
+ #
887
+ # Add a consumer group to an Event Hub-compatible endpoint in an IoT hub.
888
+ #
889
+ # @param resource_group_name [String] The name of the resource group that
890
+ # contains the IoT hub.
891
+ # @param resource_name [String] The name of the IoT hub.
892
+ # @param event_hub_endpoint_name [String] The name of the Event Hub-compatible
893
+ # endpoint in the IoT hub.
894
+ # @param name [String] The name of the consumer group to add.
895
+ # @param [Hash{String => String}] A hash of custom headers that will be added
896
+ # to the HTTP request.
897
+ #
898
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
899
+ #
900
+ def create_event_hub_consumer_group_async(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers = nil)
901
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
902
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
903
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
904
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
905
+ fail ArgumentError, 'event_hub_endpoint_name is nil' if event_hub_endpoint_name.nil?
906
+ fail ArgumentError, 'name is nil' if name.nil?
907
+
908
+
909
+ request_headers = {}
910
+
911
+ # Set Headers
912
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
913
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
914
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}'
915
+
916
+ request_url = @base_url || @client.base_url
917
+
918
+ options = {
919
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
920
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name,'eventHubEndpointName' => event_hub_endpoint_name,'name' => name},
921
+ query_params: {'api-version' => @client.api_version},
922
+ headers: request_headers.merge(custom_headers || {}),
923
+ base_url: request_url
924
+ }
925
+ promise = @client.make_request_async(:put, path_template, options)
926
+
927
+ promise = promise.then do |result|
928
+ http_response = result.response
929
+ status_code = http_response.status
930
+ response_content = http_response.body
931
+ unless status_code == 200
932
+ error_model = JSON.load(response_content)
933
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
934
+ end
935
+
936
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
937
+ # Deserialize Response
938
+ if status_code == 200
939
+ begin
940
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
941
+ result_mapper = Azure::IotHub::Mgmt::V2016_02_03::Models::EventHubConsumerGroupInfo.mapper()
942
+ result.body = @client.deserialize(result_mapper, parsed_response)
943
+ rescue Exception => e
944
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
945
+ end
946
+ end
947
+
948
+ result
949
+ end
950
+
951
+ promise.execute
952
+ end
953
+
954
+ #
955
+ # Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub.
956
+ #
957
+ # Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub.
958
+ #
959
+ # @param resource_group_name [String] The name of the resource group that
960
+ # contains the IoT hub.
961
+ # @param resource_name [String] The name of the IoT hub.
962
+ # @param event_hub_endpoint_name [String] The name of the Event Hub-compatible
963
+ # endpoint in the IoT hub.
964
+ # @param name [String] The name of the consumer group to delete.
965
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
966
+ # will be added to the HTTP request.
967
+ #
968
+ #
969
+ def delete_event_hub_consumer_group(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers = nil)
970
+ response = delete_event_hub_consumer_group_async(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers).value!
971
+ nil
972
+ end
973
+
974
+ #
975
+ # Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub.
976
+ #
977
+ # Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub.
978
+ #
979
+ # @param resource_group_name [String] The name of the resource group that
980
+ # contains the IoT hub.
981
+ # @param resource_name [String] The name of the IoT hub.
982
+ # @param event_hub_endpoint_name [String] The name of the Event Hub-compatible
983
+ # endpoint in the IoT hub.
984
+ # @param name [String] The name of the consumer group to delete.
985
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
986
+ # will be added to the HTTP request.
987
+ #
988
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
989
+ #
990
+ def delete_event_hub_consumer_group_with_http_info(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers = nil)
991
+ delete_event_hub_consumer_group_async(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers).value!
992
+ end
993
+
994
+ #
995
+ # Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub.
996
+ #
997
+ # Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub.
998
+ #
999
+ # @param resource_group_name [String] The name of the resource group that
1000
+ # contains the IoT hub.
1001
+ # @param resource_name [String] The name of the IoT hub.
1002
+ # @param event_hub_endpoint_name [String] The name of the Event Hub-compatible
1003
+ # endpoint in the IoT hub.
1004
+ # @param name [String] The name of the consumer group to delete.
1005
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1006
+ # to the HTTP request.
1007
+ #
1008
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1009
+ #
1010
+ def delete_event_hub_consumer_group_async(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers = nil)
1011
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1012
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1013
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1014
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
1015
+ fail ArgumentError, 'event_hub_endpoint_name is nil' if event_hub_endpoint_name.nil?
1016
+ fail ArgumentError, 'name is nil' if name.nil?
1017
+
1018
+
1019
+ request_headers = {}
1020
+
1021
+ # Set Headers
1022
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1023
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1024
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}'
1025
+
1026
+ request_url = @base_url || @client.base_url
1027
+
1028
+ options = {
1029
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1030
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name,'eventHubEndpointName' => event_hub_endpoint_name,'name' => name},
1031
+ query_params: {'api-version' => @client.api_version},
1032
+ headers: request_headers.merge(custom_headers || {}),
1033
+ base_url: request_url
1034
+ }
1035
+ promise = @client.make_request_async(:delete, path_template, options)
1036
+
1037
+ promise = promise.then do |result|
1038
+ http_response = result.response
1039
+ status_code = http_response.status
1040
+ response_content = http_response.body
1041
+ unless status_code == 200
1042
+ error_model = JSON.load(response_content)
1043
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1044
+ end
1045
+
1046
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1047
+
1048
+ result
1049
+ end
1050
+
1051
+ promise.execute
1052
+ end
1053
+
1054
+ #
1055
+ # Get a list of all the jobs in an IoT hub. For more information, see:
1056
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.
1057
+ #
1058
+ # Get a list of all the jobs in an IoT hub. For more information, see:
1059
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.
1060
+ #
1061
+ # @param resource_group_name [String] The name of the resource group that
1062
+ # contains the IoT hub.
1063
+ # @param resource_name [String] The name of the IoT hub.
1064
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1065
+ # will be added to the HTTP request.
1066
+ #
1067
+ # @return [Array<JobResponse>] operation results.
1068
+ #
1069
+ def list_jobs(resource_group_name, resource_name, custom_headers = nil)
1070
+ first_page = list_jobs_as_lazy(resource_group_name, resource_name, custom_headers)
1071
+ first_page.get_all_items
1072
+ end
1073
+
1074
+ #
1075
+ # Get a list of all the jobs in an IoT hub. For more information, see:
1076
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.
1077
+ #
1078
+ # Get a list of all the jobs in an IoT hub. For more information, see:
1079
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.
1080
+ #
1081
+ # @param resource_group_name [String] The name of the resource group that
1082
+ # contains the IoT hub.
1083
+ # @param resource_name [String] The name of the IoT hub.
1084
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1085
+ # will be added to the HTTP request.
1086
+ #
1087
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1088
+ #
1089
+ def list_jobs_with_http_info(resource_group_name, resource_name, custom_headers = nil)
1090
+ list_jobs_async(resource_group_name, resource_name, custom_headers).value!
1091
+ end
1092
+
1093
+ #
1094
+ # Get a list of all the jobs in an IoT hub. For more information, see:
1095
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.
1096
+ #
1097
+ # Get a list of all the jobs in an IoT hub. For more information, see:
1098
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.
1099
+ #
1100
+ # @param resource_group_name [String] The name of the resource group that
1101
+ # contains the IoT hub.
1102
+ # @param resource_name [String] The name of the IoT hub.
1103
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1104
+ # to the HTTP request.
1105
+ #
1106
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1107
+ #
1108
+ def list_jobs_async(resource_group_name, resource_name, custom_headers = nil)
1109
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1110
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1111
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1112
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
1113
+
1114
+
1115
+ request_headers = {}
1116
+
1117
+ # Set Headers
1118
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1119
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1120
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/jobs'
1121
+
1122
+ request_url = @base_url || @client.base_url
1123
+
1124
+ options = {
1125
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1126
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
1127
+ query_params: {'api-version' => @client.api_version},
1128
+ headers: request_headers.merge(custom_headers || {}),
1129
+ base_url: request_url
1130
+ }
1131
+ promise = @client.make_request_async(:get, path_template, options)
1132
+
1133
+ promise = promise.then do |result|
1134
+ http_response = result.response
1135
+ status_code = http_response.status
1136
+ response_content = http_response.body
1137
+ unless status_code == 200
1138
+ error_model = JSON.load(response_content)
1139
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1140
+ end
1141
+
1142
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1143
+ # Deserialize Response
1144
+ if status_code == 200
1145
+ begin
1146
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1147
+ result_mapper = Azure::IotHub::Mgmt::V2016_02_03::Models::JobResponseListResult.mapper()
1148
+ result.body = @client.deserialize(result_mapper, parsed_response)
1149
+ rescue Exception => e
1150
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1151
+ end
1152
+ end
1153
+
1154
+ result
1155
+ end
1156
+
1157
+ promise.execute
1158
+ end
1159
+
1160
+ #
1161
+ # Get the details of a job from an IoT hub. For more information, see:
1162
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.
1163
+ #
1164
+ # Get the details of a job from an IoT hub. For more information, see:
1165
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.
1166
+ #
1167
+ # @param resource_group_name [String] The name of the resource group that
1168
+ # contains the IoT hub.
1169
+ # @param resource_name [String] The name of the IoT hub.
1170
+ # @param job_id [String] The job identifier.
1171
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1172
+ # will be added to the HTTP request.
1173
+ #
1174
+ # @return [JobResponse] operation results.
1175
+ #
1176
+ def get_job(resource_group_name, resource_name, job_id, custom_headers = nil)
1177
+ response = get_job_async(resource_group_name, resource_name, job_id, custom_headers).value!
1178
+ response.body unless response.nil?
1179
+ end
1180
+
1181
+ #
1182
+ # Get the details of a job from an IoT hub. For more information, see:
1183
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.
1184
+ #
1185
+ # Get the details of a job from an IoT hub. For more information, see:
1186
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.
1187
+ #
1188
+ # @param resource_group_name [String] The name of the resource group that
1189
+ # contains the IoT hub.
1190
+ # @param resource_name [String] The name of the IoT hub.
1191
+ # @param job_id [String] The job identifier.
1192
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1193
+ # will be added to the HTTP request.
1194
+ #
1195
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1196
+ #
1197
+ def get_job_with_http_info(resource_group_name, resource_name, job_id, custom_headers = nil)
1198
+ get_job_async(resource_group_name, resource_name, job_id, custom_headers).value!
1199
+ end
1200
+
1201
+ #
1202
+ # Get the details of a job from an IoT hub. For more information, see:
1203
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.
1204
+ #
1205
+ # Get the details of a job from an IoT hub. For more information, see:
1206
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.
1207
+ #
1208
+ # @param resource_group_name [String] The name of the resource group that
1209
+ # contains the IoT hub.
1210
+ # @param resource_name [String] The name of the IoT hub.
1211
+ # @param job_id [String] The job identifier.
1212
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1213
+ # to the HTTP request.
1214
+ #
1215
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1216
+ #
1217
+ def get_job_async(resource_group_name, resource_name, job_id, custom_headers = nil)
1218
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1219
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1220
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1221
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
1222
+ fail ArgumentError, 'job_id is nil' if job_id.nil?
1223
+
1224
+
1225
+ request_headers = {}
1226
+
1227
+ # Set Headers
1228
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1229
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1230
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/jobs/{jobId}'
1231
+
1232
+ request_url = @base_url || @client.base_url
1233
+
1234
+ options = {
1235
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1236
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name,'jobId' => job_id},
1237
+ query_params: {'api-version' => @client.api_version},
1238
+ headers: request_headers.merge(custom_headers || {}),
1239
+ base_url: request_url
1240
+ }
1241
+ promise = @client.make_request_async(:get, path_template, options)
1242
+
1243
+ promise = promise.then do |result|
1244
+ http_response = result.response
1245
+ status_code = http_response.status
1246
+ response_content = http_response.body
1247
+ unless status_code == 200
1248
+ error_model = JSON.load(response_content)
1249
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1250
+ end
1251
+
1252
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1253
+ # Deserialize Response
1254
+ if status_code == 200
1255
+ begin
1256
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1257
+ result_mapper = Azure::IotHub::Mgmt::V2016_02_03::Models::JobResponse.mapper()
1258
+ result.body = @client.deserialize(result_mapper, parsed_response)
1259
+ rescue Exception => e
1260
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1261
+ end
1262
+ end
1263
+
1264
+ result
1265
+ end
1266
+
1267
+ promise.execute
1268
+ end
1269
+
1270
+ #
1271
+ # Get the quota metrics for an IoT hub.
1272
+ #
1273
+ # Get the quota metrics for an IoT hub.
1274
+ #
1275
+ # @param resource_group_name [String] The name of the resource group that
1276
+ # contains the IoT hub.
1277
+ # @param resource_name [String] The name of the IoT hub.
1278
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1279
+ # will be added to the HTTP request.
1280
+ #
1281
+ # @return [Array<IotHubQuotaMetricInfo>] operation results.
1282
+ #
1283
+ def get_quota_metrics(resource_group_name, resource_name, custom_headers = nil)
1284
+ first_page = get_quota_metrics_as_lazy(resource_group_name, resource_name, custom_headers)
1285
+ first_page.get_all_items
1286
+ end
1287
+
1288
+ #
1289
+ # Get the quota metrics for an IoT hub.
1290
+ #
1291
+ # Get the quota metrics for an IoT hub.
1292
+ #
1293
+ # @param resource_group_name [String] The name of the resource group that
1294
+ # contains the IoT hub.
1295
+ # @param resource_name [String] The name of the IoT hub.
1296
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1297
+ # will be added to the HTTP request.
1298
+ #
1299
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1300
+ #
1301
+ def get_quota_metrics_with_http_info(resource_group_name, resource_name, custom_headers = nil)
1302
+ get_quota_metrics_async(resource_group_name, resource_name, custom_headers).value!
1303
+ end
1304
+
1305
+ #
1306
+ # Get the quota metrics for an IoT hub.
1307
+ #
1308
+ # Get the quota metrics for an IoT hub.
1309
+ #
1310
+ # @param resource_group_name [String] The name of the resource group that
1311
+ # contains the IoT hub.
1312
+ # @param resource_name [String] The name of the IoT hub.
1313
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1314
+ # to the HTTP request.
1315
+ #
1316
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1317
+ #
1318
+ def get_quota_metrics_async(resource_group_name, resource_name, custom_headers = nil)
1319
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1320
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1321
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1322
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
1323
+
1324
+
1325
+ request_headers = {}
1326
+
1327
+ # Set Headers
1328
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1329
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1330
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/quotaMetrics'
1331
+
1332
+ request_url = @base_url || @client.base_url
1333
+
1334
+ options = {
1335
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1336
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
1337
+ query_params: {'api-version' => @client.api_version},
1338
+ headers: request_headers.merge(custom_headers || {}),
1339
+ base_url: request_url
1340
+ }
1341
+ promise = @client.make_request_async(:get, path_template, options)
1342
+
1343
+ promise = promise.then do |result|
1344
+ http_response = result.response
1345
+ status_code = http_response.status
1346
+ response_content = http_response.body
1347
+ unless status_code == 200
1348
+ error_model = JSON.load(response_content)
1349
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1350
+ end
1351
+
1352
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1353
+ # Deserialize Response
1354
+ if status_code == 200
1355
+ begin
1356
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1357
+ result_mapper = Azure::IotHub::Mgmt::V2016_02_03::Models::IotHubQuotaMetricInfoListResult.mapper()
1358
+ result.body = @client.deserialize(result_mapper, parsed_response)
1359
+ rescue Exception => e
1360
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1361
+ end
1362
+ end
1363
+
1364
+ result
1365
+ end
1366
+
1367
+ promise.execute
1368
+ end
1369
+
1370
+ #
1371
+ # Check if an IoT hub name is available.
1372
+ #
1373
+ # Check if an IoT hub name is available.
1374
+ #
1375
+ # @param operation_inputs [OperationInputs] Set the name parameter in the
1376
+ # OperationInputs structure to the name of the IoT hub to check.
1377
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1378
+ # will be added to the HTTP request.
1379
+ #
1380
+ # @return [IotHubNameAvailabilityInfo] operation results.
1381
+ #
1382
+ def check_name_availability(operation_inputs, custom_headers = nil)
1383
+ response = check_name_availability_async(operation_inputs, custom_headers).value!
1384
+ response.body unless response.nil?
1385
+ end
1386
+
1387
+ #
1388
+ # Check if an IoT hub name is available.
1389
+ #
1390
+ # Check if an IoT hub name is available.
1391
+ #
1392
+ # @param operation_inputs [OperationInputs] Set the name parameter in the
1393
+ # OperationInputs structure to the name of the IoT hub to check.
1394
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1395
+ # will be added to the HTTP request.
1396
+ #
1397
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1398
+ #
1399
+ def check_name_availability_with_http_info(operation_inputs, custom_headers = nil)
1400
+ check_name_availability_async(operation_inputs, custom_headers).value!
1401
+ end
1402
+
1403
+ #
1404
+ # Check if an IoT hub name is available.
1405
+ #
1406
+ # Check if an IoT hub name is available.
1407
+ #
1408
+ # @param operation_inputs [OperationInputs] Set the name parameter in the
1409
+ # OperationInputs structure to the name of the IoT hub to check.
1410
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1411
+ # to the HTTP request.
1412
+ #
1413
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1414
+ #
1415
+ def check_name_availability_async(operation_inputs, custom_headers = nil)
1416
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1417
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1418
+ fail ArgumentError, 'operation_inputs is nil' if operation_inputs.nil?
1419
+
1420
+
1421
+ request_headers = {}
1422
+
1423
+ # Set Headers
1424
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1425
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1426
+
1427
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1428
+
1429
+ # Serialize Request
1430
+ request_mapper = Azure::IotHub::Mgmt::V2016_02_03::Models::OperationInputs.mapper()
1431
+ request_content = @client.serialize(request_mapper, operation_inputs)
1432
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1433
+
1434
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Devices/checkNameAvailability'
1435
+
1436
+ request_url = @base_url || @client.base_url
1437
+
1438
+ options = {
1439
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1440
+ path_params: {'subscriptionId' => @client.subscription_id},
1441
+ query_params: {'api-version' => @client.api_version},
1442
+ body: request_content,
1443
+ headers: request_headers.merge(custom_headers || {}),
1444
+ base_url: request_url
1445
+ }
1446
+ promise = @client.make_request_async(:post, path_template, options)
1447
+
1448
+ promise = promise.then do |result|
1449
+ http_response = result.response
1450
+ status_code = http_response.status
1451
+ response_content = http_response.body
1452
+ unless status_code == 200
1453
+ error_model = JSON.load(response_content)
1454
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1455
+ end
1456
+
1457
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1458
+ # Deserialize Response
1459
+ if status_code == 200
1460
+ begin
1461
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1462
+ result_mapper = Azure::IotHub::Mgmt::V2016_02_03::Models::IotHubNameAvailabilityInfo.mapper()
1463
+ result.body = @client.deserialize(result_mapper, parsed_response)
1464
+ rescue Exception => e
1465
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1466
+ end
1467
+ end
1468
+
1469
+ result
1470
+ end
1471
+
1472
+ promise.execute
1473
+ end
1474
+
1475
+ #
1476
+ # Get the security metadata for an IoT hub. For more information, see:
1477
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.
1478
+ #
1479
+ # Get the security metadata for an IoT hub. For more information, see:
1480
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.
1481
+ #
1482
+ # @param resource_group_name [String] The name of the resource group that
1483
+ # contains the IoT hub.
1484
+ # @param resource_name [String] The name of the IoT hub.
1485
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1486
+ # will be added to the HTTP request.
1487
+ #
1488
+ # @return [Array<SharedAccessSignatureAuthorizationRule>] operation results.
1489
+ #
1490
+ def list_keys(resource_group_name, resource_name, custom_headers = nil)
1491
+ first_page = list_keys_as_lazy(resource_group_name, resource_name, custom_headers)
1492
+ first_page.get_all_items
1493
+ end
1494
+
1495
+ #
1496
+ # Get the security metadata for an IoT hub. For more information, see:
1497
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.
1498
+ #
1499
+ # Get the security metadata for an IoT hub. For more information, see:
1500
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.
1501
+ #
1502
+ # @param resource_group_name [String] The name of the resource group that
1503
+ # contains the IoT hub.
1504
+ # @param resource_name [String] The name of the IoT hub.
1505
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1506
+ # will be added to the HTTP request.
1507
+ #
1508
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1509
+ #
1510
+ def list_keys_with_http_info(resource_group_name, resource_name, custom_headers = nil)
1511
+ list_keys_async(resource_group_name, resource_name, custom_headers).value!
1512
+ end
1513
+
1514
+ #
1515
+ # Get the security metadata for an IoT hub. For more information, see:
1516
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.
1517
+ #
1518
+ # Get the security metadata for an IoT hub. For more information, see:
1519
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.
1520
+ #
1521
+ # @param resource_group_name [String] The name of the resource group that
1522
+ # contains the IoT hub.
1523
+ # @param resource_name [String] The name of the IoT hub.
1524
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1525
+ # to the HTTP request.
1526
+ #
1527
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1528
+ #
1529
+ def list_keys_async(resource_group_name, resource_name, custom_headers = nil)
1530
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1531
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1532
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1533
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
1534
+
1535
+
1536
+ request_headers = {}
1537
+
1538
+ # Set Headers
1539
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1540
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1541
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/listkeys'
1542
+
1543
+ request_url = @base_url || @client.base_url
1544
+
1545
+ options = {
1546
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1547
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
1548
+ query_params: {'api-version' => @client.api_version},
1549
+ headers: request_headers.merge(custom_headers || {}),
1550
+ base_url: request_url
1551
+ }
1552
+ promise = @client.make_request_async(:post, path_template, options)
1553
+
1554
+ promise = promise.then do |result|
1555
+ http_response = result.response
1556
+ status_code = http_response.status
1557
+ response_content = http_response.body
1558
+ unless status_code == 200
1559
+ error_model = JSON.load(response_content)
1560
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1561
+ end
1562
+
1563
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1564
+ # Deserialize Response
1565
+ if status_code == 200
1566
+ begin
1567
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1568
+ result_mapper = Azure::IotHub::Mgmt::V2016_02_03::Models::SharedAccessSignatureAuthorizationRuleListResult.mapper()
1569
+ result.body = @client.deserialize(result_mapper, parsed_response)
1570
+ rescue Exception => e
1571
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1572
+ end
1573
+ end
1574
+
1575
+ result
1576
+ end
1577
+
1578
+ promise.execute
1579
+ end
1580
+
1581
+ #
1582
+ # Get a shared access policy by name from an IoT hub. For more information,
1583
+ # see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.
1584
+ #
1585
+ # Get a shared access policy by name from an IoT hub. For more information,
1586
+ # see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.
1587
+ #
1588
+ # @param resource_group_name [String] The name of the resource group that
1589
+ # contains the IoT hub.
1590
+ # @param resource_name [String] The name of the IoT hub.
1591
+ # @param key_name [String] The name of the shared access policy.
1592
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1593
+ # will be added to the HTTP request.
1594
+ #
1595
+ # @return [SharedAccessSignatureAuthorizationRule] operation results.
1596
+ #
1597
+ def get_keys_for_key_name(resource_group_name, resource_name, key_name, custom_headers = nil)
1598
+ response = get_keys_for_key_name_async(resource_group_name, resource_name, key_name, custom_headers).value!
1599
+ response.body unless response.nil?
1600
+ end
1601
+
1602
+ #
1603
+ # Get a shared access policy by name from an IoT hub. For more information,
1604
+ # see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.
1605
+ #
1606
+ # Get a shared access policy by name from an IoT hub. For more information,
1607
+ # see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.
1608
+ #
1609
+ # @param resource_group_name [String] The name of the resource group that
1610
+ # contains the IoT hub.
1611
+ # @param resource_name [String] The name of the IoT hub.
1612
+ # @param key_name [String] The name of the shared access policy.
1613
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1614
+ # will be added to the HTTP request.
1615
+ #
1616
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1617
+ #
1618
+ def get_keys_for_key_name_with_http_info(resource_group_name, resource_name, key_name, custom_headers = nil)
1619
+ get_keys_for_key_name_async(resource_group_name, resource_name, key_name, custom_headers).value!
1620
+ end
1621
+
1622
+ #
1623
+ # Get a shared access policy by name from an IoT hub. For more information,
1624
+ # see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.
1625
+ #
1626
+ # Get a shared access policy by name from an IoT hub. For more information,
1627
+ # see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.
1628
+ #
1629
+ # @param resource_group_name [String] The name of the resource group that
1630
+ # contains the IoT hub.
1631
+ # @param resource_name [String] The name of the IoT hub.
1632
+ # @param key_name [String] The name of the shared access policy.
1633
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1634
+ # to the HTTP request.
1635
+ #
1636
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1637
+ #
1638
+ def get_keys_for_key_name_async(resource_group_name, resource_name, key_name, custom_headers = nil)
1639
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1640
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1641
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1642
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
1643
+ fail ArgumentError, 'key_name is nil' if key_name.nil?
1644
+
1645
+
1646
+ request_headers = {}
1647
+
1648
+ # Set Headers
1649
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1650
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1651
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/IotHubKeys/{keyName}/listkeys'
1652
+
1653
+ request_url = @base_url || @client.base_url
1654
+
1655
+ options = {
1656
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1657
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name,'keyName' => key_name},
1658
+ query_params: {'api-version' => @client.api_version},
1659
+ headers: request_headers.merge(custom_headers || {}),
1660
+ base_url: request_url
1661
+ }
1662
+ promise = @client.make_request_async(:post, path_template, options)
1663
+
1664
+ promise = promise.then do |result|
1665
+ http_response = result.response
1666
+ status_code = http_response.status
1667
+ response_content = http_response.body
1668
+ unless status_code == 200
1669
+ error_model = JSON.load(response_content)
1670
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1671
+ end
1672
+
1673
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1674
+ # Deserialize Response
1675
+ if status_code == 200
1676
+ begin
1677
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1678
+ result_mapper = Azure::IotHub::Mgmt::V2016_02_03::Models::SharedAccessSignatureAuthorizationRule.mapper()
1679
+ result.body = @client.deserialize(result_mapper, parsed_response)
1680
+ rescue Exception => e
1681
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1682
+ end
1683
+ end
1684
+
1685
+ result
1686
+ end
1687
+
1688
+ promise.execute
1689
+ end
1690
+
1691
+ #
1692
+ # Exports all the device identities in the IoT hub identity registry to an
1693
+ # Azure Storage blob container. For more information, see:
1694
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities.
1695
+ #
1696
+ # Exports all the device identities in the IoT hub identity registry to an
1697
+ # Azure Storage blob container. For more information, see:
1698
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities.
1699
+ #
1700
+ # @param resource_group_name [String] The name of the resource group that
1701
+ # contains the IoT hub.
1702
+ # @param resource_name [String] The name of the IoT hub.
1703
+ # @param export_devices_parameters [ExportDevicesRequest] The parameters that
1704
+ # specify the export devices operation.
1705
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1706
+ # will be added to the HTTP request.
1707
+ #
1708
+ # @return [JobResponse] operation results.
1709
+ #
1710
+ def export_devices(resource_group_name, resource_name, export_devices_parameters, custom_headers = nil)
1711
+ response = export_devices_async(resource_group_name, resource_name, export_devices_parameters, custom_headers).value!
1712
+ response.body unless response.nil?
1713
+ end
1714
+
1715
+ #
1716
+ # Exports all the device identities in the IoT hub identity registry to an
1717
+ # Azure Storage blob container. For more information, see:
1718
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities.
1719
+ #
1720
+ # Exports all the device identities in the IoT hub identity registry to an
1721
+ # Azure Storage blob container. For more information, see:
1722
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities.
1723
+ #
1724
+ # @param resource_group_name [String] The name of the resource group that
1725
+ # contains the IoT hub.
1726
+ # @param resource_name [String] The name of the IoT hub.
1727
+ # @param export_devices_parameters [ExportDevicesRequest] The parameters that
1728
+ # specify the export devices operation.
1729
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1730
+ # will be added to the HTTP request.
1731
+ #
1732
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1733
+ #
1734
+ def export_devices_with_http_info(resource_group_name, resource_name, export_devices_parameters, custom_headers = nil)
1735
+ export_devices_async(resource_group_name, resource_name, export_devices_parameters, custom_headers).value!
1736
+ end
1737
+
1738
+ #
1739
+ # Exports all the device identities in the IoT hub identity registry to an
1740
+ # Azure Storage blob container. For more information, see:
1741
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities.
1742
+ #
1743
+ # Exports all the device identities in the IoT hub identity registry to an
1744
+ # Azure Storage blob container. For more information, see:
1745
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities.
1746
+ #
1747
+ # @param resource_group_name [String] The name of the resource group that
1748
+ # contains the IoT hub.
1749
+ # @param resource_name [String] The name of the IoT hub.
1750
+ # @param export_devices_parameters [ExportDevicesRequest] The parameters that
1751
+ # specify the export devices operation.
1752
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1753
+ # to the HTTP request.
1754
+ #
1755
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1756
+ #
1757
+ def export_devices_async(resource_group_name, resource_name, export_devices_parameters, custom_headers = nil)
1758
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1759
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1760
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1761
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
1762
+ fail ArgumentError, 'export_devices_parameters is nil' if export_devices_parameters.nil?
1763
+
1764
+
1765
+ request_headers = {}
1766
+
1767
+ # Set Headers
1768
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1769
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1770
+
1771
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1772
+
1773
+ # Serialize Request
1774
+ request_mapper = Azure::IotHub::Mgmt::V2016_02_03::Models::ExportDevicesRequest.mapper()
1775
+ request_content = @client.serialize(request_mapper, export_devices_parameters)
1776
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1777
+
1778
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/exportDevices'
1779
+
1780
+ request_url = @base_url || @client.base_url
1781
+
1782
+ options = {
1783
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1784
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
1785
+ query_params: {'api-version' => @client.api_version},
1786
+ body: request_content,
1787
+ headers: request_headers.merge(custom_headers || {}),
1788
+ base_url: request_url
1789
+ }
1790
+ promise = @client.make_request_async(:post, path_template, options)
1791
+
1792
+ promise = promise.then do |result|
1793
+ http_response = result.response
1794
+ status_code = http_response.status
1795
+ response_content = http_response.body
1796
+ unless status_code == 200
1797
+ error_model = JSON.load(response_content)
1798
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1799
+ end
1800
+
1801
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1802
+ # Deserialize Response
1803
+ if status_code == 200
1804
+ begin
1805
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1806
+ result_mapper = Azure::IotHub::Mgmt::V2016_02_03::Models::JobResponse.mapper()
1807
+ result.body = @client.deserialize(result_mapper, parsed_response)
1808
+ rescue Exception => e
1809
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1810
+ end
1811
+ end
1812
+
1813
+ result
1814
+ end
1815
+
1816
+ promise.execute
1817
+ end
1818
+
1819
+ #
1820
+ # Import, update, or delete device identities in the IoT hub identity registry
1821
+ # from a blob. For more information, see:
1822
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities.
1823
+ #
1824
+ # Import, update, or delete device identities in the IoT hub identity registry
1825
+ # from a blob. For more information, see:
1826
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities.
1827
+ #
1828
+ # @param resource_group_name [String] The name of the resource group that
1829
+ # contains the IoT hub.
1830
+ # @param resource_name [String] The name of the IoT hub.
1831
+ # @param import_devices_parameters [ImportDevicesRequest] The parameters that
1832
+ # specify the import devices operation.
1833
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1834
+ # will be added to the HTTP request.
1835
+ #
1836
+ # @return [JobResponse] operation results.
1837
+ #
1838
+ def import_devices(resource_group_name, resource_name, import_devices_parameters, custom_headers = nil)
1839
+ response = import_devices_async(resource_group_name, resource_name, import_devices_parameters, custom_headers).value!
1840
+ response.body unless response.nil?
1841
+ end
1842
+
1843
+ #
1844
+ # Import, update, or delete device identities in the IoT hub identity registry
1845
+ # from a blob. For more information, see:
1846
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities.
1847
+ #
1848
+ # Import, update, or delete device identities in the IoT hub identity registry
1849
+ # from a blob. For more information, see:
1850
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities.
1851
+ #
1852
+ # @param resource_group_name [String] The name of the resource group that
1853
+ # contains the IoT hub.
1854
+ # @param resource_name [String] The name of the IoT hub.
1855
+ # @param import_devices_parameters [ImportDevicesRequest] The parameters that
1856
+ # specify the import devices operation.
1857
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1858
+ # will be added to the HTTP request.
1859
+ #
1860
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1861
+ #
1862
+ def import_devices_with_http_info(resource_group_name, resource_name, import_devices_parameters, custom_headers = nil)
1863
+ import_devices_async(resource_group_name, resource_name, import_devices_parameters, custom_headers).value!
1864
+ end
1865
+
1866
+ #
1867
+ # Import, update, or delete device identities in the IoT hub identity registry
1868
+ # from a blob. For more information, see:
1869
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities.
1870
+ #
1871
+ # Import, update, or delete device identities in the IoT hub identity registry
1872
+ # from a blob. For more information, see:
1873
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities.
1874
+ #
1875
+ # @param resource_group_name [String] The name of the resource group that
1876
+ # contains the IoT hub.
1877
+ # @param resource_name [String] The name of the IoT hub.
1878
+ # @param import_devices_parameters [ImportDevicesRequest] The parameters that
1879
+ # specify the import devices operation.
1880
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1881
+ # to the HTTP request.
1882
+ #
1883
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1884
+ #
1885
+ def import_devices_async(resource_group_name, resource_name, import_devices_parameters, custom_headers = nil)
1886
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1887
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1888
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1889
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
1890
+ fail ArgumentError, 'import_devices_parameters is nil' if import_devices_parameters.nil?
1891
+
1892
+
1893
+ request_headers = {}
1894
+
1895
+ # Set Headers
1896
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1897
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1898
+
1899
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1900
+
1901
+ # Serialize Request
1902
+ request_mapper = Azure::IotHub::Mgmt::V2016_02_03::Models::ImportDevicesRequest.mapper()
1903
+ request_content = @client.serialize(request_mapper, import_devices_parameters)
1904
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1905
+
1906
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/importDevices'
1907
+
1908
+ request_url = @base_url || @client.base_url
1909
+
1910
+ options = {
1911
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1912
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
1913
+ query_params: {'api-version' => @client.api_version},
1914
+ body: request_content,
1915
+ headers: request_headers.merge(custom_headers || {}),
1916
+ base_url: request_url
1917
+ }
1918
+ promise = @client.make_request_async(:post, path_template, options)
1919
+
1920
+ promise = promise.then do |result|
1921
+ http_response = result.response
1922
+ status_code = http_response.status
1923
+ response_content = http_response.body
1924
+ unless status_code == 200
1925
+ error_model = JSON.load(response_content)
1926
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1927
+ end
1928
+
1929
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1930
+ # Deserialize Response
1931
+ if status_code == 200
1932
+ begin
1933
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1934
+ result_mapper = Azure::IotHub::Mgmt::V2016_02_03::Models::JobResponse.mapper()
1935
+ result.body = @client.deserialize(result_mapper, parsed_response)
1936
+ rescue Exception => e
1937
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1938
+ end
1939
+ end
1940
+
1941
+ result
1942
+ end
1943
+
1944
+ promise.execute
1945
+ end
1946
+
1947
+ #
1948
+ # Create or update the metadata of an IoT hub.
1949
+ #
1950
+ # Create or update the metadata of an Iot hub. The usual pattern to modify a
1951
+ # property is to retrieve the IoT hub metadata and security metadata, and then
1952
+ # combine them with the modified values in a new body to update the IoT hub.
1953
+ #
1954
+ # @param resource_group_name [String] The name of the resource group that
1955
+ # contains the IoT hub.
1956
+ # @param resource_name [String] The name of the IoT hub to create or update.
1957
+ # @param iot_hub_description [IotHubDescription] The IoT hub metadata and
1958
+ # security metadata.
1959
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1960
+ # will be added to the HTTP request.
1961
+ #
1962
+ # @return [IotHubDescription] operation results.
1963
+ #
1964
+ def begin_create_or_update(resource_group_name, resource_name, iot_hub_description, custom_headers = nil)
1965
+ response = begin_create_or_update_async(resource_group_name, resource_name, iot_hub_description, custom_headers).value!
1966
+ response.body unless response.nil?
1967
+ end
1968
+
1969
+ #
1970
+ # Create or update the metadata of an IoT hub.
1971
+ #
1972
+ # Create or update the metadata of an Iot hub. The usual pattern to modify a
1973
+ # property is to retrieve the IoT hub metadata and security metadata, and then
1974
+ # combine them with the modified values in a new body to update the IoT hub.
1975
+ #
1976
+ # @param resource_group_name [String] The name of the resource group that
1977
+ # contains the IoT hub.
1978
+ # @param resource_name [String] The name of the IoT hub to create or update.
1979
+ # @param iot_hub_description [IotHubDescription] The IoT hub metadata and
1980
+ # security metadata.
1981
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1982
+ # will be added to the HTTP request.
1983
+ #
1984
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1985
+ #
1986
+ def begin_create_or_update_with_http_info(resource_group_name, resource_name, iot_hub_description, custom_headers = nil)
1987
+ begin_create_or_update_async(resource_group_name, resource_name, iot_hub_description, custom_headers).value!
1988
+ end
1989
+
1990
+ #
1991
+ # Create or update the metadata of an IoT hub.
1992
+ #
1993
+ # Create or update the metadata of an Iot hub. The usual pattern to modify a
1994
+ # property is to retrieve the IoT hub metadata and security metadata, and then
1995
+ # combine them with the modified values in a new body to update the IoT hub.
1996
+ #
1997
+ # @param resource_group_name [String] The name of the resource group that
1998
+ # contains the IoT hub.
1999
+ # @param resource_name [String] The name of the IoT hub to create or update.
2000
+ # @param iot_hub_description [IotHubDescription] The IoT hub metadata and
2001
+ # security metadata.
2002
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2003
+ # to the HTTP request.
2004
+ #
2005
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2006
+ #
2007
+ def begin_create_or_update_async(resource_group_name, resource_name, iot_hub_description, custom_headers = nil)
2008
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2009
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2010
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2011
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
2012
+ fail ArgumentError, 'iot_hub_description is nil' if iot_hub_description.nil?
2013
+
2014
+
2015
+ request_headers = {}
2016
+
2017
+ # Set Headers
2018
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2019
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2020
+
2021
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2022
+
2023
+ # Serialize Request
2024
+ request_mapper = Azure::IotHub::Mgmt::V2016_02_03::Models::IotHubDescription.mapper()
2025
+ request_content = @client.serialize(request_mapper, iot_hub_description)
2026
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2027
+
2028
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}'
2029
+
2030
+ request_url = @base_url || @client.base_url
2031
+
2032
+ options = {
2033
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2034
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
2035
+ query_params: {'api-version' => @client.api_version},
2036
+ body: request_content,
2037
+ headers: request_headers.merge(custom_headers || {}),
2038
+ base_url: request_url
2039
+ }
2040
+ promise = @client.make_request_async(:put, path_template, options)
2041
+
2042
+ promise = promise.then do |result|
2043
+ http_response = result.response
2044
+ status_code = http_response.status
2045
+ response_content = http_response.body
2046
+ unless status_code == 201 || status_code == 200
2047
+ error_model = JSON.load(response_content)
2048
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
2049
+ end
2050
+
2051
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2052
+ # Deserialize Response
2053
+ if status_code == 201
2054
+ begin
2055
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2056
+ result_mapper = Azure::IotHub::Mgmt::V2016_02_03::Models::IotHubDescription.mapper()
2057
+ result.body = @client.deserialize(result_mapper, parsed_response)
2058
+ rescue Exception => e
2059
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2060
+ end
2061
+ end
2062
+ # Deserialize Response
2063
+ if status_code == 200
2064
+ begin
2065
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2066
+ result_mapper = Azure::IotHub::Mgmt::V2016_02_03::Models::IotHubDescription.mapper()
2067
+ result.body = @client.deserialize(result_mapper, parsed_response)
2068
+ rescue Exception => e
2069
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2070
+ end
2071
+ end
2072
+
2073
+ result
2074
+ end
2075
+
2076
+ promise.execute
2077
+ end
2078
+
2079
+ #
2080
+ # Delete an IoT hub.
2081
+ #
2082
+ # Delete an IoT hub.
2083
+ #
2084
+ # @param resource_group_name [String] The name of the resource group that
2085
+ # contains the IoT hub.
2086
+ # @param resource_name [String] The name of the IoT hub to delete.
2087
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2088
+ # will be added to the HTTP request.
2089
+ #
2090
+ # @return [Object] operation results.
2091
+ #
2092
+ def begin_delete(resource_group_name, resource_name, custom_headers = nil)
2093
+ response = begin_delete_async(resource_group_name, resource_name, custom_headers).value!
2094
+ response.body unless response.nil?
2095
+ end
2096
+
2097
+ #
2098
+ # Delete an IoT hub.
2099
+ #
2100
+ # Delete an IoT hub.
2101
+ #
2102
+ # @param resource_group_name [String] The name of the resource group that
2103
+ # contains the IoT hub.
2104
+ # @param resource_name [String] The name of the IoT hub to delete.
2105
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2106
+ # will be added to the HTTP request.
2107
+ #
2108
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2109
+ #
2110
+ def begin_delete_with_http_info(resource_group_name, resource_name, custom_headers = nil)
2111
+ begin_delete_async(resource_group_name, resource_name, custom_headers).value!
2112
+ end
2113
+
2114
+ #
2115
+ # Delete an IoT hub.
2116
+ #
2117
+ # Delete an IoT hub.
2118
+ #
2119
+ # @param resource_group_name [String] The name of the resource group that
2120
+ # contains the IoT hub.
2121
+ # @param resource_name [String] The name of the IoT hub to delete.
2122
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2123
+ # to the HTTP request.
2124
+ #
2125
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2126
+ #
2127
+ def begin_delete_async(resource_group_name, resource_name, custom_headers = nil)
2128
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2129
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2130
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2131
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
2132
+
2133
+
2134
+ request_headers = {}
2135
+
2136
+ # Set Headers
2137
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2138
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2139
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}'
2140
+
2141
+ request_url = @base_url || @client.base_url
2142
+
2143
+ options = {
2144
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2145
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
2146
+ query_params: {'api-version' => @client.api_version},
2147
+ headers: request_headers.merge(custom_headers || {}),
2148
+ base_url: request_url
2149
+ }
2150
+ promise = @client.make_request_async(:delete, path_template, options)
2151
+
2152
+ promise = promise.then do |result|
2153
+ http_response = result.response
2154
+ status_code = http_response.status
2155
+ response_content = http_response.body
2156
+ unless status_code == 202 || status_code == 200 || status_code == 204 || status_code == 404
2157
+ error_model = JSON.load(response_content)
2158
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
2159
+ end
2160
+
2161
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2162
+ # Deserialize Response
2163
+ if status_code == 202
2164
+ begin
2165
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2166
+ result_mapper = Azure::IotHub::Mgmt::V2016_02_03::Models::IotHubDescription.mapper()
2167
+ result.body = @client.deserialize(result_mapper, parsed_response)
2168
+ rescue Exception => e
2169
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2170
+ end
2171
+ end
2172
+ # Deserialize Response
2173
+ if status_code == 200
2174
+ begin
2175
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2176
+ result_mapper = Azure::IotHub::Mgmt::V2016_02_03::Models::IotHubDescription.mapper()
2177
+ result.body = @client.deserialize(result_mapper, parsed_response)
2178
+ rescue Exception => e
2179
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2180
+ end
2181
+ end
2182
+ # Deserialize Response
2183
+ if status_code == 404
2184
+ begin
2185
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2186
+ result_mapper = Azure::IotHub::Mgmt::V2016_02_03::Models::ErrorDetails.mapper()
2187
+ result.body = @client.deserialize(result_mapper, parsed_response)
2188
+ rescue Exception => e
2189
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2190
+ end
2191
+ end
2192
+
2193
+ result
2194
+ end
2195
+
2196
+ promise.execute
2197
+ end
2198
+
2199
+ #
2200
+ # Get all the IoT hubs in a subscription.
2201
+ #
2202
+ # Get all the IoT hubs in a subscription.
2203
+ #
2204
+ # @param next_page_link [String] The NextLink from the previous successful call
2205
+ # to List operation.
2206
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2207
+ # will be added to the HTTP request.
2208
+ #
2209
+ # @return [IotHubDescriptionListResult] operation results.
2210
+ #
2211
+ def list_by_subscription_next(next_page_link, custom_headers = nil)
2212
+ response = list_by_subscription_next_async(next_page_link, custom_headers).value!
2213
+ response.body unless response.nil?
2214
+ end
2215
+
2216
+ #
2217
+ # Get all the IoT hubs in a subscription.
2218
+ #
2219
+ # Get all the IoT hubs in a subscription.
2220
+ #
2221
+ # @param next_page_link [String] The NextLink from the previous successful call
2222
+ # to List operation.
2223
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2224
+ # will be added to the HTTP request.
2225
+ #
2226
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2227
+ #
2228
+ def list_by_subscription_next_with_http_info(next_page_link, custom_headers = nil)
2229
+ list_by_subscription_next_async(next_page_link, custom_headers).value!
2230
+ end
2231
+
2232
+ #
2233
+ # Get all the IoT hubs in a subscription.
2234
+ #
2235
+ # Get all the IoT hubs in a subscription.
2236
+ #
2237
+ # @param next_page_link [String] The NextLink from the previous successful call
2238
+ # to List operation.
2239
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2240
+ # to the HTTP request.
2241
+ #
2242
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2243
+ #
2244
+ def list_by_subscription_next_async(next_page_link, custom_headers = nil)
2245
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2246
+
2247
+
2248
+ request_headers = {}
2249
+
2250
+ # Set Headers
2251
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2252
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2253
+ path_template = '{nextLink}'
2254
+
2255
+ request_url = @base_url || @client.base_url
2256
+
2257
+ options = {
2258
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2259
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2260
+ headers: request_headers.merge(custom_headers || {}),
2261
+ base_url: request_url
2262
+ }
2263
+ promise = @client.make_request_async(:get, path_template, options)
2264
+
2265
+ promise = promise.then do |result|
2266
+ http_response = result.response
2267
+ status_code = http_response.status
2268
+ response_content = http_response.body
2269
+ unless status_code == 200
2270
+ error_model = JSON.load(response_content)
2271
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
2272
+ end
2273
+
2274
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2275
+ # Deserialize Response
2276
+ if status_code == 200
2277
+ begin
2278
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2279
+ result_mapper = Azure::IotHub::Mgmt::V2016_02_03::Models::IotHubDescriptionListResult.mapper()
2280
+ result.body = @client.deserialize(result_mapper, parsed_response)
2281
+ rescue Exception => e
2282
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2283
+ end
2284
+ end
2285
+
2286
+ result
2287
+ end
2288
+
2289
+ promise.execute
2290
+ end
2291
+
2292
+ #
2293
+ # Get all the IoT hubs in a resource group.
2294
+ #
2295
+ # Get all the IoT hubs in a resource group.
2296
+ #
2297
+ # @param next_page_link [String] The NextLink from the previous successful call
2298
+ # to List operation.
2299
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2300
+ # will be added to the HTTP request.
2301
+ #
2302
+ # @return [IotHubDescriptionListResult] operation results.
2303
+ #
2304
+ def list_by_resource_group_next(next_page_link, custom_headers = nil)
2305
+ response = list_by_resource_group_next_async(next_page_link, custom_headers).value!
2306
+ response.body unless response.nil?
2307
+ end
2308
+
2309
+ #
2310
+ # Get all the IoT hubs in a resource group.
2311
+ #
2312
+ # Get all the IoT hubs in a resource group.
2313
+ #
2314
+ # @param next_page_link [String] The NextLink from the previous successful call
2315
+ # to List operation.
2316
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2317
+ # will be added to the HTTP request.
2318
+ #
2319
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2320
+ #
2321
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers = nil)
2322
+ list_by_resource_group_next_async(next_page_link, custom_headers).value!
2323
+ end
2324
+
2325
+ #
2326
+ # Get all the IoT hubs in a resource group.
2327
+ #
2328
+ # Get all the IoT hubs in a resource group.
2329
+ #
2330
+ # @param next_page_link [String] The NextLink from the previous successful call
2331
+ # to List operation.
2332
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2333
+ # to the HTTP request.
2334
+ #
2335
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2336
+ #
2337
+ def list_by_resource_group_next_async(next_page_link, custom_headers = nil)
2338
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2339
+
2340
+
2341
+ request_headers = {}
2342
+
2343
+ # Set Headers
2344
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2345
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2346
+ path_template = '{nextLink}'
2347
+
2348
+ request_url = @base_url || @client.base_url
2349
+
2350
+ options = {
2351
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2352
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2353
+ headers: request_headers.merge(custom_headers || {}),
2354
+ base_url: request_url
2355
+ }
2356
+ promise = @client.make_request_async(:get, path_template, options)
2357
+
2358
+ promise = promise.then do |result|
2359
+ http_response = result.response
2360
+ status_code = http_response.status
2361
+ response_content = http_response.body
2362
+ unless status_code == 200
2363
+ error_model = JSON.load(response_content)
2364
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
2365
+ end
2366
+
2367
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2368
+ # Deserialize Response
2369
+ if status_code == 200
2370
+ begin
2371
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2372
+ result_mapper = Azure::IotHub::Mgmt::V2016_02_03::Models::IotHubDescriptionListResult.mapper()
2373
+ result.body = @client.deserialize(result_mapper, parsed_response)
2374
+ rescue Exception => e
2375
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2376
+ end
2377
+ end
2378
+
2379
+ result
2380
+ end
2381
+
2382
+ promise.execute
2383
+ end
2384
+
2385
+ #
2386
+ # Get the list of valid SKUs for an IoT hub.
2387
+ #
2388
+ # Get the list of valid SKUs for an IoT hub.
2389
+ #
2390
+ # @param next_page_link [String] The NextLink from the previous successful call
2391
+ # to List operation.
2392
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2393
+ # will be added to the HTTP request.
2394
+ #
2395
+ # @return [IotHubSkuDescriptionListResult] operation results.
2396
+ #
2397
+ def get_valid_skus_next(next_page_link, custom_headers = nil)
2398
+ response = get_valid_skus_next_async(next_page_link, custom_headers).value!
2399
+ response.body unless response.nil?
2400
+ end
2401
+
2402
+ #
2403
+ # Get the list of valid SKUs for an IoT hub.
2404
+ #
2405
+ # Get the list of valid SKUs for an IoT hub.
2406
+ #
2407
+ # @param next_page_link [String] The NextLink from the previous successful call
2408
+ # to List operation.
2409
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2410
+ # will be added to the HTTP request.
2411
+ #
2412
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2413
+ #
2414
+ def get_valid_skus_next_with_http_info(next_page_link, custom_headers = nil)
2415
+ get_valid_skus_next_async(next_page_link, custom_headers).value!
2416
+ end
2417
+
2418
+ #
2419
+ # Get the list of valid SKUs for an IoT hub.
2420
+ #
2421
+ # Get the list of valid SKUs for an IoT hub.
2422
+ #
2423
+ # @param next_page_link [String] The NextLink from the previous successful call
2424
+ # to List operation.
2425
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2426
+ # to the HTTP request.
2427
+ #
2428
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2429
+ #
2430
+ def get_valid_skus_next_async(next_page_link, custom_headers = nil)
2431
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2432
+
2433
+
2434
+ request_headers = {}
2435
+
2436
+ # Set Headers
2437
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2438
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2439
+ path_template = '{nextLink}'
2440
+
2441
+ request_url = @base_url || @client.base_url
2442
+
2443
+ options = {
2444
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2445
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2446
+ headers: request_headers.merge(custom_headers || {}),
2447
+ base_url: request_url
2448
+ }
2449
+ promise = @client.make_request_async(:get, path_template, options)
2450
+
2451
+ promise = promise.then do |result|
2452
+ http_response = result.response
2453
+ status_code = http_response.status
2454
+ response_content = http_response.body
2455
+ unless status_code == 200
2456
+ error_model = JSON.load(response_content)
2457
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
2458
+ end
2459
+
2460
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2461
+ # Deserialize Response
2462
+ if status_code == 200
2463
+ begin
2464
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2465
+ result_mapper = Azure::IotHub::Mgmt::V2016_02_03::Models::IotHubSkuDescriptionListResult.mapper()
2466
+ result.body = @client.deserialize(result_mapper, parsed_response)
2467
+ rescue Exception => e
2468
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2469
+ end
2470
+ end
2471
+
2472
+ result
2473
+ end
2474
+
2475
+ promise.execute
2476
+ end
2477
+
2478
+ #
2479
+ # Get a list of the consumer groups in the Event Hub-compatible device-to-cloud
2480
+ # endpoint in an IoT hub.
2481
+ #
2482
+ # Get a list of the consumer groups in the Event Hub-compatible device-to-cloud
2483
+ # endpoint in an IoT hub.
2484
+ #
2485
+ # @param next_page_link [String] The NextLink from the previous successful call
2486
+ # to List operation.
2487
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2488
+ # will be added to the HTTP request.
2489
+ #
2490
+ # @return [EventHubConsumerGroupsListResult] operation results.
2491
+ #
2492
+ def list_event_hub_consumer_groups_next(next_page_link, custom_headers = nil)
2493
+ response = list_event_hub_consumer_groups_next_async(next_page_link, custom_headers).value!
2494
+ response.body unless response.nil?
2495
+ end
2496
+
2497
+ #
2498
+ # Get a list of the consumer groups in the Event Hub-compatible device-to-cloud
2499
+ # endpoint in an IoT hub.
2500
+ #
2501
+ # Get a list of the consumer groups in the Event Hub-compatible device-to-cloud
2502
+ # endpoint in an IoT hub.
2503
+ #
2504
+ # @param next_page_link [String] The NextLink from the previous successful call
2505
+ # to List operation.
2506
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2507
+ # will be added to the HTTP request.
2508
+ #
2509
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2510
+ #
2511
+ def list_event_hub_consumer_groups_next_with_http_info(next_page_link, custom_headers = nil)
2512
+ list_event_hub_consumer_groups_next_async(next_page_link, custom_headers).value!
2513
+ end
2514
+
2515
+ #
2516
+ # Get a list of the consumer groups in the Event Hub-compatible device-to-cloud
2517
+ # endpoint in an IoT hub.
2518
+ #
2519
+ # Get a list of the consumer groups in the Event Hub-compatible device-to-cloud
2520
+ # endpoint in an IoT hub.
2521
+ #
2522
+ # @param next_page_link [String] The NextLink from the previous successful call
2523
+ # to List operation.
2524
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2525
+ # to the HTTP request.
2526
+ #
2527
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2528
+ #
2529
+ def list_event_hub_consumer_groups_next_async(next_page_link, custom_headers = nil)
2530
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2531
+
2532
+
2533
+ request_headers = {}
2534
+
2535
+ # Set Headers
2536
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2537
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2538
+ path_template = '{nextLink}'
2539
+
2540
+ request_url = @base_url || @client.base_url
2541
+
2542
+ options = {
2543
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2544
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2545
+ headers: request_headers.merge(custom_headers || {}),
2546
+ base_url: request_url
2547
+ }
2548
+ promise = @client.make_request_async(:get, path_template, options)
2549
+
2550
+ promise = promise.then do |result|
2551
+ http_response = result.response
2552
+ status_code = http_response.status
2553
+ response_content = http_response.body
2554
+ unless status_code == 200
2555
+ error_model = JSON.load(response_content)
2556
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
2557
+ end
2558
+
2559
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2560
+ # Deserialize Response
2561
+ if status_code == 200
2562
+ begin
2563
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2564
+ result_mapper = Azure::IotHub::Mgmt::V2016_02_03::Models::EventHubConsumerGroupsListResult.mapper()
2565
+ result.body = @client.deserialize(result_mapper, parsed_response)
2566
+ rescue Exception => e
2567
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2568
+ end
2569
+ end
2570
+
2571
+ result
2572
+ end
2573
+
2574
+ promise.execute
2575
+ end
2576
+
2577
+ #
2578
+ # Get a list of all the jobs in an IoT hub. For more information, see:
2579
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.
2580
+ #
2581
+ # Get a list of all the jobs in an IoT hub. For more information, see:
2582
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.
2583
+ #
2584
+ # @param next_page_link [String] The NextLink from the previous successful call
2585
+ # to List operation.
2586
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2587
+ # will be added to the HTTP request.
2588
+ #
2589
+ # @return [JobResponseListResult] operation results.
2590
+ #
2591
+ def list_jobs_next(next_page_link, custom_headers = nil)
2592
+ response = list_jobs_next_async(next_page_link, custom_headers).value!
2593
+ response.body unless response.nil?
2594
+ end
2595
+
2596
+ #
2597
+ # Get a list of all the jobs in an IoT hub. For more information, see:
2598
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.
2599
+ #
2600
+ # Get a list of all the jobs in an IoT hub. For more information, see:
2601
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.
2602
+ #
2603
+ # @param next_page_link [String] The NextLink from the previous successful call
2604
+ # to List operation.
2605
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2606
+ # will be added to the HTTP request.
2607
+ #
2608
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2609
+ #
2610
+ def list_jobs_next_with_http_info(next_page_link, custom_headers = nil)
2611
+ list_jobs_next_async(next_page_link, custom_headers).value!
2612
+ end
2613
+
2614
+ #
2615
+ # Get a list of all the jobs in an IoT hub. For more information, see:
2616
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.
2617
+ #
2618
+ # Get a list of all the jobs in an IoT hub. For more information, see:
2619
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.
2620
+ #
2621
+ # @param next_page_link [String] The NextLink from the previous successful call
2622
+ # to List operation.
2623
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2624
+ # to the HTTP request.
2625
+ #
2626
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2627
+ #
2628
+ def list_jobs_next_async(next_page_link, custom_headers = nil)
2629
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2630
+
2631
+
2632
+ request_headers = {}
2633
+
2634
+ # Set Headers
2635
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2636
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2637
+ path_template = '{nextLink}'
2638
+
2639
+ request_url = @base_url || @client.base_url
2640
+
2641
+ options = {
2642
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2643
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2644
+ headers: request_headers.merge(custom_headers || {}),
2645
+ base_url: request_url
2646
+ }
2647
+ promise = @client.make_request_async(:get, path_template, options)
2648
+
2649
+ promise = promise.then do |result|
2650
+ http_response = result.response
2651
+ status_code = http_response.status
2652
+ response_content = http_response.body
2653
+ unless status_code == 200
2654
+ error_model = JSON.load(response_content)
2655
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
2656
+ end
2657
+
2658
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2659
+ # Deserialize Response
2660
+ if status_code == 200
2661
+ begin
2662
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2663
+ result_mapper = Azure::IotHub::Mgmt::V2016_02_03::Models::JobResponseListResult.mapper()
2664
+ result.body = @client.deserialize(result_mapper, parsed_response)
2665
+ rescue Exception => e
2666
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2667
+ end
2668
+ end
2669
+
2670
+ result
2671
+ end
2672
+
2673
+ promise.execute
2674
+ end
2675
+
2676
+ #
2677
+ # Get the quota metrics for an IoT hub.
2678
+ #
2679
+ # Get the quota metrics for an IoT hub.
2680
+ #
2681
+ # @param next_page_link [String] The NextLink from the previous successful call
2682
+ # to List operation.
2683
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2684
+ # will be added to the HTTP request.
2685
+ #
2686
+ # @return [IotHubQuotaMetricInfoListResult] operation results.
2687
+ #
2688
+ def get_quota_metrics_next(next_page_link, custom_headers = nil)
2689
+ response = get_quota_metrics_next_async(next_page_link, custom_headers).value!
2690
+ response.body unless response.nil?
2691
+ end
2692
+
2693
+ #
2694
+ # Get the quota metrics for an IoT hub.
2695
+ #
2696
+ # Get the quota metrics for an IoT hub.
2697
+ #
2698
+ # @param next_page_link [String] The NextLink from the previous successful call
2699
+ # to List operation.
2700
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2701
+ # will be added to the HTTP request.
2702
+ #
2703
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2704
+ #
2705
+ def get_quota_metrics_next_with_http_info(next_page_link, custom_headers = nil)
2706
+ get_quota_metrics_next_async(next_page_link, custom_headers).value!
2707
+ end
2708
+
2709
+ #
2710
+ # Get the quota metrics for an IoT hub.
2711
+ #
2712
+ # Get the quota metrics for an IoT hub.
2713
+ #
2714
+ # @param next_page_link [String] The NextLink from the previous successful call
2715
+ # to List operation.
2716
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2717
+ # to the HTTP request.
2718
+ #
2719
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2720
+ #
2721
+ def get_quota_metrics_next_async(next_page_link, custom_headers = nil)
2722
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2723
+
2724
+
2725
+ request_headers = {}
2726
+
2727
+ # Set Headers
2728
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2729
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2730
+ path_template = '{nextLink}'
2731
+
2732
+ request_url = @base_url || @client.base_url
2733
+
2734
+ options = {
2735
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2736
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2737
+ headers: request_headers.merge(custom_headers || {}),
2738
+ base_url: request_url
2739
+ }
2740
+ promise = @client.make_request_async(:get, path_template, options)
2741
+
2742
+ promise = promise.then do |result|
2743
+ http_response = result.response
2744
+ status_code = http_response.status
2745
+ response_content = http_response.body
2746
+ unless status_code == 200
2747
+ error_model = JSON.load(response_content)
2748
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
2749
+ end
2750
+
2751
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2752
+ # Deserialize Response
2753
+ if status_code == 200
2754
+ begin
2755
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2756
+ result_mapper = Azure::IotHub::Mgmt::V2016_02_03::Models::IotHubQuotaMetricInfoListResult.mapper()
2757
+ result.body = @client.deserialize(result_mapper, parsed_response)
2758
+ rescue Exception => e
2759
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2760
+ end
2761
+ end
2762
+
2763
+ result
2764
+ end
2765
+
2766
+ promise.execute
2767
+ end
2768
+
2769
+ #
2770
+ # Get the security metadata for an IoT hub. For more information, see:
2771
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.
2772
+ #
2773
+ # Get the security metadata for an IoT hub. For more information, see:
2774
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.
2775
+ #
2776
+ # @param next_page_link [String] The NextLink from the previous successful call
2777
+ # to List operation.
2778
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2779
+ # will be added to the HTTP request.
2780
+ #
2781
+ # @return [SharedAccessSignatureAuthorizationRuleListResult] operation results.
2782
+ #
2783
+ def list_keys_next(next_page_link, custom_headers = nil)
2784
+ response = list_keys_next_async(next_page_link, custom_headers).value!
2785
+ response.body unless response.nil?
2786
+ end
2787
+
2788
+ #
2789
+ # Get the security metadata for an IoT hub. For more information, see:
2790
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.
2791
+ #
2792
+ # Get the security metadata for an IoT hub. For more information, see:
2793
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.
2794
+ #
2795
+ # @param next_page_link [String] The NextLink from the previous successful call
2796
+ # to List operation.
2797
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2798
+ # will be added to the HTTP request.
2799
+ #
2800
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2801
+ #
2802
+ def list_keys_next_with_http_info(next_page_link, custom_headers = nil)
2803
+ list_keys_next_async(next_page_link, custom_headers).value!
2804
+ end
2805
+
2806
+ #
2807
+ # Get the security metadata for an IoT hub. For more information, see:
2808
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.
2809
+ #
2810
+ # Get the security metadata for an IoT hub. For more information, see:
2811
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.
2812
+ #
2813
+ # @param next_page_link [String] The NextLink from the previous successful call
2814
+ # to List operation.
2815
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2816
+ # to the HTTP request.
2817
+ #
2818
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2819
+ #
2820
+ def list_keys_next_async(next_page_link, custom_headers = nil)
2821
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2822
+
2823
+
2824
+ request_headers = {}
2825
+
2826
+ # Set Headers
2827
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2828
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2829
+ path_template = '{nextLink}'
2830
+
2831
+ request_url = @base_url || @client.base_url
2832
+
2833
+ options = {
2834
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2835
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2836
+ headers: request_headers.merge(custom_headers || {}),
2837
+ base_url: request_url
2838
+ }
2839
+ promise = @client.make_request_async(:post, path_template, options)
2840
+
2841
+ promise = promise.then do |result|
2842
+ http_response = result.response
2843
+ status_code = http_response.status
2844
+ response_content = http_response.body
2845
+ unless status_code == 200
2846
+ error_model = JSON.load(response_content)
2847
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
2848
+ end
2849
+
2850
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2851
+ # Deserialize Response
2852
+ if status_code == 200
2853
+ begin
2854
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2855
+ result_mapper = Azure::IotHub::Mgmt::V2016_02_03::Models::SharedAccessSignatureAuthorizationRuleListResult.mapper()
2856
+ result.body = @client.deserialize(result_mapper, parsed_response)
2857
+ rescue Exception => e
2858
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2859
+ end
2860
+ end
2861
+
2862
+ result
2863
+ end
2864
+
2865
+ promise.execute
2866
+ end
2867
+
2868
+ #
2869
+ # Get all the IoT hubs in a subscription.
2870
+ #
2871
+ # Get all the IoT hubs in a subscription.
2872
+ #
2873
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2874
+ # will be added to the HTTP request.
2875
+ #
2876
+ # @return [IotHubDescriptionListResult] which provide lazy access to pages of
2877
+ # the response.
2878
+ #
2879
+ def list_by_subscription_as_lazy(custom_headers = nil)
2880
+ response = list_by_subscription_async(custom_headers).value!
2881
+ unless response.nil?
2882
+ page = response.body
2883
+ page.next_method = Proc.new do |next_page_link|
2884
+ list_by_subscription_next_async(next_page_link, custom_headers)
2885
+ end
2886
+ page
2887
+ end
2888
+ end
2889
+
2890
+ #
2891
+ # Get all the IoT hubs in a resource group.
2892
+ #
2893
+ # Get all the IoT hubs in a resource group.
2894
+ #
2895
+ # @param resource_group_name [String] The name of the resource group that
2896
+ # contains the IoT hubs.
2897
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2898
+ # will be added to the HTTP request.
2899
+ #
2900
+ # @return [IotHubDescriptionListResult] which provide lazy access to pages of
2901
+ # the response.
2902
+ #
2903
+ def list_by_resource_group_as_lazy(resource_group_name, custom_headers = nil)
2904
+ response = list_by_resource_group_async(resource_group_name, custom_headers).value!
2905
+ unless response.nil?
2906
+ page = response.body
2907
+ page.next_method = Proc.new do |next_page_link|
2908
+ list_by_resource_group_next_async(next_page_link, custom_headers)
2909
+ end
2910
+ page
2911
+ end
2912
+ end
2913
+
2914
+ #
2915
+ # Get the list of valid SKUs for an IoT hub.
2916
+ #
2917
+ # Get the list of valid SKUs for an IoT hub.
2918
+ #
2919
+ # @param resource_group_name [String] The name of the resource group that
2920
+ # contains the IoT hub.
2921
+ # @param resource_name [String] The name of the IoT hub.
2922
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2923
+ # will be added to the HTTP request.
2924
+ #
2925
+ # @return [IotHubSkuDescriptionListResult] which provide lazy access to pages
2926
+ # of the response.
2927
+ #
2928
+ def get_valid_skus_as_lazy(resource_group_name, resource_name, custom_headers = nil)
2929
+ response = get_valid_skus_async(resource_group_name, resource_name, custom_headers).value!
2930
+ unless response.nil?
2931
+ page = response.body
2932
+ page.next_method = Proc.new do |next_page_link|
2933
+ get_valid_skus_next_async(next_page_link, custom_headers)
2934
+ end
2935
+ page
2936
+ end
2937
+ end
2938
+
2939
+ #
2940
+ # Get a list of the consumer groups in the Event Hub-compatible device-to-cloud
2941
+ # endpoint in an IoT hub.
2942
+ #
2943
+ # Get a list of the consumer groups in the Event Hub-compatible device-to-cloud
2944
+ # endpoint in an IoT hub.
2945
+ #
2946
+ # @param resource_group_name [String] The name of the resource group that
2947
+ # contains the IoT hub.
2948
+ # @param resource_name [String] The name of the IoT hub.
2949
+ # @param event_hub_endpoint_name [String] The name of the Event Hub-compatible
2950
+ # endpoint.
2951
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2952
+ # will be added to the HTTP request.
2953
+ #
2954
+ # @return [EventHubConsumerGroupsListResult] which provide lazy access to pages
2955
+ # of the response.
2956
+ #
2957
+ def list_event_hub_consumer_groups_as_lazy(resource_group_name, resource_name, event_hub_endpoint_name, custom_headers = nil)
2958
+ response = list_event_hub_consumer_groups_async(resource_group_name, resource_name, event_hub_endpoint_name, custom_headers).value!
2959
+ unless response.nil?
2960
+ page = response.body
2961
+ page.next_method = Proc.new do |next_page_link|
2962
+ list_event_hub_consumer_groups_next_async(next_page_link, custom_headers)
2963
+ end
2964
+ page
2965
+ end
2966
+ end
2967
+
2968
+ #
2969
+ # Get a list of all the jobs in an IoT hub. For more information, see:
2970
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.
2971
+ #
2972
+ # Get a list of all the jobs in an IoT hub. For more information, see:
2973
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.
2974
+ #
2975
+ # @param resource_group_name [String] The name of the resource group that
2976
+ # contains the IoT hub.
2977
+ # @param resource_name [String] The name of the IoT hub.
2978
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2979
+ # will be added to the HTTP request.
2980
+ #
2981
+ # @return [JobResponseListResult] which provide lazy access to pages of the
2982
+ # response.
2983
+ #
2984
+ def list_jobs_as_lazy(resource_group_name, resource_name, custom_headers = nil)
2985
+ response = list_jobs_async(resource_group_name, resource_name, custom_headers).value!
2986
+ unless response.nil?
2987
+ page = response.body
2988
+ page.next_method = Proc.new do |next_page_link|
2989
+ list_jobs_next_async(next_page_link, custom_headers)
2990
+ end
2991
+ page
2992
+ end
2993
+ end
2994
+
2995
+ #
2996
+ # Get the quota metrics for an IoT hub.
2997
+ #
2998
+ # Get the quota metrics for an IoT hub.
2999
+ #
3000
+ # @param resource_group_name [String] The name of the resource group that
3001
+ # contains the IoT hub.
3002
+ # @param resource_name [String] The name of the IoT hub.
3003
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3004
+ # will be added to the HTTP request.
3005
+ #
3006
+ # @return [IotHubQuotaMetricInfoListResult] which provide lazy access to pages
3007
+ # of the response.
3008
+ #
3009
+ def get_quota_metrics_as_lazy(resource_group_name, resource_name, custom_headers = nil)
3010
+ response = get_quota_metrics_async(resource_group_name, resource_name, custom_headers).value!
3011
+ unless response.nil?
3012
+ page = response.body
3013
+ page.next_method = Proc.new do |next_page_link|
3014
+ get_quota_metrics_next_async(next_page_link, custom_headers)
3015
+ end
3016
+ page
3017
+ end
3018
+ end
3019
+
3020
+ #
3021
+ # Get the security metadata for an IoT hub. For more information, see:
3022
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.
3023
+ #
3024
+ # Get the security metadata for an IoT hub. For more information, see:
3025
+ # https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.
3026
+ #
3027
+ # @param resource_group_name [String] The name of the resource group that
3028
+ # contains the IoT hub.
3029
+ # @param resource_name [String] The name of the IoT hub.
3030
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3031
+ # will be added to the HTTP request.
3032
+ #
3033
+ # @return [SharedAccessSignatureAuthorizationRuleListResult] which provide lazy
3034
+ # access to pages of the response.
3035
+ #
3036
+ def list_keys_as_lazy(resource_group_name, resource_name, custom_headers = nil)
3037
+ response = list_keys_async(resource_group_name, resource_name, custom_headers).value!
3038
+ unless response.nil?
3039
+ page = response.body
3040
+ page.next_method = Proc.new do |next_page_link|
3041
+ list_keys_next_async(next_page_link, custom_headers)
3042
+ end
3043
+ page
3044
+ end
3045
+ end
3046
+
3047
+ end
3048
+ end