datadog_api_client 2.47.0 → 2.48.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 (165) hide show
  1. checksums.yaml +4 -4
  2. data/.generator/schemas/v1/openapi.yaml +96 -5
  3. data/.generator/schemas/v2/openapi.yaml +2453 -707
  4. data/CHANGELOG.md +20 -0
  5. data/examples/v2/incidents/CreateIncidentAttachment.rb +22 -0
  6. data/examples/v2/incidents/DeleteIncidentAttachment.rb +8 -0
  7. data/examples/v2/incidents/ListIncidentAttachments.rb +1 -1
  8. data/examples/v2/incidents/UpdateIncidentAttachment.rb +20 -0
  9. data/examples/v2/on-call/CreateUserNotificationRule.rb +29 -0
  10. data/examples/v2/on-call/DeleteUserNotificationRule.rb +11 -0
  11. data/examples/v2/on-call/GetUserNotificationRule.rb +14 -0
  12. data/examples/v2/on-call/ListUserNotificationRules.rb +11 -0
  13. data/examples/v2/on-call/UpdateUserNotificationRule.rb +36 -0
  14. data/examples/v2/product-analytics/SubmitProductAnalyticsEvent.rb +24 -0
  15. data/examples/v2/security-monitoring/CreateSecurityMonitoringRule_2323193894.rb +48 -0
  16. data/examples/v2/synthetics/PatchGlobalVariable.rb +19 -0
  17. data/examples/v2/teams/CreateTeamNotificationRule.rb +23 -0
  18. data/examples/v2/teams/DeleteTeamConnections.rb +0 -3
  19. data/examples/v2/teams/DeleteTeamNotificationRule.rb +11 -0
  20. data/examples/v2/teams/GetTeamNotificationRule.rb +11 -0
  21. data/examples/v2/teams/GetTeamNotificationRules.rb +8 -0
  22. data/examples/v2/teams/GetTeamSync.rb +0 -3
  23. data/examples/v2/teams/ListTeamConnections.rb +0 -3
  24. data/examples/v2/teams/ListTeamConnections_2418873869.rb +0 -3
  25. data/examples/v2/teams/SyncTeams.rb +0 -3
  26. data/examples/v2/teams/SyncTeams_3215592344.rb +0 -3
  27. data/examples/v2/teams/UpdateTeamNotificationRule.rb +27 -0
  28. data/lib/datadog_api_client/configuration.rb +55 -6
  29. data/lib/datadog_api_client/inflector.rb +92 -20
  30. data/lib/datadog_api_client/v1/api/synthetics_api.rb +3 -3
  31. data/lib/datadog_api_client/v1/api/usage_metering_api.rb +6 -4
  32. data/lib/datadog_api_client/v1/models/hourly_usage_attribution_usage_type.rb +3 -0
  33. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_supported_metrics.rb +6 -0
  34. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_values.rb +61 -1
  35. data/lib/datadog_api_client/v1/models/synthetics_list_tests_response.rb +1 -1
  36. data/lib/datadog_api_client/v1/models/synthetics_test_details.rb +1 -1
  37. data/lib/datadog_api_client/v1/models/synthetics_test_details_without_steps.rb +221 -0
  38. data/lib/datadog_api_client/v2/api/dora_metrics_api.rb +8 -8
  39. data/lib/datadog_api_client/v2/api/incidents_api.rb +188 -36
  40. data/lib/datadog_api_client/v2/api/on_call_api.rb +360 -0
  41. data/lib/datadog_api_client/v2/api/product_analytics_api.rb +121 -0
  42. data/lib/datadog_api_client/v2/api/software_catalog_api.rb +4 -0
  43. data/lib/datadog_api_client/v2/api/synthetics_api.rb +79 -0
  44. data/lib/datadog_api_client/v2/api/teams_api.rb +339 -30
  45. data/lib/datadog_api_client/v2/models/attachment.rb +117 -0
  46. data/lib/datadog_api_client/v2/models/{incident_attachments_response.rb → attachment_array.rb} +7 -7
  47. data/lib/datadog_api_client/v2/models/{incident_attachment_data.rb → attachment_data.rb} +8 -8
  48. data/lib/datadog_api_client/v2/models/attachment_data_attributes.rb +125 -0
  49. data/lib/datadog_api_client/v2/models/attachment_data_attributes_attachment.rb +115 -0
  50. data/lib/datadog_api_client/v2/models/{incident_attachment_attachment_type.rb → attachment_data_attributes_attachment_type.rb} +3 -3
  51. data/lib/datadog_api_client/v2/models/{incident_attachment_relationships.rb → attachment_data_relationships.rb} +5 -5
  52. data/lib/datadog_api_client/v2/models/{incident_attachment_update_request.rb → attachment_data_relationships_last_modified_by_user.rb} +6 -11
  53. data/lib/datadog_api_client/v2/models/attachment_data_relationships_last_modified_by_user_data.rb +144 -0
  54. data/lib/datadog_api_client/v2/models/{incident_attachments_response_included_item.rb → attachment_included.rb} +3 -3
  55. data/lib/datadog_api_client/v2/models/case_create_attributes.rb +11 -1
  56. data/lib/datadog_api_client/v2/models/{dora_fetch_response.rb → create_attachment_request.rb} +5 -5
  57. data/lib/datadog_api_client/v2/models/{incident_attachment_update_data.rb → create_attachment_request_data.rb} +6 -6
  58. data/lib/datadog_api_client/v2/models/create_attachment_request_data_attributes.rb +115 -0
  59. data/lib/datadog_api_client/v2/models/create_attachment_request_data_attributes_attachment.rb +115 -0
  60. data/lib/datadog_api_client/v2/models/create_on_call_notification_rule_request.rb +123 -0
  61. data/lib/datadog_api_client/v2/models/create_on_call_notification_rule_request_data.rb +143 -0
  62. data/lib/datadog_api_client/v2/models/custom_attribute_type.rb +1 -0
  63. data/lib/datadog_api_client/v2/models/dora_deployment_fetch_response.rb +105 -0
  64. data/lib/datadog_api_client/v2/models/dora_deployment_object.rb +125 -0
  65. data/lib/datadog_api_client/v2/models/dora_deployment_object_attributes.rb +225 -0
  66. data/lib/datadog_api_client/v2/models/dora_deployment_request_attributes.rb +1 -1
  67. data/lib/datadog_api_client/v2/models/dora_deployments_list_response.rb +107 -0
  68. data/lib/datadog_api_client/v2/models/dora_failure_fetch_response.rb +105 -0
  69. data/lib/datadog_api_client/v2/models/dora_failure_request_attributes.rb +1 -1
  70. data/lib/datadog_api_client/v2/models/{dora_list_response.rb → dora_failures_list_response.rb} +5 -5
  71. data/lib/datadog_api_client/v2/models/{dora_event.rb → dora_incident_object.rb} +8 -8
  72. data/lib/datadog_api_client/v2/models/dora_incident_object_attributes.rb +225 -0
  73. data/lib/datadog_api_client/v2/models/global_variable_data.rb +125 -0
  74. data/lib/datadog_api_client/v2/models/global_variable_json_patch_request.rb +123 -0
  75. data/lib/datadog_api_client/v2/models/global_variable_json_patch_request_data.rb +115 -0
  76. data/lib/datadog_api_client/v2/models/global_variable_json_patch_request_data_attributes.rb +107 -0
  77. data/lib/datadog_api_client/v2/models/global_variable_json_patch_type.rb +26 -0
  78. data/lib/datadog_api_client/v2/models/global_variable_response.rb +105 -0
  79. data/lib/datadog_api_client/v2/models/{incident_attachment_link_attachment_type.rb → global_variable_type.rb} +3 -3
  80. data/lib/datadog_api_client/v2/models/incident_response_included_item.rb +1 -1
  81. data/lib/datadog_api_client/v2/models/{incident_attachments_postmortem_attributes_attachment_object.rb → json_patch_operation.rb} +40 -30
  82. data/lib/datadog_api_client/v2/models/json_patch_operation_op.rb +31 -0
  83. data/lib/datadog_api_client/v2/models/list_on_call_notification_rules_response.rb +119 -0
  84. data/lib/datadog_api_client/v2/models/observability_pipeline_add_env_vars_processor.rb +11 -1
  85. data/lib/datadog_api_client/v2/models/observability_pipeline_add_fields_processor.rb +11 -1
  86. data/lib/datadog_api_client/v2/models/observability_pipeline_config_processor_group.rb +11 -1
  87. data/lib/datadog_api_client/v2/models/observability_pipeline_custom_processor.rb +11 -1
  88. data/lib/datadog_api_client/v2/models/observability_pipeline_datadog_tags_processor.rb +11 -1
  89. data/lib/datadog_api_client/v2/models/observability_pipeline_dedupe_processor.rb +11 -1
  90. data/lib/datadog_api_client/v2/models/observability_pipeline_enrichment_table_processor.rb +11 -1
  91. data/lib/datadog_api_client/v2/models/observability_pipeline_filter_processor.rb +11 -1
  92. data/lib/datadog_api_client/v2/models/observability_pipeline_generate_metrics_processor.rb +11 -1
  93. data/lib/datadog_api_client/v2/models/observability_pipeline_ocsf_mapper_processor.rb +11 -1
  94. data/lib/datadog_api_client/v2/models/observability_pipeline_parse_grok_processor.rb +11 -1
  95. data/lib/datadog_api_client/v2/models/observability_pipeline_parse_json_processor.rb +11 -1
  96. data/lib/datadog_api_client/v2/models/observability_pipeline_quota_processor.rb +11 -1
  97. data/lib/datadog_api_client/v2/models/observability_pipeline_reduce_processor.rb +11 -1
  98. data/lib/datadog_api_client/v2/models/observability_pipeline_remove_fields_processor.rb +11 -1
  99. data/lib/datadog_api_client/v2/models/observability_pipeline_rename_fields_processor.rb +11 -1
  100. data/lib/datadog_api_client/v2/models/observability_pipeline_sample_processor.rb +11 -1
  101. data/lib/datadog_api_client/v2/models/observability_pipeline_sensitive_data_scanner_processor.rb +11 -1
  102. data/lib/datadog_api_client/v2/models/observability_pipeline_throttle_processor.rb +11 -1
  103. data/lib/datadog_api_client/v2/models/{incident_attachment_update_response.rb → on_call_notification_rule.rb} +8 -11
  104. data/lib/datadog_api_client/v2/models/on_call_notification_rule_attributes.rb +125 -0
  105. data/lib/datadog_api_client/v2/models/on_call_notification_rule_category.rb +27 -0
  106. data/lib/datadog_api_client/v2/models/on_call_notification_rule_channel_relationship.rb +123 -0
  107. data/lib/datadog_api_client/v2/models/on_call_notification_rule_channel_relationship_data.rb +115 -0
  108. data/lib/datadog_api_client/v2/models/{incident_attachment_update_attributes.rb → on_call_notification_rule_channel_settings.rb} +3 -4
  109. data/lib/datadog_api_client/v2/models/on_call_notification_rule_data.rb +153 -0
  110. data/lib/datadog_api_client/v2/models/on_call_notification_rule_relationships.rb +105 -0
  111. data/lib/datadog_api_client/v2/models/on_call_notification_rule_request_attributes.rb +125 -0
  112. data/lib/datadog_api_client/v2/models/on_call_notification_rule_type.rb +26 -0
  113. data/lib/datadog_api_client/v2/models/{incident_attachment_attributes.rb → on_call_notification_rules_included.rb} +3 -4
  114. data/lib/datadog_api_client/v2/models/on_call_phone_notification_rule_method.rb +27 -0
  115. data/lib/datadog_api_client/v2/models/{incident_attachment_link_attributes_attachment_object.rb → on_call_phone_notification_rule_settings.rb} +30 -30
  116. data/lib/datadog_api_client/v2/models/patch_attachment_request.rb +105 -0
  117. data/lib/datadog_api_client/v2/models/patch_attachment_request_data.rb +143 -0
  118. data/lib/datadog_api_client/v2/models/patch_attachment_request_data_attributes.rb +105 -0
  119. data/lib/datadog_api_client/v2/models/patch_attachment_request_data_attributes_attachment.rb +115 -0
  120. data/lib/datadog_api_client/v2/models/product_analytics_server_side_event_error.rb +125 -0
  121. data/lib/datadog_api_client/v2/models/product_analytics_server_side_event_errors.rb +107 -0
  122. data/lib/datadog_api_client/v2/models/product_analytics_server_side_event_item.rb +195 -0
  123. data/lib/datadog_api_client/v2/models/product_analytics_server_side_event_item_account.rb +123 -0
  124. data/lib/datadog_api_client/v2/models/product_analytics_server_side_event_item_application.rb +124 -0
  125. data/lib/datadog_api_client/v2/models/product_analytics_server_side_event_item_event.rb +123 -0
  126. data/lib/datadog_api_client/v2/models/product_analytics_server_side_event_item_session.rb +123 -0
  127. data/lib/datadog_api_client/v2/models/product_analytics_server_side_event_item_type.rb +26 -0
  128. data/lib/datadog_api_client/v2/models/product_analytics_server_side_event_item_usr.rb +123 -0
  129. data/lib/datadog_api_client/v2/models/security_monitoring_rule_anomaly_detection_options.rb +155 -0
  130. data/lib/datadog_api_client/v2/models/security_monitoring_rule_anomaly_detection_options_bucket_duration.rb +32 -0
  131. data/lib/datadog_api_client/v2/models/security_monitoring_rule_anomaly_detection_options_detection_tolerance.rb +31 -0
  132. data/lib/datadog_api_client/v2/models/security_monitoring_rule_anomaly_detection_options_learning_duration.rb +32 -0
  133. data/lib/datadog_api_client/v2/models/security_monitoring_rule_options.rb +11 -1
  134. data/lib/datadog_api_client/v2/models/synthetics_global_variable.rb +248 -0
  135. data/lib/datadog_api_client/v2/models/synthetics_global_variable_attributes.rb +107 -0
  136. data/lib/datadog_api_client/v2/models/synthetics_global_variable_options.rb +105 -0
  137. data/lib/datadog_api_client/v2/models/{incident_attachment_postmortem_attributes.rb → synthetics_global_variable_parse_test_options.rb} +44 -35
  138. data/lib/datadog_api_client/v2/models/synthetics_global_variable_parse_test_options_type.rb +29 -0
  139. data/lib/datadog_api_client/v2/models/synthetics_global_variable_parser_type.rb +29 -0
  140. data/lib/datadog_api_client/v2/models/{incident_attachment_link_attributes.rb → synthetics_global_variable_totp_parameters.rb} +38 -40
  141. data/lib/datadog_api_client/v2/models/synthetics_global_variable_value.rb +126 -0
  142. data/lib/datadog_api_client/v2/models/synthetics_variable_parser.rb +133 -0
  143. data/lib/datadog_api_client/v2/models/team_notification_rule.rb +154 -0
  144. data/lib/datadog_api_client/v2/models/team_notification_rule_attributes.rb +135 -0
  145. data/lib/datadog_api_client/v2/models/team_notification_rule_attributes_email.rb +105 -0
  146. data/lib/datadog_api_client/v2/models/team_notification_rule_attributes_ms_teams.rb +105 -0
  147. data/lib/datadog_api_client/v2/models/team_notification_rule_attributes_pagerduty.rb +105 -0
  148. data/lib/datadog_api_client/v2/models/team_notification_rule_attributes_slack.rb +115 -0
  149. data/lib/datadog_api_client/v2/models/team_notification_rule_request.rb +123 -0
  150. data/lib/datadog_api_client/v2/models/team_notification_rule_response.rb +105 -0
  151. data/lib/datadog_api_client/v2/models/{incident_attachment_postmortem_attachment_type.rb → team_notification_rule_type.rb} +3 -3
  152. data/lib/datadog_api_client/v2/models/team_notification_rules_response.rb +117 -0
  153. data/lib/datadog_api_client/v2/models/team_notification_rules_response_meta.rb +105 -0
  154. data/lib/datadog_api_client/v2/models/team_notification_rules_response_meta_page.rb +184 -0
  155. data/lib/datadog_api_client/v2/models/threat_hunting_job_options.rb +11 -1
  156. data/lib/datadog_api_client/v2/models/update_on_call_notification_rule_request.rb +123 -0
  157. data/lib/datadog_api_client/v2/models/update_on_call_notification_rule_request_attributes.rb +125 -0
  158. data/lib/datadog_api_client/v2/models/update_on_call_notification_rule_request_data.rb +153 -0
  159. data/lib/datadog_api_client/v2/models/user140420082644000.rb +143 -0
  160. data/lib/datadog_api_client/v2/models/{incident_attachment_related_object.rb → user_type.rb} +2 -2
  161. data/lib/datadog_api_client/version.rb +1 -1
  162. metadata +109 -24
  163. data/examples/v2/incidents/ListIncidentAttachments_2457735435.rb +0 -11
  164. data/examples/v2/incidents/UpdateIncidentAttachments.rb +0 -38
  165. data/examples/v2/incidents/UpdateIncidentAttachments_3881702075.rb +0 -26
