azure_mgmt_iot_hub 0.16.0 → 0.17.4

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