azure_mgmt_security 0.17.2 → 0.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (249) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2015-06-01-preview/generated/azure_mgmt_security.rb +109 -0
  3. data/lib/2015-06-01-preview/generated/azure_mgmt_security/adaptive_application_controls.rb +313 -0
  4. data/lib/2015-06-01-preview/generated/azure_mgmt_security/adaptive_network_hardenings.rb +539 -0
  5. data/lib/2015-06-01-preview/generated/azure_mgmt_security/alerts.rb +1280 -0
  6. data/lib/2015-06-01-preview/generated/azure_mgmt_security/allowed_connections.rb +535 -0
  7. data/lib/2015-06-01-preview/generated/azure_mgmt_security/discovered_security_solutions.rb +532 -0
  8. data/lib/2015-06-01-preview/generated/azure_mgmt_security/external_security_solutions.rb +525 -0
  9. data/lib/2015-06-01-preview/generated/azure_mgmt_security/jit_network_access_policies.rb +1295 -0
  10. data/lib/2015-06-01-preview/generated/azure_mgmt_security/locations.rb +330 -0
  11. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/aad_connectivity_state.rb +17 -0
  12. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/aad_connectivity_state1.rb +48 -0
  13. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/aad_external_security_solution.rb +99 -0
  14. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/aad_solution_properties.rb +83 -0
  15. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/adaptive_network_hardening.rb +116 -0
  16. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/adaptive_network_hardening_enforce_request.rb +77 -0
  17. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/adaptive_network_hardenings_list.rb +99 -0
  18. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/alert.rb +375 -0
  19. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/alert_confidence_reason.rb +59 -0
  20. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/alert_entity.rb +66 -0
  21. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/alert_list.rb +99 -0
  22. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/allowed_connections_list.rb +100 -0
  23. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/allowed_connections_resource.rb +118 -0
  24. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/app_whitelisting_group.rb +191 -0
  25. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/app_whitelisting_groups.rb +56 -0
  26. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/app_whitelisting_issue_summary.rb +61 -0
  27. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/app_whitelisting_put_group_data.rb +86 -0
  28. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/asc_location.rb +73 -0
  29. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/asc_location_list.rb +100 -0
  30. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/ata_external_security_solution.rb +98 -0
  31. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/ata_solution_properties.rb +87 -0
  32. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/cef_external_security_solution.rb +98 -0
  33. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/cef_solution_properties.rb +109 -0
  34. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/connectable_resource.rb +91 -0
  35. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/connected_resource.rb +71 -0
  36. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/connected_workspace.rb +47 -0
  37. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/connection_type.rb +16 -0
  38. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/direction.rb +16 -0
  39. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/discovered_security_solution.rb +129 -0
  40. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/discovered_security_solution_list.rb +99 -0
  41. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/effective_network_security_groups.rb +66 -0
  42. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/external_security_solution.rb +98 -0
  43. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/external_security_solution_kind.rb +17 -0
  44. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/external_security_solution_kind1.rb +47 -0
  45. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/external_security_solution_list.rb +101 -0
  46. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/external_security_solution_properties.rb +88 -0
  47. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/jit_network_access_policies_list.rb +99 -0
  48. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/jit_network_access_policy.rb +149 -0
  49. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/jit_network_access_policy_initiate_port.rb +70 -0
  50. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/jit_network_access_policy_initiate_request.rb +57 -0
  51. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/jit_network_access_policy_initiate_virtual_machine.rb +70 -0
  52. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/jit_network_access_policy_virtual_machine.rb +81 -0
  53. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/jit_network_access_port_rule.rb +103 -0
  54. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/jit_network_access_request.rb +78 -0
  55. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/jit_network_access_request_port.rb +128 -0
  56. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/jit_network_access_request_virtual_machine.rb +69 -0
  57. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/kind.rb +46 -0
  58. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/location.rb +47 -0
  59. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/operation.rb +71 -0
  60. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/operation_display.rb +84 -0
  61. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/operation_list.rb +99 -0
  62. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/path_recommendation.rb +156 -0
  63. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/protocol.rb +17 -0
  64. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/publisher_info.rb +84 -0
  65. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/reported_severity.rb +18 -0
  66. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/resource.rb +80 -0
  67. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/rule.rb +111 -0
  68. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/security_family.rb +18 -0
  69. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/security_task.rb +123 -0
  70. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/security_task_list.rb +100 -0
  71. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/security_task_parameters.rb +67 -0
  72. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/status.rb +16 -0
  73. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/status_reason.rb +17 -0
  74. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/topology_list.rb +100 -0
  75. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/topology_resource.rb +118 -0
  76. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/topology_single_resource.rb +154 -0
  77. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/topology_single_resource_child.rb +49 -0
  78. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/topology_single_resource_parent.rb +49 -0
  79. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/transport_protocol.rb +16 -0
  80. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/user_recommendation.rb +58 -0
  81. data/lib/2015-06-01-preview/generated/azure_mgmt_security/models/vm_recommendation.rb +69 -0
  82. data/lib/2015-06-01-preview/generated/azure_mgmt_security/module_definition.rb +9 -0
  83. data/lib/2015-06-01-preview/generated/azure_mgmt_security/operations.rb +218 -0
  84. data/lib/2015-06-01-preview/generated/azure_mgmt_security/security_center.rb +175 -0
  85. data/lib/2015-06-01-preview/generated/azure_mgmt_security/tasks.rb +1055 -0
  86. data/lib/2015-06-01-preview/generated/azure_mgmt_security/topology.rb +530 -0
  87. data/lib/2017-08-01-preview/generated/azure_mgmt_security.rb +72 -13
  88. data/lib/2017-08-01-preview/generated/azure_mgmt_security/advanced_threat_protection.rb +222 -0
  89. data/lib/2017-08-01-preview/generated/azure_mgmt_security/auto_provisioning_settings.rb +12 -4
  90. data/lib/2017-08-01-preview/generated/azure_mgmt_security/compliances.rb +9 -3
  91. data/lib/2017-08-01-preview/generated/azure_mgmt_security/device_security_groups.rb +523 -0
  92. data/lib/2017-08-01-preview/generated/azure_mgmt_security/information_protection_policies.rb +447 -0
  93. data/lib/2017-08-01-preview/generated/azure_mgmt_security/io_tsecurity_solutions.rb +230 -0
  94. data/lib/2017-08-01-preview/generated/azure_mgmt_security/io_tsecurity_solutions_analytics.rb +227 -0
  95. data/lib/2017-08-01-preview/generated/azure_mgmt_security/io_tsecurity_solutions_analytics_aggregated_alert.rb +224 -0
  96. data/lib/2017-08-01-preview/generated/azure_mgmt_security/io_tsecurity_solutions_analytics_aggregated_alerts.rb +243 -0
  97. data/lib/2017-08-01-preview/generated/azure_mgmt_security/io_tsecurity_solutions_analytics_recommendation.rb +133 -0
  98. data/lib/2017-08-01-preview/generated/azure_mgmt_security/io_tsecurity_solutions_analytics_recommendations.rb +243 -0
  99. data/lib/2017-08-01-preview/generated/azure_mgmt_security/io_tsecurity_solutions_resource_group.rb +242 -0
  100. data/lib/2017-08-01-preview/generated/azure_mgmt_security/iot_security_solution.rb +459 -0
  101. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/advanced_threat_protection_setting.rb +74 -0
  102. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/allowlist_custom_alert_rule.rb +99 -0
  103. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/asc_location.rb +73 -0
  104. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/custom_alert_rule.rb +81 -0
  105. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/data_export_setting.rb +81 -0
  106. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/data_source.rb +15 -0
  107. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/denylist_custom_alert_rule.rb +99 -0
  108. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/device_security_group.rb +146 -0
  109. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/device_security_group_list.rb +100 -0
  110. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/export_data.rb +15 -0
  111. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/information_protection_keyword.rb +80 -0
  112. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/information_protection_policy.rb +116 -0
  113. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/information_protection_policy_list.rb +100 -0
  114. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/information_type.rb +114 -0
  115. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/io_tsecurity_aggregated_alert.rb +238 -0
  116. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/io_tsecurity_aggregated_alert_list.rb +100 -0
  117. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/io_tsecurity_aggregated_recommendation.rb +212 -0
  118. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/io_tsecurity_aggregated_recommendation_list.rb +101 -0
  119. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/io_tsecurity_alerted_device.rb +60 -0
  120. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/io_tsecurity_alerted_devices_list.rb +68 -0
  121. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/io_tsecurity_device_alert.rb +73 -0
  122. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/io_tsecurity_device_alerts_list.rb +67 -0
  123. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/io_tsecurity_device_recommendation.rb +73 -0
  124. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/io_tsecurity_device_recommendations_list.rb +68 -0
  125. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/io_tsecurity_solution_analytics_model.rb +149 -0
  126. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/io_tsecurity_solution_analytics_model_list.rb +68 -0
  127. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/io_tsecurity_solution_analytics_model_properties_devices_metrics_item.rb +61 -0
  128. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/io_tsecurity_solution_model.rb +248 -0
  129. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/io_tsecurity_solutions_list.rb +99 -0
  130. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/io_tseverity_metrics.rb +68 -0
  131. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/list_custom_alert_rule.rb +82 -0
  132. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/recommendation_config_status.rb +16 -0
  133. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/recommendation_configuration_properties.rb +79 -0
  134. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/recommendation_type.rb +30 -0
  135. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/reported_severity.rb +18 -0
  136. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/security_contact.rb +1 -1
  137. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/security_solution_status.rb +16 -0
  138. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/sensitivity_label.rb +68 -0
  139. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/setting.rb +70 -0
  140. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/setting_kind.rb +16 -0
  141. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/setting_resource.rb +75 -0
  142. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/settings_list.rb +99 -0
  143. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/tags_resource.rb +55 -0
  144. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/threshold_custom_alert_rule.rb +92 -0
  145. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/time_window_custom_alert_rule.rb +115 -0
  146. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/update_iot_security_solution_data.rb +84 -0
  147. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/user_defined_resources_properties.rb +68 -0
  148. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/value_type.rb +16 -0
  149. data/lib/2017-08-01-preview/generated/azure_mgmt_security/pricings.rb +23 -7
  150. data/lib/2017-08-01-preview/generated/azure_mgmt_security/security_center.rb +200 -0
  151. data/lib/2017-08-01-preview/generated/azure_mgmt_security/security_contacts.rb +18 -6
  152. data/lib/2017-08-01-preview/generated/azure_mgmt_security/settings.rb +420 -0
  153. data/lib/2017-08-01-preview/generated/azure_mgmt_security/workspace_settings.rb +38 -16
  154. data/lib/2017-08-01/generated/azure_mgmt_security.rb +33 -0
  155. data/lib/2017-08-01/generated/azure_mgmt_security/compliance_results.rb +329 -0
  156. data/lib/2017-08-01/generated/azure_mgmt_security/models/asc_location.rb +73 -0
  157. data/lib/2017-08-01/generated/azure_mgmt_security/models/compliance_result.rb +76 -0
  158. data/lib/2017-08-01/generated/azure_mgmt_security/models/compliance_result_list.rb +99 -0
  159. data/lib/2017-08-01/generated/azure_mgmt_security/models/resource.rb +80 -0
  160. data/lib/2017-08-01/generated/azure_mgmt_security/models/resource_status.rb +18 -0
  161. data/lib/2017-08-01/generated/azure_mgmt_security/module_definition.rb +9 -0
  162. data/lib/2017-08-01/generated/azure_mgmt_security/security_center.rb +128 -0
  163. data/lib/2018-06-01/generated/azure_mgmt_security.rb +33 -0
  164. data/lib/2018-06-01/generated/azure_mgmt_security/models/asc_location.rb +73 -0
  165. data/lib/2018-06-01/generated/azure_mgmt_security/models/pricing.rb +90 -0
  166. data/lib/2018-06-01/generated/azure_mgmt_security/models/pricing_list.rb +55 -0
  167. data/lib/2018-06-01/generated/azure_mgmt_security/models/pricing_tier.rb +16 -0
  168. data/lib/2018-06-01/generated/azure_mgmt_security/models/resource.rb +80 -0
  169. data/lib/2018-06-01/generated/azure_mgmt_security/module_definition.rb +9 -0
  170. data/lib/2018-06-01/generated/azure_mgmt_security/pricings.rb +332 -0
  171. data/lib/{2017-08-01-preview/generated/azure_mgmt_security/security_management_client.rb → 2018-06-01/generated/azure_mgmt_security/security_center.rb} +5 -21
  172. data/lib/2019-01-01-preview/generated/azure_mgmt_security.rb +42 -0
  173. data/lib/2019-01-01-preview/generated/azure_mgmt_security/models/asc_location.rb +73 -0
  174. data/lib/2019-01-01-preview/generated/azure_mgmt_security/models/regulatory_compliance_assessment.rb +166 -0
  175. data/lib/2019-01-01-preview/generated/azure_mgmt_security/models/regulatory_compliance_assessment_list.rb +99 -0
  176. data/lib/2019-01-01-preview/generated/azure_mgmt_security/models/regulatory_compliance_control.rb +126 -0
  177. data/lib/2019-01-01-preview/generated/azure_mgmt_security/models/regulatory_compliance_control_list.rb +100 -0
  178. data/lib/2019-01-01-preview/generated/azure_mgmt_security/models/regulatory_compliance_standard.rb +127 -0
  179. data/lib/2019-01-01-preview/generated/azure_mgmt_security/models/regulatory_compliance_standard_list.rb +99 -0
  180. data/lib/2019-01-01-preview/generated/azure_mgmt_security/models/resource.rb +80 -0
  181. data/lib/2019-01-01-preview/generated/azure_mgmt_security/models/server_vulnerability_assessment.rb +76 -0
  182. data/lib/2019-01-01-preview/generated/azure_mgmt_security/models/server_vulnerability_assessments_list.rb +55 -0
  183. data/lib/2019-01-01-preview/generated/azure_mgmt_security/models/state.rb +18 -0
  184. data/lib/2019-01-01-preview/generated/azure_mgmt_security/module_definition.rb +9 -0
  185. data/lib/2019-01-01-preview/generated/azure_mgmt_security/regulatory_compliance_assessments.rb +359 -0
  186. data/lib/2019-01-01-preview/generated/azure_mgmt_security/regulatory_compliance_controls.rb +343 -0
  187. data/lib/2019-01-01-preview/generated/azure_mgmt_security/regulatory_compliance_standards.rb +320 -0
  188. data/lib/2019-01-01-preview/generated/azure_mgmt_security/security_center.rb +145 -0
  189. data/lib/2019-01-01-preview/generated/azure_mgmt_security/server_vulnerability_assessment_operations.rb +462 -0
  190. data/lib/2019-01-01/generated/azure_mgmt_security.rb +41 -0
  191. data/lib/2019-01-01/generated/azure_mgmt_security/alerts.rb +1280 -0
  192. data/lib/2019-01-01/generated/azure_mgmt_security/models/alert.rb +375 -0
  193. data/lib/2019-01-01/generated/azure_mgmt_security/models/alert_confidence_reason.rb +59 -0
  194. data/lib/2019-01-01/generated/azure_mgmt_security/models/alert_entity.rb +66 -0
  195. data/lib/2019-01-01/generated/azure_mgmt_security/models/alert_list.rb +99 -0
  196. data/lib/2019-01-01/generated/azure_mgmt_security/models/asc_location.rb +73 -0
  197. data/lib/2019-01-01/generated/azure_mgmt_security/models/data_export_setting.rb +81 -0
  198. data/lib/2019-01-01/generated/azure_mgmt_security/models/reported_severity.rb +18 -0
  199. data/lib/2019-01-01/generated/azure_mgmt_security/models/resource.rb +80 -0
  200. data/lib/2019-01-01/generated/azure_mgmt_security/models/setting.rb +70 -0
  201. data/lib/2019-01-01/generated/azure_mgmt_security/models/setting_kind.rb +16 -0
  202. data/lib/2019-01-01/generated/azure_mgmt_security/models/setting_resource.rb +75 -0
  203. data/lib/2019-01-01/generated/azure_mgmt_security/models/settings_list.rb +99 -0
  204. data/lib/2019-01-01/generated/azure_mgmt_security/module_definition.rb +9 -0
  205. data/lib/2019-01-01/generated/azure_mgmt_security/security_center.rb +139 -0
  206. data/lib/2019-01-01/generated/azure_mgmt_security/settings.rb +420 -0
  207. data/lib/2019-08-01/generated/azure_mgmt_security.rb +63 -0
  208. data/lib/2019-08-01/generated/azure_mgmt_security/io_tsecurity_solutions.rb +230 -0
  209. data/lib/2019-08-01/generated/azure_mgmt_security/io_tsecurity_solutions_analytics.rb +227 -0
  210. data/lib/2019-08-01/generated/azure_mgmt_security/io_tsecurity_solutions_analytics_aggregated_alert.rb +224 -0
  211. data/lib/2019-08-01/generated/azure_mgmt_security/io_tsecurity_solutions_analytics_aggregated_alerts.rb +243 -0
  212. data/lib/2019-08-01/generated/azure_mgmt_security/io_tsecurity_solutions_analytics_recommendation.rb +133 -0
  213. data/lib/2019-08-01/generated/azure_mgmt_security/io_tsecurity_solutions_analytics_recommendations.rb +243 -0
  214. data/lib/2019-08-01/generated/azure_mgmt_security/io_tsecurity_solutions_resource_group.rb +242 -0
  215. data/lib/2019-08-01/generated/azure_mgmt_security/iot_security_solution.rb +459 -0
  216. data/lib/2019-08-01/generated/azure_mgmt_security/models/asc_location.rb +73 -0
  217. data/lib/2019-08-01/generated/azure_mgmt_security/models/data_source.rb +15 -0
  218. data/lib/2019-08-01/generated/azure_mgmt_security/models/export_data.rb +15 -0
  219. data/lib/2019-08-01/generated/azure_mgmt_security/models/io_tsecurity_aggregated_alert.rb +238 -0
  220. data/lib/2019-08-01/generated/azure_mgmt_security/models/io_tsecurity_aggregated_alert_list.rb +100 -0
  221. data/lib/2019-08-01/generated/azure_mgmt_security/models/io_tsecurity_aggregated_recommendation.rb +212 -0
  222. data/lib/2019-08-01/generated/azure_mgmt_security/models/io_tsecurity_aggregated_recommendation_list.rb +101 -0
  223. data/lib/2019-08-01/generated/azure_mgmt_security/models/io_tsecurity_alerted_device.rb +60 -0
  224. data/lib/2019-08-01/generated/azure_mgmt_security/models/io_tsecurity_alerted_devices_list.rb +56 -0
  225. data/lib/2019-08-01/generated/azure_mgmt_security/models/io_tsecurity_device_alert.rb +73 -0
  226. data/lib/2019-08-01/generated/azure_mgmt_security/models/io_tsecurity_device_alerts_list.rb +67 -0
  227. data/lib/2019-08-01/generated/azure_mgmt_security/models/io_tsecurity_device_recommendation.rb +73 -0
  228. data/lib/2019-08-01/generated/azure_mgmt_security/models/io_tsecurity_device_recommendations_list.rb +56 -0
  229. data/lib/2019-08-01/generated/azure_mgmt_security/models/io_tsecurity_solution_analytics_model.rb +149 -0
  230. data/lib/2019-08-01/generated/azure_mgmt_security/models/io_tsecurity_solution_analytics_model_list.rb +68 -0
  231. data/lib/2019-08-01/generated/azure_mgmt_security/models/io_tsecurity_solution_analytics_model_properties_devices_metrics_item.rb +61 -0
  232. data/lib/2019-08-01/generated/azure_mgmt_security/models/io_tsecurity_solution_model.rb +248 -0
  233. data/lib/2019-08-01/generated/azure_mgmt_security/models/io_tsecurity_solutions_list.rb +99 -0
  234. data/lib/2019-08-01/generated/azure_mgmt_security/models/io_tseverity_metrics.rb +68 -0
  235. data/lib/2019-08-01/generated/azure_mgmt_security/models/recommendation_config_status.rb +16 -0
  236. data/lib/2019-08-01/generated/azure_mgmt_security/models/recommendation_configuration_properties.rb +79 -0
  237. data/lib/2019-08-01/generated/azure_mgmt_security/models/recommendation_type.rb +30 -0
  238. data/lib/2019-08-01/generated/azure_mgmt_security/models/reported_severity.rb +18 -0
  239. data/lib/2019-08-01/generated/azure_mgmt_security/models/resource.rb +80 -0
  240. data/lib/2019-08-01/generated/azure_mgmt_security/models/security_solution_status.rb +16 -0
  241. data/lib/2019-08-01/generated/azure_mgmt_security/models/tags_resource.rb +55 -0
  242. data/lib/2019-08-01/generated/azure_mgmt_security/models/update_iot_security_solution_data.rb +84 -0
  243. data/lib/2019-08-01/generated/azure_mgmt_security/models/user_defined_resources_properties.rb +68 -0
  244. data/lib/2019-08-01/generated/azure_mgmt_security/module_definition.rb +9 -0
  245. data/lib/2019-08-01/generated/azure_mgmt_security/security_center.rb +164 -0
  246. data/lib/azure_mgmt_security.rb +6 -0
  247. data/lib/profiles/latest/modules/security_profile_module.rb +652 -40
  248. data/lib/version.rb +1 -1
  249. metadata +242 -6
