azure_mgmt_security_insights 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (331) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights.rb +254 -0
  4. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/actions.rb +255 -0
  5. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/alert_rule_templates.rb +365 -0
  6. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/alert_rules.rb +966 -0
  7. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/bookmark_operations.rb +154 -0
  8. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/bookmark_relations.rb +651 -0
  9. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/bookmarks.rb +602 -0
  10. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/case_comments.rb +155 -0
  11. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/case_relations.rb +652 -0
  12. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/cases.rb +752 -0
  13. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/cases_aggregations.rb +140 -0
  14. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/comments.rb +287 -0
  15. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/data_connectors.rb +603 -0
  16. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/data_connectors_check_requirements_operations.rb +150 -0
  17. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/entities.rb +492 -0
  18. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/entities_relations.rb +287 -0
  19. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/entity_queries.rb +364 -0
  20. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/entity_relations.rb +144 -0
  21. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/incident_comments.rb +652 -0
  22. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/incident_relations.rb +651 -0
  23. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/incidents.rb +976 -0
  24. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/aadcheck_requirements.rb +61 -0
  25. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/aaddata_connector.rb +109 -0
  26. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/aatpcheck_requirements.rb +62 -0
  27. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/aatpdata_connector.rb +109 -0
  28. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/account_entity.rb +261 -0
  29. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/action_properties_base.rb +47 -0
  30. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/action_request.rb +93 -0
  31. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/action_response.rb +96 -0
  32. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/actions_list.rb +99 -0
  33. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/aggregations.rb +82 -0
  34. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/aggregations_kind.rb +49 -0
  35. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/alert_rule.rb +95 -0
  36. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/alert_rule_kind.rb +17 -0
  37. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/alert_rule_kind1.rb +47 -0
  38. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/alert_rule_template.rb +84 -0
  39. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/alert_rule_template_data_source.rb +66 -0
  40. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/alert_rule_template_properties_base.rb +115 -0
  41. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/alert_rule_templates_list.rb +101 -0
  42. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/alert_rules_list.rb +101 -0
  43. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/alert_severity.rb +18 -0
  44. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/alert_status.rb +19 -0
  45. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/alerts_data_type_of_data_connector.rb +48 -0
  46. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/alerts_data_type_of_data_connector_alerts.rb +43 -0
  47. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/asccheck_requirements.rb +62 -0
  48. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/ascdata_connector.rb +110 -0
  49. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/attack_tactic.rb +27 -0
  50. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/aws_cloud_trail_check_requirements.rb +50 -0
  51. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/aws_cloud_trail_data_connector.rb +110 -0
  52. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/aws_cloud_trail_data_connector_data_types.rb +48 -0
  53. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/aws_cloud_trail_data_connector_data_types_logs.rb +43 -0
  54. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/azure_resource_entity.rb +136 -0
  55. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/bookmark.rb +191 -0
  56. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/bookmark_expand_parameters.rb +71 -0
  57. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/bookmark_expand_response.rb +60 -0
  58. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/bookmark_expand_response_value.rb +57 -0
  59. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/bookmark_list.rb +99 -0
  60. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/case_comment.rb +98 -0
  61. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/case_comment_list.rb +99 -0
  62. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/case_list.rb +99 -0
  63. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/case_model.rb +293 -0
  64. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/case_relation.rb +123 -0
  65. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/case_relation_list.rb +99 -0
  66. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/case_severity.rb +19 -0
  67. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/case_status.rb +18 -0
  68. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/cases_aggregation.rb +103 -0
  69. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/cases_aggregation_by_severity_properties.rb +96 -0
  70. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/cases_aggregation_by_status_properties.rb +83 -0
  71. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/client_info.rb +79 -0
  72. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/close_reason.rb +19 -0
  73. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/cloud_application_entity.rb +150 -0
  74. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/confidence_level.rb +17 -0
  75. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/confidence_score_status.rb +18 -0
  76. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/data_connector.rb +102 -0
  77. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/data_connector_authorization_state.rb +16 -0
  78. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/data_connector_data_type_common.rb +47 -0
  79. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/data_connector_kind.rb +24 -0
  80. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/data_connector_kind1.rb +51 -0
  81. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/data_connector_license_state.rb +17 -0
  82. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/data_connector_list.rb +101 -0
  83. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/data_connector_requirements_state.rb +59 -0
  84. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/data_connector_tenant_id.rb +46 -0
  85. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/data_connector_with_alerts_properties.rb +48 -0
  86. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/data_connectors_check_requirements.rb +54 -0
  87. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/data_type_state.rb +16 -0
  88. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/dns_entity.rb +170 -0
  89. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/elevation_token.rb +17 -0
  90. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/entities_matching_method.rb +17 -0
  91. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/entity.rb +98 -0
  92. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/entity_analytics.rb +97 -0
  93. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/entity_common_properties.rb +70 -0
  94. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/entity_expand_parameters.rb +71 -0
  95. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/entity_expand_response.rb +60 -0
  96. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/entity_expand_response_value.rb +57 -0
  97. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/entity_kind.rb +31 -0
  98. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/entity_kind1.rb +50 -0
  99. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/entity_list.rb +101 -0
  100. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/entity_query.rb +159 -0
  101. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/entity_query_list.rb +99 -0
  102. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/entity_type.rb +31 -0
  103. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/event_grouping_aggregation_kind.rb +16 -0
  104. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/event_grouping_settings.rb +47 -0
  105. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/expansion_result_aggregation.rb +85 -0
  106. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/expansion_results_metadata.rb +56 -0
  107. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/eyes_on.rb +97 -0
  108. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/file_entity.rb +170 -0
  109. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/file_hash_algorithm.rb +19 -0
  110. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/file_hash_entity.rb +137 -0
  111. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/fusion_alert_rule.rb +179 -0
  112. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/fusion_alert_rule_template.rb +188 -0
  113. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/geo_location.rb +126 -0
  114. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/grouping_configuration.rb +101 -0
  115. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/grouping_entity_type.rb +18 -0
  116. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/host_entity.rb +224 -0
  117. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/hunting_bookmark.rb +244 -0
  118. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/incident.rb +291 -0
  119. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/incident_additional_data.rb +111 -0
  120. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/incident_alert_list.rb +55 -0
  121. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/incident_bookmark_list.rb +55 -0
  122. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/incident_classification.rb +18 -0
  123. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/incident_classification_reason.rb +18 -0
  124. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/incident_comment.rb +118 -0
  125. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/incident_comment_list.rb +99 -0
  126. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/incident_configuration.rb +60 -0
  127. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/incident_entities_response.rb +78 -0
  128. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/incident_entities_results_metadata.rb +63 -0
  129. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/incident_info.rb +80 -0
  130. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/incident_label.rb +59 -0
  131. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/incident_label_type.rb +16 -0
  132. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/incident_list.rb +99 -0
  133. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/incident_owner_info.rb +80 -0
  134. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/incident_severity.rb +18 -0
  135. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/incident_status.rb +17 -0
  136. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/io_tdevice_entity.rb +218 -0
  137. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/ip_entity.rb +160 -0
  138. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/kill_chain_intent.rb +28 -0
  139. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/malware_entity.rb +178 -0
  140. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/mcascheck_requirements.rb +62 -0
  141. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/mcasdata_connector.rb +109 -0
  142. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/mcasdata_connector_data_types.rb +58 -0
  143. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/mcasdata_connector_data_types_discovery_logs.rb +43 -0
  144. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/mdatpcheck_requirements.rb +62 -0
  145. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/mdatpdata_connector.rb +110 -0
  146. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/microsoft_security_incident_creation_alert_rule.rb +221 -0
  147. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/microsoft_security_incident_creation_alert_rule_common_properties.rb +112 -0
  148. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/microsoft_security_incident_creation_alert_rule_template.rb +234 -0
  149. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/microsoft_security_product_name.rb +21 -0
  150. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/office_atpcheck_requirements.rb +62 -0
  151. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/office_atpdata_connector.rb +110 -0
  152. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/office_consent.rb +85 -0
  153. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/office_consent_list.rb +99 -0
  154. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/office_data_connector.rb +109 -0
  155. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/office_data_connector_data_types.rb +73 -0
  156. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/office_data_connector_data_types_exchange.rb +43 -0
  157. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/office_data_connector_data_types_share_point.rb +43 -0
  158. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/office_data_connector_data_types_teams.rb +43 -0
  159. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/operation.rb +58 -0
  160. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/operation_display.rb +79 -0
  161. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/operations_list.rb +98 -0
  162. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/osfamily.rb +18 -0
  163. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/process_entity.rb +221 -0
  164. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/registry_hive.rb +24 -0
  165. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/registry_key_entity.rb +141 -0
  166. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/registry_value_entity.rb +163 -0
  167. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/registry_value_kind.rb +22 -0
  168. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/relation.rb +117 -0
  169. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/relation_base.rb +86 -0
  170. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/relation_list.rb +99 -0
  171. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/relation_node.rb +89 -0
  172. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/relation_node_kind.rb +16 -0
  173. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/relation_types.rb +15 -0
  174. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/relations_model_input.rb +114 -0
  175. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/resource.rb +80 -0
  176. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/resource_with_etag.rb +82 -0
  177. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/scheduled_alert_rule.rb +285 -0
  178. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/scheduled_alert_rule_common_properties.rb +119 -0
  179. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/scheduled_alert_rule_template.rb +260 -0
  180. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/security_alert.rb +462 -0
  181. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/security_alert_properties_confidence_reasons_item.rb +60 -0
  182. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/security_group_entity.rb +150 -0
  183. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/setting_kind.rb +17 -0
  184. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/setting_list.rb +57 -0
  185. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/settings.rb +95 -0
  186. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/settings_kind.rb +47 -0
  187. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/source.rb +16 -0
  188. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/template_status.rb +17 -0
  189. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/threat_intelligence.rb +108 -0
  190. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/threat_intelligence_append_tags_request_body.rb +54 -0
  191. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/threat_intelligence_arm_stix_query.rb +227 -0
  192. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/threat_intelligence_arm_stix_sort_by.rb +17 -0
  193. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/threat_intelligence_arm_stix_sort_by1.rb +58 -0
  194. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/threat_intelligence_granular_marking_model.rb +76 -0
  195. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/threat_intelligence_indicator_model.rb +410 -0
  196. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/threat_intelligence_indicator_without_read_only_fields.rb +382 -0
  197. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/threat_intelligence_kill_chain_phase.rb +57 -0
  198. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/threat_intelligence_metric.rb +106 -0
  199. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/threat_intelligence_metric_entity.rb +57 -0
  200. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/threat_intelligence_metric_resource.rb +47 -0
  201. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/threat_intelligence_metric_resource_list.rb +56 -0
  202. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/threat_intelligence_resource.rb +93 -0
  203. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/threat_intelligence_resource_kind.rb +15 -0
  204. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/threat_intelligence_resource_kind1.rb +48 -0
  205. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/threat_intelligence_resource_list.rb +102 -0
  206. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/ti_taxii_check_requirements.rb +61 -0
  207. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/ti_taxii_data_connector.rb +175 -0
  208. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/ti_taxii_data_connector_data_types.rb +48 -0
  209. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/ti_taxii_data_connector_data_types_taxii_client.rb +43 -0
  210. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/ticheck_requirements.rb +61 -0
  211. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/tidata_connector.rb +109 -0
  212. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/tidata_connector_data_types.rb +49 -0
  213. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/tidata_connector_data_types_indicators.rb +43 -0
  214. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/trigger_operator.rb +18 -0
  215. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/ueba.rb +105 -0
  216. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/ueba_data_sources.rb +18 -0
  217. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/url_entity.rb +124 -0
  218. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/user_info.rb +70 -0
  219. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/watchlist.rb +256 -0
  220. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/watchlist_item.rb +185 -0
  221. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/watchlist_list.rb +99 -0
  222. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/module_definition.rb +9 -0
  223. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/office_consents.rb +468 -0
  224. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/operations.rb +219 -0
  225. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/product_settings.rb +487 -0
  226. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/security_insights.rb +384 -0
  227. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/threat_intelligence_indicator.rb +494 -0
  228. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/threat_intelligence_indicator_metrics.rb +139 -0
  229. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/threat_intelligence_indicator_upsert.rb +167 -0
  230. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/threat_intelligence_indicators.rb +283 -0
  231. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/threat_intelligence_indicators_list.rb +267 -0
  232. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/watchlists.rb +814 -0
  233. data/lib/2020-01-01/generated/azure_mgmt_security_insights.rb +116 -0
  234. data/lib/2020-01-01/generated/azure_mgmt_security_insights/actions.rb +246 -0
  235. data/lib/2020-01-01/generated/azure_mgmt_security_insights/alert_rule_templates.rb +349 -0
  236. data/lib/2020-01-01/generated/azure_mgmt_security_insights/alert_rules.rb +915 -0
  237. data/lib/2020-01-01/generated/azure_mgmt_security_insights/bookmarks.rb +572 -0
  238. data/lib/2020-01-01/generated/azure_mgmt_security_insights/data_connectors.rb +573 -0
  239. data/lib/2020-01-01/generated/azure_mgmt_security_insights/incident_comments.rb +512 -0
  240. data/lib/2020-01-01/generated/azure_mgmt_security_insights/incidents.rb +604 -0
  241. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/aaddata_connector.rb +109 -0
  242. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/aatpdata_connector.rb +109 -0
  243. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/action_properties_base.rb +47 -0
  244. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/action_request.rb +93 -0
  245. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/action_response.rb +96 -0
  246. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/actions_list.rb +99 -0
  247. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/alert_rule.rb +79 -0
  248. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/alert_rule_kind.rb +17 -0
  249. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/alert_rule_template.rb +71 -0
  250. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/alert_rule_template_data_source.rb +66 -0
  251. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/alert_rule_templates_list.rb +101 -0
  252. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/alert_rules_list.rb +101 -0
  253. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/alert_severity.rb +18 -0
  254. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/alerts_data_type_of_data_connector.rb +47 -0
  255. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/ascdata_connector.rb +110 -0
  256. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/attack_tactic.rb +26 -0
  257. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/aws_cloud_trail_data_connector.rb +110 -0
  258. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/aws_cloud_trail_data_connector_data_types.rb +48 -0
  259. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/aws_cloud_trail_data_connector_data_types_logs.rb +43 -0
  260. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/bookmark.rb +191 -0
  261. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/bookmark_list.rb +99 -0
  262. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/case_severity.rb +19 -0
  263. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/client_info.rb +79 -0
  264. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/data_connector.rb +79 -0
  265. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/data_connector_data_type_common.rb +47 -0
  266. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/data_connector_kind.rb +22 -0
  267. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/data_connector_list.rb +101 -0
  268. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/data_connector_tenant_id.rb +46 -0
  269. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/data_connector_with_alerts_properties.rb +48 -0
  270. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/data_type_state.rb +16 -0
  271. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/error_additional_info.rb +59 -0
  272. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/error_response.rb +117 -0
  273. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/fusion_alert_rule.rb +179 -0
  274. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/fusion_alert_rule_template.rb +188 -0
  275. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/incident.rb +291 -0
  276. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/incident_additional_data.rb +111 -0
  277. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/incident_classification.rb +18 -0
  278. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/incident_classification_reason.rb +18 -0
  279. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/incident_comment.rb +98 -0
  280. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/incident_comment_list.rb +99 -0
  281. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/incident_info.rb +80 -0
  282. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/incident_label.rb +59 -0
  283. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/incident_label_type.rb +16 -0
  284. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/incident_list.rb +99 -0
  285. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/incident_owner_info.rb +80 -0
  286. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/incident_severity.rb +18 -0
  287. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/incident_status.rb +17 -0
  288. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/license_status.rb +16 -0
  289. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/mcasdata_connector.rb +109 -0
  290. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/mcasdata_connector_data_types.rb +58 -0
  291. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/mdatpdata_connector.rb +110 -0
  292. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/microsoft_security_incident_creation_alert_rule.rb +220 -0
  293. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/microsoft_security_incident_creation_alert_rule_common_properties.rb +111 -0
  294. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/microsoft_security_incident_creation_alert_rule_template.rb +233 -0
  295. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/microsoft_security_product_name.rb +19 -0
  296. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/office_consent.rb +85 -0
  297. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/office_consent_list.rb +67 -0
  298. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/office_data_connector.rb +109 -0
  299. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/office_data_connector_data_types.rb +61 -0
  300. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/office_data_connector_data_types_exchange.rb +43 -0
  301. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/office_data_connector_data_types_share_point.rb +43 -0
  302. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/operation.rb +58 -0
  303. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/operation_display.rb +79 -0
  304. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/operations_list.rb +98 -0
  305. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/resource.rb +80 -0
  306. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/resource_with_etag.rb +82 -0
  307. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/scheduled_alert_rule.rb +260 -0
  308. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/scheduled_alert_rule_common_properties.rb +107 -0
  309. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/scheduled_alert_rule_template.rb +248 -0
  310. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/setting_kind.rb +16 -0
  311. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/settings.rb +79 -0
  312. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/status_in_mcas.rb +16 -0
  313. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/template_status.rb +17 -0
  314. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/threat_intelligence.rb +108 -0
  315. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/tidata_connector.rb +109 -0
  316. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/tidata_connector_data_types.rb +48 -0
  317. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/tidata_connector_data_types_indicators.rb +43 -0
  318. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/toggle_settings.rb +96 -0
  319. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/trigger_operator.rb +18 -0
  320. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/ueba_settings.rb +125 -0
  321. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/user_info.rb +70 -0
  322. data/lib/2020-01-01/generated/azure_mgmt_security_insights/module_definition.rb +9 -0
  323. data/lib/2020-01-01/generated/azure_mgmt_security_insights/operations.rb +219 -0
  324. data/lib/2020-01-01/generated/azure_mgmt_security_insights/security_insights.rb +159 -0
  325. data/lib/azure_mgmt_security_insights.rb +7 -0
  326. data/lib/module_definition.rb +7 -0
  327. data/lib/profiles/latest/modules/securityinsights_profile_module.rb +399 -0
  328. data/lib/profiles/latest/securityinsights_latest_profile_client.rb +40 -0
  329. data/lib/profiles/latest/securityinsights_module_definition.rb +8 -0
  330. data/lib/version.rb +7 -0
  331. metadata +446 -0
