datadog_api_client 2.45.0 → 2.46.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) hide show
  1. checksums.yaml +4 -4
  2. data/.generator/schemas/v1/openapi.yaml +81 -0
  3. data/.generator/schemas/v2/openapi.yaml +3968 -94
  4. data/.pre-commit-config.yaml +4 -0
  5. data/CHANGELOG.md +20 -0
  6. data/examples/v1/monitors/CreateMonitor_3541766733.rb +32 -0
  7. data/examples/v2/deployment-gates/CreateDeploymentGate.rb +20 -0
  8. data/examples/v2/deployment-gates/CreateDeploymentRule.rb +25 -0
  9. data/examples/v2/deployment-gates/DeleteDeploymentGate.rb +11 -0
  10. data/examples/v2/deployment-gates/DeleteDeploymentRule.rb +14 -0
  11. data/examples/v2/deployment-gates/GetDeploymentGate.rb +11 -0
  12. data/examples/v2/deployment-gates/GetDeploymentRule.rb +14 -0
  13. data/examples/v2/deployment-gates/UpdateDeploymentGate.rb +21 -0
  14. data/examples/v2/deployment-gates/UpdateDeploymentRule.rb +27 -0
  15. data/examples/v2/fleet-automation/GetFleetAgentInfo.rb +8 -0
  16. data/examples/v2/fleet-automation/ListFleetAgents.rb +8 -0
  17. data/examples/v2/logs-restriction-queries/AddRoleToRestrictionQuery.rb +21 -0
  18. data/examples/v2/logs-restriction-queries/CreateRestrictionQuery.rb +17 -0
  19. data/examples/v2/logs-restriction-queries/DeleteRestrictionQuery.rb +11 -0
  20. data/examples/v2/logs-restriction-queries/GetRestrictionQuery.rb +11 -0
  21. data/examples/v2/logs-restriction-queries/GetRoleRestrictionQuery.rb +11 -0
  22. data/examples/v2/logs-restriction-queries/ListRestrictionQueries.rb +8 -0
  23. data/examples/v2/logs-restriction-queries/ListRestrictionQueryRoles.rb +11 -0
  24. data/examples/v2/logs-restriction-queries/ListUserRestrictionQueries.rb +11 -0
  25. data/examples/v2/logs-restriction-queries/RemoveRoleFromRestrictionQuery.rb +21 -0
  26. data/examples/v2/logs-restriction-queries/ReplaceRestrictionQuery.rb +20 -0
  27. data/examples/v2/logs-restriction-queries/UpdateRestrictionQuery.rb +20 -0
  28. data/examples/v2/monitors/CreateMonitorNotificationRule_1379932371.rb +21 -0
  29. data/examples/v2/monitors/UpdateMonitorNotificationRule_1446058210.rb +24 -0
  30. data/examples/v2/on-call/CreateOnCallEscalationPolicy.rb +9 -0
  31. data/examples/v2/on-call/GetScheduleOnCallUser.rb +1 -1
  32. data/examples/v2/reference-tables/CreateReferenceTable.rb +23 -14
  33. data/examples/v2/reference-tables/DeleteRows.rb +14 -0
  34. data/examples/v2/reference-tables/UpsertRows.rb +19 -0
  35. data/examples/v2/security-monitoring/AttachCase.rb +26 -0
  36. data/examples/v2/security-monitoring/AttachCase_897782765.rb +22 -0
  37. data/examples/v2/security-monitoring/AttachJiraIssue.rb +34 -0
  38. data/examples/v2/security-monitoring/AttachJiraIssue_3042842144.rb +30 -0
  39. data/examples/v2/security-monitoring/CreateCases.rb +56 -0
  40. data/examples/v2/security-monitoring/CreateCases_2385516013.rb +33 -0
  41. data/examples/v2/security-monitoring/CreateCases_2798851680.rb +37 -0
  42. data/examples/v2/security-monitoring/CreateJiraIssues.rb +96 -0
  43. data/examples/v2/security-monitoring/CreateJiraIssues_379590688.rb +56 -0
  44. data/examples/v2/security-monitoring/CreateJiraIssues_829823123.rb +64 -0
  45. data/examples/v2/security-monitoring/DetachCase.rb +21 -0
  46. data/examples/v2/teams/AddTeamHierarchyLink.rb +31 -0
  47. data/examples/v2/{team-connections → teams}/CreateTeamConnections.rb +1 -1
  48. data/examples/v2/{team-connections → teams}/DeleteTeamConnections.rb +1 -1
  49. data/examples/v2/teams/GetTeamHierarchyLink.rb +8 -0
  50. data/examples/v2/teams/GetTeamSync.rb +8 -0
  51. data/examples/v2/{team-connections → teams}/ListTeamConnections.rb +1 -1
  52. data/examples/v2/{team-connections → teams}/ListTeamConnections_1473516764.rb +1 -1
  53. data/examples/v2/{team-connections → teams}/ListTeamConnections_2418873869.rb +1 -1
  54. data/examples/v2/teams/ListTeamHierarchyLinks.rb +15 -0
  55. data/examples/v2/teams/ListTeamHierarchyLinks_3360757486.rb +5 -0
  56. data/examples/v2/teams/RemoveTeamHierarchyLink.rb +8 -0
  57. data/lib/datadog_api_client/configuration.rb +25 -3
  58. data/lib/datadog_api_client/inflector.rb +141 -3
  59. data/lib/datadog_api_client/v1/api/monitors_api.rb +2 -0
  60. data/lib/datadog_api_client/v1/models/monitor.rb +13 -1
  61. data/lib/datadog_api_client/v1/models/monitor_asset.rb +186 -0
  62. data/lib/datadog_api_client/v1/models/monitor_asset_category.rb +26 -0
  63. data/lib/datadog_api_client/v1/models/monitor_asset_resource_type.rb +26 -0
  64. data/lib/datadog_api_client/v1/models/monitor_update_request.rb +14 -1
  65. data/lib/datadog_api_client/v1/models/usage_summary_date.rb +11 -1
  66. data/lib/datadog_api_client/v1/models/usage_summary_date_org.rb +11 -1
  67. data/lib/datadog_api_client/v1/models/usage_summary_response.rb +11 -1
  68. data/lib/datadog_api_client/v2/api/deployment_gates_api.rb +632 -0
  69. data/lib/datadog_api_client/v2/api/fleet_automation_api.rb +166 -1
  70. data/lib/datadog_api_client/v2/api/logs_restriction_queries_api.rb +842 -0
  71. data/lib/datadog_api_client/v2/api/on_call_api.rb +2 -2
  72. data/lib/datadog_api_client/v2/api/reference_tables_api.rb +144 -0
  73. data/lib/datadog_api_client/v2/api/security_monitoring_api.rb +355 -5
  74. data/lib/datadog_api_client/v2/api/teams_api.rb +628 -1
  75. data/lib/datadog_api_client/v2/models/attach_case_request.rb +105 -0
  76. data/lib/datadog_api_client/v2/models/attach_case_request_data.rb +154 -0
  77. data/lib/datadog_api_client/v2/models/attach_case_request_data_relationships.rb +123 -0
  78. data/lib/datadog_api_client/v2/models/attach_jira_issue_request.rb +105 -0
  79. data/lib/datadog_api_client/v2/models/attach_jira_issue_request_data.rb +153 -0
  80. data/lib/datadog_api_client/v2/models/attach_jira_issue_request_data_attributes.rb +123 -0
  81. data/lib/datadog_api_client/v2/models/attach_jira_issue_request_data_relationships.rb +144 -0
  82. data/lib/datadog_api_client/v2/models/batch_delete_rows_request_array.rb +129 -0
  83. data/lib/datadog_api_client/v2/models/batch_delete_rows_request_data.rb +144 -0
  84. data/lib/datadog_api_client/v2/models/batch_upsert_rows_request_array.rb +129 -0
  85. data/lib/datadog_api_client/v2/models/batch_upsert_rows_request_data.rb +154 -0
  86. data/lib/datadog_api_client/v2/models/batch_upsert_rows_request_data_attributes.rb +123 -0
  87. data/lib/datadog_api_client/v2/models/case_data_type.rb +26 -0
  88. data/lib/datadog_api_client/v2/models/case_insights_items.rb +125 -0
  89. data/lib/datadog_api_client/v2/models/case_management_project.rb +123 -0
  90. data/lib/datadog_api_client/v2/models/case_management_project_data.rb +144 -0
  91. data/lib/datadog_api_client/v2/models/case_management_project_data_type.rb +26 -0
  92. data/lib/datadog_api_client/v2/models/configured_schedule.rb +186 -0
  93. data/lib/datadog_api_client/v2/models/configured_schedule_target.rb +144 -0
  94. data/lib/datadog_api_client/v2/models/configured_schedule_target_attributes.rb +123 -0
  95. data/lib/datadog_api_client/v2/models/configured_schedule_target_relationships.rb +123 -0
  96. data/lib/datadog_api_client/v2/models/configured_schedule_target_relationships_schedule.rb +123 -0
  97. data/lib/datadog_api_client/v2/models/configured_schedule_target_type.rb +26 -0
  98. data/lib/datadog_api_client/v2/models/create_case_request_array.rb +125 -0
  99. data/lib/datadog_api_client/v2/models/create_case_request_data.rb +153 -0
  100. data/lib/datadog_api_client/v2/models/create_case_request_data_attributes.rb +135 -0
  101. data/lib/datadog_api_client/v2/models/create_case_request_data_relationships.rb +144 -0
  102. data/lib/datadog_api_client/v2/models/create_deployment_gate_params.rb +123 -0
  103. data/lib/datadog_api_client/v2/models/create_deployment_gate_params_data.rb +144 -0
  104. data/lib/datadog_api_client/v2/models/create_deployment_gate_params_data_attributes.rb +164 -0
  105. data/lib/datadog_api_client/v2/models/create_deployment_rule_params.rb +105 -0
  106. data/lib/datadog_api_client/v2/models/create_deployment_rule_params_data.rb +144 -0
  107. data/lib/datadog_api_client/v2/models/create_deployment_rule_params_data_attributes.rb +175 -0
  108. data/lib/datadog_api_client/v2/models/create_jira_issue_request_array.rb +137 -0
  109. data/lib/datadog_api_client/v2/models/create_jira_issue_request_array_included.rb +64 -0
  110. data/lib/datadog_api_client/v2/models/create_jira_issue_request_data.rb +153 -0
  111. data/lib/datadog_api_client/v2/models/create_jira_issue_request_data_attributes.rb +105 -0
  112. data/lib/datadog_api_client/v2/models/create_jira_issue_request_data_attributes_fields.rb +105 -0
  113. data/lib/datadog_api_client/v2/models/create_jira_issue_request_data_relationships.rb +123 -0
  114. data/lib/datadog_api_client/v2/models/create_jira_issue_request_data_relationships_case.rb +123 -0
  115. data/lib/datadog_api_client/v2/models/create_jira_issue_request_data_relationships_case_data.rb +144 -0
  116. data/lib/datadog_api_client/v2/models/deployment_gate_data_type.rb +26 -0
  117. data/lib/datadog_api_client/v2/models/deployment_gate_response.rb +105 -0
  118. data/lib/datadog_api_client/v2/models/deployment_gate_response_data.rb +165 -0
  119. data/lib/datadog_api_client/v2/models/deployment_gate_response_data_attributes.rb +248 -0
  120. data/lib/datadog_api_client/v2/models/deployment_gate_response_data_attributes_created_by.rb +143 -0
  121. data/lib/datadog_api_client/v2/models/deployment_gate_response_data_attributes_updated_by.rb +143 -0
  122. data/lib/datadog_api_client/v2/models/deployment_rule_data_type.rb +26 -0
  123. data/lib/datadog_api_client/v2/models/{table_result_v2_data_attributes_file_metadata_local_file.rb → deployment_rule_options_faulty_deployment_detection.rb} +21 -19
  124. data/lib/datadog_api_client/v2/models/deployment_rule_options_monitor.rb +108 -0
  125. data/lib/datadog_api_client/v2/models/deployment_rule_response.rb +105 -0
  126. data/lib/datadog_api_client/v2/models/deployment_rule_response_data.rb +165 -0
  127. data/lib/datadog_api_client/v2/models/deployment_rule_response_data_attributes.rb +269 -0
  128. data/lib/datadog_api_client/v2/models/deployment_rule_response_data_attributes_created_by.rb +143 -0
  129. data/lib/datadog_api_client/v2/models/deployment_rule_response_data_attributes_type.rb +27 -0
  130. data/lib/datadog_api_client/v2/models/deployment_rule_response_data_attributes_updated_by.rb +143 -0
  131. data/lib/datadog_api_client/v2/models/deployment_rules_options.rb +63 -0
  132. data/lib/datadog_api_client/v2/models/detach_case_request.rb +105 -0
  133. data/lib/datadog_api_client/v2/models/detach_case_request_data.rb +143 -0
  134. data/lib/datadog_api_client/v2/models/detach_case_request_data_relationships.rb +123 -0
  135. data/lib/datadog_api_client/v2/models/escalation_policy_create_request_data_attributes.rb +28 -1
  136. data/lib/datadog_api_client/v2/models/escalation_policy_create_request_data_attributes_steps_items.rb +16 -1
  137. data/lib/datadog_api_client/v2/models/escalation_policy_data_attributes.rb +20 -1
  138. data/lib/datadog_api_client/v2/models/escalation_policy_included.rb +3 -2
  139. data/lib/datadog_api_client/v2/models/escalation_policy_step_target.rb +12 -2
  140. data/lib/datadog_api_client/v2/models/escalation_policy_step_target_config.rb +105 -0
  141. data/lib/datadog_api_client/v2/models/escalation_policy_step_target_config_schedule.rb +105 -0
  142. data/lib/datadog_api_client/v2/models/escalation_policy_update_request_data_attributes.rb +28 -1
  143. data/lib/datadog_api_client/v2/models/escalation_policy_update_request_data_attributes_steps_items.rb +16 -1
  144. data/lib/datadog_api_client/v2/models/escalation_target.rb +3 -2
  145. data/lib/datadog_api_client/v2/models/finding_case_response.rb +105 -0
  146. data/lib/datadog_api_client/v2/models/finding_case_response_array.rb +125 -0
  147. data/lib/datadog_api_client/v2/models/finding_case_response_data.rb +153 -0
  148. data/lib/datadog_api_client/v2/models/finding_case_response_data_attributes.rb +277 -0
  149. data/lib/datadog_api_client/v2/models/finding_case_response_data_relationships.rb +125 -0
  150. data/lib/datadog_api_client/v2/models/finding_data.rb +144 -0
  151. data/lib/datadog_api_client/v2/models/finding_data_type.rb +26 -0
  152. data/lib/datadog_api_client/v2/models/finding_jira_issue.rb +125 -0
  153. data/lib/datadog_api_client/v2/models/finding_jira_issue_result.rb +135 -0
  154. data/lib/datadog_api_client/v2/models/findings.rb +107 -0
  155. data/lib/datadog_api_client/v2/models/fleet_agent_attributes.rb +327 -0
  156. data/lib/datadog_api_client/v2/models/fleet_agent_attributes_tags_items.rb +115 -0
  157. data/lib/datadog_api_client/v2/models/fleet_agent_info.rb +165 -0
  158. data/lib/datadog_api_client/v2/models/fleet_agent_info_attributes.rb +137 -0
  159. data/lib/datadog_api_client/v2/models/fleet_agent_info_details.rb +403 -0
  160. data/lib/datadog_api_client/v2/models/fleet_agent_info_resource_type.rb +26 -0
  161. data/lib/datadog_api_client/v2/models/fleet_agent_info_response.rb +123 -0
  162. data/lib/datadog_api_client/v2/models/fleet_agents_response.rb +133 -0
  163. data/lib/datadog_api_client/v2/models/fleet_agents_response_data.rb +165 -0
  164. data/lib/datadog_api_client/v2/models/fleet_agents_response_data_attributes.rb +107 -0
  165. data/lib/datadog_api_client/v2/models/fleet_agents_response_meta.rb +105 -0
  166. data/lib/datadog_api_client/v2/models/fleet_configuration_file.rb +125 -0
  167. data/lib/datadog_api_client/v2/models/fleet_configuration_layer.rb +155 -0
  168. data/lib/datadog_api_client/v2/models/fleet_detected_integration.rb +115 -0
  169. data/lib/datadog_api_client/v2/models/fleet_integration_details.rb +197 -0
  170. data/lib/datadog_api_client/v2/models/fleet_integrations_by_status.rb +165 -0
  171. data/lib/datadog_api_client/v2/models/httpcd_gates_bad_request_response.rb +107 -0
  172. data/lib/datadog_api_client/v2/models/httpcd_gates_not_found_response.rb +107 -0
  173. data/lib/datadog_api_client/v2/models/httpcd_rules_not_found_response.rb +107 -0
  174. data/lib/datadog_api_client/v2/models/jira_issues_data_type.rb +26 -0
  175. data/lib/datadog_api_client/v2/models/layer_attributes.rb +13 -3
  176. data/lib/datadog_api_client/v2/models/logs_restriction_queries_type.rb +26 -0
  177. data/lib/datadog_api_client/v2/models/monitor_notification_rule_attributes.rb +2 -2
  178. data/lib/datadog_api_client/v2/models/monitor_notification_rule_condition.rb +1 -1
  179. data/lib/datadog_api_client/v2/models/monitor_notification_rule_conditional_recipients.rb +2 -2
  180. data/lib/datadog_api_client/v2/models/monitor_notification_rule_filter.rb +2 -1
  181. data/lib/datadog_api_client/v2/models/monitor_notification_rule_filter_scope.rb +106 -0
  182. data/lib/datadog_api_client/v2/models/monitor_notification_rule_filter_tags.rb +2 -2
  183. data/lib/datadog_api_client/v2/models/monitor_notification_rule_response_attributes.rb +2 -2
  184. data/lib/datadog_api_client/v2/models/observability_pipeline_google_chronicle_destination.rb +1 -12
  185. data/lib/datadog_api_client/v2/models/observability_pipeline_google_cloud_storage_destination.rb +2 -24
  186. data/lib/datadog_api_client/v2/models/observability_pipeline_google_pub_sub_source.rb +1 -12
  187. data/lib/datadog_api_client/v2/models/relationship_to_user_team_permission.rb +8 -0
  188. data/lib/datadog_api_client/v2/models/restriction_query_attributes.rb +165 -0
  189. data/lib/datadog_api_client/v2/models/restriction_query_create_attributes.rb +123 -0
  190. data/lib/datadog_api_client/v2/models/restriction_query_create_data.rb +115 -0
  191. data/lib/datadog_api_client/v2/models/restriction_query_create_payload.rb +105 -0
  192. data/lib/datadog_api_client/v2/models/restriction_query_list_response.rb +107 -0
  193. data/lib/datadog_api_client/v2/models/restriction_query_response_included_item.rb +62 -0
  194. data/lib/datadog_api_client/v2/models/restriction_query_role.rb +165 -0
  195. data/lib/datadog_api_client/v2/models/restriction_query_role_attribute.rb +105 -0
  196. data/lib/datadog_api_client/v2/models/restriction_query_roles_response.rb +107 -0
  197. data/lib/datadog_api_client/v2/models/restriction_query_update_attributes.rb +123 -0
  198. data/lib/datadog_api_client/v2/models/restriction_query_update_data.rb +115 -0
  199. data/lib/datadog_api_client/v2/models/restriction_query_update_payload.rb +105 -0
  200. data/lib/datadog_api_client/v2/models/restriction_query_with_relationships.rb +135 -0
  201. data/lib/datadog_api_client/v2/models/restriction_query_with_relationships_response.rb +117 -0
  202. data/lib/datadog_api_client/v2/models/restriction_query_without_relationships.rb +125 -0
  203. data/lib/datadog_api_client/v2/models/restriction_query_without_relationships_response.rb +105 -0
  204. data/lib/datadog_api_client/v2/models/schedule_create_request_data_attributes_layers_items.rb +13 -3
  205. data/lib/datadog_api_client/v2/models/schedule_target.rb +1 -1
  206. data/lib/datadog_api_client/v2/models/schedule_target_position.rb +28 -0
  207. data/lib/datadog_api_client/v2/models/schedule_update_request_data_attributes_layers_items.rb +13 -3
  208. data/lib/datadog_api_client/v2/models/table_result_v2_data_attributes.rb +8 -0
  209. data/lib/datadog_api_client/v2/models/table_result_v2_data_attributes_file_metadata.rb +101 -36
  210. data/lib/datadog_api_client/v2/models/team_attributes.rb +13 -1
  211. data/lib/datadog_api_client/v2/models/team_hierarchy_link.rb +175 -0
  212. data/lib/datadog_api_client/v2/models/team_hierarchy_link_attributes.rb +144 -0
  213. data/lib/datadog_api_client/v2/models/team_hierarchy_link_create.rb +144 -0
  214. data/lib/datadog_api_client/v2/models/team_hierarchy_link_create_relationships.rb +144 -0
  215. data/lib/datadog_api_client/v2/models/team_hierarchy_link_create_request.rb +123 -0
  216. data/lib/datadog_api_client/v2/models/team_hierarchy_link_create_team.rb +144 -0
  217. data/lib/datadog_api_client/v2/models/team_hierarchy_link_create_team_relationship.rb +123 -0
  218. data/lib/datadog_api_client/v2/models/team_hierarchy_link_relationships.rb +144 -0
  219. data/lib/datadog_api_client/v2/models/team_hierarchy_link_response.rb +127 -0
  220. data/lib/datadog_api_client/v2/models/team_hierarchy_link_team.rb +154 -0
  221. data/lib/datadog_api_client/v2/models/team_hierarchy_link_team_attributes.rb +223 -0
  222. data/lib/datadog_api_client/v2/models/team_hierarchy_link_team_relationship.rb +123 -0
  223. data/lib/datadog_api_client/v2/models/team_hierarchy_link_type.rb +26 -0
  224. data/lib/datadog_api_client/v2/models/team_hierarchy_links_response.rb +139 -0
  225. data/lib/datadog_api_client/v2/models/team_sync_attributes.rb +22 -2
  226. data/lib/datadog_api_client/v2/models/team_sync_attributes_frequency.rb +28 -0
  227. data/lib/datadog_api_client/v2/models/team_sync_attributes_type.rb +2 -1
  228. data/lib/datadog_api_client/v2/models/team_sync_data.rb +12 -2
  229. data/lib/datadog_api_client/v2/models/team_sync_request.rb +1 -1
  230. data/lib/datadog_api_client/v2/models/team_sync_response.rb +107 -0
  231. data/lib/datadog_api_client/v2/models/teams_hierarchy_links_response_links.rb +156 -0
  232. data/lib/datadog_api_client/v2/models/teams_hierarchy_links_response_meta.rb +105 -0
  233. data/lib/datadog_api_client/v2/models/teams_hierarchy_links_response_meta_page.rb +184 -0
  234. data/lib/datadog_api_client/v2/models/threat_hunting_job_response_attributes.rb +13 -3
  235. data/lib/datadog_api_client/v2/models/update_deployment_gate_params.rb +123 -0
  236. data/lib/datadog_api_client/v2/models/update_deployment_gate_params_data.rb +165 -0
  237. data/lib/datadog_api_client/v2/models/update_deployment_gate_params_data_attributes.rb +123 -0
  238. data/lib/datadog_api_client/v2/models/update_deployment_rule_params.rb +123 -0
  239. data/lib/datadog_api_client/v2/models/update_deployment_rule_params_data.rb +144 -0
  240. data/lib/datadog_api_client/v2/models/update_deployment_rule_params_data_attributes.rb +165 -0
  241. data/lib/datadog_api_client/version.rb +1 -1
  242. metadata +190 -9
  243. data/lib/datadog_api_client/v2/api/team_connections_api.rb +0 -272
  244. data/lib/datadog_api_client/v2/models/table_result_v2_data_attributes_file_metadata_cloud_storage.rb +0 -138