@@ -20,29 +20,88 @@ require '2017-08-01-preview/generated/azure_mgmt_security/module_definition'
20
20
  require 'ms_rest_azure'
21
21
 
22
22
  module Azure::Security::Mgmt::V2017_08_01_preview
23
+ autoload :AdvancedThreatProtection, '2017-08-01-preview/generated/azure_mgmt_security/advanced_threat_protection.rb'
24
+ autoload :AutoProvisioningSettings, '2017-08-01-preview/generated/azure_mgmt_security/auto_provisioning_settings.rb'
25
+ autoload :Compliances, '2017-08-01-preview/generated/azure_mgmt_security/compliances.rb'
26
+ autoload :DeviceSecurityGroups, '2017-08-01-preview/generated/azure_mgmt_security/device_security_groups.rb'
27
+ autoload :InformationProtectionPolicies, '2017-08-01-preview/generated/azure_mgmt_security/information_protection_policies.rb'
28
+ autoload :IoTSecuritySolutionsAnalytics, '2017-08-01-preview/generated/azure_mgmt_security/io_tsecurity_solutions_analytics.rb'
29
+ autoload :IoTSecuritySolutionsAnalyticsAggregatedAlerts, '2017-08-01-preview/generated/azure_mgmt_security/io_tsecurity_solutions_analytics_aggregated_alerts.rb'
30
+ autoload :IoTSecuritySolutionsAnalyticsAggregatedAlert, '2017-08-01-preview/generated/azure_mgmt_security/io_tsecurity_solutions_analytics_aggregated_alert.rb'
31
+ autoload :IoTSecuritySolutionsAnalyticsRecommendation, '2017-08-01-preview/generated/azure_mgmt_security/io_tsecurity_solutions_analytics_recommendation.rb'
32
+ autoload :IoTSecuritySolutionsAnalyticsRecommendations, '2017-08-01-preview/generated/azure_mgmt_security/io_tsecurity_solutions_analytics_recommendations.rb'
33
+ autoload :IoTSecuritySolutions, '2017-08-01-preview/generated/azure_mgmt_security/io_tsecurity_solutions.rb'
34
+ autoload :IoTSecuritySolutionsResourceGroup, '2017-08-01-preview/generated/azure_mgmt_security/io_tsecurity_solutions_resource_group.rb'
35
+ autoload :IotSecuritySolution, '2017-08-01-preview/generated/azure_mgmt_security/iot_security_solution.rb'
23
36
  autoload :Pricings, '2017-08-01-preview/generated/azure_mgmt_security/pricings.rb'
