azure_mgmt_iot_hub 0.16.0 → 0.17.0

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