azure_mgmt_iot_hub 0.17.4 → 0.17.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_client.rb +1 -1
  3. data/lib/2017-01-19/generated/azure_mgmt_iot_hub/iot_hub_client.rb +1 -1
  4. data/lib/2017-07-01/generated/azure_mgmt_iot_hub/iot_hub_client.rb +1 -1
  5. data/lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_client.rb +1 -1
  6. data/lib/2018-04-01/generated/azure_mgmt_iot_hub/iot_hub_client.rb +1 -1
  7. data/lib/2018-12-01-preview/generated/azure_mgmt_iot_hub/iot_hub_client.rb +1 -1
  8. data/lib/2019-03-22-preview/generated/azure_mgmt_iot_hub/iot_hub_client.rb +1 -1
  9. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub.rb +114 -0
  10. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/certificates.rb +723 -0
  11. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/iot_hub.rb +172 -0
  12. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/iot_hub_client.rb +147 -0
  13. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/iot_hub_resource.rb +3738 -0
  14. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/access_rights.rb +29 -0
  15. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/capabilities.rb +16 -0
  16. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/certificate_body_description.rb +47 -0
  17. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/certificate_description.rb +95 -0
  18. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/certificate_list_description.rb +56 -0
  19. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/certificate_properties.rb +118 -0
  20. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/certificate_properties_with_nonce.rb +133 -0
  21. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/certificate_verification_description.rb +47 -0
  22. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/certificate_with_nonce_description.rb +95 -0
  23. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/cloud_to_device_properties.rb +77 -0
  24. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/endpoint_health_data.rb +69 -0
  25. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/endpoint_health_data_list_result.rb +100 -0
  26. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/endpoint_health_status.rb +18 -0
  27. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/enrichment_properties.rb +81 -0
  28. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/error_details.rb +83 -0
  29. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/event_hub_consumer_group_info.rb +102 -0
  30. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/event_hub_consumer_groups_list_result.rb +101 -0
  31. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/event_hub_properties.rb +107 -0
  32. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/export_devices_request.rb +59 -0
  33. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/failover_input.rb +46 -0
  34. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/fallback_route_properties.rb +114 -0
  35. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/feedback_properties.rb +77 -0
  36. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/import_devices_request.rb +58 -0
  37. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/iot_hub_capacity.rb +89 -0
  38. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/iot_hub_description.rb +126 -0
  39. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/iot_hub_description_list_result.rb +100 -0
  40. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/iot_hub_location_description.rb +59 -0
  41. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/iot_hub_name_availability_info.rb +73 -0
  42. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/iot_hub_name_unavailability_reason.rb +16 -0
  43. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/iot_hub_properties.rb +275 -0
  44. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/iot_hub_properties_device_streams.rb +54 -0
  45. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/iot_hub_quota_metric_info.rb +71 -0
  46. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/iot_hub_quota_metric_info_list_result.rb +101 -0
  47. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/iot_hub_replica_role_type.rb +16 -0
  48. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/iot_hub_scale_type.rb +17 -0
  49. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/iot_hub_sku.rb +21 -0
  50. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/iot_hub_sku_description.rb +71 -0
  51. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/iot_hub_sku_description_list_result.rb +101 -0
  52. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/iot_hub_sku_info.rb +73 -0
  53. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/iot_hub_sku_tier.rb +17 -0
  54. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/ip_filter_action_type.rb +16 -0
  55. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/ip_filter_rule.rb +71 -0
  56. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/job_response.rb +137 -0
  57. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/job_response_list_result.rb +99 -0
  58. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/job_status.rb +20 -0
  59. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/job_type.rb +24 -0
  60. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/matched_route.rb +47 -0
  61. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/messaging_endpoint_properties.rb +77 -0
  62. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/name.rb +57 -0
  63. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/operation.rb +60 -0
  64. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/operation_display.rb +83 -0
  65. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/operation_inputs.rb +46 -0
  66. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/operation_list_result.rb +103 -0
  67. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/registry_statistics.rb +73 -0
  68. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/resource.rb +113 -0
  69. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/route_compilation_error.rb +70 -0
  70. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/route_error_position.rb +57 -0
  71. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/route_error_range.rb +59 -0
  72. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/route_error_severity.rb +16 -0
  73. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/route_properties.rb +116 -0
  74. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/routing_endpoints.rb +126 -0
  75. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/routing_event_hub_properties.rb +87 -0
  76. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/routing_message.rb +84 -0
  77. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/routing_properties.rb +110 -0
  78. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/routing_service_bus_queue_endpoint_properties.rb +90 -0
  79. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/routing_service_bus_topic_endpoint_properties.rb +90 -0
  80. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/routing_source.rb +20 -0
  81. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/routing_storage_container_properties.rb +157 -0
  82. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/routing_twin.rb +58 -0
  83. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/routing_twin_properties.rb +58 -0
  84. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/shared_access_signature_authorization_rule.rb +89 -0
  85. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/shared_access_signature_authorization_rule_list_result.rb +103 -0
  86. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/storage_endpoint_properties.rb +73 -0
  87. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/tags_resource.rb +55 -0
  88. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/test_all_routes_input.rb +73 -0
  89. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/test_all_routes_result.rb +55 -0
  90. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/test_result_status.rb +17 -0
  91. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/test_route_input.rb +71 -0
  92. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/test_route_result.rb +59 -0
  93. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/test_route_result_details.rb +56 -0
  94. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/user_subscription_quota.rb +102 -0
  95. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/models/user_subscription_quota_list_result.rb +67 -0
  96. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/module_definition.rb +9 -0
  97. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/operations.rb +219 -0
  98. data/lib/2019-07-01-preview/generated/azure_mgmt_iot_hub/resource_provider_common.rb +117 -0
  99. data/lib/azure_mgmt_iot_hub.rb +5 -4
  100. data/lib/version.rb +1 -1
  101. metadata +93 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fecee24186b51e5a8e4468f1fd47bd78ecef17bff8fd853ffe6d5c3a88a21eb0