24
37
  autoload :SecurityContacts, '2017-08-01-preview/generated/azure_mgmt_security/security_contacts.rb'
38
+ autoload :Settings, '2017-08-01-preview/generated/azure_mgmt_security/settings.rb'
25
39
  autoload :WorkspaceSettings, '2017-08-01-preview/generated/azure_mgmt_security/workspace_settings.rb'
26
- autoload :AutoProvisioningSettings, '2017-08-01-preview/generated/azure_mgmt_security/auto_provisioning_settings.rb'
27
- autoload :Compliances, '2017-08-01-preview/generated/azure_mgmt_security/compliances.rb'
28
- autoload :SecurityManagementClient, '2017-08-01-preview/generated/azure_mgmt_security/security_management_client.rb'
40
+ autoload :SecurityCenter, '2017-08-01-preview/generated/azure_mgmt_security/security_center.rb'
29
41
 
30
42
  module Models
31
- autoload :AutoProvisioningSettingList, '2017-08-01-preview/generated/azure_mgmt_security/models/auto_provisioning_setting_list.rb'
32
- autoload :PricingList, '2017-08-01-preview/generated/azure_mgmt_security/models/pricing_list.rb'
33
- autoload :ComplianceSegment, '2017-08-01-preview/generated/azure_mgmt_security/models/compliance_segment.rb'
34
- autoload :SecurityContactList, '2017-08-01-preview/generated/azure_mgmt_security/models/security_contact_list.rb'
35
- autoload :ComplianceList, '2017-08-01-preview/generated/azure_mgmt_security/models/compliance_list.rb'
43
+ autoload :IoTSecurityAlertedDevicesList, '2017-08-01-preview/generated/azure_mgmt_security/models/io_tsecurity_alerted_devices_list.rb'
44
+ autoload :IoTSecurityDeviceAlert, '2017-08-01-preview/generated/azure_mgmt_security/models/io_tsecurity_device_alert.rb'
45
+ autoload :InformationProtectionKeyword, '2017-08-01-preview/generated/azure_mgmt_security/models/information_protection_keyword.rb'
36
46
  autoload :Resource, '2017-08-01-preview/generated/azure_mgmt_security/models/resource.rb'