@@ -0,0 +1,915 @@
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::SecurityInsights::Mgmt::V2020_01_01
7
+ #
8
+ # API spec for Microsoft.SecurityInsights (Azure Security Insights) resource
9
+ # provider
10
+ #
11
+ class AlertRules
12
+ include MsRestAzure
13
+
14
+ #
15
+ # Creates and initializes a new instance of the AlertRules class.
16
+ # @param client service class for accessing basic functionality.
17
+ #
18
+ def initialize(client)
19
+ @client = client
20
+ end
21
+
22
+ # @return [SecurityInsights] reference to the SecurityInsights
23
+ attr_reader :client
24
+
25
+ #
26
+ # Gets all alert rules.
27
+ #
28
+ # @param resource_group_name [String] The name of the resource group within the
29
+ # user's subscription. The name is case insensitive.
30
+ # @param workspace_name [String] The name of the workspace.
31
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
32
+ # will be added to the HTTP request.
33
+ #
34
+ # @return [Array<AlertRule>] operation results.
35
+ #
36
+ def list(resource_group_name, workspace_name, custom_headers:nil)
37
+ first_page = list_as_lazy(resource_group_name, workspace_name, custom_headers:custom_headers)
38
+ first_page.get_all_items
39
+ end
40
+
41
+ #
42
+ # Gets all alert rules.
43
+ #
44
+ # @param resource_group_name [String] The name of the resource group within the
45
+ # user's subscription. The name is case insensitive.
46
+ # @param workspace_name [String] The name of the workspace.
47
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
48
+ # will be added to the HTTP request.
49
+ #
50
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
51
+ #
52
+ def list_with_http_info(resource_group_name, workspace_name, custom_headers:nil)
53
+ list_async(resource_group_name, workspace_name, custom_headers:custom_headers).value!
54
+ end
55
+
56
+ #
57
+ # Gets all alert rules.
58
+ #
59
+ # @param resource_group_name [String] The name of the resource group within the
60
+ # user's subscription. The name is case insensitive.
61
+ # @param workspace_name [String] The name of the workspace.
62
+ # @param [Hash{String => String}] A hash of custom headers that will be added
63
+ # to the HTTP request.
64
+ #
65
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
66
+ #
67
+ def list_async(resource_group_name, workspace_name, custom_headers:nil)
68
+ @client.api_version = '2020-01-01'
69
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
70
+ 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?
71
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
72
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
73
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
74
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
75
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
76
+ fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MaxLength': '90'" if !workspace_name.nil? && workspace_name.length > 90
77
+ fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MinLength': '1'" if !workspace_name.nil? && workspace_name.length < 1
78
+
79
+
80
+ request_headers = {}
81
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
82
+
83
+ # Set Headers
84
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
85
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
86
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules'
87
+
88
+ request_url = @base_url || @client.base_url
89
+
90
+ options = {
91
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
92
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name},
93
+ query_params: {'api-version' => @client.api_version},
94
+ headers: request_headers.merge(custom_headers || {}),
95
+ base_url: request_url
96
+ }
97
+ promise = @client.make_request_async(:get, path_template, options)
98
+
99
+ promise = promise.then do |result|
100
+ http_response = result.response
101
+ status_code = http_response.status
102
+ response_content = http_response.body
103
+ unless status_code == 200
104
+ error_model = JSON.load(response_content)
105
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
106
+ end
107
+
108
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
109
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
110
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
111
+ # Deserialize Response
112
+ if status_code == 200
113
+ begin
114
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
115
+ result_mapper = Azure::SecurityInsights::Mgmt::V2020_01_01::Models::AlertRulesList.mapper()
116
+ result.body = @client.deserialize(result_mapper, parsed_response)
117
+ rescue Exception => e
118
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
119
+ end
120
+ end
121
+
122
+ result
123
+ end
124
+
125
+ promise.execute
126
+ end
127
+
128
+ #
129
+ # Gets the alert rule.
130
+ #
131
+ # @param resource_group_name [String] The name of the resource group within the
132
+ # user's subscription. The name is case insensitive.
133
+ # @param workspace_name [String] The name of the workspace.
134
+ # @param rule_id [String] Alert rule ID
135
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
136
+ # will be added to the HTTP request.
137
+ #
138
+ # @return [AlertRule] operation results.
139
+ #
140
+ def get(resource_group_name, workspace_name, rule_id, custom_headers:nil)
141
+ response = get_async(resource_group_name, workspace_name, rule_id, custom_headers:custom_headers).value!
142
+ response.body unless response.nil?
143
+ end
144
+
145
+ #
146
+ # Gets the alert rule.
147
+ #
148
+ # @param resource_group_name [String] The name of the resource group within the
149
+ # user's subscription. The name is case insensitive.
150
+ # @param workspace_name [String] The name of the workspace.
151
+ # @param rule_id [String] Alert rule ID
152
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
153
+ # will be added to the HTTP request.
154
+ #
155
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
156
+ #
157
+ def get_with_http_info(resource_group_name, workspace_name, rule_id, custom_headers:nil)
158
+ get_async(resource_group_name, workspace_name, rule_id, custom_headers:custom_headers).value!
159
+ end
160
+
161
+ #
162
+ # Gets the alert rule.
163
+ #
164
+ # @param resource_group_name [String] The name of the resource group within the
165
+ # user's subscription. The name is case insensitive.
166
+ # @param workspace_name [String] The name of the workspace.
167
+ # @param rule_id [String] Alert rule ID
168
+ # @param [Hash{String => String}] A hash of custom headers that will be added
169
+ # to the HTTP request.
170
+ #
171
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
172
+ #
173
+ def get_async(resource_group_name, workspace_name, rule_id, custom_headers:nil)
174
+ @client.api_version = '2020-01-01'
175
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
176
+ 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?
177
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
178
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
179
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
180
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
181
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
182
+ fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MaxLength': '90'" if !workspace_name.nil? && workspace_name.length > 90
183
+ fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MinLength': '1'" if !workspace_name.nil? && workspace_name.length < 1
184
+ fail ArgumentError, 'rule_id is nil' if rule_id.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.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}'
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,'workspaceName' => workspace_name,'ruleId' => rule_id},
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 MsRestAzure::AzureOperationError.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::SecurityInsights::Mgmt::V2020_01_01::Models::AlertRule.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
+ # Creates or updates the alert rule.
237
+ #
238
+ # @param resource_group_name [String] The name of the resource group within the
239
+ # user's subscription. The name is case insensitive.
240
+ # @param workspace_name [String] The name of the workspace.
241
+ # @param rule_id [String] Alert rule ID
242
+ # @param alert_rule [AlertRule] The alert rule
243
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
244
+ # will be added to the HTTP request.
245
+ #
246
+ # @return [AlertRule] operation results.
247
+ #
248
+ def create_or_update(resource_group_name, workspace_name, rule_id, alert_rule, custom_headers:nil)
249
+ response = create_or_update_async(resource_group_name, workspace_name, rule_id, alert_rule, custom_headers:custom_headers).value!
250
+ response.body unless response.nil?
251
+ end
252
+
253
+ #
254
+ # Creates or updates the alert rule.
255
+ #
256
+ # @param resource_group_name [String] The name of the resource group within the
257
+ # user's subscription. The name is case insensitive.
258
+ # @param workspace_name [String] The name of the workspace.
259
+ # @param rule_id [String] Alert rule ID
260
+ # @param alert_rule [AlertRule] The alert rule
261
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
262
+ # will be added to the HTTP request.
263
+ #
264
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
265
+ #
266
+ def create_or_update_with_http_info(resource_group_name, workspace_name, rule_id, alert_rule, custom_headers:nil)
267
+ create_or_update_async(resource_group_name, workspace_name, rule_id, alert_rule, custom_headers:custom_headers).value!
268
+ end
269
+
270
+ #
271
+ # Creates or updates the alert rule.
272
+ #
273
+ # @param resource_group_name [String] The name of the resource group within the
274
+ # user's subscription. The name is case insensitive.
275
+ # @param workspace_name [String] The name of the workspace.
276
+ # @param rule_id [String] Alert rule ID
277
+ # @param alert_rule [AlertRule] The alert rule
278
+ # @param [Hash{String => String}] A hash of custom headers that will be added
279
+ # to the HTTP request.
280
+ #
281
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
282
+ #
283
+ def create_or_update_async(resource_group_name, workspace_name, rule_id, alert_rule, custom_headers:nil)
284
+ @client.api_version = '2020-01-01'
285
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
286
+ 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?
287
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
288
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
289
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
290
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
291
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
292
+ fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MaxLength': '90'" if !workspace_name.nil? && workspace_name.length > 90
293
+ fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MinLength': '1'" if !workspace_name.nil? && workspace_name.length < 1
294
+ fail ArgumentError, 'rule_id is nil' if rule_id.nil?
295
+ fail ArgumentError, 'alert_rule is nil' if alert_rule.nil?
296
+
297
+
298
+ request_headers = {}
299
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
300
+
301
+ # Set Headers
302
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
303
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
304
+
305
+ # Serialize Request
306
+ request_mapper = Azure::SecurityInsights::Mgmt::V2020_01_01::Models::AlertRule.mapper()
307
+ request_content = @client.serialize(request_mapper, alert_rule)
308
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
309
+
310
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}'
311
+
312
+ request_url = @base_url || @client.base_url
313
+
314
+ options = {
315
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
316
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'ruleId' => rule_id},
317
+ query_params: {'api-version' => @client.api_version},
318
+ body: request_content,
319
+ headers: request_headers.merge(custom_headers || {}),
320
+ base_url: request_url
321
+ }
322
+ promise = @client.make_request_async(:put, path_template, options)
323
+
324
+ promise = promise.then do |result|
325
+ http_response = result.response
326
+ status_code = http_response.status
327
+ response_content = http_response.body
328
+ unless status_code == 200 || status_code == 201
329
+ error_model = JSON.load(response_content)
330
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
331
+ end
332
+
333
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
334
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
335
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
336
+ # Deserialize Response
337
+ if status_code == 200
338
+ begin
339
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
340
+ result_mapper = Azure::SecurityInsights::Mgmt::V2020_01_01::Models::AlertRule.mapper()
341
+ result.body = @client.deserialize(result_mapper, parsed_response)
342
+ rescue Exception => e
343
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
344
+ end
345
+ end
346
+ # Deserialize Response
347
+ if status_code == 201
348
+ begin
349
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
350
+ result_mapper = Azure::SecurityInsights::Mgmt::V2020_01_01::Models::AlertRule.mapper()
351
+ result.body = @client.deserialize(result_mapper, parsed_response)
352
+ rescue Exception => e
353
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
354
+ end
355
+ end
356
+
357
+ result
358
+ end
359
+
360
+ promise.execute
361
+ end
362
+
363
+ #
364
+ # Delete the alert rule.
365
+ #
366
+ # @param resource_group_name [String] The name of the resource group within the
367
+ # user's subscription. The name is case insensitive.
368
+ # @param workspace_name [String] The name of the workspace.
369
+ # @param rule_id [String] Alert rule ID
370
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
371
+ # will be added to the HTTP request.
372
+ #
373
+ #
374
+ def delete(resource_group_name, workspace_name, rule_id, custom_headers:nil)
375
+ response = delete_async(resource_group_name, workspace_name, rule_id, custom_headers:custom_headers).value!
376
+ nil
377
+ end
378
+
379
+ #
380
+ # Delete the alert rule.
381
+ #
382
+ # @param resource_group_name [String] The name of the resource group within the
383
+ # user's subscription. The name is case insensitive.
384
+ # @param workspace_name [String] The name of the workspace.
385
+ # @param rule_id [String] Alert rule ID
386
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
387
+ # will be added to the HTTP request.
388
+ #
389
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
390
+ #
391
+ def delete_with_http_info(resource_group_name, workspace_name, rule_id, custom_headers:nil)
392
+ delete_async(resource_group_name, workspace_name, rule_id, custom_headers:custom_headers).value!
393
+ end
394
+
395
+ #
396
+ # Delete the alert rule.
397
+ #
398
+ # @param resource_group_name [String] The name of the resource group within the
399
+ # user's subscription. The name is case insensitive.
400
+ # @param workspace_name [String] The name of the workspace.
401
+ # @param rule_id [String] Alert rule ID
402
+ # @param [Hash{String => String}] A hash of custom headers that will be added
403
+ # to the HTTP request.
404
+ #
405
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
406
+ #
407
+ def delete_async(resource_group_name, workspace_name, rule_id, custom_headers:nil)
408
+ @client.api_version = '2020-01-01'
409
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
410
+ 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?
411
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
412
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
413
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
414
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
415
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
416
+ fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MaxLength': '90'" if !workspace_name.nil? && workspace_name.length > 90
417
+ fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MinLength': '1'" if !workspace_name.nil? && workspace_name.length < 1
418
+ fail ArgumentError, 'rule_id is nil' if rule_id.nil?
419
+
420
+
421
+ request_headers = {}
422
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
423
+
424
+ # Set Headers
425
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
426
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
427
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}'
428
+
429
+ request_url = @base_url || @client.base_url
430
+
431
+ options = {
432
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
433
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'ruleId' => rule_id},
434
+ query_params: {'api-version' => @client.api_version},
435
+ headers: request_headers.merge(custom_headers || {}),
436
+ base_url: request_url
437
+ }
438
+ promise = @client.make_request_async(:delete, path_template, options)
439
+
440
+ promise = promise.then do |result|
441
+ http_response = result.response
442
+ status_code = http_response.status
443
+ response_content = http_response.body
444
+ unless status_code == 200 || status_code == 204
445
+ error_model = JSON.load(response_content)
446
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
447
+ end
448
+
449
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
450
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
451
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
452
+
453
+ result
454
+ end
455
+
456
+ promise.execute
457
+ end
458
+
459
+ #
460
+ # Gets the action of alert rule.
461
+ #
462
+ # @param resource_group_name [String] The name of the resource group within the
463
+ # user's subscription. The name is case insensitive.
464
+ # @param workspace_name [String] The name of the workspace.
465
+ # @param rule_id [String] Alert rule ID
466
+ # @param action_id [String] Action ID
467
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
468
+ # will be added to the HTTP request.
469
+ #
470
+ # @return [ActionResponse] operation results.
471
+ #
472
+ def get_action(resource_group_name, workspace_name, rule_id, action_id, custom_headers:nil)
473
+ response = get_action_async(resource_group_name, workspace_name, rule_id, action_id, custom_headers:custom_headers).value!
474
+ response.body unless response.nil?
475
+ end
476
+
477
+ #
478
+ # Gets the action of alert rule.
479
+ #
480
+ # @param resource_group_name [String] The name of the resource group within the
481
+ # user's subscription. The name is case insensitive.
482
+ # @param workspace_name [String] The name of the workspace.
483
+ # @param rule_id [String] Alert rule ID
484
+ # @param action_id [String] Action ID
485
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
486
+ # will be added to the HTTP request.
487
+ #
488
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
489
+ #
490
+ def get_action_with_http_info(resource_group_name, workspace_name, rule_id, action_id, custom_headers:nil)
491
+ get_action_async(resource_group_name, workspace_name, rule_id, action_id, custom_headers:custom_headers).value!
492
+ end
493
+
494
+ #
495
+ # Gets the action of alert rule.
496
+ #
497
+ # @param resource_group_name [String] The name of the resource group within the
498
+ # user's subscription. The name is case insensitive.
499
+ # @param workspace_name [String] The name of the workspace.
500
+ # @param rule_id [String] Alert rule ID
501
+ # @param action_id [String] Action ID
502
+ # @param [Hash{String => String}] A hash of custom headers that will be added
503
+ # to the HTTP request.
504
+ #
505
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
506
+ #
507
+ def get_action_async(resource_group_name, workspace_name, rule_id, action_id, custom_headers:nil)
508
+ @client.api_version = '2020-01-01'
509
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
510
+ 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?
511
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
512
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
513
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
514
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
515
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
516
+ fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MaxLength': '90'" if !workspace_name.nil? && workspace_name.length > 90
517
+ fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MinLength': '1'" if !workspace_name.nil? && workspace_name.length < 1
518
+ fail ArgumentError, 'rule_id is nil' if rule_id.nil?
519
+ fail ArgumentError, 'action_id is nil' if action_id.nil?
520
+
521
+
522
+ request_headers = {}
523
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
524
+
525
+ # Set Headers
526
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
527
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
528
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions/{actionId}'
529
+
530
+ request_url = @base_url || @client.base_url
531
+
532
+ options = {
533
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
534
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'ruleId' => rule_id,'actionId' => action_id},
535
+ query_params: {'api-version' => @client.api_version},
536
+ headers: request_headers.merge(custom_headers || {}),
537
+ base_url: request_url
538
+ }
539
+ promise = @client.make_request_async(:get, path_template, options)
540
+
541
+ promise = promise.then do |result|
542
+ http_response = result.response
543
+ status_code = http_response.status
544
+ response_content = http_response.body
545
+ unless status_code == 200
546
+ error_model = JSON.load(response_content)
547
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
548
+ end
549
+
550
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
551
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
552
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
553
+ # Deserialize Response
554
+ if status_code == 200
555
+ begin
556
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
557
+ result_mapper = Azure::SecurityInsights::Mgmt::V2020_01_01::Models::ActionResponse.mapper()
558
+ result.body = @client.deserialize(result_mapper, parsed_response)
559
+ rescue Exception => e
560
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
561
+ end
562
+ end
563
+
564
+ result
565
+ end
566
+
567
+ promise.execute
568
+ end
569
+
570
+ #
571
+ # Creates or updates the action of alert rule.
572
+ #
573
+ # @param resource_group_name [String] The name of the resource group within the
574
+ # user's subscription. The name is case insensitive.
575
+ # @param workspace_name [String] The name of the workspace.
576
+ # @param rule_id [String] Alert rule ID
577
+ # @param action_id [String] Action ID
578
+ # @param action [ActionRequest] The action
579
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
580
+ # will be added to the HTTP request.
581
+ #
582
+ # @return [ActionResponse] operation results.
583
+ #
584
+ def create_or_update_action(resource_group_name, workspace_name, rule_id, action_id, action, custom_headers:nil)
585
+ response = create_or_update_action_async(resource_group_name, workspace_name, rule_id, action_id, action, custom_headers:custom_headers).value!
586
+ response.body unless response.nil?
587
+ end
588
+
589
+ #
590
+ # Creates or updates the action of alert rule.
591
+ #
592
+ # @param resource_group_name [String] The name of the resource group within the
593
+ # user's subscription. The name is case insensitive.
594
+ # @param workspace_name [String] The name of the workspace.
595
+ # @param rule_id [String] Alert rule ID
596
+ # @param action_id [String] Action ID
597
+ # @param action [ActionRequest] The action
598
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
599
+ # will be added to the HTTP request.
600
+ #
601
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
602
+ #
603
+ def create_or_update_action_with_http_info(resource_group_name, workspace_name, rule_id, action_id, action, custom_headers:nil)
604
+ create_or_update_action_async(resource_group_name, workspace_name, rule_id, action_id, action, custom_headers:custom_headers).value!
605
+ end
606
+
607
+ #
608
+ # Creates or updates the action of alert rule.
609
+ #
610
+ # @param resource_group_name [String] The name of the resource group within the
611
+ # user's subscription. The name is case insensitive.
612
+ # @param workspace_name [String] The name of the workspace.
613
+ # @param rule_id [String] Alert rule ID
614
+ # @param action_id [String] Action ID
615
+ # @param action [ActionRequest] The action
616
+ # @param [Hash{String => String}] A hash of custom headers that will be added
617
+ # to the HTTP request.
618
+ #
619
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
620
+ #
621
+ def create_or_update_action_async(resource_group_name, workspace_name, rule_id, action_id, action, custom_headers:nil)
622
+ @client.api_version = '2020-01-01'
623
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
624
+ 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?
625
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
626
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
627
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
628
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
629
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
630
+ fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MaxLength': '90'" if !workspace_name.nil? && workspace_name.length > 90
631
+ fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MinLength': '1'" if !workspace_name.nil? && workspace_name.length < 1
632
+ fail ArgumentError, 'rule_id is nil' if rule_id.nil?
633
+ fail ArgumentError, 'action_id is nil' if action_id.nil?
634
+ fail ArgumentError, 'action is nil' if action.nil?
635
+
636
+
637
+ request_headers = {}
638
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
639
+
640
+ # Set Headers
641
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
642
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
643
+
644
+ # Serialize Request
645
+ request_mapper = Azure::SecurityInsights::Mgmt::V2020_01_01::Models::ActionRequest.mapper()
646
+ request_content = @client.serialize(request_mapper, action)
647
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
648
+
649
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions/{actionId}'
650
+
651
+ request_url = @base_url || @client.base_url
652
+
653
+ options = {
654
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
655
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'ruleId' => rule_id,'actionId' => action_id},
656
+ query_params: {'api-version' => @client.api_version},
657
+ body: request_content,
658
+ headers: request_headers.merge(custom_headers || {}),
659
+ base_url: request_url
660
+ }
661
+ promise = @client.make_request_async(:put, path_template, options)
662
+
663
+ promise = promise.then do |result|
664
+ http_response = result.response
665
+ status_code = http_response.status
666
+ response_content = http_response.body
667
+ unless status_code == 200 || status_code == 201
668
+ error_model = JSON.load(response_content)
669
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
670
+ end
671
+
672
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
673
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
674
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
675
+ # Deserialize Response
676
+ if status_code == 200
677
+ begin
678
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
679
+ result_mapper = Azure::SecurityInsights::Mgmt::V2020_01_01::Models::ActionResponse.mapper()
680
+ result.body = @client.deserialize(result_mapper, parsed_response)
681
+ rescue Exception => e
682
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
683
+ end
684
+ end
685
+ # Deserialize Response
686
+ if status_code == 201
687
+ begin
688
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
689
+ result_mapper = Azure::SecurityInsights::Mgmt::V2020_01_01::Models::ActionResponse.mapper()
690
+ result.body = @client.deserialize(result_mapper, parsed_response)
691
+ rescue Exception => e
692
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
693
+ end
694
+ end
695
+
696
+ result
697
+ end
698
+
699
+ promise.execute
700
+ end
701
+
702
+ #
703
+ # Delete the action of alert rule.
704
+ #
705
+ # @param resource_group_name [String] The name of the resource group within the
706
+ # user's subscription. The name is case insensitive.
707
+ # @param workspace_name [String] The name of the workspace.
708
+ # @param rule_id [String] Alert rule ID
709
+ # @param action_id [String] Action ID
710
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
711
+ # will be added to the HTTP request.
712
+ #
713
+ #
714
+ def delete_action(resource_group_name, workspace_name, rule_id, action_id, custom_headers:nil)
715
+ response = delete_action_async(resource_group_name, workspace_name, rule_id, action_id, custom_headers:custom_headers).value!
716
+ nil
717
+ end
718
+
719
+ #
720
+ # Delete the action of alert rule.
721
+ #
722
+ # @param resource_group_name [String] The name of the resource group within the
723
+ # user's subscription. The name is case insensitive.
724
+ # @param workspace_name [String] The name of the workspace.
725
+ # @param rule_id [String] Alert rule ID
726
+ # @param action_id [String] Action ID
727
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
728
+ # will be added to the HTTP request.
729
+ #
730
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
731
+ #
732
+ def delete_action_with_http_info(resource_group_name, workspace_name, rule_id, action_id, custom_headers:nil)
733
+ delete_action_async(resource_group_name, workspace_name, rule_id, action_id, custom_headers:custom_headers).value!
734
+ end
735
+
736
+ #
737
+ # Delete the action of alert rule.
738
+ #
739
+ # @param resource_group_name [String] The name of the resource group within the
740
+ # user's subscription. The name is case insensitive.
741
+ # @param workspace_name [String] The name of the workspace.
742
+ # @param rule_id [String] Alert rule ID
743
+ # @param action_id [String] Action ID
744
+ # @param [Hash{String => String}] A hash of custom headers that will be added
745
+ # to the HTTP request.
746
+ #
747
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
748
+ #
749
+ def delete_action_async(resource_group_name, workspace_name, rule_id, action_id, custom_headers:nil)
750
+ @client.api_version = '2020-01-01'
751
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
752
+ 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?
753
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
754
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
755
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
756
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
757
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
758
+ fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MaxLength': '90'" if !workspace_name.nil? && workspace_name.length > 90
759
+ fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MinLength': '1'" if !workspace_name.nil? && workspace_name.length < 1
760
+ fail ArgumentError, 'rule_id is nil' if rule_id.nil?
761
+ fail ArgumentError, 'action_id is nil' if action_id.nil?
762
+
763
+
764
+ request_headers = {}
765
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
766
+
767
+ # Set Headers
768
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
769
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
770
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions/{actionId}'
771
+
772
+ request_url = @base_url || @client.base_url
773
+
774
+ options = {
775
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
776
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'ruleId' => rule_id,'actionId' => action_id},
777
+ query_params: {'api-version' => @client.api_version},
778
+ headers: request_headers.merge(custom_headers || {}),
779
+ base_url: request_url
780
+ }
781
+ promise = @client.make_request_async(:delete, path_template, options)
782
+
783
+ promise = promise.then do |result|
784
+ http_response = result.response
785
+ status_code = http_response.status
786
+ response_content = http_response.body
787
+ unless status_code == 200 || status_code == 204
788
+ error_model = JSON.load(response_content)
789
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
790
+ end
791
+
792
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
793
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
794
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
795
+
796
+ result
797
+ end
798
+
799
+ promise.execute
800
+ end
801
+
802
+ #
803
+ # Gets all alert rules.
804
+ #
805
+ # @param next_page_link [String] The NextLink from the previous successful call
806
+ # to List operation.
807
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
808
+ # will be added to the HTTP request.
809
+ #
810
+ # @return [AlertRulesList] operation results.
811
+ #
812
+ def list_next(next_page_link, custom_headers:nil)
813
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
814
+ response.body unless response.nil?
815
+ end
816
+
817
+ #
818
+ # Gets all alert rules.
819
+ #
820
+ # @param next_page_link [String] The NextLink from the previous successful call
821
+ # to List operation.
822
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
823
+ # will be added to the HTTP request.
824
+ #
825
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
826
+ #
827
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
828
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
829
+ end
830
+
831
+ #
832
+ # Gets all alert rules.
833
+ #
834
+ # @param next_page_link [String] The NextLink from the previous successful call
835
+ # to List operation.
836
+ # @param [Hash{String => String}] A hash of custom headers that will be added
837
+ # to the HTTP request.
838
+ #
839
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
840
+ #
841
+ def list_next_async(next_page_link, custom_headers:nil)
842
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
843
+
844
+
845
+ request_headers = {}
846
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
847
+
848
+ # Set Headers
849
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
850
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
851
+ path_template = '{nextLink}'
852
+
853
+ request_url = @base_url || @client.base_url
854
+
855
+ options = {
856
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
857
+ skip_encoding_path_params: {'nextLink' => next_page_link},
858
+ headers: request_headers.merge(custom_headers || {}),
859
+ base_url: request_url
860
+ }
861
+ promise = @client.make_request_async(:get, path_template, options)
862
+
863
+ promise = promise.then do |result|
864
+ http_response = result.response
865
+ status_code = http_response.status
866
+ response_content = http_response.body
867
+ unless status_code == 200
868
+ error_model = JSON.load(response_content)
869
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
870
+ end
871
+
872
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
873
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
874
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
875
+ # Deserialize Response
876
+ if status_code == 200
877
+ begin
878
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
879
+ result_mapper = Azure::SecurityInsights::Mgmt::V2020_01_01::Models::AlertRulesList.mapper()
880
+ result.body = @client.deserialize(result_mapper, parsed_response)
881
+ rescue Exception => e
882
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
883
+ end
884
+ end
885
+
886
+ result
887
+ end
888
+
889
+ promise.execute
890
+ end
891
+
892
+ #
893
+ # Gets all alert rules.
894
+ #
895
+ # @param resource_group_name [String] The name of the resource group within the
896
+ # user's subscription. The name is case insensitive.
897
+ # @param workspace_name [String] The name of the workspace.
898
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
899
+ # will be added to the HTTP request.
900
+ #
901
+ # @return [AlertRulesList] which provide lazy access to pages of the response.
902
+ #
903
+ def list_as_lazy(resource_group_name, workspace_name, custom_headers:nil)
904
+ response = list_async(resource_group_name, workspace_name, custom_headers:custom_headers).value!
905
+ unless response.nil?
906
+ page = response.body
907
+ page.next_method = Proc.new do |next_page_link|
908
+ list_next_async(next_page_link, custom_headers:custom_headers)
909
+ end
910
+ page
911
+ end
912
+ end
913
+
914
+ end
915
+ end