datadog_api_client 2.0.2 → 2.2.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.
- checksums.yaml +4 -4
- data/.apigentools-info +6 -6
- data/.generator/poetry.lock +21 -14
- data/.generator/pyproject.toml +1 -1
- data/.generator/schemas/v1/openapi.yaml +840 -908
- data/.generator/schemas/v2/openapi.yaml +1304 -913
- data/.generator/src/generator/formatter.py +1 -1
- data/.generator/src/generator/templates/api_client.j2 +5 -1
- data/.generator/src/generator/templates/configuration.j2 +17 -0
- data/.github/workflows/test.yml +4 -1
- data/.github/workflows/test_integration.yml +5 -0
- data/.pre-commit-config.yaml +1 -1
- data/CHANGELOG.md +49 -0
- data/README.md +11 -0
- data/examples/v1/dashboards/CreateDashboard_1094917386.rb +37 -0
- data/examples/v1/dashboards/CreateDashboard_1307120899.rb +61 -0
- data/examples/v1/dashboards/CreateDashboard_1423904722.rb +38 -0
- data/examples/v1/dashboards/CreateDashboard_2652180930.rb +43 -0
- data/examples/v1/dashboards/CreateDashboard_2850365602.rb +55 -0
- data/examples/v1/dashboards/CreateDashboard_3117424216.rb +33 -0
- data/examples/v1/dashboards/CreateDashboard_3669695268.rb +50 -0
- data/examples/v1/dashboards/CreateDashboard_858397694.rb +41 -0
- data/examples/v1/monitors/ValidateExistingMonitor.rb +1 -0
- data/examples/v1/monitors/ValidateMonitor.rb +1 -0
- data/examples/v1/monitors/ValidateMonitor_4247196452.rb +38 -0
- data/examples/v1/synthetics/CreateGlobalVariable.rb +1 -0
- data/examples/v1/synthetics/CreateGlobalVariable_1068962881.rb +23 -0
- data/examples/v1/synthetics/CreateSyntheticsAPITest_1279271422.rb +10 -0
- data/examples/v1/synthetics/CreateSyntheticsBrowserTest_2932742688.rb +6 -0
- data/examples/v1/synthetics/EditGlobalVariable.rb +1 -0
- data/examples/v1/synthetics/UpdateBrowserTest.rb +1 -0
- data/examples/v1/usage-metering/GetDailyCustomReports.rb +0 -3
- data/examples/v1/usage-metering/GetMonthlyCustomReports.rb +0 -3
- data/examples/v1/usage-metering/GetSpecifiedDailyCustomReports.rb +0 -3
- data/examples/v1/usage-metering/GetSpecifiedMonthlyCustomReports.rb +0 -3
- data/examples/v1/usage-metering/GetUsageAttribution.rb +0 -3
- data/examples/v2/incidents/ListIncidentAttachments.rb +8 -0
- data/examples/v2/incidents/ListIncidentAttachments_2457735435.rb +11 -0
- data/examples/v2/incidents/UpdateIncidentAttachments.rb +38 -0
- data/examples/v2/incidents/UpdateIncidentAttachments_3881702075.rb +26 -0
- data/examples/v2/metrics/ListActiveMetricConfigurations.rb +5 -0
- data/examples/v2/metrics/ListTagConfigurations.rb +1 -1
- data/examples/v2/metrics/ListTagConfigurations_265033704.rb +8 -0
- data/examples/v2/metrics/{ListTagConfigurations_103226315.rb → ListTagConfigurations_2739018321.rb} +1 -1
- data/examples/v2/metrics/SubmitMetrics_1762007427.rb +23 -0
- data/examples/v2/roles/UpdateRole.rb +13 -0
- data/examples/v2/rum/CreateRUMApplication.rb +15 -0
- data/examples/v2/rum/DeleteRUMApplication.rb +8 -0
- data/examples/v2/rum/GetRUMApplication.rb +8 -0
- data/examples/v2/rum/GetRUMApplications.rb +5 -0
- data/examples/v2/rum/UpdateRUMApplication.rb +16 -0
- data/examples/v2/security-monitoring/CreateSecurityMonitoringRule.rb +3 -2
- data/examples/v2/security-monitoring/CreateSecurityMonitoringRule_461183901.rb +2 -2
- data/examples/v2/security-monitoring/CreateSecurityMonitoringRule_498211763.rb +2 -2
- data/examples/v2/security-monitoring/CreateSecurityMonitoringRule_914562040.rb +50 -0
- data/examples/v2/security-monitoring/GetSecurityMonitoringSignal.rb +5 -0
- data/examples/v2/security-monitoring/UpdateSecurityMonitoringRule.rb +2 -1
- data/examples/v2/usage-metering/GetEstimatedCostByOrg.rb +1 -4
- data/examples/v2/usage-metering/GetEstimatedCostByOrg_2734954020.rb +2 -4
- data/examples/v2/usage-metering/GetEstimatedCostByOrg_3186693804.rb +2 -4
- data/examples/v2/usage-metering/GetHistoricalCostByOrg.rb +8 -0
- data/examples/v2/usage-metering/GetHourlyUsage.rb +5 -0
- data/generate.sh +30 -0
- data/lib/datadog_api_client/api_client.rb +5 -1
- data/lib/datadog_api_client/configuration.rb +20 -6
- data/lib/datadog_api_client/inflector.rb +67 -1
- data/lib/datadog_api_client/v1/api/metrics_api.rb +1 -1
- data/lib/datadog_api_client/v1/api/service_level_objectives_api.rb +3 -1
- data/lib/datadog_api_client/v1/api/usage_metering_api.rb +42 -62
- data/lib/datadog_api_client/v1/models/dashboard_template_variable.rb +14 -2
- data/lib/datadog_api_client/v1/models/dashboard_template_variable_preset_value.rb +28 -5
- data/lib/datadog_api_client/v1/models/formula_and_function_event_query_definition.rb +14 -4
- data/lib/datadog_api_client/v1/models/formula_and_function_events_data_source.rb +1 -0
- data/lib/datadog_api_client/v1/models/hourly_usage_attribution_usage_type.rb +2 -0
- data/lib/datadog_api_client/v1/models/list_stream_query.rb +14 -4
- data/lib/datadog_api_client/v1/models/list_stream_source.rb +1 -0
- data/lib/datadog_api_client/v1/models/metric_content_encoding.rb +1 -0
- data/lib/datadog_api_client/v1/models/monitor_options.rb +28 -1
- data/lib/datadog_api_client/v1/models/monitor_summary_widget_definition.rb +13 -1
- data/lib/datadog_api_client/v1/models/monthly_usage_attribution_supported_metrics.rb +4 -0
- data/lib/datadog_api_client/v1/models/monthly_usage_attribution_values.rb +41 -1
- data/lib/datadog_api_client/v1/models/on_missing_data_option.rb +33 -0
- data/lib/datadog_api_client/v1/models/search_service_level_objective.rb +111 -0
- data/lib/datadog_api_client/v1/models/search_service_level_objective_attributes.rb +286 -0
- data/lib/datadog_api_client/v1/models/search_service_level_objective_data.rb +134 -0
- data/lib/datadog_api_client/v1/models/search_slo_query.rb +137 -0
- data/lib/datadog_api_client/v1/models/search_slo_response_data_attributes.rb +8 -8
- data/lib/datadog_api_client/v1/models/search_slo_response_links.rb +2 -0
- data/lib/datadog_api_client/v1/models/search_slo_threshold.rb +184 -0
- data/lib/datadog_api_client/v1/models/search_slo_timeframe.rb +28 -0
- data/lib/datadog_api_client/v1/models/slo_creator.rb +131 -0
- data/lib/datadog_api_client/v1/models/slo_list_widget_definition.rb +185 -0
- data/lib/datadog_api_client/v1/models/slo_list_widget_definition_type.rb +26 -0
- data/lib/datadog_api_client/v1/models/slo_list_widget_query.rb +149 -0
- data/lib/datadog_api_client/v1/models/slo_list_widget_request.rb +143 -0
- data/lib/datadog_api_client/v1/models/slo_list_widget_request_type.rb +26 -0
- data/lib/datadog_api_client/v1/models/slo_overall_statuses.rb +174 -0
- data/lib/datadog_api_client/v1/models/slo_raw_error_budget_remaining.rb +121 -0
- data/lib/datadog_api_client/v1/models/synthetics_assertion_operator.rb +1 -0
- data/lib/datadog_api_client/v1/models/synthetics_basic_auth.rb +2 -1
- data/lib/datadog_api_client/v1/models/synthetics_basic_auth_digest.rb +155 -0
- data/lib/datadog_api_client/v1/models/synthetics_basic_auth_digest_type.rb +26 -0
- data/lib/datadog_api_client/v1/models/synthetics_global_variable_parse_test_options.rb +11 -12
- data/lib/datadog_api_client/v1/models/synthetics_global_variable_parse_test_options_type.rb +1 -0
- data/lib/datadog_api_client/v1/models/synthetics_test_options.rb +31 -1
- data/lib/datadog_api_client/v1/models/synthetics_test_process_status.rb +0 -1
- data/lib/datadog_api_client/v1/models/synthetics_test_request.rb +15 -1
- data/lib/datadog_api_client/v1/models/topology_map_widget_definition.rb +193 -0
- data/lib/datadog_api_client/v1/models/topology_map_widget_definition_type.rb +26 -0
- data/lib/datadog_api_client/v1/models/topology_query.rb +144 -0
- data/lib/datadog_api_client/v1/models/topology_query_data_source.rb +27 -0
- data/lib/datadog_api_client/v1/models/topology_request.rb +121 -0
- data/lib/datadog_api_client/v1/models/topology_request_type.rb +26 -0
- data/lib/datadog_api_client/v1/models/usage_attribution_sort.rb +4 -0
- data/lib/datadog_api_client/v1/models/usage_attribution_supported_metrics.rb +4 -0
- data/lib/datadog_api_client/v1/models/usage_attribution_values.rb +41 -1
- data/lib/datadog_api_client/v1/models/usage_billable_summary_hour.rb +11 -1
- data/lib/datadog_api_client/v1/models/usage_cloud_security_posture_management_hour.rb +12 -1
- data/lib/datadog_api_client/v1/models/usage_fargate_hour.rb +11 -1
- data/lib/datadog_api_client/v1/models/usage_summary_date.rb +21 -1
- data/lib/datadog_api_client/v1/models/usage_summary_date_org.rb +31 -1
- data/lib/datadog_api_client/v1/models/usage_summary_response.rb +21 -1
- data/lib/datadog_api_client/v1/models/widget_definition.rb +3 -1
- data/lib/datadog_api_client/v1/models/widget_monitor_summary_sort.rb +2 -0
- data/lib/datadog_api_client/v2/api/events_api.rb +1 -1
- data/lib/datadog_api_client/v2/api/incident_services_api.rb +2 -2
- data/lib/datadog_api_client/v2/api/incident_teams_api.rb +2 -2
- data/lib/datadog_api_client/v2/api/incidents_api.rb +155 -0
- data/lib/datadog_api_client/v2/api/logs_api.rb +1 -1
- data/lib/datadog_api_client/v2/api/metrics_api.rb +77 -9
- data/lib/datadog_api_client/v2/api/rum_api.rb +329 -0
- data/lib/datadog_api_client/v2/api/security_monitoring_api.rb +68 -3
- data/lib/datadog_api_client/v2/api/usage_metering_api.rb +83 -17
- data/lib/datadog_api_client/v2/models/content_encoding.rb +1 -0
- data/lib/datadog_api_client/v2/models/incident_attachment_attachment_type.rb +27 -0
- data/lib/datadog_api_client/v2/models/incident_attachment_attributes.rb +63 -0
- data/lib/datadog_api_client/v2/models/incident_attachment_data.rb +187 -0
- data/lib/datadog_api_client/v2/models/incident_attachment_link_attachment_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/incident_attachment_link_attributes.rb +145 -0
- data/lib/datadog_api_client/v2/models/incident_attachment_link_attributes_attachment_object.rb +143 -0
- data/lib/datadog_api_client/v2/models/incident_attachment_postmortem_attachment_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/incident_attachment_postmortem_attributes.rb +145 -0
- data/lib/datadog_api_client/v2/models/incident_attachment_related_object.rb +26 -0
- data/lib/datadog_api_client/v2/models/incident_attachment_relationships.rb +111 -0
- data/lib/datadog_api_client/v2/models/incident_attachment_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/incident_attachment_update_attributes.rb +63 -0
- data/lib/datadog_api_client/v2/models/incident_attachment_update_data.rb +144 -0
- data/lib/datadog_api_client/v2/models/incident_attachment_update_request.rb +127 -0
- data/lib/datadog_api_client/v2/models/incident_attachment_update_response.rb +137 -0
- data/lib/datadog_api_client/v2/models/incident_attachments_postmortem_attributes_attachment_object.rb +143 -0
- data/lib/datadog_api_client/v2/models/incident_attachments_response.rb +136 -0
- data/lib/datadog_api_client/v2/models/incident_attachments_response_included_item.rb +62 -0
- data/lib/datadog_api_client/v2/models/incident_related_object.rb +1 -0
- data/lib/datadog_api_client/v2/models/incident_response_attributes.rb +1 -11
- data/lib/datadog_api_client/v2/models/incident_response_included_item.rb +2 -1
- data/lib/datadog_api_client/v2/models/incident_response_relationships.rb +14 -14
- data/lib/datadog_api_client/v2/models/metric_active_configuration_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/metric_content_encoding.rb +2 -0
- data/lib/datadog_api_client/v2/models/metric_suggested_tags_and_aggregations.rb +133 -0
- data/lib/datadog_api_client/v2/models/metric_suggested_tags_and_aggregations_response.rb +111 -0
- data/lib/datadog_api_client/v2/models/metric_suggested_tags_attributes.rb +125 -0
- data/lib/datadog_api_client/v2/models/relationship_to_incident_attachment.rb +124 -0
- data/lib/datadog_api_client/v2/models/relationship_to_incident_attachment_data.rb +145 -0
- data/lib/datadog_api_client/v2/models/role_update_data.rb +11 -1
- data/lib/datadog_api_client/v2/models/rum_application.rb +166 -0
- data/lib/datadog_api_client/v2/models/rum_application_attributes.rb +279 -0
- data/lib/datadog_api_client/v2/models/rum_application_create.rb +145 -0
- data/lib/datadog_api_client/v2/models/rum_application_create_attributes.rb +132 -0
- data/lib/datadog_api_client/v2/models/rum_application_create_request.rb +122 -0
- data/lib/datadog_api_client/v2/models/rum_application_create_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/rum_application_response.rb +111 -0
- data/lib/datadog_api_client/v2/models/rum_application_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/rum_application_update.rb +155 -0
- data/lib/datadog_api_client/v2/models/rum_application_update_attributes.rb +121 -0
- data/lib/datadog_api_client/v2/models/rum_application_update_request.rb +122 -0
- data/lib/datadog_api_client/v2/models/rum_application_update_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/rum_applications_response.rb +113 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_create_payload.rb +36 -248
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_query.rb +36 -151
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_query_aggregation.rb +1 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_response.rb +37 -253
- data/lib/datadog_api_client/v2/models/security_monitoring_signal_rule_create_payload.rb +275 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_signal_rule_query.rb +187 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_signal_rule_response.rb +279 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_signal_rule_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_create_payload.rb +275 -0
- data/lib/datadog_api_client/v2/models/{security_monitoring_rule_query_create.rb → security_monitoring_standard_rule_query.rb} +3 -3
- data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_response.rb +279 -0
- data/lib/datadog_api_client/version.rb +1 -1
- metadata +97 -6
- data/Makefile +0 -7
- data/examples/v2/metrics/ListTagConfigurations_1799362914.rb +0 -8
|
@@ -18,161 +18,46 @@ require 'time'
|
|
|
18
18
|
|
|
19
19
|
module DatadogAPIClient::V2
|
|
20
20
|
# Query for matching rule.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
def self.attribute_map
|
|
53
|
-
{
|
|
54
|
-
:'aggregation' => :'aggregation',
|
|
55
|
-
:'distinct_fields' => :'distinctFields',
|
|
56
|
-
:'group_by_fields' => :'groupByFields',
|
|
57
|
-
:'metric' => :'metric',
|
|
58
|
-
:'metrics' => :'metrics',
|
|
59
|
-
:'name' => :'name',
|
|
60
|
-
:'query' => :'query'
|
|
61
|
-
}
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
# Returns all the JSON keys this model knows about
|
|
65
|
-
# @!visibility private
|
|
66
|
-
def self.acceptable_attributes
|
|
67
|
-
attribute_map.values
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
# Attribute type mapping.
|
|
71
|
-
# @!visibility private
|
|
72
|
-
def self.openapi_types
|
|
73
|
-
{
|
|
74
|
-
:'aggregation' => :'SecurityMonitoringRuleQueryAggregation',
|
|
75
|
-
:'distinct_fields' => :'Array<String>',
|
|
76
|
-
:'group_by_fields' => :'Array<String>',
|
|
77
|
-
:'metric' => :'String',
|
|
78
|
-
:'metrics' => :'Array<String>',
|
|
79
|
-
:'name' => :'String',
|
|
80
|
-
:'query' => :'String'
|
|
81
|
-
}
|
|
82
|
-
end
|
|
83
|
-
|
|
84
|
-
# List of attributes with nullable: true
|
|
85
|
-
# @!visibility private
|
|
86
|
-
def self.openapi_nullable
|
|
87
|
-
Set.new([
|
|
88
|
-
])
|
|
89
|
-
end
|
|
90
|
-
|
|
91
|
-
# Initializes the object
|
|
92
|
-
# @param attributes [Hash] Model attributes in the form of hash
|
|
93
|
-
# @!visibility private
|
|
94
|
-
def initialize(attributes = {})
|
|
95
|
-
if (!attributes.is_a?(Hash))
|
|
96
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringRuleQuery` initialize method"
|
|
97
|
-
end
|
|
98
|
-
|
|
99
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
|
100
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
101
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
|
102
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::SecurityMonitoringRuleQuery`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
21
|
+
module SecurityMonitoringRuleQuery
|
|
22
|
+
class << self
|
|
23
|
+
include BaseOneOfModel
|
|
24
|
+
include BaseOneOfModelNoDiscriminator
|
|
25
|
+
|
|
26
|
+
# List of class defined in oneOf (OpenAPI v3)
|
|
27
|
+
def openapi_one_of
|
|
28
|
+
[
|
|
29
|
+
:'SecurityMonitoringStandardRuleQuery',
|
|
30
|
+
:'SecurityMonitoringSignalRuleQuery'
|
|
31
|
+
]
|
|
32
|
+
end
|
|
33
|
+
# Builds the object
|
|
34
|
+
# @param [Mixed] Data to be matched against the list of oneOf items
|
|
35
|
+
# @return [Object] Returns the model or the data itself
|
|
36
|
+
def build(data)
|
|
37
|
+
# Go through the list of oneOf items and attempt to identify the appropriate one.
|
|
38
|
+
# Note:
|
|
39
|
+
# - We do not attempt to check whether exactly one item matches.
|
|
40
|
+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
|
41
|
+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
|
42
|
+
# - TODO: scalar values are de facto behaving as if they were nullable.
|
|
43
|
+
# - TODO: logging when debugging is set.
|
|
44
|
+
openapi_one_of.each do |klass|
|
|
45
|
+
begin
|
|
46
|
+
next if klass == :AnyType # "nullable: true"
|
|
47
|
+
typed_data = find_and_cast_into_type(klass, data)
|
|
48
|
+
next if typed_data._unparsed
|
|
49
|
+
return typed_data if typed_data
|
|
50
|
+
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
|
51
|
+
end
|
|
103
52
|
end
|
|
104
|
-
h[k.to_sym] = v
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
if attributes.key?(:'aggregation')
|
|
108
|
-
self.aggregation = attributes[:'aggregation']
|
|
109
|
-
end
|
|
110
53
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
54
|
+
if openapi_one_of.include?(:AnyType)
|
|
55
|
+
data
|
|
56
|
+
else
|
|
57
|
+
self._unparsed = true
|
|
58
|
+
DatadogAPIClient::UnparsedObject.new(data)
|
|
114
59
|
end
|
|
115
60
|
end
|
|
116
|
-
|
|
117
|
-
if attributes.key?(:'group_by_fields')
|
|
118
|
-
if (value = attributes[:'group_by_fields']).is_a?(Array)
|
|
119
|
-
self.group_by_fields = value
|
|
120
|
-
end
|
|
121
|
-
end
|
|
122
|
-
|
|
123
|
-
if attributes.key?(:'metric')
|
|
124
|
-
self.metric = attributes[:'metric']
|
|
125
|
-
end
|
|
126
|
-
|
|
127
|
-
if attributes.key?(:'metrics')
|
|
128
|
-
if (value = attributes[:'metrics']).is_a?(Array)
|
|
129
|
-
self.metrics = value
|
|
130
|
-
end
|
|
131
|
-
end
|
|
132
|
-
|
|
133
|
-
if attributes.key?(:'name')
|
|
134
|
-
self.name = attributes[:'name']
|
|
135
|
-
end
|
|
136
|
-
|
|
137
|
-
if attributes.key?(:'query')
|
|
138
|
-
self.query = attributes[:'query']
|
|
139
|
-
end
|
|
140
|
-
end
|
|
141
|
-
|
|
142
|
-
# Check to see if the all the properties in the model are valid
|
|
143
|
-
# @return true if the model is valid
|
|
144
|
-
# @!visibility private
|
|
145
|
-
def valid?
|
|
146
|
-
true
|
|
147
|
-
end
|
|
148
|
-
|
|
149
|
-
# Checks equality by comparing each attribute.
|
|
150
|
-
# @param o [Object] Object to be compared
|
|
151
|
-
# @!visibility private
|
|
152
|
-
def ==(o)
|
|
153
|
-
return true if self.equal?(o)
|
|
154
|
-
self.class == o.class &&
|
|
155
|
-
aggregation == o.aggregation &&
|
|
156
|
-
distinct_fields == o.distinct_fields &&
|
|
157
|
-
group_by_fields == o.group_by_fields &&
|
|
158
|
-
metric == o.metric &&
|
|
159
|
-
metrics == o.metrics &&
|
|
160
|
-
name == o.name &&
|
|
161
|
-
query == o.query
|
|
162
|
-
end
|
|
163
|
-
|
|
164
|
-
# @see the `==` method
|
|
165
|
-
# @param o [Object] Object to be compared
|
|
166
|
-
# @!visibility private
|
|
167
|
-
def eql?(o)
|
|
168
|
-
self == o
|
|
169
|
-
end
|
|
170
|
-
|
|
171
|
-
# Calculates hash code according to all attributes.
|
|
172
|
-
# @return [Integer] Hash code
|
|
173
|
-
# @!visibility private
|
|
174
|
-
def hash
|
|
175
|
-
[aggregation, distinct_fields, group_by_fields, metric, metrics, name, query].hash
|
|
176
61
|
end
|
|
177
62
|
end
|
|
178
63
|
end
|
|
@@ -17,263 +17,47 @@ require 'date'
|
|
|
17
17
|
require 'time'
|
|
18
18
|
|
|
19
19
|
module DatadogAPIClient::V2
|
|
20
|
-
#
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
# Whether the rule is enabled.
|
|
53
|
-
attr_accessor :is_enabled
|
|
54
|
-
|
|
55
|
-
# Message for generated signals.
|
|
56
|
-
attr_accessor :message
|
|
57
|
-
|
|
58
|
-
# The name of the rule.
|
|
59
|
-
attr_accessor :name
|
|
60
|
-
|
|
61
|
-
# Options on rules.
|
|
62
|
-
attr_accessor :options
|
|
63
|
-
|
|
64
|
-
# Queries for selecting logs which are part of the rule.
|
|
65
|
-
attr_accessor :queries
|
|
66
|
-
|
|
67
|
-
# Tags for generated signals.
|
|
68
|
-
attr_accessor :tags
|
|
69
|
-
|
|
70
|
-
# The rule type.
|
|
71
|
-
attr_accessor :type
|
|
72
|
-
|
|
73
|
-
# User ID of the user who updated the rule.
|
|
74
|
-
attr_accessor :update_author_id
|
|
75
|
-
|
|
76
|
-
# The version of the rule.
|
|
77
|
-
attr_accessor :version
|
|
78
|
-
|
|
79
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
|
80
|
-
# @!visibility private
|
|
81
|
-
def self.attribute_map
|
|
82
|
-
{
|
|
83
|
-
:'cases' => :'cases',
|
|
84
|
-
:'created_at' => :'createdAt',
|
|
85
|
-
:'creation_author_id' => :'creationAuthorId',
|
|
86
|
-
:'filters' => :'filters',
|
|
87
|
-
:'has_extended_title' => :'hasExtendedTitle',
|
|
88
|
-
:'id' => :'id',
|
|
89
|
-
:'is_default' => :'isDefault',
|
|
90
|
-
:'is_deleted' => :'isDeleted',
|
|
91
|
-
:'is_enabled' => :'isEnabled',
|
|
92
|
-
:'message' => :'message',
|
|
93
|
-
:'name' => :'name',
|
|
94
|
-
:'options' => :'options',
|
|
95
|
-
:'queries' => :'queries',
|
|
96
|
-
:'tags' => :'tags',
|
|
97
|
-
:'type' => :'type',
|
|
98
|
-
:'update_author_id' => :'updateAuthorId',
|
|
99
|
-
:'version' => :'version'
|
|
100
|
-
}
|
|
101
|
-
end
|
|
102
|
-
|
|
103
|
-
# Returns all the JSON keys this model knows about
|
|
104
|
-
# @!visibility private
|
|
105
|
-
def self.acceptable_attributes
|
|
106
|
-
attribute_map.values
|
|
107
|
-
end
|
|
108
|
-
|
|
109
|
-
# Attribute type mapping.
|
|
110
|
-
# @!visibility private
|
|
111
|
-
def self.openapi_types
|
|
112
|
-
{
|
|
113
|
-
:'cases' => :'Array<SecurityMonitoringRuleCase>',
|
|
114
|
-
:'created_at' => :'Integer',
|
|
115
|
-
:'creation_author_id' => :'Integer',
|
|
116
|
-
:'filters' => :'Array<SecurityMonitoringFilter>',
|
|
117
|
-
:'has_extended_title' => :'Boolean',
|
|
118
|
-
:'id' => :'String',
|
|
119
|
-
:'is_default' => :'Boolean',
|
|
120
|
-
:'is_deleted' => :'Boolean',
|
|
121
|
-
:'is_enabled' => :'Boolean',
|
|
122
|
-
:'message' => :'String',
|
|
123
|
-
:'name' => :'String',
|
|
124
|
-
:'options' => :'SecurityMonitoringRuleOptions',
|
|
125
|
-
:'queries' => :'Array<SecurityMonitoringRuleQuery>',
|
|
126
|
-
:'tags' => :'Array<String>',
|
|
127
|
-
:'type' => :'SecurityMonitoringRuleTypeRead',
|
|
128
|
-
:'update_author_id' => :'Integer',
|
|
129
|
-
:'version' => :'Integer'
|
|
130
|
-
}
|
|
131
|
-
end
|
|
132
|
-
|
|
133
|
-
# List of attributes with nullable: true
|
|
134
|
-
# @!visibility private
|
|
135
|
-
def self.openapi_nullable
|
|
136
|
-
Set.new([
|
|
137
|
-
])
|
|
138
|
-
end
|
|
139
|
-
|
|
140
|
-
# Initializes the object
|
|
141
|
-
# @param attributes [Hash] Model attributes in the form of hash
|
|
142
|
-
# @!visibility private
|
|
143
|
-
def initialize(attributes = {})
|
|
144
|
-
if (!attributes.is_a?(Hash))
|
|
145
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringRuleResponse` initialize method"
|
|
146
|
-
end
|
|
147
|
-
|
|
148
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
|
149
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
150
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
|
151
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::SecurityMonitoringRuleResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
152
|
-
end
|
|
153
|
-
h[k.to_sym] = v
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
if attributes.key?(:'cases')
|
|
157
|
-
if (value = attributes[:'cases']).is_a?(Array)
|
|
158
|
-
self.cases = value
|
|
159
|
-
end
|
|
160
|
-
end
|
|
161
|
-
|
|
162
|
-
if attributes.key?(:'created_at')
|
|
163
|
-
self.created_at = attributes[:'created_at']
|
|
164
|
-
end
|
|
165
|
-
|
|
166
|
-
if attributes.key?(:'creation_author_id')
|
|
167
|
-
self.creation_author_id = attributes[:'creation_author_id']
|
|
168
|
-
end
|
|
169
|
-
|
|
170
|
-
if attributes.key?(:'filters')
|
|
171
|
-
if (value = attributes[:'filters']).is_a?(Array)
|
|
172
|
-
self.filters = value
|
|
173
|
-
end
|
|
174
|
-
end
|
|
175
|
-
|
|
176
|
-
if attributes.key?(:'has_extended_title')
|
|
177
|
-
self.has_extended_title = attributes[:'has_extended_title']
|
|
178
|
-
end
|
|
179
|
-
|
|
180
|
-
if attributes.key?(:'id')
|
|
181
|
-
self.id = attributes[:'id']
|
|
182
|
-
end
|
|
183
|
-
|
|
184
|
-
if attributes.key?(:'is_default')
|
|
185
|
-
self.is_default = attributes[:'is_default']
|
|
186
|
-
end
|
|
187
|
-
|
|
188
|
-
if attributes.key?(:'is_deleted')
|
|
189
|
-
self.is_deleted = attributes[:'is_deleted']
|
|
190
|
-
end
|
|
191
|
-
|
|
192
|
-
if attributes.key?(:'is_enabled')
|
|
193
|
-
self.is_enabled = attributes[:'is_enabled']
|
|
194
|
-
end
|
|
195
|
-
|
|
196
|
-
if attributes.key?(:'message')
|
|
197
|
-
self.message = attributes[:'message']
|
|
198
|
-
end
|
|
199
|
-
|
|
200
|
-
if attributes.key?(:'name')
|
|
201
|
-
self.name = attributes[:'name']
|
|
202
|
-
end
|
|
203
|
-
|
|
204
|
-
if attributes.key?(:'options')
|
|
205
|
-
self.options = attributes[:'options']
|
|
206
|
-
end
|
|
207
|
-
|
|
208
|
-
if attributes.key?(:'queries')
|
|
209
|
-
if (value = attributes[:'queries']).is_a?(Array)
|
|
210
|
-
self.queries = value
|
|
20
|
+
# Create a new rule.
|
|
21
|
+
module SecurityMonitoringRuleResponse
|
|
22
|
+
class << self
|
|
23
|
+
include BaseOneOfModel
|
|
24
|
+
include BaseOneOfModelNoDiscriminator
|
|
25
|
+
|
|
26
|
+
# List of class defined in oneOf (OpenAPI v3)
|
|
27
|
+
def openapi_one_of
|
|
28
|
+
[
|
|
29
|
+
:'SecurityMonitoringStandardRuleResponse',
|
|
30
|
+
:'SecurityMonitoringSignalRuleResponse'
|
|
31
|
+
]
|
|
32
|
+
end
|
|
33
|
+
# Builds the object
|
|
34
|
+
# @param [Mixed] Data to be matched against the list of oneOf items
|
|
35
|
+
# @return [Object] Returns the model or the data itself
|
|
36
|
+
def build(data)
|
|
37
|
+
# Go through the list of oneOf items and attempt to identify the appropriate one.
|
|
38
|
+
# Note:
|
|
39
|
+
# - We do not attempt to check whether exactly one item matches.
|
|
40
|
+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
|
41
|
+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
|
42
|
+
# - TODO: scalar values are de facto behaving as if they were nullable.
|
|
43
|
+
# - TODO: logging when debugging is set.
|
|
44
|
+
openapi_one_of.each do |klass|
|
|
45
|
+
begin
|
|
46
|
+
next if klass == :AnyType # "nullable: true"
|
|
47
|
+
typed_data = find_and_cast_into_type(klass, data)
|
|
48
|
+
next if typed_data._unparsed
|
|
49
|
+
return typed_data if typed_data
|
|
50
|
+
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
|
51
|
+
end
|
|
211
52
|
end
|
|
212
|
-
end
|
|
213
53
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
54
|
+
if openapi_one_of.include?(:AnyType)
|
|
55
|
+
data
|
|
56
|
+
else
|
|
57
|
+
self._unparsed = true
|
|
58
|
+
DatadogAPIClient::UnparsedObject.new(data)
|
|
217
59
|
end
|
|
218
60
|
end
|
|
219
|
-
|
|
220
|
-
if attributes.key?(:'type')
|
|
221
|
-
self.type = attributes[:'type']
|
|
222
|
-
end
|
|
223
|
-
|
|
224
|
-
if attributes.key?(:'update_author_id')
|
|
225
|
-
self.update_author_id = attributes[:'update_author_id']
|
|
226
|
-
end
|
|
227
|
-
|
|
228
|
-
if attributes.key?(:'version')
|
|
229
|
-
self.version = attributes[:'version']
|
|
230
|
-
end
|
|
231
|
-
end
|
|
232
|
-
|
|
233
|
-
# Check to see if the all the properties in the model are valid
|
|
234
|
-
# @return true if the model is valid
|
|
235
|
-
# @!visibility private
|
|
236
|
-
def valid?
|
|
237
|
-
true
|
|
238
|
-
end
|
|
239
|
-
|
|
240
|
-
# Checks equality by comparing each attribute.
|
|
241
|
-
# @param o [Object] Object to be compared
|
|
242
|
-
# @!visibility private
|
|
243
|
-
def ==(o)
|
|
244
|
-
return true if self.equal?(o)
|
|
245
|
-
self.class == o.class &&
|
|
246
|
-
cases == o.cases &&
|
|
247
|
-
created_at == o.created_at &&
|
|
248
|
-
creation_author_id == o.creation_author_id &&
|
|
249
|
-
filters == o.filters &&
|
|
250
|
-
has_extended_title == o.has_extended_title &&
|
|
251
|
-
id == o.id &&
|
|
252
|
-
is_default == o.is_default &&
|
|
253
|
-
is_deleted == o.is_deleted &&
|
|
254
|
-
is_enabled == o.is_enabled &&
|
|
255
|
-
message == o.message &&
|
|
256
|
-
name == o.name &&
|
|
257
|
-
options == o.options &&
|
|
258
|
-
queries == o.queries &&
|
|
259
|
-
tags == o.tags &&
|
|
260
|
-
type == o.type &&
|
|
261
|
-
update_author_id == o.update_author_id &&
|
|
262
|
-
version == o.version
|
|
263
|
-
end
|
|
264
|
-
|
|
265
|
-
# @see the `==` method
|
|
266
|
-
# @param o [Object] Object to be compared
|
|
267
|
-
# @!visibility private
|
|
268
|
-
def eql?(o)
|
|
269
|
-
self == o
|
|
270
|
-
end
|
|
271
|
-
|
|
272
|
-
# Calculates hash code according to all attributes.
|
|
273
|
-
# @return [Integer] Hash code
|
|
274
|
-
# @!visibility private
|
|
275
|
-
def hash
|
|
276
|
-
[cases, created_at, creation_author_id, filters, has_extended_title, id, is_default, is_deleted, is_enabled, message, name, options, queries, tags, type, update_author_id, version].hash
|
|
277
61
|
end
|
|
278
62
|
end
|
|
279
63
|
end
|