@@ -0,0 +1,26 @@
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 'date'
17
+ require 'time'
18
+
19
+ module DatadogAPIClient::V2
20
+ # The type of Product Analytics event. Must be `server` for server-side events.
21
+ class ProductAnalyticsServerSideEventItemType
22
+ include BaseEnumModel
23
+
24
+ SERVER = "server".freeze
25
+ end
26
+ end
@@ -0,0 +1,123 @@
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 'date'
17
+ require 'time'
18
+
19
+ module DatadogAPIClient::V2
20
+ # The user linked to your event.
21
+ class ProductAnalyticsServerSideEventItemUsr
22
+ include BaseGenericModel
23
+
24
+ # The user ID used in Datadog.
25
+ attr_reader :id
26
+
27
+ attr_accessor :additional_properties
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ # @!visibility private
31
+ def self.attribute_map
32
+ {
33
+ :'id' => :'id'
34
+ }
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ # @!visibility private
39
+ def self.openapi_types
40
+ {
41
+ :'id' => :'String'
42
+ }
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param attributes [Hash] Model attributes in the form of hash
47
+ # @!visibility private
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsServerSideEventItemUsr` initialize method"
51
+ end
52
+
53
+ self.additional_properties = {}
54
+ # check to see if the attribute exists and convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}) { |(k, v), h|
56
+ if (!self.class.attribute_map.key?(k.to_sym))
57
+ self.additional_properties[k.to_sym] = v
58
+ else
59
+ h[k.to_sym] = v
60
+ end
61
+ }
62
+
63
+ if attributes.key?(:'id')
64
+ self.id = attributes[:'id']
65
+ end
66
+ end
67
+
68
+ # Check to see if the all the properties in the model are valid
69
+ # @return true if the model is valid
70
+ # @!visibility private
71
+ def valid?
72
+ return false if @id.nil?
73
+ true
74
+ end
75
+
76
+ # Custom attribute writer method with validation
77
+ # @param id [Object] Object to be assigned
78
+ # @!visibility private
79
+ def id=(id)
80
+ if id.nil?
81
+ fail ArgumentError, 'invalid value for "id", id cannot be nil.'
82
+ end
83
+ @id = id
84
+ end
85
+
86
+ # Returns the object in the form of hash, with additionalProperties support.
87
+ # @return [Hash] Returns the object in the form of hash
88
+ # @!visibility private
89
+ def to_hash
90
+ hash = {}
91
+ self.class.attribute_map.each_pair do |attr, param|
92
+ value = self.send(attr)
93
+ if value.nil?
94
+ is_nullable = self.class.openapi_nullable.include?(attr)
95
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
96
+ end
97
+
98
+ hash[param] = _to_hash(value)
99
+ end
100
+ self.additional_properties.each_pair do |attr, value|
101
+ hash[attr] = value
102
+ end
103
+ hash
104
+ end
105
+
106
+ # Checks equality by comparing each attribute.
107
+ # @param o [Object] Object to be compared
108
+ # @!visibility private
109
+ def ==(o)
110
+ return true if self.equal?(o)
111
+ self.class == o.class &&
112
+ id == o.id &&
113
+ additional_properties == o.additional_properties
114
+ end
115
+
116
+ # Calculates hash code according to all attributes.
117
+ # @return [Integer] Hash code
118
+ # @!visibility private
119
+ def hash
120
+ [id, additional_properties].hash
121
+ end
122
+ end
123
+ end
@@ -0,0 +1,155 @@
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 'date'
17
+ require 'time'
18
+
19
+ module DatadogAPIClient::V2
20
+ # Options on anomaly detection method.
21
+ class SecurityMonitoringRuleAnomalyDetectionOptions
22
+ include BaseGenericModel
23
+
24
+ # Duration in seconds of the time buckets used to aggregate events matched by the rule.
25
+ # Must be greater than or equal to 300.
26
+ attr_accessor :bucket_duration
27
+
28
+ # An optional parameter that sets how permissive anomaly detection is.
29
+ # Higher values require higher deviations before triggering a signal.
30
+ attr_accessor :detection_tolerance
31
+
32
+ # Learning duration in hours. Anomaly detection waits for at least this amount of historical data before it starts evaluating.
33
+ attr_accessor :learning_duration
34
+
35
+ # An optional override baseline to apply while the rule is in the learning period. Must be greater than or equal to 0.
36
+ attr_reader :learning_period_baseline
37
+
38
+ attr_accessor :additional_properties
39
+
40
+ # Attribute mapping from ruby-style variable name to JSON key.
41
+ # @!visibility private
42
+ def self.attribute_map
43
+ {
44
+ :'bucket_duration' => :'bucketDuration',
45
+ :'detection_tolerance' => :'detectionTolerance',
46
+ :'learning_duration' => :'learningDuration',
47
+ :'learning_period_baseline' => :'learningPeriodBaseline'
48
+ }
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ # @!visibility private
53
+ def self.openapi_types
54
+ {
55
+ :'bucket_duration' => :'SecurityMonitoringRuleAnomalyDetectionOptionsBucketDuration',
56
+ :'detection_tolerance' => :'SecurityMonitoringRuleAnomalyDetectionOptionsDetectionTolerance',
57
+ :'learning_duration' => :'SecurityMonitoringRuleAnomalyDetectionOptionsLearningDuration',
58
+ :'learning_period_baseline' => :'Integer'
59
+ }
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param attributes [Hash] Model attributes in the form of hash
64
+ # @!visibility private
65
+ def initialize(attributes = {})
66
+ if (!attributes.is_a?(Hash))
67
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringRuleAnomalyDetectionOptions` initialize method"
68
+ end
69
+
70
+ self.additional_properties = {}
71
+ # check to see if the attribute exists and convert string to symbol for hash key
72
+ attributes = attributes.each_with_object({}) { |(k, v), h|
73
+ if (!self.class.attribute_map.key?(k.to_sym))
74
+ self.additional_properties[k.to_sym] = v
75
+ else
76
+ h[k.to_sym] = v
77
+ end
78
+ }
79
+
80
+ if attributes.key?(:'bucket_duration')
81
+ self.bucket_duration = attributes[:'bucket_duration']
82
+ end
83
+
84
+ if attributes.key?(:'detection_tolerance')
85
+ self.detection_tolerance = attributes[:'detection_tolerance']
86
+ end
87
+
88
+ if attributes.key?(:'learning_duration')
89
+ self.learning_duration = attributes[:'learning_duration']
90
+ end
91
+
92
+ if attributes.key?(:'learning_period_baseline')
93
+ self.learning_period_baseline = attributes[:'learning_period_baseline']
94
+ end
95
+ end
96
+
97
+ # Check to see if the all the properties in the model are valid
98
+ # @return true if the model is valid
99
+ # @!visibility private
100
+ def valid?
101
+ return false if !@learning_period_baseline.nil? && @learning_period_baseline < 0
102
+ true
103
+ end
104
+
105
+ # Custom attribute writer method with validation
106
+ # @param learning_period_baseline [Object] Object to be assigned
107
+ # @!visibility private
108
+ def learning_period_baseline=(learning_period_baseline)
109
+ if !learning_period_baseline.nil? && learning_period_baseline < 0
110
+ fail ArgumentError, 'invalid value for "learning_period_baseline", must be greater than or equal to 0.'
111
+ end
112
+ @learning_period_baseline = learning_period_baseline
113
+ end
114
+
115
+ # Returns the object in the form of hash, with additionalProperties support.
116
+ # @return [Hash] Returns the object in the form of hash
117
+ # @!visibility private
118
+ def to_hash
119
+ hash = {}
120
+ self.class.attribute_map.each_pair do |attr, param|
121
+ value = self.send(attr)
122
+ if value.nil?
123
+ is_nullable = self.class.openapi_nullable.include?(attr)
124
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
125
+ end
126
+
127
+ hash[param] = _to_hash(value)
128
+ end
129
+ self.additional_properties.each_pair do |attr, value|
130
+ hash[attr] = value
131
+ end
132
+ hash
133
+ end
134
+
135
+ # Checks equality by comparing each attribute.
136
+ # @param o [Object] Object to be compared
137
+ # @!visibility private
138
+ def ==(o)
139
+ return true if self.equal?(o)
140
+ self.class == o.class &&
141
+ bucket_duration == o.bucket_duration &&
142
+ detection_tolerance == o.detection_tolerance &&
143
+ learning_duration == o.learning_duration &&
144
+ learning_period_baseline == o.learning_period_baseline &&
145
+ additional_properties == o.additional_properties
146
+ end
147
+
148
+ # Calculates hash code according to all attributes.
149
+ # @return [Integer] Hash code
150
+ # @!visibility private
151
+ def hash
152
+ [bucket_duration, detection_tolerance, learning_duration, learning_period_baseline, additional_properties].hash
153
+ end
154
+ end
155
+ end
@@ -0,0 +1,32 @@
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 'date'
17
+ require 'time'
18
+
19
+ module DatadogAPIClient::V2
20
+ # Duration in seconds of the time buckets used to aggregate events matched by the rule.
21
+ # Must be greater than or equal to 300.
22
+ class SecurityMonitoringRuleAnomalyDetectionOptionsBucketDuration
23
+ include BaseEnumModel
24
+
25
+ FIVE_MINUTES = 300.freeze
26
+ TEN_MINUTES = 600.freeze
27
+ FIFTEEN_MINUTES = 900.freeze
28
+ THIRTY_MINUTES = 1800.freeze
29
+ ONE_HOUR = 3600.freeze
30
+ THREE_HOURS = 10800.freeze
31
+ end
32
+ end
@@ -0,0 +1,31 @@
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 'date'
17
+ require 'time'
18
+
19
+ module DatadogAPIClient::V2
20
+ # An optional parameter that sets how permissive anomaly detection is.
21
+ # Higher values require higher deviations before triggering a signal.
22
+ class SecurityMonitoringRuleAnomalyDetectionOptionsDetectionTolerance
23
+ include BaseEnumModel
24
+
25
+ ONE = 1.freeze
26
+ TWO = 2.freeze
27
+ THREE = 3.freeze
28
+ FOUR = 4.freeze
29
+ FIVE = 5.freeze
30
+ end
31
+ end
@@ -0,0 +1,32 @@
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 'date'
17
+ require 'time'
18
+
19
+ module DatadogAPIClient::V2
20
+ # Learning duration in hours. Anomaly detection waits for at least this amount of historical data before it starts evaluating.
21
+ class SecurityMonitoringRuleAnomalyDetectionOptionsLearningDuration
22
+ include BaseEnumModel
23
+
24
+ ONE_HOUR = 1.freeze
25
+ SIX_HOURS = 6.freeze
26
+ TWELVE_HOURS = 12.freeze
27
+ ONE_DAY = 24.freeze
28
+ TWO_DAYS = 48.freeze
29
+ ONE_WEEK = 168.freeze
30
+ TWO_WEEKS = 336.freeze
31
+ end
32
+ end
@@ -21,6 +21,9 @@ module DatadogAPIClient::V2
21
21
  class SecurityMonitoringRuleOptions