4
- data.tar.gz: 9bd8de419e56b36dd2462352b9827c450cb189792d0e9de94fd0223ed0617152
3
+ metadata.gz: 188b408eda1eaa8c888b2e8a2a20ca2e58db48815038eda29b68660a65771176
4
+ data.tar.gz: 7881d6e4ba3a688b3b163c20593868623c2471abf9cb8408a0636e9701a61e1f
5
5
  SHA512:
6
- metadata.gz: b6164fb562dbc11bed922a81509378e5daa52eaf3a8aaf8c8df62f0cf94d159bfb8733dcb8196a371a83b66cf158b1212601e587f55dab84716d6da33a0af20f
7
- data.tar.gz: 53721b6fe1276e5a3953f9a23c445afcf9436019fb71603df73029c8d2273ae4a751837d5c08186fe8a59ed29af161e1ecb59825037a0c5445600be604e79184
6
+ metadata.gz: 24398be21d4246d65c07ce1de4f07521ba402ef5f6c02b4b69a0b1c3c435d67160d9b097fbb938e373b0b47af5e871c04b065824cf43dc7bff58e117866ab9ea
7
+ data.tar.gz: 1c4d69a28f19a6e4cd094c407e7141b9cd1f5e5f670b266253c34fbeda95269d59876c4dce270b601b3c597a3fe667d45c7fbf7e6e950c8cb1b75fbc093b2357
@@ -124,7 +124,7 @@ module Azure::IotHub::Mgmt::V2016_02_03
124
124
  #
125
125
  def add_telemetry
126
126
  sdk_information = 'azure_mgmt_iot_hub'
127
- sdk_information = "#{sdk_information}/0.17.4"
127
+ sdk_information = "#{sdk_information}/0.17.5"
128
128
  add_user_agent_information(sdk_information)
129
129
  end
130
130
  end
@@ -124,7 +124,7 @@ module Azure::IotHub::Mgmt::V2017_01_19
124
124
  #
125
125
  def add_telemetry
126
126
  sdk_information = 'azure_mgmt_iot_hub'
127
- sdk_information = "#{sdk_information}/0.17.4"
127
+ sdk_information = "#{sdk_information}/0.17.5"
128
128
  add_user_agent_information(sdk_information)
129
129
  end
130
130
  end
@@ -132,7 +132,7 @@ module Azure::IotHub::Mgmt::V2017_07_01
132
132
  #
133
133
  def add_telemetry
134
134
  sdk_information = 'azure_mgmt_iot_hub'
135
- sdk_information = "#{sdk_information}/0.17.4"
135
+ sdk_information = "#{sdk_information}/0.17.5"
136
136
  add_user_agent_information(sdk_information)
137
137
  end
138
138
  end
@@ -132,7 +132,7 @@ module Azure::IotHub::Mgmt::V2018_01_22
132
132
  #
133
133
  def add_telemetry
134
134
  sdk_information = 'azure_mgmt_iot_hub'
135
- sdk_information = "#{sdk_information}/0.17.4"
135
+ sdk_information = "#{sdk_information}/0.17.5"
136
136
  add_user_agent_information(sdk_information)
137
137
  end
138
138
  end
@@ -136,7 +136,7 @@ module Azure::IotHub::Mgmt::V2018_04_01
136
136
  #
137
137
  def add_telemetry
138
138
  sdk_information = 'azure_mgmt_iot_hub'
139
- sdk_information = "#{sdk_information}/0.17.4"
139
+ sdk_information = "#{sdk_information}/0.17.5"
140
140
  add_user_agent_information(sdk_information)
141
141
  end
142
142
  end
@@ -136,7 +136,7 @@ module Azure::IotHub::Mgmt::V2018_12_01_preview
136
136
  #
137
137
  def add_telemetry
138
138
  sdk_information = 'azure_mgmt_iot_hub'
139
- sdk_information = "#{sdk_information}/0.17.4"
139
+ sdk_information = "#{sdk_information}/0.17.5"
140
140
  add_user_agent_information(sdk_information)
141
141
  end
142
142
  end
@@ -140,7 +140,7 @@ module Azure::IotHub::Mgmt::V2019_03_22_preview
140
140
  #
141
141
  def add_telemetry
142
142
  sdk_information = 'azure_mgmt_iot_hub'
143
- sdk_information = "#{sdk_information}/0.17.4"
143
+ sdk_information = "#{sdk_information}/0.17.5"
144
144
  add_user_agent_information(sdk_information)
145
145
  end
146
146
  end