47
+ autoload :InformationType, '2017-08-01-preview/generated/azure_mgmt_security/models/information_type.rb'
37
48
  autoload :WorkspaceSettingList, '2017-08-01-preview/generated/azure_mgmt_security/models/workspace_setting_list.rb'
38
- autoload :SecurityContact, '2017-08-01-preview/generated/azure_mgmt_security/models/security_contact.rb'
39
- autoload :Pricing, '2017-08-01-preview/generated/azure_mgmt_security/models/pricing.rb'
40
- autoload :WorkspaceSetting, '2017-08-01-preview/generated/azure_mgmt_security/models/workspace_setting.rb'
49
+ autoload :UserDefinedResourcesProperties, '2017-08-01-preview/generated/azure_mgmt_security/models/user_defined_resources_properties.rb'
50
+ autoload :ComplianceSegment, '2017-08-01-preview/generated/azure_mgmt_security/models/compliance_segment.rb'
51
+ autoload :InformationProtectionPolicyList, '2017-08-01-preview/generated/azure_mgmt_security/models/information_protection_policy_list.rb'
52
+ autoload :ComplianceList, '2017-08-01-preview/generated/azure_mgmt_security/models/compliance_list.rb'
53
+ autoload :IoTSeverityMetrics, '2017-08-01-preview/generated/azure_mgmt_security/models/io_tseverity_metrics.rb'
54
+ autoload :TimeWindowCustomAlertRule, '2017-08-01-preview/generated/azure_mgmt_security/models/time_window_custom_alert_rule.rb'
55
+ autoload :IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem, '2017-08-01-preview/generated/azure_mgmt_security/models/io_tsecurity_solution_analytics_model_properties_devices_metrics_item.rb'
56
+ autoload :IoTSecuritySolutionsList, '2017-08-01-preview/generated/azure_mgmt_security/models/io_tsecurity_solutions_list.rb'
57
+ autoload :IoTSecurityAlertedDevice, '2017-08-01-preview/generated/azure_mgmt_security/models/io_tsecurity_alerted_device.rb'
58
+ autoload :DeviceSecurityGroupList, '2017-08-01-preview/generated/azure_mgmt_security/models/device_security_group_list.rb'
59
+ autoload :CustomAlertRule, '2017-08-01-preview/generated/azure_mgmt_security/models/custom_alert_rule.rb'
60
+ autoload :IoTSecurityAggregatedRecommendation, '2017-08-01-preview/generated/azure_mgmt_security/models/io_tsecurity_aggregated_recommendation.rb'
61
+ autoload :SensitivityLabel, '2017-08-01-preview/generated/azure_mgmt_security/models/sensitivity_label.rb'
62
+ autoload :TagsResource, '2017-08-01-preview/generated/azure_mgmt_security/models/tags_resource.rb'
63
+ autoload :AutoProvisioningSettingList, '2017-08-01-preview/generated/azure_mgmt_security/models/auto_provisioning_setting_list.rb'
64
+ autoload :IoTSecurityDeviceAlertsList, '2017-08-01-preview/generated/azure_mgmt_security/models/io_tsecurity_device_alerts_list.rb'
65
+ autoload :SecurityContactList, '2017-08-01-preview/generated/azure_mgmt_security/models/security_contact_list.rb'
66
+ autoload :IoTSecurityDeviceRecommendation, '2017-08-01-preview/generated/azure_mgmt_security/models/io_tsecurity_device_recommendation.rb'
67
+ autoload :IoTSecuritySolutionModel, '2017-08-01-preview/generated/azure_mgmt_security/models/io_tsecurity_solution_model.rb'
68
+ autoload :IoTSecurityDeviceRecommendationsList, '2017-08-01-preview/generated/azure_mgmt_security/models/io_tsecurity_device_recommendations_list.rb'
69
+ autoload :IoTSecurityAggregatedRecommendationList, '2017-08-01-preview/generated/azure_mgmt_security/models/io_tsecurity_aggregated_recommendation_list.rb'
70
+ autoload :PricingList, '2017-08-01-preview/generated/azure_mgmt_security/models/pricing_list.rb'
71
+ autoload :IoTSecuritySolutionAnalyticsModelList, '2017-08-01-preview/generated/azure_mgmt_security/models/io_tsecurity_solution_analytics_model_list.rb'
72
+ autoload :SettingsList, '2017-08-01-preview/generated/azure_mgmt_security/models/settings_list.rb'
73
+ autoload :IoTSecurityAggregatedAlert, '2017-08-01-preview/generated/azure_mgmt_security/models/io_tsecurity_aggregated_alert.rb'
74
+ autoload :RecommendationConfigurationProperties, '2017-08-01-preview/generated/azure_mgmt_security/models/recommendation_configuration_properties.rb'
75
+ autoload :IoTSecurityAggregatedAlertList, '2017-08-01-preview/generated/azure_mgmt_security/models/io_tsecurity_aggregated_alert_list.rb'
76
+ autoload :AdvancedThreatProtectionSetting, '2017-08-01-preview/generated/azure_mgmt_security/models/advanced_threat_protection_setting.rb'
77
+ autoload :AscLocation, '2017-08-01-preview/generated/azure_mgmt_security/models/asc_location.rb'
41
78
  autoload :AutoProvisioningSetting, '2017-08-01-preview/generated/azure_mgmt_security/models/auto_provisioning_setting.rb'
42
79
  autoload :Compliance, '2017-08-01-preview/generated/azure_mgmt_security/models/compliance.rb'