@@ -0,0 +1,842 @@
1
+ =begin
2
+ #Datadog API V2 Collection
3
+
4
+ #Collection of all Datadog Public endpoints.
5
+
6
+ The version of the OpenAPI document: 1.0
7
+ Contact: support@datadoghq.com
8
+ Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9
+
10
+ Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11
+ This product includes software developed at Datadog (https://www.datadoghq.com/).
12
+ Copyright 2020-Present Datadog, Inc.
13
+
14
+ =end
15
+
16
+ require 'cgi'
17
+
18
+ module DatadogAPIClient::V2
19
+ class LogsRestrictionQueriesAPI
20
+ attr_accessor :api_client
21
+
22
+ def initialize(api_client = DatadogAPIClient::APIClient.default)
23
+ @api_client = api_client
24
+ end
25
+
26
+ # Grant role to a restriction query.
27
+ #
28
+ # @see #add_role_to_restriction_query_with_http_info
29
+ def add_role_to_restriction_query(restriction_query_id, body, opts = {})
30
+ add_role_to_restriction_query_with_http_info(restriction_query_id, body, opts)
31
+ nil
32
+ end
33
+
34
+ # Grant role to a restriction query.
35
+ #
36
+ # Adds a role to a restriction query.
37
+ #
38
+ # **Note**: This operation automatically grants the `logs_read_data` permission to the role if it doesn't already have it.
39
+ #
40
+ # @param restriction_query_id [String] The ID of the restriction query.
41
+ # @param body [RelationshipToRole]
42
+ # @param opts [Hash] the optional parameters
43
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
44
+ def add_role_to_restriction_query_with_http_info(restriction_query_id, body, opts = {})
45
+ unstable_enabled = @api_client.config.unstable_operations["v2.add_role_to_restriction_query".to_sym]
46
+ if unstable_enabled
47
+ @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.add_role_to_restriction_query")
48
+ else
49
+ raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.add_role_to_restriction_query"))
50
+ end
51
+
52
+ if @api_client.config.debugging
53
+ @api_client.config.logger.debug 'Calling API: LogsRestrictionQueriesAPI.add_role_to_restriction_query ...'
54
+ end
55
+ # verify the required parameter 'restriction_query_id' is set
56
+ if @api_client.config.client_side_validation && restriction_query_id.nil?
57
+ fail ArgumentError, "Missing the required parameter 'restriction_query_id' when calling LogsRestrictionQueriesAPI.add_role_to_restriction_query"
58
+ end
59
+ # verify the required parameter 'body' is set
60
+ if @api_client.config.client_side_validation && body.nil?
61
+ fail ArgumentError, "Missing the required parameter 'body' when calling LogsRestrictionQueriesAPI.add_role_to_restriction_query"
62
+ end
63
+ # resource path
64
+ local_var_path = '/api/v2/logs/config/restriction_queries/{restriction_query_id}/roles'.sub('{restriction_query_id}', CGI.escape(restriction_query_id.to_s).gsub('%2F', '/'))
65
+
66
+ # query parameters
67
+ query_params = opts[:query_params] || {}
68
+
69
+ # header parameters
70
+ header_params = opts[:header_params] || {}
71
+ # HTTP header 'Accept' (if needed)
72
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
73
+ # HTTP header 'Content-Type'
74
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
75
+
76
+ # form parameters
77
+ form_params = opts[:form_params] || {}
78
+
79
+ # http body (model)
80
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
81
+
82
+ # return_type
83
+ return_type = opts[:debug_return_type]
84
+
85
+ # auth_names
86
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
87
+
88
+ new_options = opts.merge(
89
+ :operation => :add_role_to_restriction_query,
90
+ :header_params => header_params,
91
+ :query_params => query_params,
92
+ :form_params => form_params,
93
+ :body => post_body,
94
+ :auth_names => auth_names,
95
+ :return_type => return_type,
96
+ :api_version => "V2"
97
+ )
98
+
99
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
100
+ if @api_client.config.debugging
101
+ @api_client.config.logger.debug "API called: LogsRestrictionQueriesAPI#add_role_to_restriction_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
102
+ end
103
+ return data, status_code, headers
104
+ end
105
+
106
+ # Create a restriction query.
107
+ #
108
+ # @see #create_restriction_query_with_http_info
109
+ def create_restriction_query(body, opts = {})
110
+ data, _status_code, _headers = create_restriction_query_with_http_info(body, opts)
111
+ data
112
+ end
113
+
114
+ # Create a restriction query.
115
+ #
116
+ # Create a new restriction query for your organization.
117
+ #
118
+ # @param body [RestrictionQueryCreatePayload]
119
+ # @param opts [Hash] the optional parameters
120
+ # @return [Array<(RestrictionQueryWithoutRelationshipsResponse, Integer, Hash)>] RestrictionQueryWithoutRelationshipsResponse data, response status code and response headers
121
+ def create_restriction_query_with_http_info(body, opts = {})
122
+ unstable_enabled = @api_client.config.unstable_operations["v2.create_restriction_query".to_sym]
123
+ if unstable_enabled
124
+ @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_restriction_query")
125
+ else
126
+ raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_restriction_query"))
127
+ end
128
+
129
+ if @api_client.config.debugging
130
+ @api_client.config.logger.debug 'Calling API: LogsRestrictionQueriesAPI.create_restriction_query ...'
131
+ end
132
+ # verify the required parameter 'body' is set
133
+ if @api_client.config.client_side_validation && body.nil?
134
+ fail ArgumentError, "Missing the required parameter 'body' when calling LogsRestrictionQueriesAPI.create_restriction_query"
135
+ end
136
+ # resource path
137
+ local_var_path = '/api/v2/logs/config/restriction_queries'
138
+
139
+ # query parameters
140
+ query_params = opts[:query_params] || {}
141
+
142
+ # header parameters
143
+ header_params = opts[:header_params] || {}
144
+ # HTTP header 'Accept' (if needed)
145
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
146
+ # HTTP header 'Content-Type'
147
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
148
+
149
+ # form parameters
150
+ form_params = opts[:form_params] || {}
151
+
152
+ # http body (model)
153
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
154
+
155
+ # return_type
156
+ return_type = opts[:debug_return_type] || 'RestrictionQueryWithoutRelationshipsResponse'
157
+
158
+ # auth_names
159
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
160
+
161
+ new_options = opts.merge(
162
+ :operation => :create_restriction_query,
163
+ :header_params => header_params,
164
+ :query_params => query_params,
165
+ :form_params => form_params,
166
+ :body => post_body,
167
+ :auth_names => auth_names,
168
+ :return_type => return_type,
169
+ :api_version => "V2"
170
+ )
171
+
172
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
173
+ if @api_client.config.debugging
174
+ @api_client.config.logger.debug "API called: LogsRestrictionQueriesAPI#create_restriction_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
175
+ end
176
+ return data, status_code, headers
177
+ end
178
+
179
+ # Delete a restriction query.
180
+ #
181
+ # @see #delete_restriction_query_with_http_info
182
+ def delete_restriction_query(restriction_query_id, opts = {})
183
+ delete_restriction_query_with_http_info(restriction_query_id, opts)
184
+ nil
185
+ end
186
+
187
+ # Delete a restriction query.
188
+ #
189
+ # Deletes a restriction query.
190
+ #
191
+ # @param restriction_query_id [String] The ID of the restriction query.
192
+ # @param opts [Hash] the optional parameters
193
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
194
+ def delete_restriction_query_with_http_info(restriction_query_id, opts = {})
195
+ unstable_enabled = @api_client.config.unstable_operations["v2.delete_restriction_query".to_sym]
196
+ if unstable_enabled
197
+ @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_restriction_query")
198
+ else
199
+ raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_restriction_query"))
200
+ end
201
+
202
+ if @api_client.config.debugging
203
+ @api_client.config.logger.debug 'Calling API: LogsRestrictionQueriesAPI.delete_restriction_query ...'
204
+ end
205
+ # verify the required parameter 'restriction_query_id' is set
206
+ if @api_client.config.client_side_validation && restriction_query_id.nil?
207
+ fail ArgumentError, "Missing the required parameter 'restriction_query_id' when calling LogsRestrictionQueriesAPI.delete_restriction_query"
208
+ end
209
+ # resource path
210
+ local_var_path = '/api/v2/logs/config/restriction_queries/{restriction_query_id}'.sub('{restriction_query_id}', CGI.escape(restriction_query_id.to_s).gsub('%2F', '/'))
211
+
212
+ # query parameters
213
+ query_params = opts[:query_params] || {}
214
+
215
+ # header parameters
216
+ header_params = opts[:header_params] || {}
217
+ # HTTP header 'Accept' (if needed)
218
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
219
+
220
+ # form parameters
221
+ form_params = opts[:form_params] || {}
222
+
223
+ # http body (model)
224
+ post_body = opts[:debug_body]
225
+
226
+ # return_type
227
+ return_type = opts[:debug_return_type]
228
+
229
+ # auth_names
230
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
231
+
232
+ new_options = opts.merge(
233
+ :operation => :delete_restriction_query,
234
+ :header_params => header_params,
235
+ :query_params => query_params,
236
+ :form_params => form_params,
237
+ :body => post_body,
238
+ :auth_names => auth_names,
239
+ :return_type => return_type,
240
+ :api_version => "V2"
241
+ )
242
+
243
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
244
+ if @api_client.config.debugging
245
+ @api_client.config.logger.debug "API called: LogsRestrictionQueriesAPI#delete_restriction_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
246
+ end
247
+ return data, status_code, headers
248
+ end
249
+
250
+ # Get a restriction query.
251
+ #
252
+ # @see #get_restriction_query_with_http_info
253
+ def get_restriction_query(restriction_query_id, opts = {})
254
+ data, _status_code, _headers = get_restriction_query_with_http_info(restriction_query_id, opts)
255
+ data
256
+ end
257
+
258
+ # Get a restriction query.
259
+ #
260
+ # Get a restriction query in the organization specified by the restriction query's `restriction_query_id`.
261
+ #
262
+ # @param restriction_query_id [String] The ID of the restriction query.
263
+ # @param opts [Hash] the optional parameters
264
+ # @return [Array<(RestrictionQueryWithRelationshipsResponse, Integer, Hash)>] RestrictionQueryWithRelationshipsResponse data, response status code and response headers
265
+ def get_restriction_query_with_http_info(restriction_query_id, opts = {})
266
+ unstable_enabled = @api_client.config.unstable_operations["v2.get_restriction_query".to_sym]
267
+ if unstable_enabled
268
+ @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_restriction_query")
269
+ else
270
+ raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_restriction_query"))
271
+ end
272
+
273
+ if @api_client.config.debugging
274
+ @api_client.config.logger.debug 'Calling API: LogsRestrictionQueriesAPI.get_restriction_query ...'
275
+ end
276
+ # verify the required parameter 'restriction_query_id' is set
277
+ if @api_client.config.client_side_validation && restriction_query_id.nil?
278
+ fail ArgumentError, "Missing the required parameter 'restriction_query_id' when calling LogsRestrictionQueriesAPI.get_restriction_query"
279
+ end
280
+ # resource path
281
+ local_var_path = '/api/v2/logs/config/restriction_queries/{restriction_query_id}'.sub('{restriction_query_id}', CGI.escape(restriction_query_id.to_s).gsub('%2F', '/'))
282
+
283
+ # query parameters
284
+ query_params = opts[:query_params] || {}
285
+
286
+ # header parameters
287
+ header_params = opts[:header_params] || {}
288
+ # HTTP header 'Accept' (if needed)
289
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
290
+
291
+ # form parameters
292
+ form_params = opts[:form_params] || {}
293
+
294
+ # http body (model)
295
+ post_body = opts[:debug_body]
296
+
297
+ # return_type
298
+ return_type = opts[:debug_return_type] || 'RestrictionQueryWithRelationshipsResponse'
299
+
300
+ # auth_names
301
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
302
+
303
+ new_options = opts.merge(
304
+ :operation => :get_restriction_query,
305
+ :header_params => header_params,
306
+ :query_params => query_params,
307
+ :form_params => form_params,
308
+ :body => post_body,
309
+ :auth_names => auth_names,
310
+ :return_type => return_type,
311
+ :api_version => "V2"
312
+ )
313
+
314
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
315
+ if @api_client.config.debugging
316
+ @api_client.config.logger.debug "API called: LogsRestrictionQueriesAPI#get_restriction_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
317
+ end
318
+ return data, status_code, headers
319
+ end
320
+
321
+ # Get restriction query for a given role.
322
+ #
323
+ # @see #get_role_restriction_query_with_http_info
324
+ def get_role_restriction_query(role_id, opts = {})
325
+ data, _status_code, _headers = get_role_restriction_query_with_http_info(role_id, opts)
326
+ data
327
+ end
328
+
329
+ # Get restriction query for a given role.
330
+ #
331
+ # Get restriction query for a given role.
332
+ #
333
+ # @param role_id [String] The ID of the role.
334
+ # @param opts [Hash] the optional parameters
335
+ # @return [Array<(RestrictionQueryListResponse, Integer, Hash)>] RestrictionQueryListResponse data, response status code and response headers
336
+ def get_role_restriction_query_with_http_info(role_id, opts = {})
337
+ unstable_enabled = @api_client.config.unstable_operations["v2.get_role_restriction_query".to_sym]
338
+ if unstable_enabled
339
+ @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_role_restriction_query")
340
+ else
341
+ raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_role_restriction_query"))
342
+ end
343
+
344
+ if @api_client.config.debugging
345
+ @api_client.config.logger.debug 'Calling API: LogsRestrictionQueriesAPI.get_role_restriction_query ...'
346
+ end
347
+ # verify the required parameter 'role_id' is set
348
+ if @api_client.config.client_side_validation && role_id.nil?
349
+ fail ArgumentError, "Missing the required parameter 'role_id' when calling LogsRestrictionQueriesAPI.get_role_restriction_query"
350
+ end
351
+ # resource path
352
+ local_var_path = '/api/v2/logs/config/restriction_queries/role/{role_id}'.sub('{role_id}', CGI.escape(role_id.to_s).gsub('%2F', '/'))
353
+
354
+ # query parameters
355
+ query_params = opts[:query_params] || {}
356
+
357
+ # header parameters
358
+ header_params = opts[:header_params] || {}
359
+ # HTTP header 'Accept' (if needed)
360
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
361
+
362
+ # form parameters
363
+ form_params = opts[:form_params] || {}
364
+
365
+ # http body (model)
366
+ post_body = opts[:debug_body]
367
+
368
+ # return_type
369
+ return_type = opts[:debug_return_type] || 'RestrictionQueryListResponse'
370
+
371
+ # auth_names
372
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
373
+
374
+ new_options = opts.merge(
375
+ :operation => :get_role_restriction_query,
376
+ :header_params => header_params,
377
+ :query_params => query_params,
378
+ :form_params => form_params,
379
+ :body => post_body,
380
+ :auth_names => auth_names,
381
+ :return_type => return_type,
382
+ :api_version => "V2"
383
+ )
384
+
385
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
386
+ if @api_client.config.debugging
387
+ @api_client.config.logger.debug "API called: LogsRestrictionQueriesAPI#get_role_restriction_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
388
+ end
389
+ return data, status_code, headers
390
+ end
391
+
392
+ # List restriction queries.
393
+ #
394
+ # @see #list_restriction_queries_with_http_info
395
+ def list_restriction_queries(opts = {})
396
+ data, _status_code, _headers = list_restriction_queries_with_http_info(opts)
397
+ data
398
+ end
399
+
400
+ # List restriction queries.
401
+ #
402
+ # Returns all restriction queries, including their names and IDs.
403
+ #
404
+ # @param opts [Hash] the optional parameters
405
+ # @option opts [Integer] :page_size Size for a given page. The maximum allowed value is 100.
406
+ # @option opts [Integer] :page_number Specific page number to return.
407
+ # @return [Array<(RestrictionQueryListResponse, Integer, Hash)>] RestrictionQueryListResponse data, response status code and response headers
408
+ def list_restriction_queries_with_http_info(opts = {})
409
+ unstable_enabled = @api_client.config.unstable_operations["v2.list_restriction_queries".to_sym]
410
+ if unstable_enabled
411
+ @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_restriction_queries")
412
+ else
413
+ raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_restriction_queries"))
414
+ end
415
+
416
+ if @api_client.config.debugging
417
+ @api_client.config.logger.debug 'Calling API: LogsRestrictionQueriesAPI.list_restriction_queries ...'
418
+ end
419
+ # resource path
420
+ local_var_path = '/api/v2/logs/config/restriction_queries'
421
+
422
+ # query parameters
423
+ query_params = opts[:query_params] || {}
424
+ query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
425
+ query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil?
426
+
427
+ # header parameters
428
+ header_params = opts[:header_params] || {}
429
+ # HTTP header 'Accept' (if needed)
430
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
431
+
432
+ # form parameters
433
+ form_params = opts[:form_params] || {}
434
+
435
+ # http body (model)
436
+ post_body = opts[:debug_body]
437
+
438
+ # return_type
439
+ return_type = opts[:debug_return_type] || 'RestrictionQueryListResponse'
440
+
441
+ # auth_names
442
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
443
+
444
+ new_options = opts.merge(
445
+ :operation => :list_restriction_queries,
446
+ :header_params => header_params,
447
+ :query_params => query_params,
448
+ :form_params => form_params,
449
+ :body => post_body,
450
+ :auth_names => auth_names,
451
+ :return_type => return_type,
452
+ :api_version => "V2"
453
+ )
454
+
455
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
456
+ if @api_client.config.debugging
457
+ @api_client.config.logger.debug "API called: LogsRestrictionQueriesAPI#list_restriction_queries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
458
+ end
459
+ return data, status_code, headers
460
+ end
461
+
462
+ # List roles for a restriction query.
463
+ #
464
+ # @see #list_restriction_query_roles_with_http_info
465
+ def list_restriction_query_roles(restriction_query_id, opts = {})
466
+ data, _status_code, _headers = list_restriction_query_roles_with_http_info(restriction_query_id, opts)
467
+ data
468
+ end
469
+
470
+ # List roles for a restriction query.
471
+ #
472
+ # Returns all roles that have a given restriction query.
473
+ #
474
+ # @param restriction_query_id [String] The ID of the restriction query.
475
+ # @param opts [Hash] the optional parameters
476
+ # @option opts [Integer] :page_size Size for a given page. The maximum allowed value is 100.
477
+ # @option opts [Integer] :page_number Specific page number to return.
478
+ # @return [Array<(RestrictionQueryRolesResponse, Integer, Hash)>] RestrictionQueryRolesResponse data, response status code and response headers
479
+ def list_restriction_query_roles_with_http_info(restriction_query_id, opts = {})
480
+ unstable_enabled = @api_client.config.unstable_operations["v2.list_restriction_query_roles".to_sym]
481
+ if unstable_enabled
482
+ @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_restriction_query_roles")
483
+ else
484
+ raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_restriction_query_roles"))
485
+ end
486
+
487
+ if @api_client.config.debugging
488
+ @api_client.config.logger.debug 'Calling API: LogsRestrictionQueriesAPI.list_restriction_query_roles ...'
489
+ end
490
+ # verify the required parameter 'restriction_query_id' is set
491
+ if @api_client.config.client_side_validation && restriction_query_id.nil?
492
+ fail ArgumentError, "Missing the required parameter 'restriction_query_id' when calling LogsRestrictionQueriesAPI.list_restriction_query_roles"
493
+ end
494
+ # resource path
495
+ local_var_path = '/api/v2/logs/config/restriction_queries/{restriction_query_id}/roles'.sub('{restriction_query_id}', CGI.escape(restriction_query_id.to_s).gsub('%2F', '/'))
496
+
497
+ # query parameters
498
+ query_params = opts[:query_params] || {}
499
+ query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
500
+ query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil?
501
+
502
+ # header parameters
503
+ header_params = opts[:header_params] || {}
504
+ # HTTP header 'Accept' (if needed)
505
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
506
+
507
+ # form parameters
508
+ form_params = opts[:form_params] || {}
509
+
510
+ # http body (model)
511
+ post_body = opts[:debug_body]
512
+
513
+ # return_type
514
+ return_type = opts[:debug_return_type] || 'RestrictionQueryRolesResponse'
515
+
516
+ # auth_names
517
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
518
+
519
+ new_options = opts.merge(
520
+ :operation => :list_restriction_query_roles,
521
+ :header_params => header_params,
522
+ :query_params => query_params,
523
+ :form_params => form_params,
524
+ :body => post_body,
525
+ :auth_names => auth_names,
526
+ :return_type => return_type,
527
+ :api_version => "V2"
528
+ )
529
+
530
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
531
+ if @api_client.config.debugging
532
+ @api_client.config.logger.debug "API called: LogsRestrictionQueriesAPI#list_restriction_query_roles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
533
+ end
534
+ return data, status_code, headers
535
+ end
536
+
537
+ # Get all restriction queries for a given user.
538
+ #
539
+ # @see #list_user_restriction_queries_with_http_info
540
+ def list_user_restriction_queries(user_id, opts = {})
541
+ data, _status_code, _headers = list_user_restriction_queries_with_http_info(user_id, opts)
542
+ data
543
+ end
544
+
545
+ # Get all restriction queries for a given user.
546
+ #
547
+ # Get all restriction queries for a given user.
548
+ #
549
+ # @param user_id [String] The ID of the user.
550
+ # @param opts [Hash] the optional parameters
551
+ # @return [Array<(RestrictionQueryListResponse, Integer, Hash)>] RestrictionQueryListResponse data, response status code and response headers
552
+ def list_user_restriction_queries_with_http_info(user_id, opts = {})
553
+ unstable_enabled = @api_client.config.unstable_operations["v2.list_user_restriction_queries".to_sym]
554
+ if unstable_enabled
555
+ @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_user_restriction_queries")
556
+ else
557
+ raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_user_restriction_queries"))
558
+ end
559
+
560
+ if @api_client.config.debugging
561
+ @api_client.config.logger.debug 'Calling API: LogsRestrictionQueriesAPI.list_user_restriction_queries ...'
562
+ end
563
+ # verify the required parameter 'user_id' is set
564
+ if @api_client.config.client_side_validation && user_id.nil?
565
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling LogsRestrictionQueriesAPI.list_user_restriction_queries"
566
+ end
567
+ # resource path
568
+ local_var_path = '/api/v2/logs/config/restriction_queries/user/{user_id}'.sub('{user_id}', CGI.escape(user_id.to_s).gsub('%2F', '/'))
569
+
570
+ # query parameters
571
+ query_params = opts[:query_params] || {}
572
+
573
+ # header parameters
574
+ header_params = opts[:header_params] || {}
575
+ # HTTP header 'Accept' (if needed)
576
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
577
+
578
+ # form parameters
579
+ form_params = opts[:form_params] || {}
580
+
581
+ # http body (model)
582
+ post_body = opts[:debug_body]
583
+
584
+ # return_type
585
+ return_type = opts[:debug_return_type] || 'RestrictionQueryListResponse'
586
+
587
+ # auth_names
588
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
589
+
590
+ new_options = opts.merge(
591
+ :operation => :list_user_restriction_queries,
592
+ :header_params => header_params,
593
+ :query_params => query_params,
594
+ :form_params => form_params,
595
+ :body => post_body,
596
+ :auth_names => auth_names,
597
+ :return_type => return_type,
598
+ :api_version => "V2"
599
+ )
600
+
601
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
602
+ if @api_client.config.debugging
603
+ @api_client.config.logger.debug "API called: LogsRestrictionQueriesAPI#list_user_restriction_queries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
604
+ end
605
+ return data, status_code, headers
606
+ end
607
+
608
+ # Revoke role from a restriction query.
609
+ #
610
+ # @see #remove_role_from_restriction_query_with_http_info
611
+ def remove_role_from_restriction_query(restriction_query_id, body, opts = {})
612
+ remove_role_from_restriction_query_with_http_info(restriction_query_id, body, opts)
613
+ nil
614
+ end
615
+
616
+ # Revoke role from a restriction query.
617
+ #
618
+ # Removes a role from a restriction query.
619
+ #
620
+ # @param restriction_query_id [String] The ID of the restriction query.
621
+ # @param body [RelationshipToRole]
622
+ # @param opts [Hash] the optional parameters
623
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
624
+ def remove_role_from_restriction_query_with_http_info(restriction_query_id, body, opts = {})
625
+ unstable_enabled = @api_client.config.unstable_operations["v2.remove_role_from_restriction_query".to_sym]
626
+ if unstable_enabled
627
+ @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.remove_role_from_restriction_query")
628
+ else
629
+ raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.remove_role_from_restriction_query"))
630
+ end
631
+
632
+ if @api_client.config.debugging
633
+ @api_client.config.logger.debug 'Calling API: LogsRestrictionQueriesAPI.remove_role_from_restriction_query ...'
634
+ end
635
+ # verify the required parameter 'restriction_query_id' is set
636
+ if @api_client.config.client_side_validation && restriction_query_id.nil?
637
+ fail ArgumentError, "Missing the required parameter 'restriction_query_id' when calling LogsRestrictionQueriesAPI.remove_role_from_restriction_query"
638
+ end
639
+ # verify the required parameter 'body' is set
640
+ if @api_client.config.client_side_validation && body.nil?
641
+ fail ArgumentError, "Missing the required parameter 'body' when calling LogsRestrictionQueriesAPI.remove_role_from_restriction_query"
642
+ end
643
+ # resource path
644
+ local_var_path = '/api/v2/logs/config/restriction_queries/{restriction_query_id}/roles'.sub('{restriction_query_id}', CGI.escape(restriction_query_id.to_s).gsub('%2F', '/'))
645
+
646
+ # query parameters
647
+ query_params = opts[:query_params] || {}
648
+
649
+ # header parameters
650
+ header_params = opts[:header_params] || {}
651
+ # HTTP header 'Accept' (if needed)
652
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
653
+ # HTTP header 'Content-Type'
654
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
655
+
656
+ # form parameters
657
+ form_params = opts[:form_params] || {}
658
+
659
+ # http body (model)
660
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
661
+
662
+ # return_type
663
+ return_type = opts[:debug_return_type]
664
+
665
+ # auth_names
666
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
667
+
668
+ new_options = opts.merge(
669
+ :operation => :remove_role_from_restriction_query,
670
+ :header_params => header_params,
671
+ :query_params => query_params,
672
+ :form_params => form_params,
673
+ :body => post_body,
674
+ :auth_names => auth_names,
675
+ :return_type => return_type,
676
+ :api_version => "V2"
677
+ )
678
+
679
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
680
+ if @api_client.config.debugging
681
+ @api_client.config.logger.debug "API called: LogsRestrictionQueriesAPI#remove_role_from_restriction_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
682
+ end
683
+ return data, status_code, headers
684
+ end
685
+
686
+ # Replace a restriction query.
687
+ #
688
+ # @see #replace_restriction_query_with_http_info
689
+ def replace_restriction_query(restriction_query_id, body, opts = {})
690
+ data, _status_code, _headers = replace_restriction_query_with_http_info(restriction_query_id, body, opts)
691
+ data
692
+ end
693
+
694
+ # Replace a restriction query.
695
+ #
696
+ # Replace a restriction query.
697
+ #
698
+ # @param restriction_query_id [String] The ID of the restriction query.
699
+ # @param body [RestrictionQueryUpdatePayload]
700
+ # @param opts [Hash] the optional parameters
701
+ # @return [Array<(RestrictionQueryWithoutRelationshipsResponse, Integer, Hash)>] RestrictionQueryWithoutRelationshipsResponse data, response status code and response headers
702
+ def replace_restriction_query_with_http_info(restriction_query_id, body, opts = {})
703
+ unstable_enabled = @api_client.config.unstable_operations["v2.replace_restriction_query".to_sym]
704
+ if unstable_enabled
705
+ @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.replace_restriction_query")
706
+ else
707
+ raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.replace_restriction_query"))
708
+ end
709
+
710
+ if @api_client.config.debugging
711
+ @api_client.config.logger.debug 'Calling API: LogsRestrictionQueriesAPI.replace_restriction_query ...'
712
+ end
713
+ # verify the required parameter 'restriction_query_id' is set
714
+ if @api_client.config.client_side_validation && restriction_query_id.nil?
715
+ fail ArgumentError, "Missing the required parameter 'restriction_query_id' when calling LogsRestrictionQueriesAPI.replace_restriction_query"
716
+ end
717
+ # verify the required parameter 'body' is set
718
+ if @api_client.config.client_side_validation && body.nil?
719
+ fail ArgumentError, "Missing the required parameter 'body' when calling LogsRestrictionQueriesAPI.replace_restriction_query"
720
+ end
721
+ # resource path
722
+ local_var_path = '/api/v2/logs/config/restriction_queries/{restriction_query_id}'.sub('{restriction_query_id}', CGI.escape(restriction_query_id.to_s).gsub('%2F', '/'))
723
+
724
+ # query parameters
725
+ query_params = opts[:query_params] || {}
726
+
727
+ # header parameters
728
+ header_params = opts[:header_params] || {}
729
+ # HTTP header 'Accept' (if needed)
730
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
731
+ # HTTP header 'Content-Type'
732
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
733
+
734
+ # form parameters
735
+ form_params = opts[:form_params] || {}
736
+
737
+ # http body (model)
738
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
739
+
740
+ # return_type
741
+ return_type = opts[:debug_return_type] || 'RestrictionQueryWithoutRelationshipsResponse'
742
+
743
+ # auth_names
744
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
745
+
746
+ new_options = opts.merge(
747
+ :operation => :replace_restriction_query,
748
+ :header_params => header_params,
749
+ :query_params => query_params,
750
+ :form_params => form_params,
751
+ :body => post_body,
752
+ :auth_names => auth_names,
753
+ :return_type => return_type,
754
+ :api_version => "V2"
755
+ )
756
+
757
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options)
758
+ if @api_client.config.debugging
759
+ @api_client.config.logger.debug "API called: LogsRestrictionQueriesAPI#replace_restriction_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
760
+ end
761
+ return data, status_code, headers
762
+ end
763
+
764
+ # Update a restriction query.
765
+ #
766
+ # @see #update_restriction_query_with_http_info
767
+ def update_restriction_query(restriction_query_id, body, opts = {})
768
+ data, _status_code, _headers = update_restriction_query_with_http_info(restriction_query_id, body, opts)
769
+ data
770
+ end
771
+
772
+ # Update a restriction query.
773
+ #
774
+ # Edit a restriction query.
775
+ #
776
+ # @param restriction_query_id [String] The ID of the restriction query.
777
+ # @param body [RestrictionQueryUpdatePayload]
778
+ # @param opts [Hash] the optional parameters
779
+ # @return [Array<(RestrictionQueryWithoutRelationshipsResponse, Integer, Hash)>] RestrictionQueryWithoutRelationshipsResponse data, response status code and response headers
780
+ def update_restriction_query_with_http_info(restriction_query_id, body, opts = {})
781
+ unstable_enabled = @api_client.config.unstable_operations["v2.update_restriction_query".to_sym]
782
+ if unstable_enabled
783
+ @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_restriction_query")
784
+ else
785
+ raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_restriction_query"))
786
+ end
787
+
788
+ if @api_client.config.debugging
789
+ @api_client.config.logger.debug 'Calling API: LogsRestrictionQueriesAPI.update_restriction_query ...'
790
+ end
791
+ # verify the required parameter 'restriction_query_id' is set
792
+ if @api_client.config.client_side_validation && restriction_query_id.nil?
793
+ fail ArgumentError, "Missing the required parameter 'restriction_query_id' when calling LogsRestrictionQueriesAPI.update_restriction_query"
794
+ end
795
+ # verify the required parameter 'body' is set
796
+ if @api_client.config.client_side_validation && body.nil?
797
+ fail ArgumentError, "Missing the required parameter 'body' when calling LogsRestrictionQueriesAPI.update_restriction_query"
798
+ end
799
+ # resource path
800
+ local_var_path = '/api/v2/logs/config/restriction_queries/{restriction_query_id}'.sub('{restriction_query_id}', CGI.escape(restriction_query_id.to_s).gsub('%2F', '/'))
801
+
802
+ # query parameters
803
+ query_params = opts[:query_params] || {}
804
+
805
+ # header parameters
806
+ header_params = opts[:header_params] || {}
807
+ # HTTP header 'Accept' (if needed)
808
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
809
+ # HTTP header 'Content-Type'
810
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
811
+
812
+ # form parameters
813
+ form_params = opts[:form_params] || {}
814
+
815
+ # http body (model)
816
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
817
+
818
+ # return_type
819
+ return_type = opts[:debug_return_type] || 'RestrictionQueryWithoutRelationshipsResponse'
820
+
821
+ # auth_names
822
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
823
+
824
+ new_options = opts.merge(
825
+ :operation => :update_restriction_query,
826
+ :header_params => header_params,
827
+ :query_params => query_params,
828
+ :form_params => form_params,
829
+ :body => post_body,
830
+ :auth_names => auth_names,
831
+ :return_type => return_type,
832
+ :api_version => "V2"
833
+ )
834
+
835
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options)
836
+ if @api_client.config.debugging
837
+ @api_client.config.logger.debug "API called: LogsRestrictionQueriesAPI#update_restriction_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
838
+ end
839
+ return data, status_code, headers
840
+ end
841
+ end
842
+ end