@@ -0,0 +1,114 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ require 'uri'
7
+ require 'cgi'
8
+ require 'date'
9
+ require 'json'
10
+ require 'base64'
11
+ require 'erb'
12
+ require 'securerandom'
13
+ require 'time'
14
+ require 'timeliness'
15
+ require 'faraday'
16
+ require 'faraday-cookie_jar'
17
+ require 'concurrent'
18
+ require 'ms_rest'
19
+ require '2019-07-01-preview/generated/azure_mgmt_iot_hub/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::IotHub::Mgmt::V2019_07_01_preview
23
+ autoload :Operations, '2019-07-01-preview/generated/azure_mgmt_iot_hub/operations.rb'
24
+ autoload :IotHubResource, '2019-07-01-preview/generated/azure_mgmt_iot_hub/iot_hub_resource.rb'
25
+ autoload :ResourceProviderCommon, '2019-07-01-preview/generated/azure_mgmt_iot_hub/resource_provider_common.rb'
26
+ autoload :Certificates, '2019-07-01-preview/generated/azure_mgmt_iot_hub/certificates.rb'
27
+ autoload :IotHub, '2019-07-01-preview/generated/azure_mgmt_iot_hub/iot_hub.rb'
28
+ autoload :IotHubClient, '2019-07-01-preview/generated/azure_mgmt_iot_hub/iot_hub_client.rb'
29
+
30
+ module Models
31
+ autoload :IotHubQuotaMetricInfo, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/iot_hub_quota_metric_info.rb'
32
+ autoload :CertificateVerificationDescription, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/certificate_verification_description.rb'
33
+ autoload :IotHubQuotaMetricInfoListResult, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/iot_hub_quota_metric_info_list_result.rb'
34
+ autoload :CertificateDescription, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/certificate_description.rb'
35
+ autoload :EndpointHealthData, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/endpoint_health_data.rb'
36
+ autoload :CertificateBodyDescription, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/certificate_body_description.rb'
37
+ autoload :EndpointHealthDataListResult, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/endpoint_health_data_list_result.rb'
38
+ autoload :CertificateWithNonceDescription, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/certificate_with_nonce_description.rb'
39
+ autoload :RegistryStatistics, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/registry_statistics.rb'
40
+ autoload :IpFilterRule, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/ip_filter_rule.rb'
41
+ autoload :JobResponse, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/job_response.rb'
42
+ autoload :RoutingServiceBusQueueEndpointProperties, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/routing_service_bus_queue_endpoint_properties.rb'
43
+ autoload :JobResponseListResult, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/job_response_list_result.rb'
44
+ autoload :RoutingEventHubProperties, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/routing_event_hub_properties.rb'
45
+ autoload :IotHubCapacity, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/iot_hub_capacity.rb'
46
+ autoload :RoutingEndpoints, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/routing_endpoints.rb'
47
+ autoload :IotHubSkuDescription, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/iot_hub_sku_description.rb'
48
+ autoload :FallbackRouteProperties, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/fallback_route_properties.rb'
49
+ autoload :TagsResource, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/tags_resource.rb'
50
+ autoload :RoutingProperties, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/routing_properties.rb'
51
+ autoload :EventHubConsumerGroupInfo, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/event_hub_consumer_group_info.rb'
52
+ autoload :MessagingEndpointProperties, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/messaging_endpoint_properties.rb'
53
+ autoload :EventHubConsumerGroupsListResult, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/event_hub_consumer_groups_list_result.rb'
54
+ autoload :CloudToDeviceProperties, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/cloud_to_device_properties.rb'
55
+ autoload :IotHubSkuDescriptionListResult, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/iot_hub_sku_description_list_result.rb'
56
+ autoload :IotHubLocationDescription, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/iot_hub_location_description.rb'
57
+ autoload :IotHubDescriptionListResult, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/iot_hub_description_list_result.rb'
58
+ autoload :IotHubSkuInfo, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/iot_hub_sku_info.rb'
59
+ autoload :OperationInputs, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/operation_inputs.rb'
60
+ autoload :Resource, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/resource.rb'
61
+ autoload :IotHubNameAvailabilityInfo, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/iot_hub_name_availability_info.rb'
62
+ autoload :OperationDisplay, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/operation_display.rb'
63
+ autoload :Name, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/name.rb'
64
+ autoload :OperationListResult, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/operation_list_result.rb'
65
+ autoload :UserSubscriptionQuota, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/user_subscription_quota.rb'
66
+ autoload :CertificateProperties, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/certificate_properties.rb'
67
+ autoload :UserSubscriptionQuotaListResult, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/user_subscription_quota_list_result.rb'
68
+ autoload :CertificatePropertiesWithNonce, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/certificate_properties_with_nonce.rb'
69
+ autoload :RoutingMessage, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/routing_message.rb'
70
+ autoload :EventHubProperties, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/event_hub_properties.rb'
71
+ autoload :RoutingTwinProperties, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/routing_twin_properties.rb'
72
+ autoload :RoutingStorageContainerProperties, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/routing_storage_container_properties.rb'
73
+ autoload :RoutingTwin, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/routing_twin.rb'
74
+ autoload :EnrichmentProperties, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/enrichment_properties.rb'
75
+ autoload :TestAllRoutesInput, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/test_all_routes_input.rb'
76
+ autoload :FeedbackProperties, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/feedback_properties.rb'
77
+ autoload :MatchedRoute, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/matched_route.rb'
78
+ autoload :IotHubProperties, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/iot_hub_properties.rb'
79
+ autoload :TestAllRoutesResult, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/test_all_routes_result.rb'
80
+ autoload :SharedAccessSignatureAuthorizationRuleListResult, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/shared_access_signature_authorization_rule_list_result.rb'
81
+ autoload :TestRouteInput, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/test_route_input.rb'
82
+ autoload :ErrorDetails, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/error_details.rb'
83
+ autoload :RouteErrorPosition, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/route_error_position.rb'
84
+ autoload :SharedAccessSignatureAuthorizationRule, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/shared_access_signature_authorization_rule.rb'
85
+ autoload :RouteErrorRange, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/route_error_range.rb'
86
+ autoload :RouteProperties, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/route_properties.rb'
87
+ autoload :RouteCompilationError, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/route_compilation_error.rb'
88
+ autoload :IotHubPropertiesDeviceStreams, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/iot_hub_properties_device_streams.rb'
89
+ autoload :TestRouteResultDetails, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/test_route_result_details.rb'
90
+ autoload :Operation, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/operation.rb'
91
+ autoload :TestRouteResult, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/test_route_result.rb'
92
+ autoload :RoutingServiceBusTopicEndpointProperties, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/routing_service_bus_topic_endpoint_properties.rb'
93
+ autoload :ExportDevicesRequest, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/export_devices_request.rb'
94
+ autoload :CertificateListDescription, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/certificate_list_description.rb'
95
+ autoload :ImportDevicesRequest, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/import_devices_request.rb'
96
+ autoload :StorageEndpointProperties, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/storage_endpoint_properties.rb'
97
+ autoload :FailoverInput, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/failover_input.rb'
98
+ autoload :IotHubDescription, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/iot_hub_description.rb'
99
+ autoload :AccessRights, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/access_rights.rb'
100
+ autoload :IpFilterActionType, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/ip_filter_action_type.rb'
101
+ autoload :RoutingSource, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/routing_source.rb'
102
+ autoload :Capabilities, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/capabilities.rb'
103
+ autoload :IotHubReplicaRoleType, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/iot_hub_replica_role_type.rb'
104
+ autoload :IotHubSku, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/iot_hub_sku.rb'
105
+ autoload :IotHubSkuTier, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/iot_hub_sku_tier.rb'
106
+ autoload :EndpointHealthStatus, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/endpoint_health_status.rb'
107
+ autoload :JobType, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/job_type.rb'
108
+ autoload :JobStatus, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/job_status.rb'
109
+ autoload :IotHubScaleType, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/iot_hub_scale_type.rb'
110
+ autoload :IotHubNameUnavailabilityReason, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/iot_hub_name_unavailability_reason.rb'
111
+ autoload :TestResultStatus, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/test_result_status.rb'
112
+ autoload :RouteErrorSeverity, '2019-07-01-preview/generated/azure_mgmt_iot_hub/models/route_error_severity.rb'
113
+ end
114
+ end
@@ -0,0 +1,723 @@
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::V2019_07_01_preview
7
+ #
8
+ # Use this API to manage the IoT hubs in your Azure subscription.
9
+ #
10
+ class Certificates
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Certificates 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 certificate list.
26
+ #
27
+ # Returns the list of certificates.
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 [CertificateListDescription] operation results.
36
+ #
37
+ def list_by_iot_hub(resource_group_name, resource_name, custom_headers:nil)
38
+ response = list_by_iot_hub_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
39
+ response.body unless response.nil?
40
+ end
41
+
42
+ #
43
+ # Get the certificate list.
44
+ #
45
+ # Returns the list of certificates.
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 list_by_iot_hub_with_http_info(resource_group_name, resource_name, custom_headers:nil)
56
+ list_by_iot_hub_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
57
+ end
58
+
59
+ #
60
+ # Get the certificate list.
61
+ #
62
+ # Returns the list of certificates.
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 list_by_iot_hub_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}/certificates'
86
+
87
+ request_url = @base_url || @client.base_url
88
+
89
+ options = {
90
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
91
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
92
+ query_params: {'api-version' => @client.api_version},
93
+ headers: request_headers.merge(custom_headers || {}),
94
+ base_url: request_url
95
+ }
96
+ promise = @client.make_request_async(:get, path_template, options)
97
+
98
+ promise = promise.then do |result|
99
+ http_response = result.response
100
+ status_code = http_response.status
101
+ response_content = http_response.body
102
+ unless status_code == 200
103
+ error_model = JSON.load(response_content)
104
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
105
+ end
106
+
107
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
108
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
109
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
110
+ # Deserialize Response
111
+ if status_code == 200
112
+ begin
113
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
114
+ result_mapper = Azure::IotHub::Mgmt::V2019_07_01_preview::Models::CertificateListDescription.mapper()
115
+ result.body = @client.deserialize(result_mapper, parsed_response)
116
+ rescue Exception => e
117
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
118
+ end
119
+ end
120
+
121
+ result
122
+ end
123
+
124
+ promise.execute
125
+ end
126
+
127
+ #
128
+ # Get the certificate.
129
+ #
130
+ # Returns the certificate.
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 certificate_name [String] The name of the certificate
136
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
137
+ # will be added to the HTTP request.
138
+ #
139
+ # @return [CertificateDescription] operation results.
140
+ #
141
+ def get(resource_group_name, resource_name, certificate_name, custom_headers:nil)
142
+ response = get_async(resource_group_name, resource_name, certificate_name, custom_headers:custom_headers).value!
143
+ response.body unless response.nil?
144
+ end
145
+
146
+ #
147
+ # Get the certificate.
148
+ #
149
+ # Returns the certificate.
150
+ #
151
+ # @param resource_group_name [String] The name of the resource group that
152
+ # contains the IoT hub.
153
+ # @param resource_name [String] The name of the IoT hub.
154
+ # @param certificate_name [String] The name of the certificate
155
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
156
+ # will be added to the HTTP request.
157
+ #
158
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
159
+ #
160
+ def get_with_http_info(resource_group_name, resource_name, certificate_name, custom_headers:nil)
161
+ get_async(resource_group_name, resource_name, certificate_name, custom_headers:custom_headers).value!
162
+ end
163
+
164
+ #
165
+ # Get the certificate.
166
+ #
167
+ # Returns the certificate.
168
+ #
169
+ # @param resource_group_name [String] The name of the resource group that
170
+ # contains the IoT hub.
171
+ # @param resource_name [String] The name of the IoT hub.
172
+ # @param certificate_name [String] The name of the certificate
173
+ # @param [Hash{String => String}] A hash of custom headers that will be added
174
+ # to the HTTP request.
175
+ #
176
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
177
+ #
178
+ def get_async(resource_group_name, resource_name, certificate_name, custom_headers:nil)
179
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
180
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
181
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
182
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
183
+ fail ArgumentError, 'certificate_name is nil' if certificate_name.nil?
184
+ fail ArgumentError, "'certificate_name' should satisfy the constraint - 'Pattern': '^[A-Za-z0-9-._]{1,64}$'" if !certificate_name.nil? && certificate_name.match(Regexp.new('^^[A-Za-z0-9-._]{1,64}$$')).nil?
185
+
186
+
187
+ request_headers = {}
188
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
189
+
190
+ # Set Headers
191
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
192
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
193
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}'
194
+
195
+ request_url = @base_url || @client.base_url
196
+
197
+ options = {
198
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
199
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name,'certificateName' => certificate_name},
200
+ query_params: {'api-version' => @client.api_version},
201
+ headers: request_headers.merge(custom_headers || {}),
202
+ base_url: request_url
203
+ }
204
+ promise = @client.make_request_async(:get, path_template, options)
205
+
206
+ promise = promise.then do |result|
207
+ http_response = result.response
208
+ status_code = http_response.status
209
+ response_content = http_response.body
210
+ unless status_code == 200
211
+ error_model = JSON.load(response_content)
212
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
213
+ end
214
+
215
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
216
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
217
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
218
+ # Deserialize Response
219
+ if status_code == 200
220
+ begin
221
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
222
+ result_mapper = Azure::IotHub::Mgmt::V2019_07_01_preview::Models::CertificateDescription.mapper()
223
+ result.body = @client.deserialize(result_mapper, parsed_response)
224
+ rescue Exception => e
225
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
226
+ end
227
+ end
228
+
229
+ result
230
+ end
231
+
232
+ promise.execute
233
+ end
234
+
235
+ #
236
+ # Upload the certificate to the IoT hub.
237
+ #
238
+ # Adds new or replaces existing certificate.
239
+ #
240
+ # @param resource_group_name [String] The name of the resource group that
241
+ # contains the IoT hub.
242
+ # @param resource_name [String] The name of the IoT hub.
243
+ # @param certificate_name [String] The name of the certificate
244
+ # @param certificate_description [CertificateBodyDescription] The certificate
245
+ # body.
246
+ # @param if_match [String] ETag of the Certificate. Do not specify for creating
247
+ # a brand new certificate. Required to update an existing certificate.
248
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
249
+ # will be added to the HTTP request.
250
+ #
251
+ # @return [CertificateDescription] operation results.
252
+ #
253
+ def create_or_update(resource_group_name, resource_name, certificate_name, certificate_description, if_match:nil, custom_headers:nil)
254
+ response = create_or_update_async(resource_group_name, resource_name, certificate_name, certificate_description, if_match:if_match, custom_headers:custom_headers).value!
255
+ response.body unless response.nil?
256
+ end
257
+
258
+ #
259
+ # Upload the certificate to the IoT hub.
260
+ #
261
+ # Adds new or replaces existing certificate.
262
+ #
263
+ # @param resource_group_name [String] The name of the resource group that
264
+ # contains the IoT hub.
265
+ # @param resource_name [String] The name of the IoT hub.
266
+ # @param certificate_name [String] The name of the certificate
267
+ # @param certificate_description [CertificateBodyDescription] The certificate
268
+ # body.
269
+ # @param if_match [String] ETag of the Certificate. Do not specify for creating
270
+ # a brand new certificate. Required to update an existing certificate.
271
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
272
+ # will be added to the HTTP request.
273
+ #
274
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
275
+ #
276
+ def create_or_update_with_http_info(resource_group_name, resource_name, certificate_name, certificate_description, if_match:nil, custom_headers:nil)
277
+ create_or_update_async(resource_group_name, resource_name, certificate_name, certificate_description, if_match:if_match, custom_headers:custom_headers).value!
278
+ end
279
+
280
+ #
281
+ # Upload the certificate to the IoT hub.
282
+ #
283
+ # Adds new or replaces existing certificate.
284
+ #
285
+ # @param resource_group_name [String] The name of the resource group that
286
+ # contains the IoT hub.
287
+ # @param resource_name [String] The name of the IoT hub.
288
+ # @param certificate_name [String] The name of the certificate
289
+ # @param certificate_description [CertificateBodyDescription] The certificate
290
+ # body.
291
+ # @param if_match [String] ETag of the Certificate. Do not specify for creating
292
+ # a brand new certificate. Required to update an existing certificate.
293
+ # @param [Hash{String => String}] A hash of custom headers that will be added
294
+ # to the HTTP request.
295
+ #
296
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
297
+ #
298
+ def create_or_update_async(resource_group_name, resource_name, certificate_name, certificate_description, if_match:nil, custom_headers:nil)
299
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
300
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
301
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
302
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
303
+ fail ArgumentError, 'certificate_name is nil' if certificate_name.nil?
304
+ fail ArgumentError, "'certificate_name' should satisfy the constraint - 'Pattern': '^[A-Za-z0-9-._]{1,64}$'" if !certificate_name.nil? && certificate_name.match(Regexp.new('^^[A-Za-z0-9-._]{1,64}$$')).nil?
305
+ fail ArgumentError, 'certificate_description is nil' if certificate_description.nil?
306
+
307
+
308
+ request_headers = {}
309
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
310
+
311
+ # Set Headers
312
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
313
+ request_headers['If-Match'] = if_match unless if_match.nil?
314
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
315
+
316
+ # Serialize Request
317
+ request_mapper = Azure::IotHub::Mgmt::V2019_07_01_preview::Models::CertificateBodyDescription.mapper()
318
+ request_content = @client.serialize(request_mapper, certificate_description)
319
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
320
+
321
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}'
322
+
323
+ request_url = @base_url || @client.base_url
324
+
325
+ options = {
326
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
327
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name,'certificateName' => certificate_name},
328
+ query_params: {'api-version' => @client.api_version},
329
+ body: request_content,
330
+ headers: request_headers.merge(custom_headers || {}),
331
+ base_url: request_url
332
+ }
333
+ promise = @client.make_request_async(:put, path_template, options)
334
+
335
+ promise = promise.then do |result|
336
+ http_response = result.response
337
+ status_code = http_response.status
338
+ response_content = http_response.body
339
+ unless status_code == 201 || status_code == 200
340
+ error_model = JSON.load(response_content)
341
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
342
+ end
343
+
344
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
345
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
346
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
347
+ # Deserialize Response
348
+ if status_code == 201
349
+ begin
350
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
351
+ result_mapper = Azure::IotHub::Mgmt::V2019_07_01_preview::Models::CertificateDescription.mapper()
352
+ result.body = @client.deserialize(result_mapper, parsed_response)
353
+ rescue Exception => e
354
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
355
+ end
356
+ end
357
+ # Deserialize Response
358
+ if status_code == 200
359
+ begin
360
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
361
+ result_mapper = Azure::IotHub::Mgmt::V2019_07_01_preview::Models::CertificateDescription.mapper()
362
+ result.body = @client.deserialize(result_mapper, parsed_response)
363
+ rescue Exception => e
364
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
365
+ end
366
+ end
367
+
368
+ result
369
+ end
370
+
371
+ promise.execute
372
+ end
373
+
374
+ #
375
+ # Delete an X509 certificate.
376
+ #
377
+ # Deletes an existing X509 certificate or does nothing if it does not exist.
378
+ #
379
+ # @param resource_group_name [String] The name of the resource group that
380
+ # contains the IoT hub.
381
+ # @param resource_name [String] The name of the IoT hub.
382
+ # @param certificate_name [String] The name of the certificate
383
+ # @param if_match [String] ETag of the Certificate.
384
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
385
+ # will be added to the HTTP request.
386
+ #
387
+ #
388
+ def delete(resource_group_name, resource_name, certificate_name, if_match, custom_headers:nil)
389
+ response = delete_async(resource_group_name, resource_name, certificate_name, if_match, custom_headers:custom_headers).value!
390
+ nil
391
+ end
392
+
393
+ #
394
+ # Delete an X509 certificate.
395
+ #
396
+ # Deletes an existing X509 certificate or does nothing if it does not exist.
397
+ #
398
+ # @param resource_group_name [String] The name of the resource group that
399
+ # contains the IoT hub.
400
+ # @param resource_name [String] The name of the IoT hub.
401
+ # @param certificate_name [String] The name of the certificate
402
+ # @param if_match [String] ETag of the Certificate.
403
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
404
+ # will be added to the HTTP request.
405
+ #
406
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
407
+ #
408
+ def delete_with_http_info(resource_group_name, resource_name, certificate_name, if_match, custom_headers:nil)
409
+ delete_async(resource_group_name, resource_name, certificate_name, if_match, custom_headers:custom_headers).value!
410
+ end
411
+
412
+ #
413
+ # Delete an X509 certificate.
414
+ #
415
+ # Deletes an existing X509 certificate or does nothing if it does not exist.
416
+ #
417
+ # @param resource_group_name [String] The name of the resource group that
418
+ # contains the IoT hub.
419
+ # @param resource_name [String] The name of the IoT hub.
420
+ # @param certificate_name [String] The name of the certificate
421
+ # @param if_match [String] ETag of the Certificate.
422
+ # @param [Hash{String => String}] A hash of custom headers that will be added
423
+ # to the HTTP request.
424
+ #
425
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
426
+ #
427
+ def delete_async(resource_group_name, resource_name, certificate_name, if_match, custom_headers:nil)
428
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
429
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
430
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
431
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
432
+ fail ArgumentError, 'certificate_name is nil' if certificate_name.nil?
433
+ fail ArgumentError, "'certificate_name' should satisfy the constraint - 'Pattern': '^[A-Za-z0-9-._]{1,64}$'" if !certificate_name.nil? && certificate_name.match(Regexp.new('^^[A-Za-z0-9-._]{1,64}$$')).nil?
434
+ fail ArgumentError, 'if_match is nil' if if_match.nil?
435
+
436
+
437
+ request_headers = {}
438
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
439
+
440
+ # Set Headers
441
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
442
+ request_headers['If-Match'] = if_match unless if_match.nil?
443
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
444
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}'
445
+
446
+ request_url = @base_url || @client.base_url
447
+
448
+ options = {
449
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
450
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name,'certificateName' => certificate_name},
451
+ query_params: {'api-version' => @client.api_version},
452
+ headers: request_headers.merge(custom_headers || {}),
453
+ base_url: request_url
454
+ }
455
+ promise = @client.make_request_async(:delete, path_template, options)
456
+
457
+ promise = promise.then do |result|
458
+ http_response = result.response
459
+ status_code = http_response.status
460
+ response_content = http_response.body
461
+ unless status_code == 200 || status_code == 204
462
+ error_model = JSON.load(response_content)
463
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
464
+ end
465
+
466
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
467
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
468
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
469
+
470
+ result
471
+ end
472
+
473
+ promise.execute
474
+ end
475
+
476
+ #
477
+ # Generate verification code for proof of possession flow.
478
+ #
479
+ # Generates verification code for proof of possession flow. The verification
480
+ # code will be used to generate a leaf certificate.
481
+ #
482
+ # @param resource_group_name [String] The name of the resource group that
483
+ # contains the IoT hub.
484
+ # @param resource_name [String] The name of the IoT hub.
485
+ # @param certificate_name [String] The name of the certificate
486
+ # @param if_match [String] ETag of the Certificate.
487
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
488
+ # will be added to the HTTP request.
489
+ #
490
+ # @return [CertificateWithNonceDescription] operation results.
491
+ #
492
+ def generate_verification_code(resource_group_name, resource_name, certificate_name, if_match, custom_headers:nil)
493
+ response = generate_verification_code_async(resource_group_name, resource_name, certificate_name, if_match, custom_headers:custom_headers).value!
494
+ response.body unless response.nil?
495
+ end
496
+
497
+ #
498
+ # Generate verification code for proof of possession flow.
499
+ #
500
+ # Generates verification code for proof of possession flow. The verification
501
+ # code will be used to generate a leaf certificate.
502
+ #
503
+ # @param resource_group_name [String] The name of the resource group that
504
+ # contains the IoT hub.
505
+ # @param resource_name [String] The name of the IoT hub.
506
+ # @param certificate_name [String] The name of the certificate
507
+ # @param if_match [String] ETag of the Certificate.
508
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
509
+ # will be added to the HTTP request.
510
+ #
511
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
512
+ #
513
+ def generate_verification_code_with_http_info(resource_group_name, resource_name, certificate_name, if_match, custom_headers:nil)
514
+ generate_verification_code_async(resource_group_name, resource_name, certificate_name, if_match, custom_headers:custom_headers).value!
515
+ end
516
+
517
+ #
518
+ # Generate verification code for proof of possession flow.
519
+ #
520
+ # Generates verification code for proof of possession flow. The verification
521
+ # code will be used to generate a leaf certificate.
522
+ #
523
+ # @param resource_group_name [String] The name of the resource group that
524
+ # contains the IoT hub.
525
+ # @param resource_name [String] The name of the IoT hub.
526
+ # @param certificate_name [String] The name of the certificate
527
+ # @param if_match [String] ETag of the Certificate.
528
+ # @param [Hash{String => String}] A hash of custom headers that will be added
529
+ # to the HTTP request.
530
+ #
531
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
532
+ #
533
+ def generate_verification_code_async(resource_group_name, resource_name, certificate_name, if_match, custom_headers:nil)
534
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
535
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
536
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
537
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
538
+ fail ArgumentError, 'certificate_name is nil' if certificate_name.nil?
539
+ fail ArgumentError, "'certificate_name' should satisfy the constraint - 'Pattern': '^[A-Za-z0-9-._]{1,64}$'" if !certificate_name.nil? && certificate_name.match(Regexp.new('^^[A-Za-z0-9-._]{1,64}$$')).nil?
540
+ fail ArgumentError, 'if_match is nil' if if_match.nil?
541
+
542
+
543
+ request_headers = {}
544
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
545
+
546
+ # Set Headers
547
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
548
+ request_headers['If-Match'] = if_match unless if_match.nil?
549
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
550
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}/generateVerificationCode'
551
+
552
+ request_url = @base_url || @client.base_url
553
+
554
+ options = {
555
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
556
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name,'certificateName' => certificate_name},
557
+ query_params: {'api-version' => @client.api_version},
558
+ headers: request_headers.merge(custom_headers || {}),
559
+ base_url: request_url
560
+ }
561
+ promise = @client.make_request_async(:post, path_template, options)
562
+
563
+ promise = promise.then do |result|
564
+ http_response = result.response
565
+ status_code = http_response.status
566
+ response_content = http_response.body
567
+ unless status_code == 200
568
+ error_model = JSON.load(response_content)
569
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
570
+ end
571
+
572
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
573
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
574
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
575
+ # Deserialize Response
576
+ if status_code == 200
577
+ begin
578
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
579
+ result_mapper = Azure::IotHub::Mgmt::V2019_07_01_preview::Models::CertificateWithNonceDescription.mapper()
580
+ result.body = @client.deserialize(result_mapper, parsed_response)
581
+ rescue Exception => e
582
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
583
+ end
584
+ end
585
+
586
+ result
587
+ end
588
+
589
+ promise.execute
590
+ end
591
+
592
+ #
593
+ # Verify certificate's private key possession.
594
+ #
595
+ # Verifies the certificate's private key possession by providing the leaf cert
596
+ # issued by the verifying pre uploaded certificate.
597
+ #
598
+ # @param resource_group_name [String] The name of the resource group that
599
+ # contains the IoT hub.
600
+ # @param resource_name [String] The name of the IoT hub.
601
+ # @param certificate_name [String] The name of the certificate
602
+ # @param certificate_verification_body [CertificateVerificationDescription] The
603
+ # name of the certificate
604
+ # @param if_match [String] ETag of the Certificate.
605
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
606
+ # will be added to the HTTP request.
607
+ #
608
+ # @return [CertificateDescription] operation results.
609
+ #
610
+ def verify(resource_group_name, resource_name, certificate_name, certificate_verification_body, if_match, custom_headers:nil)
611
+ response = verify_async(resource_group_name, resource_name, certificate_name, certificate_verification_body, if_match, custom_headers:custom_headers).value!
612
+ response.body unless response.nil?
613
+ end
614
+
615
+ #
616
+ # Verify certificate's private key possession.
617
+ #
618
+ # Verifies the certificate's private key possession by providing the leaf cert
619
+ # issued by the verifying pre uploaded certificate.
620
+ #
621
+ # @param resource_group_name [String] The name of the resource group that
622
+ # contains the IoT hub.
623
+ # @param resource_name [String] The name of the IoT hub.
624
+ # @param certificate_name [String] The name of the certificate
625
+ # @param certificate_verification_body [CertificateVerificationDescription] The
626
+ # name of the certificate
627
+ # @param if_match [String] ETag of the Certificate.
628
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
629
+ # will be added to the HTTP request.
630
+ #
631
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
632
+ #
633
+ def verify_with_http_info(resource_group_name, resource_name, certificate_name, certificate_verification_body, if_match, custom_headers:nil)
634
+ verify_async(resource_group_name, resource_name, certificate_name, certificate_verification_body, if_match, custom_headers:custom_headers).value!
635
+ end
636
+
637
+ #
638
+ # Verify certificate's private key possession.
639
+ #
640
+ # Verifies the certificate's private key possession by providing the leaf cert
641
+ # issued by the verifying pre uploaded certificate.
642
+ #
643
+ # @param resource_group_name [String] The name of the resource group that
644
+ # contains the IoT hub.
645
+ # @param resource_name [String] The name of the IoT hub.
646
+ # @param certificate_name [String] The name of the certificate
647
+ # @param certificate_verification_body [CertificateVerificationDescription] The
648
+ # name of the certificate
649
+ # @param if_match [String] ETag of the Certificate.
650
+ # @param [Hash{String => String}] A hash of custom headers that will be added
651
+ # to the HTTP request.
652
+ #
653
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
654
+ #
655
+ def verify_async(resource_group_name, resource_name, certificate_name, certificate_verification_body, if_match, custom_headers:nil)
656
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
657
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
658
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
659
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
660
+ fail ArgumentError, 'certificate_name is nil' if certificate_name.nil?
661
+ fail ArgumentError, "'certificate_name' should satisfy the constraint - 'Pattern': '^[A-Za-z0-9-._]{1,64}$'" if !certificate_name.nil? && certificate_name.match(Regexp.new('^^[A-Za-z0-9-._]{1,64}$$')).nil?
662
+ fail ArgumentError, 'certificate_verification_body is nil' if certificate_verification_body.nil?
663
+ fail ArgumentError, 'if_match is nil' if if_match.nil?
664
+
665
+
666
+ request_headers = {}
667
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
668
+
669
+ # Set Headers
670
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
671
+ request_headers['If-Match'] = if_match unless if_match.nil?
672
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
673
+
674
+ # Serialize Request
675
+ request_mapper = Azure::IotHub::Mgmt::V2019_07_01_preview::Models::CertificateVerificationDescription.mapper()
676
+ request_content = @client.serialize(request_mapper, certificate_verification_body)
677
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
678
+
679
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}/verify'
680
+
681
+ request_url = @base_url || @client.base_url
682
+
683
+ options = {
684
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
685
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name,'certificateName' => certificate_name},
686
+ query_params: {'api-version' => @client.api_version},
687
+ body: request_content,
688
+ headers: request_headers.merge(custom_headers || {}),
689
+ base_url: request_url
690
+ }
691
+ promise = @client.make_request_async(:post, path_template, options)
692
+
693
+ promise = promise.then do |result|
694
+ http_response = result.response
695
+ status_code = http_response.status
696
+ response_content = http_response.body
697
+ unless status_code == 200
698
+ error_model = JSON.load(response_content)
699
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
700
+ end
701
+
702
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
703
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
704
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
705
+ # Deserialize Response
706
+ if status_code == 200
707
+ begin
708
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
709
+ result_mapper = Azure::IotHub::Mgmt::V2019_07_01_preview::Models::CertificateDescription.mapper()
710
+ result.body = @client.deserialize(result_mapper, parsed_response)
711
+ rescue Exception => e
712
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
713
+ end
714
+ end
715
+
716
+ result
717
+ end
718
+
719
+ promise.execute
720
+ end
721
+
722
+ end
723
+ end