80
+ autoload :ThresholdCustomAlertRule, '2017-08-01-preview/generated/azure_mgmt_security/models/threshold_custom_alert_rule.rb'
81
+ autoload :ListCustomAlertRule, '2017-08-01-preview/generated/azure_mgmt_security/models/list_custom_alert_rule.rb'
82
+ autoload :AllowlistCustomAlertRule, '2017-08-01-preview/generated/azure_mgmt_security/models/allowlist_custom_alert_rule.rb'
83
+ autoload :DenylistCustomAlertRule, '2017-08-01-preview/generated/azure_mgmt_security/models/denylist_custom_alert_rule.rb'
84
+ autoload :DeviceSecurityGroup, '2017-08-01-preview/generated/azure_mgmt_security/models/device_security_group.rb'
85
+ autoload :InformationProtectionPolicy, '2017-08-01-preview/generated/azure_mgmt_security/models/information_protection_policy.rb'
86
+ autoload :IoTSecuritySolutionAnalyticsModel, '2017-08-01-preview/generated/azure_mgmt_security/models/io_tsecurity_solution_analytics_model.rb'
87
+ autoload :UpdateIotSecuritySolutionData, '2017-08-01-preview/generated/azure_mgmt_security/models/update_iot_security_solution_data.rb'
88
+ autoload :Pricing, '2017-08-01-preview/generated/azure_mgmt_security/models/pricing.rb'
89
+ autoload :SecurityContact, '2017-08-01-preview/generated/azure_mgmt_security/models/security_contact.rb'
90
+ autoload :SettingResource, '2017-08-01-preview/generated/azure_mgmt_security/models/setting_resource.rb'
91
+ autoload :Setting, '2017-08-01-preview/generated/azure_mgmt_security/models/setting.rb'
92
+ autoload :DataExportSetting, '2017-08-01-preview/generated/azure_mgmt_security/models/data_export_setting.rb'
93
+ autoload :WorkspaceSetting, '2017-08-01-preview/generated/azure_mgmt_security/models/workspace_setting.rb'
94
+ autoload :AutoProvision, '2017-08-01-preview/generated/azure_mgmt_security/models/auto_provision.rb'
95
+ autoload :ValueType, '2017-08-01-preview/generated/azure_mgmt_security/models/value_type.rb'
96
+ autoload :ReportedSeverity, '2017-08-01-preview/generated/azure_mgmt_security/models/reported_severity.rb'
97
+ autoload :SecuritySolutionStatus, '2017-08-01-preview/generated/azure_mgmt_security/models/security_solution_status.rb'
98
+ autoload :ExportData, '2017-08-01-preview/generated/azure_mgmt_security/models/export_data.rb'
99
+ autoload :DataSource, '2017-08-01-preview/generated/azure_mgmt_security/models/data_source.rb'
100
+ autoload :RecommendationType, '2017-08-01-preview/generated/azure_mgmt_security/models/recommendation_type.rb'
101
+ autoload :RecommendationConfigStatus, '2017-08-01-preview/generated/azure_mgmt_security/models/recommendation_config_status.rb'
102
+ autoload :PricingTier, '2017-08-01-preview/generated/azure_mgmt_security/models/pricing_tier.rb'
43
103
  autoload :AlertNotifications, '2017-08-01-preview/generated/azure_mgmt_security/models/alert_notifications.rb'
44
104
  autoload :AlertsToAdmins, '2017-08-01-preview/generated/azure_mgmt_security/models/alerts_to_admins.rb'
45
- autoload :PricingTier, '2017-08-01-preview/generated/azure_mgmt_security/models/pricing_tier.rb'
46
- autoload :AutoProvision, '2017-08-01-preview/generated/azure_mgmt_security/models/auto_provision.rb'
105
+ autoload :SettingKind, '2017-08-01-preview/generated/azure_mgmt_security/models/setting_kind.rb'
47
106
  end
48
107
  end
@@ -0,0 +1,222 @@
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::Security::Mgmt::V2017_08_01_preview
7
+ #
8
+ # API spec for Microsoft.Security (Azure Security Center) resource provider
9
+ #
10
+ class AdvancedThreatProtection
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the AdvancedThreatProtection class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [SecurityCenter] reference to the SecurityCenter
22
+ attr_reader :client
23
+
24
+ #
25
+ # Gets the Advanced Threat Protection settings for the specified resource.
26
+ #
27
+ # @param resource_id [String] The identifier of the resource.
28
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
29
+ # will be added to the HTTP request.
30
+ #
31
+ # @return [AdvancedThreatProtectionSetting] operation results.
32
+ #
33
+ def get(resource_id, custom_headers:nil)
34
+ response = get_async(resource_id, custom_headers:custom_headers).value!
35
+ response.body unless response.nil?
36
+ end
37
+
38
+ #
39
+ # Gets the Advanced Threat Protection settings for the specified resource.
40
+ #
41
+ # @param resource_id [String] The identifier of the resource.
42
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
43
+ # will be added to the HTTP request.
44
+ #
45
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
46
+ #
47
+ def get_with_http_info(resource_id, custom_headers:nil)
48
+ get_async(resource_id, custom_headers:custom_headers).value!
49
+ end
50
+
51
+ #
52
+ # Gets the Advanced Threat Protection settings for the specified resource.
53
+ #
54
+ # @param resource_id [String] The identifier of the resource.
55
+ # @param [Hash{String => String}] A hash of custom headers that will be added
56
+ # to the HTTP request.
57
+ #
58
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
59
+ #
60
+ def get_async(resource_id, custom_headers:nil)
61
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
62
+ fail ArgumentError, 'resource_id is nil' if resource_id.nil?
63
+ setting_name = 'current'
64
+
65
+
66
+ request_headers = {}
67
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
68
+
69
+ # Set Headers
70
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
71
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
72
+ path_template = '{resourceId}/providers/Microsoft.Security/advancedThreatProtectionSettings/{settingName}'
73
+
74
+ request_url = @base_url || @client.base_url
75
+
76
+ options = {
77
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
78
+ path_params: {'resourceId' => resource_id,'settingName' => setting_name},
79
+ query_params: {'api-version' => @client.api_version},
80
+ headers: request_headers.merge(custom_headers || {}),
81
+ base_url: request_url
82
+ }
83
+ promise = @client.make_request_async(:get, path_template, options)
84
+
85
+ promise = promise.then do |result|
86
+ http_response = result.response
87
+ status_code = http_response.status
88
+ response_content = http_response.body
89
+ unless status_code == 200
90
+ error_model = JSON.load(response_content)
91
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
92
+ end
93
+
94
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
95
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
96
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
97
+ # Deserialize Response
98
+ if status_code == 200
99
+ begin
100
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
101
+ result_mapper = Azure::Security::Mgmt::V2017_08_01_preview::Models::AdvancedThreatProtectionSetting.mapper()
102
+ result.body = @client.deserialize(result_mapper, parsed_response)
103
+ rescue Exception => e
104
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
105
+ end
106
+ end
107
+
108
+ result
109
+ end
110
+
111
+ promise.execute
112
+ end
113
+
114
+ #
115
+ # Creates or updates the Advanced Threat Protection settings on a specified
116
+ # resource.
117
+ #
118
+ # @param resource_id [String] The identifier of the resource.
119
+ # @param advanced_threat_protection_setting [AdvancedThreatProtectionSetting]
120
+ # Advanced Threat Protection Settings
121
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
122
+ # will be added to the HTTP request.
123
+ #
124
+ # @return [AdvancedThreatProtectionSetting] operation results.
125
+ #
126
+ def create(resource_id, advanced_threat_protection_setting, custom_headers:nil)
127
+ response = create_async(resource_id, advanced_threat_protection_setting, custom_headers:custom_headers).value!
128
+ response.body unless response.nil?
129
+ end
130
+
131
+ #
132
+ # Creates or updates the Advanced Threat Protection settings on a specified
133
+ # resource.
134
+ #
135
+ # @param resource_id [String] The identifier of the resource.
136
+ # @param advanced_threat_protection_setting [AdvancedThreatProtectionSetting]
137
+ # Advanced Threat Protection Settings
138
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
139
+ # will be added to the HTTP request.
140
+ #
141
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
142
+ #
143
+ def create_with_http_info(resource_id, advanced_threat_protection_setting, custom_headers:nil)
144
+ create_async(resource_id, advanced_threat_protection_setting, custom_headers:custom_headers).value!
145
+ end
146
+
147
+ #
148
+ # Creates or updates the Advanced Threat Protection settings on a specified
149
+ # resource.
150
+ #
151
+ # @param resource_id [String] The identifier of the resource.
152
+ # @param advanced_threat_protection_setting [AdvancedThreatProtectionSetting]
153
+ # Advanced Threat Protection Settings
154
+ # @param [Hash{String => String}] A hash of custom headers that will be added
155
+ # to the HTTP request.
156
+ #
157
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
158
+ #
159
+ def create_async(resource_id, advanced_threat_protection_setting, custom_headers:nil)
160
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
161
+ fail ArgumentError, 'resource_id is nil' if resource_id.nil?
162
+ setting_name = 'current'
163
+ fail ArgumentError, 'advanced_threat_protection_setting is nil' if advanced_threat_protection_setting.nil?
164
+
165
+
166
+ request_headers = {}
167
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
168
+
169
+ # Set Headers
170
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
171
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
172
+
173
+ # Serialize Request
174
+ request_mapper = Azure::Security::Mgmt::V2017_08_01_preview::Models::AdvancedThreatProtectionSetting.mapper()
175
+ request_content = @client.serialize(request_mapper, advanced_threat_protection_setting)
176
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
177
+
178
+ path_template = '{resourceId}/providers/Microsoft.Security/advancedThreatProtectionSettings/{settingName}'
179
+
180
+ request_url = @base_url || @client.base_url
181
+
182
+ options = {
183
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
184
+ path_params: {'resourceId' => resource_id,'settingName' => setting_name},
185
+ query_params: {'api-version' => @client.api_version},
186
+ body: request_content,
187
+ headers: request_headers.merge(custom_headers || {}),
188
+ base_url: request_url
189
+ }
190
+ promise = @client.make_request_async(:put, path_template, options)
191
+
192
+ promise = promise.then do |result|
193
+ http_response = result.response
194
+ status_code = http_response.status
195
+ response_content = http_response.body
196
+ unless status_code == 200
197
+ error_model = JSON.load(response_content)
198
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
199
+ end
200
+
201
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
202
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
203
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
204
+ # Deserialize Response
205
+ if status_code == 200
206
+ begin
207
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
208
+ result_mapper = Azure::Security::Mgmt::V2017_08_01_preview::Models::AdvancedThreatProtectionSetting.mapper()
209
+ result.body = @client.deserialize(result_mapper, parsed_response)
210
+ rescue Exception => e
211
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
212
+ end
213
+ end
214
+
215
+ result
216
+ end
217
+
218
+ promise.execute
219
+ end
220
+
221
+ end
222
+ end
@@ -18,7 +18,7 @@ module Azure::Security::Mgmt::V2017_08_01_preview
18
18
  @client = client