22
22
  include BaseGenericModel
23
23
 
24
+ # Options on anomaly detection method.
25
+ attr_accessor :anomaly_detection_options
26
+
24
27
  # Options for cloud_configuration rules.
25
28
  # Fields `resourceType` and `regoRule` are mandatory when managing custom `cloud_configuration` rules.
26
29
  attr_accessor :compliance_rule_options
@@ -66,6 +69,7 @@ module DatadogAPIClient::V2
66
69
  # @!visibility private
67
70
  def self.attribute_map
68
71
  {
72
+ :'anomaly_detection_options' => :'anomalyDetectionOptions',
69
73
  :'compliance_rule_options' => :'complianceRuleOptions',
70
74
  :'decrease_criticality_based_on_env' => :'decreaseCriticalityBasedOnEnv',
71
75
  :'detection_method' => :'detectionMethod',
@@ -84,6 +88,7 @@ module DatadogAPIClient::V2
84
88
  # @!visibility private
85
89
  def self.openapi_types
86
90
  {
91
+ :'anomaly_detection_options' => :'SecurityMonitoringRuleAnomalyDetectionOptions',
87
92
  :'compliance_rule_options' => :'CloudConfigurationComplianceRuleOptions',
88
93
  :'decrease_criticality_based_on_env' => :'Boolean',
89
94
  :'detection_method' => :'SecurityMonitoringRuleDetectionMethod',
@@ -116,6 +121,10 @@ module DatadogAPIClient::V2
116
121
  end
117
122
  }
118
123
 
124
+ if attributes.key?(:'anomaly_detection_options')
125
+ self.anomaly_detection_options = attributes[:'anomaly_detection_options']
126
+ end
127
+
119
128
  if attributes.key?(:'compliance_rule_options')
120
129
  self.compliance_rule_options = attributes[:'compliance_rule_options']
121
130
  end
@@ -187,6 +196,7 @@ module DatadogAPIClient::V2
187
196
  def ==(o)
188
197
  return true if self.equal?(o)
189
198
  self.class == o.class &&
199
+ anomaly_detection_options == o.anomaly_detection_options &&
190
200
  compliance_rule_options == o.compliance_rule_options &&
191
201
  decrease_criticality_based_on_env == o.decrease_criticality_based_on_env &&
192
202
  detection_method == o.detection_method &&
@@ -205,7 +215,7 @@ module DatadogAPIClient::V2
205
215
  # @return [Integer] Hash code
206
216
  # @!visibility private
207
217
  def hash
208
- [compliance_rule_options, decrease_criticality_based_on_env, detection_method, evaluation_window, hardcoded_evaluator_type, impossible_travel_options, keep_alive, max_signal_duration, new_value_options, sequence_detection_options, third_party_rule_options, additional_properties].hash
218
+ [anomaly_detection_options, compliance_rule_options, decrease_criticality_based_on_env, detection_method, evaluation_window, hardcoded_evaluator_type, impossible_travel_options, keep_alive, max_signal_duration, new_value_options, sequence_detection_options, third_party_rule_options, additional_properties].hash
209
219
  end
210
220
  end
211
221
  end