19
19
  end
20
20
 
21
- # @return [SecurityManagementClient] reference to the SecurityManagementClient
21
+ # @return [SecurityCenter] reference to the SecurityCenter
22
22
  attr_reader :client
23
23
 
24
24
  #
@@ -55,7 +55,7 @@ module Azure::Security::Mgmt::V2017_08_01_preview
55
55
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
56
56
  #
57
57
  def list_async(custom_headers:nil)
58
- @client.api_version = '2017-08-01-preview'
58
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
59
59
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
60
60
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil?
61
61
 
@@ -89,6 +89,8 @@ module Azure::Security::Mgmt::V2017_08_01_preview
89
89
  end
90
90
 
91
91
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
92
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
93
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
92
94
  # Deserialize Response
93
95
  if status_code == 200
94
96
  begin
@@ -143,7 +145,7 @@ module Azure::Security::Mgmt::V2017_08_01_preview
143
145
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
144
146
  #
145
147
  def get_async(setting_name, custom_headers:nil)
146
- @client.api_version = '2017-08-01-preview'
148
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
147
149
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
148
150
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil?
149
151
  fail ArgumentError, 'setting_name is nil' if setting_name.nil?
@@ -178,6 +180,8 @@ module Azure::Security::Mgmt::V2017_08_01_preview
178
180
  end
179
181
 
180
182
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
183
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
184
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
181
185
  # Deserialize Response
182
186
  if status_code == 200
183
187
  begin
@@ -235,7 +239,7 @@ module Azure::Security::Mgmt::V2017_08_01_preview
235
239
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
236
240
  #
237
241
  def create_async(setting_name, setting, custom_headers:nil)
238
- @client.api_version = '2017-08-01-preview'
242
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
239
243
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
240
244
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil?
241
245
  fail ArgumentError, 'setting_name is nil' if setting_name.nil?
@@ -278,6 +282,8 @@ module Azure::Security::Mgmt::V2017_08_01_preview
278
282
  end
279
283
 
280
284
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
285
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
286
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
281
287
  # Deserialize Response
282
288
  if status_code == 200
283
289
  begin
@@ -366,6 +372,8 @@ module Azure::Security::Mgmt::V2017_08_01_preview
366
372
  end
367
373
 
368
374
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
375
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
376
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
369
377
  # Deserialize Response
370
378
  if status_code == 200
371
379
  begin
@@ -18,7 +18,7 @@ module Azure::Security::Mgmt::V2017_08_01_preview
18
18
  @client = client
19
19
  end
20
20
 
21
- # @return [SecurityManagementClient] reference to the SecurityManagementClient
21
+ # @return [SecurityCenter] reference to the SecurityCenter
22
22
  attr_reader :client
23
23
 
24
24
  #
@@ -64,7 +64,7 @@ module Azure::Security::Mgmt::V2017_08_01_preview
64
64
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
65
65
  #
66
66
  def list_async(scope, custom_headers:nil)
67
- @client.api_version = '2017-08-01-preview'
67
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
68
68
  fail ArgumentError, 'scope is nil' if scope.nil?
69
69
 
70
70
 
@@ -97,6 +97,8 @@ module Azure::Security::Mgmt::V2017_08_01_preview
97
97
  end
98
98
 
99
99
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
100
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
101
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
100
102
  # Deserialize Response
101
103
  if status_code == 200
102
104
  begin
@@ -160,7 +162,7 @@ module Azure::Security::Mgmt::V2017_08_01_preview
160
162
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
161
163
  #
162
164
  def get_async(scope, compliance_name, custom_headers:nil)
163
- @client.api_version = '2017-08-01-preview'
165
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
164
166
  fail ArgumentError, 'scope is nil' if scope.nil?
165
167
  fail ArgumentError, 'compliance_name is nil' if compliance_name.nil?
166
168
 
@@ -194,6 +196,8 @@ module Azure::Security::Mgmt::V2017_08_01_preview
194
196
  end
195
197
 
196
198
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
199
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
200
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
197
201
  # Deserialize Response
198
202
  if status_code == 200
199
203
  begin
@@ -282,6 +286,8 @@ module Azure::Security::Mgmt::V2017_08_01_preview
282
286
  end
283
287
 
284
288
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
289
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
290
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
285
291
  # Deserialize Response
286
292
  if status_code == 200
287
293
  begin
@@ -0,0 +1,523 @@
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::Security::Mgmt::V2017_08_01_preview
7
+ #
8
+ # API spec for Microsoft.Security (Azure Security Center) resource provider
9
+ #
10
+ class DeviceSecurityGroups
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the DeviceSecurityGroups class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [SecurityCenter] reference to the SecurityCenter
22
+ attr_reader :client
23
+
24
+ #
25
+ # Gets the list of device security groups for the specified IoT hub resource.
26
+ #
27
+ # @param resource_id [String] The identifier of the resource.
28
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
29
+ # will be added to the HTTP request.
30
+ #
31
+ # @return [Array<DeviceSecurityGroup>] operation results.
32
+ #
33
+ def list(resource_id, custom_headers:nil)
34
+ first_page = list_as_lazy(resource_id, custom_headers:custom_headers)
35
+ first_page.get_all_items
36
+ end
37
+
38
+ #
39
+ # Gets the list of device security groups for the specified IoT hub resource.
40
+ #
41
+ # @param resource_id [String] The identifier of the resource.
42
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
43
+ # will be added to the HTTP request.
44
+ #
45
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
46
+ #
47
+ def list_with_http_info(resource_id, custom_headers:nil)
48
+ list_async(resource_id, custom_headers:custom_headers).value!
49
+ end
50
+
51
+ #
52
+ # Gets the list of device security groups for the specified IoT hub resource.
53
+ #
54
+ # @param resource_id [String] The identifier of the resource.
55
+ # @param [Hash{String => String}] A hash of custom headers that will be added
56
+ # to the HTTP request.
57
+ #
58
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
59
+ #
60
+ def list_async(resource_id, custom_headers:nil)
61
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
62
+ fail ArgumentError, 'resource_id is nil' if resource_id.nil?
63
+
64
+
65
+ request_headers = {}
66
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
67
+
68
+ # Set Headers
69
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
70
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
71
+ path_template = '{resourceId}/providers/Microsoft.Security/deviceSecurityGroups'
72
+
73
+ request_url = @base_url || @client.base_url
74
+
75
+ options = {
76
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
77
+ path_params: {'resourceId' => resource_id},
78
+ query_params: {'api-version' => @client.api_version},
79
+ headers: request_headers.merge(custom_headers || {}),
80
+ base_url: request_url
81
+ }
82
+ promise = @client.make_request_async(:get, path_template, options)
83
+
84
+ promise = promise.then do |result|
85
+ http_response = result.response
86
+ status_code = http_response.status
87
+ response_content = http_response.body
88
+ unless status_code == 200
89
+ error_model = JSON.load(response_content)
90
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
91
+ end
92
+
93
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
94
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
95
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
96
+ # Deserialize Response
97
+ if status_code == 200
98
+ begin
99
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
100
+ result_mapper = Azure::Security::Mgmt::V2017_08_01_preview::Models::DeviceSecurityGroupList.mapper()
101
+ result.body = @client.deserialize(result_mapper, parsed_response)
102
+ rescue Exception => e
103
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
104
+ end
105
+ end
106
+
107
+ result
108
+ end
109
+
110
+ promise.execute
111
+ end
112
+
113
+ #
114
+ # Gets the device security group for the specified IoT hub resource.
115
+ #
116
+ # @param resource_id [String] The identifier of the resource.
117
+ # @param device_security_group_name [String] The name of the security group.
118
+ # Please notice that the name is case insensitive.
119
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
120
+ # will be added to the HTTP request.
121
+ #
122
+ # @return [DeviceSecurityGroup] operation results.
123
+ #
124
+ def get(resource_id, device_security_group_name, custom_headers:nil)
125
+ response = get_async(resource_id, device_security_group_name, custom_headers:custom_headers).value!
126
+ response.body unless response.nil?
127
+ end
128
+
129
+ #
130
+ # Gets the device security group for the specified IoT hub resource.
131
+ #
132
+ # @param resource_id [String] The identifier of the resource.
133
+ # @param device_security_group_name [String] The name of the security group.
134
+ # Please notice that the name is case insensitive.
135
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
136
+ # will be added to the HTTP request.
137
+ #
138
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
139
+ #
140
+ def get_with_http_info(resource_id, device_security_group_name, custom_headers:nil)
141
+ get_async(resource_id, device_security_group_name, custom_headers:custom_headers).value!
142
+ end
143
+
144
+ #
145
+ # Gets the device security group for the specified IoT hub resource.
146
+ #
147
+ # @param resource_id [String] The identifier of the resource.
148
+ # @param device_security_group_name [String] The name of the security group.
149
+ # Please notice that the name is case insensitive.
150
+ # @param [Hash{String => String}] A hash of custom headers that will be added
151
+ # to the HTTP request.
152
+ #
153
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
154
+ #
155
+ def get_async(resource_id, device_security_group_name, custom_headers:nil)
156
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
157
+ fail ArgumentError, 'resource_id is nil' if resource_id.nil?
158
+ fail ArgumentError, 'device_security_group_name is nil' if device_security_group_name.nil?
159
+
160
+
161
+ request_headers = {}
162
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
163
+
164
+ # Set Headers
165
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
166
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
167
+ path_template = '{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}'
168
+
169
+ request_url = @base_url || @client.base_url
170
+
171
+ options = {
172
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
173
+ path_params: {'resourceId' => resource_id,'deviceSecurityGroupName' => device_security_group_name},
174
+ query_params: {'api-version' => @client.api_version},
175
+ headers: request_headers.merge(custom_headers || {}),
176
+ base_url: request_url
177
+ }
178
+ promise = @client.make_request_async(:get, path_template, options)
179
+
180
+ promise = promise.then do |result|
181
+ http_response = result.response
182
+ status_code = http_response.status
183
+ response_content = http_response.body
184
+ unless status_code == 200
185
+ error_model = JSON.load(response_content)
186
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
187
+ end
188
+
189
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
190
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
191
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
192
+ # Deserialize Response
193
+ if status_code == 200
194
+ begin
195
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
196
+ result_mapper = Azure::Security::Mgmt::V2017_08_01_preview::Models::DeviceSecurityGroup.mapper()
197
+ result.body = @client.deserialize(result_mapper, parsed_response)
198
+ rescue Exception => e
199
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
200
+ end
201
+ end
202
+
203
+ result
204
+ end
205
+
206
+ promise.execute
207
+ end
208
+
209
+ #
210
+ # Creates or updates the device security group on a specified IoT hub resource.
211
+ #
212
+ # @param resource_id [String] The identifier of the resource.
213
+ # @param device_security_group_name [String] The name of the security group.
214
+ # Please notice that the name is case insensitive.
215
+ # @param device_security_group [DeviceSecurityGroup] Security group object.
216
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
217
+ # will be added to the HTTP request.
218
+ #
219
+ # @return [DeviceSecurityGroup] operation results.
220
+ #
221
+ def create_or_update(resource_id, device_security_group_name, device_security_group, custom_headers:nil)
222
+ response = create_or_update_async(resource_id, device_security_group_name, device_security_group, custom_headers:custom_headers).value!
223
+ response.body unless response.nil?
224
+ end
225
+
226
+ #
227
+ # Creates or updates the device security group on a specified IoT hub resource.
228
+ #
229
+ # @param resource_id [String] The identifier of the resource.
230
+ # @param device_security_group_name [String] The name of the security group.
231
+ # Please notice that the name is case insensitive.
232
+ # @param device_security_group [DeviceSecurityGroup] Security group object.
233
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
234
+ # will be added to the HTTP request.
235
+ #
236
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
237
+ #
238
+ def create_or_update_with_http_info(resource_id, device_security_group_name, device_security_group, custom_headers:nil)
239
+ create_or_update_async(resource_id, device_security_group_name, device_security_group, custom_headers:custom_headers).value!
240
+ end
241
+
242
+ #
243
+ # Creates or updates the device security group on a specified IoT hub resource.
244
+ #
245
+ # @param resource_id [String] The identifier of the resource.
246
+ # @param device_security_group_name [String] The name of the security group.
247
+ # Please notice that the name is case insensitive.
248
+ # @param device_security_group [DeviceSecurityGroup] Security group object.
249
+ # @param [Hash{String => String}] A hash of custom headers that will be added
250
+ # to the HTTP request.
251
+ #
252
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
253
+ #
254
+ def create_or_update_async(resource_id, device_security_group_name, device_security_group, custom_headers:nil)
255
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
256
+ fail ArgumentError, 'resource_id is nil' if resource_id.nil?
257
+ fail ArgumentError, 'device_security_group_name is nil' if device_security_group_name.nil?
258
+ fail ArgumentError, 'device_security_group is nil' if device_security_group.nil?
259
+
260
+
261
+ request_headers = {}
262
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
263
+
264
+ # Set Headers
265
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
266
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
267
+
268
+ # Serialize Request
269
+ request_mapper = Azure::Security::Mgmt::V2017_08_01_preview::Models::DeviceSecurityGroup.mapper()
270
+ request_content = @client.serialize(request_mapper, device_security_group)
271
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
272
+
273
+ path_template = '{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}'
274
+
275
+ request_url = @base_url || @client.base_url
276
+
277
+ options = {
278
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
279
+ path_params: {'resourceId' => resource_id,'deviceSecurityGroupName' => device_security_group_name},
280
+ query_params: {'api-version' => @client.api_version},
281
+ body: request_content,
282
+ headers: request_headers.merge(custom_headers || {}),
283
+ base_url: request_url
284
+ }
285
+ promise = @client.make_request_async(:put, path_template, options)
286
+
287
+ promise = promise.then do |result|
288
+ http_response = result.response
289
+ status_code = http_response.status
290
+ response_content = http_response.body
291
+ unless status_code == 200 || status_code == 201
292
+ error_model = JSON.load(response_content)
293
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
294
+ end
295
+
296
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
297
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
298
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
299
+ # Deserialize Response
300
+ if status_code == 200
301
+ begin
302
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
303
+ result_mapper = Azure::Security::Mgmt::V2017_08_01_preview::Models::DeviceSecurityGroup.mapper()
304
+ result.body = @client.deserialize(result_mapper, parsed_response)
305
+ rescue Exception => e
306
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
307
+ end
308
+ end
309
+ # Deserialize Response
310
+ if status_code == 201
311
+ begin
312
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
313
+ result_mapper = Azure::Security::Mgmt::V2017_08_01_preview::Models::DeviceSecurityGroup.mapper()
314
+ result.body = @client.deserialize(result_mapper, parsed_response)
315
+ rescue Exception => e
316
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
317
+ end
318
+ end
319
+
320
+ result
321
+ end
322
+
323
+ promise.execute
324
+ end
325
+
326
+ #
327
+ # Deletes the security group
328
+ #
329
+ # @param resource_id [String] The identifier of the resource.
330
+ # @param device_security_group_name [String] The name of the security group.
331
+ # Please notice that the name is case insensitive.
332
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
333
+ # will be added to the HTTP request.
334
+ #
335
+ #
336
+ def delete(resource_id, device_security_group_name, custom_headers:nil)
337
+ response = delete_async(resource_id, device_security_group_name, custom_headers:custom_headers).value!
338
+ nil
339
+ end
340
+
341
+ #
342
+ # Deletes the security group
343
+ #
344
+ # @param resource_id [String] The identifier of the resource.
345
+ # @param device_security_group_name [String] The name of the security group.
346
+ # Please notice that the name is case insensitive.
347
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
348
+ # will be added to the HTTP request.
349
+ #
350
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
351
+ #
352
+ def delete_with_http_info(resource_id, device_security_group_name, custom_headers:nil)
353
+ delete_async(resource_id, device_security_group_name, custom_headers:custom_headers).value!
354
+ end
355
+
356
+ #
357
+ # Deletes the security group
358
+ #
359
+ # @param resource_id [String] The identifier of the resource.
360
+ # @param device_security_group_name [String] The name of the security group.
361
+ # Please notice that the name is case insensitive.
362
+ # @param [Hash{String => String}] A hash of custom headers that will be added
363
+ # to the HTTP request.
364
+ #
365
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
366
+ #
367
+ def delete_async(resource_id, device_security_group_name, custom_headers:nil)
368
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
369
+ fail ArgumentError, 'resource_id is nil' if resource_id.nil?
370
+ fail ArgumentError, 'device_security_group_name is nil' if device_security_group_name.nil?
371
+
372
+
373
+ request_headers = {}
374
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
375
+
376
+ # Set Headers
377
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
378
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
379
+ path_template = '{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}'
380
+
381
+ request_url = @base_url || @client.base_url
382
+
383
+ options = {
384
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
385
+ path_params: {'resourceId' => resource_id,'deviceSecurityGroupName' => device_security_group_name},
386
+ query_params: {'api-version' => @client.api_version},
387
+ headers: request_headers.merge(custom_headers || {}),
388
+ base_url: request_url
389
+ }
390
+ promise = @client.make_request_async(:delete, path_template, options)
391
+
392
+ promise = promise.then do |result|
393
+ http_response = result.response
394
+ status_code = http_response.status
395
+ response_content = http_response.body
396
+ unless status_code == 200 || status_code == 204
397
+ error_model = JSON.load(response_content)
398
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
399
+ end
400
+
401
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
402
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
403
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
404
+
405
+ result
406
+ end
407
+
408
+ promise.execute
409
+ end
410
+
411
+ #
412
+ # Gets the list of device security groups for the specified IoT hub resource.
413
+ #
414
+ # @param next_page_link [String] The NextLink from the previous successful call
415
+ # to List operation.
416
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
417
+ # will be added to the HTTP request.
418
+ #
419
+ # @return [DeviceSecurityGroupList] operation results.
420
+ #
421
+ def list_next(next_page_link, custom_headers:nil)
422
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
423
+ response.body unless response.nil?
424
+ end
425
+
426
+ #
427
+ # Gets the list of device security groups for the specified IoT hub resource.
428
+ #
429
+ # @param next_page_link [String] The NextLink from the previous successful call
430
+ # to List operation.
431
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
432
+ # will be added to the HTTP request.
433
+ #
434
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
435
+ #
436
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
437
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
438
+ end
439
+
440
+ #
441
+ # Gets the list of device security groups for the specified IoT hub resource.
442
+ #
443
+ # @param next_page_link [String] The NextLink from the previous successful call
444
+ # to List operation.
445
+ # @param [Hash{String => String}] A hash of custom headers that will be added
446
+ # to the HTTP request.
447
+ #
448
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
449
+ #
450
+ def list_next_async(next_page_link, custom_headers:nil)
451
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
452
+
453
+
454
+ request_headers = {}
455
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
456
+
457
+ # Set Headers
458
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
459
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
460
+ path_template = '{nextLink}'
461
+
462
+ request_url = @base_url || @client.base_url
463
+
464
+ options = {
465
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
466
+ skip_encoding_path_params: {'nextLink' => next_page_link},
467
+ headers: request_headers.merge(custom_headers || {}),
468
+ base_url: request_url
469
+ }
470
+ promise = @client.make_request_async(:get, path_template, options)
471
+
472
+ promise = promise.then do |result|
473
+ http_response = result.response
474
+ status_code = http_response.status
475
+ response_content = http_response.body
476
+ unless status_code == 200
477
+ error_model = JSON.load(response_content)
478
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
479
+ end
480
+
481
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
482
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
483
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
484
+ # Deserialize Response
485
+ if status_code == 200
486
+ begin
487
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
488
+ result_mapper = Azure::Security::Mgmt::V2017_08_01_preview::Models::DeviceSecurityGroupList.mapper()
489
+ result.body = @client.deserialize(result_mapper, parsed_response)
490
+ rescue Exception => e
491
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
492
+ end
493
+ end
494
+
495
+ result
496
+ end
497
+
498
+ promise.execute
499
+ end
500
+
501
+ #
502
+ # Gets the list of device security groups for the specified IoT hub resource.
503
+ #
504
+ # @param resource_id [String] The identifier of the resource.
505
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
506
+ # will be added to the HTTP request.
507
+ #
508
+ # @return [DeviceSecurityGroupList] which provide lazy access to pages of the
509
+ # response.
510
+ #
511
+ def list_as_lazy(resource_id, custom_headers:nil)
512
+ response = list_async(resource_id, custom_headers:custom_headers).value!
513
+ unless response.nil?
514
+ page = response.body
515
+ page.next_method = Proc.new do |next_page_link|
516
+ list_next_async(next_page_link, custom_headers:custom_headers)
517
+ end
518
+ page
519
+ end
520
+ end
521
+
522
+ end
523
+ end