datadog_api_client 2.18.0 → 2.20.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.apigentools-info +4 -4
- data/.generator/conftest.py +1 -1
- data/.generator/poetry.lock +69 -69
- data/.generator/schemas/v1/openapi.yaml +286 -55
- data/.generator/schemas/v2/openapi.yaml +2021 -226
- data/.generator/src/generator/templates/api.j2 +5 -5
- data/.generator/src/generator/templates/model_generic.j2 +2 -2
- data/CHANGELOG.md +38 -0
- data/examples/v1/azure-integration/CreateAzureIntegration.rb +4 -4
- data/examples/v1/azure-integration/DeleteAzureIntegration.rb +2 -15
- data/examples/v1/azure-integration/UpdateAzureIntegration.rb +4 -4
- data/examples/v1/gcp-integration/CreateGCPIntegration.rb +4 -5
- data/examples/v1/gcp-integration/DeleteGCPIntegration.rb +2 -14
- data/examples/v1/gcp-integration/UpdateGCPIntegration.rb +4 -5
- data/examples/v1/logs-indexes/CreateLogsIndex.rb +5 -0
- data/examples/v1/logs-indexes/UpdateLogsIndex.rb +5 -0
- data/examples/v1/service-level-objectives/CreateSLO_3765703239.rb +46 -0
- data/examples/v1/synthetics/CreateSyntheticsAPITest.rb +1 -1
- data/examples/v1/synthetics/CreateSyntheticsBrowserTest.rb +1 -1
- data/examples/v1/synthetics/TriggerCITests.rb +1 -1
- data/examples/v1/synthetics/UpdateBrowserTest.rb +1 -1
- data/examples/v1/usage-metering/GetUsageLambda.rb +5 -2
- data/examples/v2/api-management/CreateOpenAPI.rb +11 -0
- data/examples/v2/api-management/DeleteOpenAPI.rb +11 -0
- data/examples/v2/api-management/GetOpenAPI.rb +11 -0
- data/examples/v2/api-management/UpdateOpenAPI.rb +14 -0
- data/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent.rb +0 -3
- data/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent_129899466.rb +0 -3
- data/examples/v2/cloud-cost-management/CreateCostAWSCURConfig.rb +18 -0
- data/examples/v2/cloud-cost-management/CreateCostAzureUCConfigs.rb +29 -0
- data/examples/v2/cloud-cost-management/DeleteCostAWSCURConfig.rb +5 -0
- data/examples/v2/cloud-cost-management/DeleteCostAzureUCConfig.rb +5 -0
- data/examples/v2/cloud-cost-management/GetCloudCostActivity.rb +5 -0
- data/examples/v2/cloud-cost-management/ListAWSRelatedAccounts.rb +5 -0
- data/examples/v2/cloud-cost-management/ListCostAWSCURConfigs.rb +5 -0
- data/examples/v2/cloud-cost-management/ListCostAzureUCConfigs.rb +5 -0
- data/examples/v2/cloud-cost-management/UpdateCostAWSCURConfig.rb +14 -0
- data/examples/v2/cloud-cost-management/UpdateCostAzureUCConfigs.rb +14 -0
- data/examples/v2/cloudflare-integration/CreateCloudflareAccount.rb +1 -1
- data/examples/v2/cloudflare-integration/UpdateCloudflareAccount.rb +4 -1
- data/examples/v2/downtimes/ListMonitorDowntimes_3316718253.rb +5 -0
- data/examples/v2/gcp-integration/CreateGCPSTSAccount_130557025.rb +16 -0
- data/examples/v2/gcp-integration/CreateGCPSTSAccount_2597004741.rb +16 -0
- data/examples/v2/gcp-integration/CreateGCPSTSAccount_4235664992.rb +17 -0
- data/examples/v2/gcp-integration/UpdateGCPSTSAccount_3205636354.rb +19 -0
- data/examples/v2/okta-integration/CreateOktaAccount.rb +1 -1
- data/examples/v2/security-monitoring/CreateSecurityMonitoringRule_3367706049.rb +46 -0
- data/examples/v2/security-monitoring/CreateSecurityMonitoringSuppression.rb +19 -0
- data/examples/v2/security-monitoring/DeleteSecurityMonitoringSuppression.rb +8 -0
- data/examples/v2/security-monitoring/GetSecurityMonitoringSuppression.rb +8 -0
- data/examples/v2/security-monitoring/ListSecurityMonitoringSuppressions.rb +5 -0
- data/examples/v2/security-monitoring/UpdateSecurityMonitoringSuppression.rb +17 -0
- data/examples/v2/sensitive-data-scanner/CreateScanningRule.rb +7 -0
- data/examples/v2/sensitive-data-scanner/UpdateScanningRule.rb +7 -10
- data/examples/v2/teams/CreateTeamMembership.rb +6 -0
- data/examples/v2/teams/GetTeamMemberships_3799131168.rb +8 -0
- data/examples/v2/usage-metering/GetUsageLambdaTracedInvocations.rb +1 -1
- data/lib/datadog_api_client/configuration.rb +4 -1
- data/lib/datadog_api_client/inflector.rb +74 -0
- data/lib/datadog_api_client/v1/api/downtimes_api.rb +28 -7
- data/lib/datadog_api_client/v1/api/monitors_api.rb +1 -1
- data/lib/datadog_api_client/v1/api/organizations_api.rb +1 -1
- data/lib/datadog_api_client/v1/api/usage_metering_api.rb +3 -3
- data/lib/datadog_api_client/v1/models/dashboard.rb +5 -1
- data/lib/datadog_api_client/v1/models/dashboard_summary_definition.rb +2 -0
- data/lib/datadog_api_client/v1/models/gcp_account.rb +22 -2
- data/lib/datadog_api_client/v1/models/log.rb +1 -1
- data/lib/datadog_api_client/v1/models/logs_daily_limit_reset.rb +90 -0
- data/lib/datadog_api_client/v1/models/logs_index.rb +36 -1
- data/lib/datadog_api_client/v1/models/logs_index_update_request.rb +36 -1
- data/lib/datadog_api_client/v1/models/metrics_payload.rb +1 -1
- data/lib/datadog_api_client/v1/models/metrics_query_metadata.rb +1 -1
- data/lib/datadog_api_client/v1/models/organization.rb +1 -1
- data/lib/datadog_api_client/v1/models/service_level_objective.rb +11 -1
- data/lib/datadog_api_client/v1/models/service_level_objective_request.rb +11 -1
- data/lib/datadog_api_client/v1/models/slo_correction_create_request_attributes.rb +1 -1
- data/lib/datadog_api_client/v1/models/slo_correction_response_attributes.rb +1 -1
- data/lib/datadog_api_client/v1/models/slo_correction_update_request_attributes.rb +1 -1
- data/lib/datadog_api_client/v1/models/slo_data_source_query_definition.rb +62 -0
- data/lib/datadog_api_client/v1/models/slo_formula.rb +98 -0
- data/lib/datadog_api_client/v1/models/slo_history_metrics.rb +2 -2
- data/lib/datadog_api_client/v1/models/slo_history_metrics_series.rb +1 -1
- data/lib/datadog_api_client/v1/models/slo_history_monitor.rb +1 -1
- data/lib/datadog_api_client/v1/models/slo_history_sli_data.rb +1 -1
- data/lib/datadog_api_client/v1/models/slo_response_data.rb +11 -1
- data/lib/datadog_api_client/v1/models/slo_sli_spec.rb +62 -0
- data/lib/datadog_api_client/v1/models/slo_time_slice_comparator.rb +29 -0
- data/lib/datadog_api_client/v1/models/slo_time_slice_condition.rb +141 -0
- data/lib/datadog_api_client/v1/models/slo_time_slice_query.rb +131 -0
- data/lib/datadog_api_client/v1/models/slo_time_slice_spec.rb +99 -0
- data/lib/datadog_api_client/v1/models/slo_type.rb +1 -0
- data/lib/datadog_api_client/v1/models/slo_type_numeric.rb +1 -0
- data/lib/datadog_api_client/v1/models/split_config.rb +6 -6
- data/lib/datadog_api_client/v1/models/synthetics_test_request.rb +11 -1
- data/lib/datadog_api_client/v1/models/usage_lambda_hour.rb +1 -1
- data/lib/datadog_api_client/v1/models/usage_lambda_response.rb +1 -1
- data/lib/datadog_api_client/v1/models/usage_summary_date.rb +11 -1
- data/lib/datadog_api_client/v1/models/usage_summary_date_org.rb +11 -1
- data/lib/datadog_api_client/v1/models/usage_summary_response.rb +11 -1
- data/lib/datadog_api_client/v2/api/api_management_api.rb +319 -0
- data/lib/datadog_api_client/v2/api/ci_visibility_pipelines_api.rb +0 -6
- data/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb +680 -0
- data/lib/datadog_api_client/v2/api/downtimes_api.rb +25 -0
- data/lib/datadog_api_client/v2/api/metrics_api.rb +3 -2
- data/lib/datadog_api_client/v2/api/organizations_api.rb +1 -1
- data/lib/datadog_api_client/v2/api/security_monitoring_api.rb +329 -0
- data/lib/datadog_api_client/v2/api/teams_api.rb +22 -0
- data/lib/datadog_api_client/v2/api/usage_metering_api.rb +3 -3
- data/lib/datadog_api_client/v2/models/aws_cur_config.rb +129 -0
- data/lib/datadog_api_client/v2/models/aws_cur_config_attributes.rb +305 -0
- data/lib/datadog_api_client/v2/models/aws_cur_config_patch_data.rb +119 -0
- data/lib/datadog_api_client/v2/models/aws_cur_config_patch_request.rb +98 -0
- data/lib/datadog_api_client/v2/models/aws_cur_config_patch_request_attributes.rb +98 -0
- data/lib/datadog_api_client/v2/models/aws_cur_config_patch_request_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/aws_cur_config_post_data.rb +119 -0
- data/lib/datadog_api_client/v2/models/aws_cur_config_post_request.rb +98 -0
- data/lib/datadog_api_client/v2/models/aws_cur_config_post_request_attributes.rb +202 -0
- data/lib/datadog_api_client/v2/models/aws_cur_config_post_request_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/aws_cur_config_response.rb +80 -0
- data/lib/datadog_api_client/v2/models/aws_cur_config_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/aws_cur_configs_response.rb +82 -0
- data/lib/datadog_api_client/v2/models/aws_related_account.rb +129 -0
- data/lib/datadog_api_client/v2/models/aws_related_account_attributes.rb +90 -0
- data/lib/datadog_api_client/v2/models/aws_related_account_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/aws_related_accounts_response.rb +82 -0
- data/lib/datadog_api_client/v2/models/azure_uc_config.rb +378 -0
- data/lib/datadog_api_client/v2/models/azure_uc_config_pair.rb +129 -0
- data/lib/datadog_api_client/v2/models/azure_uc_config_pair_attributes.rb +110 -0
- data/lib/datadog_api_client/v2/models/azure_uc_config_pair_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/azure_uc_config_pairs_response.rb +80 -0
- data/lib/datadog_api_client/v2/models/azure_uc_config_patch_data.rb +119 -0
- data/lib/datadog_api_client/v2/models/azure_uc_config_patch_request.rb +98 -0
- data/lib/datadog_api_client/v2/models/azure_uc_config_patch_request_attributes.rb +98 -0
- data/lib/datadog_api_client/v2/models/azure_uc_config_patch_request_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/azure_uc_config_post_data.rb +119 -0
- data/lib/datadog_api_client/v2/models/azure_uc_config_post_request.rb +98 -0
- data/lib/datadog_api_client/v2/models/azure_uc_config_post_request_attributes.rb +192 -0
- data/lib/datadog_api_client/v2/models/azure_uc_config_post_request_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/azure_uc_configs_response.rb +82 -0
- data/lib/datadog_api_client/v2/models/bill_config.rb +161 -0
- data/lib/datadog_api_client/v2/models/ci_app_git_info.rb +2 -2
- data/lib/datadog_api_client/v2/models/cloud_cost_activity.rb +119 -0
- data/lib/datadog_api_client/v2/models/cloud_cost_activity_attributes.rb +98 -0
- data/lib/datadog_api_client/v2/models/cloud_cost_activity_response.rb +80 -0
- data/lib/datadog_api_client/v2/models/cloud_cost_activity_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/cloudflare_account_create_request_attributes.rb +28 -4
- data/lib/datadog_api_client/v2/models/cloudflare_account_response_attributes.rb +28 -4
- data/lib/datadog_api_client/v2/models/cloudflare_account_update_request_attributes.rb +28 -4
- data/lib/datadog_api_client/v2/models/create_open_api_response.rb +80 -0
- data/lib/datadog_api_client/v2/models/create_open_api_response_attributes.rb +82 -0
- data/lib/datadog_api_client/v2/models/create_open_api_response_data.rb +90 -0
- data/lib/datadog_api_client/v2/models/dora_deployment_request_attributes.rb +11 -1
- data/lib/datadog_api_client/v2/models/dora_git_info.rb +2 -2
- data/lib/datadog_api_client/v2/models/dora_incident_request_attributes.rb +11 -1
- data/lib/datadog_api_client/v2/models/gcpsts_service_account_attributes.rb +25 -5
- data/lib/datadog_api_client/v2/models/metric_payload.rb +1 -1
- data/lib/datadog_api_client/v2/models/open_api_endpoint.rb +90 -0
- data/lib/datadog_api_client/v2/models/open_api_file.rb +80 -0
- data/lib/datadog_api_client/v2/models/relationship_to_user_team_team.rb +98 -0
- data/lib/datadog_api_client/v2/models/relationship_to_user_team_team_data.rb +119 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_options.rb +14 -4
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_third_party_options.rb +114 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_update_payload.rb +13 -1
- data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_create_payload.rb +13 -1
- data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_response.rb +13 -1
- data/lib/datadog_api_client/v2/models/security_monitoring_suppression.rb +100 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_suppression_attributes.rb +198 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_suppression_create_attributes.rb +181 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_suppression_create_data.rb +119 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_suppression_create_request.rb +98 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_suppression_response.rb +80 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_suppression_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_suppression_update_attributes.rb +166 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_suppression_update_data.rb +119 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_suppression_update_request.rb +98 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_suppressions_response.rb +82 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_third_party_root_query.rb +92 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_third_party_rule_case.rb +112 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_third_party_rule_case_create.rb +130 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_user.rb +98 -0
- data/lib/datadog_api_client/v2/models/sensitive_data_scanner_included_keyword_configuration.rb +134 -0
- data/lib/datadog_api_client/v2/models/sensitive_data_scanner_rule_attributes.rb +46 -1
- data/lib/datadog_api_client/v2/models/sensitive_data_scanner_standard_pattern_attributes.rb +33 -1
- data/lib/datadog_api_client/v2/models/update_open_api_response.rb +80 -0
- data/lib/datadog_api_client/v2/models/update_open_api_response_attributes.rb +82 -0
- data/lib/datadog_api_client/v2/models/update_open_api_response_data.rb +90 -0
- data/lib/datadog_api_client/v2/models/user_team_attributes.rb +24 -1
- data/lib/datadog_api_client/v2/models/user_team_relationships.rb +11 -1
- data/lib/datadog_api_client/v2/models/user_team_team_type.rb +26 -0
- data/lib/datadog_api_client/version.rb +1 -1
- metadata +103 -3
- data/examples/v1/usage-metering/GetUsageLambda_3132428705.rb +0 -8
@@ -47,9 +47,12 @@ module DatadogAPIClient::V1
|
|
47
47
|
# Only hosts that match one of the defined tags are imported into Datadog.
|
48
48
|
attr_accessor :host_filters
|
49
49
|
|
50
|
-
# When enabled, Datadog
|
50
|
+
# When enabled, Datadog will activate the Cloud Security Monitoring product for this service account. Note: This requires resource_collection_enabled to be set to true.
|
51
51
|
attr_accessor :is_cspm_enabled
|
52
52
|
|
53
|
+
# When enabled, Datadog will attempt to collect Security Command Center Findings. Note: This requires additional permissions on the service account.
|
54
|
+
attr_accessor :is_security_command_center_enabled
|
55
|
+
|
53
56
|
# Your private key name found in your JSON service account key.
|
54
57
|
attr_accessor :private_key
|
55
58
|
|
@@ -59,6 +62,9 @@ module DatadogAPIClient::V1
|
|
59
62
|
# Your Google Cloud project ID found in your JSON service account key.
|
60
63
|
attr_accessor :project_id
|
61
64
|
|
65
|
+
# When enabled, Datadog scans for all resources in your GCP environment.
|
66
|
+
attr_accessor :resource_collection_enabled
|
67
|
+
|
62
68
|
# Should be `https://accounts.google.com/o/oauth2/token`.
|
63
69
|
attr_accessor :token_uri
|
64
70
|
|
@@ -78,9 +84,11 @@ module DatadogAPIClient::V1
|
|
78
84
|
:'errors' => :'errors',
|
79
85
|
:'host_filters' => :'host_filters',
|
80
86
|
:'is_cspm_enabled' => :'is_cspm_enabled',
|
87
|
+
:'is_security_command_center_enabled' => :'is_security_command_center_enabled',
|
81
88
|
:'private_key' => :'private_key',
|
82
89
|
:'private_key_id' => :'private_key_id',
|
83
90
|
:'project_id' => :'project_id',
|
91
|
+
:'resource_collection_enabled' => :'resource_collection_enabled',
|
84
92
|
:'token_uri' => :'token_uri',
|
85
93
|
:'type' => :'type'
|
86
94
|
}
|
@@ -99,9 +107,11 @@ module DatadogAPIClient::V1
|
|
99
107
|
:'errors' => :'Array<String>',
|
100
108
|
:'host_filters' => :'String',
|
101
109
|
:'is_cspm_enabled' => :'Boolean',
|
110
|
+
:'is_security_command_center_enabled' => :'Boolean',
|
102
111
|
:'private_key' => :'String',
|
103
112
|
:'private_key_id' => :'String',
|
104
113
|
:'project_id' => :'String',
|
114
|
+
:'resource_collection_enabled' => :'Boolean',
|
105
115
|
:'token_uri' => :'String',
|
106
116
|
:'type' => :'String'
|
107
117
|
}
|
@@ -161,6 +171,10 @@ module DatadogAPIClient::V1
|
|
161
171
|
self.is_cspm_enabled = attributes[:'is_cspm_enabled']
|
162
172
|
end
|
163
173
|
|
174
|
+
if attributes.key?(:'is_security_command_center_enabled')
|
175
|
+
self.is_security_command_center_enabled = attributes[:'is_security_command_center_enabled']
|
176
|
+
end
|
177
|
+
|
164
178
|
if attributes.key?(:'private_key')
|
165
179
|
self.private_key = attributes[:'private_key']
|
166
180
|
end
|
@@ -173,6 +187,10 @@ module DatadogAPIClient::V1
|
|
173
187
|
self.project_id = attributes[:'project_id']
|
174
188
|
end
|
175
189
|
|
190
|
+
if attributes.key?(:'resource_collection_enabled')
|
191
|
+
self.resource_collection_enabled = attributes[:'resource_collection_enabled']
|
192
|
+
end
|
193
|
+
|
176
194
|
if attributes.key?(:'token_uri')
|
177
195
|
self.token_uri = attributes[:'token_uri']
|
178
196
|
end
|
@@ -197,9 +215,11 @@ module DatadogAPIClient::V1
|
|
197
215
|
errors == o.errors &&
|
198
216
|
host_filters == o.host_filters &&
|
199
217
|
is_cspm_enabled == o.is_cspm_enabled &&
|
218
|
+
is_security_command_center_enabled == o.is_security_command_center_enabled &&
|
200
219
|
private_key == o.private_key &&
|
201
220
|
private_key_id == o.private_key_id &&
|
202
221
|
project_id == o.project_id &&
|
222
|
+
resource_collection_enabled == o.resource_collection_enabled &&
|
203
223
|
token_uri == o.token_uri &&
|
204
224
|
type == o.type
|
205
225
|
end
|
@@ -208,7 +228,7 @@ module DatadogAPIClient::V1
|
|
208
228
|
# @return [Integer] Hash code
|
209
229
|
# @!visibility private
|
210
230
|
def hash
|
211
|
-
[auth_provider_x509_cert_url, auth_uri, automute, client_email, client_id, client_x509_cert_url, errors, host_filters, is_cspm_enabled, private_key, private_key_id, project_id, token_uri, type].hash
|
231
|
+
[auth_provider_x509_cert_url, auth_uri, automute, client_email, client_id, client_x509_cert_url, errors, host_filters, is_cspm_enabled, is_security_command_center_enabled, private_key, private_key_id, project_id, resource_collection_enabled, token_uri, type].hash
|
212
232
|
end
|
213
233
|
end
|
214
234
|
end
|
@@ -24,7 +24,7 @@ module DatadogAPIClient::V1
|
|
24
24
|
# JSON object containing all log attributes and their associated values.
|
25
25
|
attr_accessor :content
|
26
26
|
|
27
|
-
#
|
27
|
+
# ID of the Log.
|
28
28
|
attr_accessor :id
|
29
29
|
|
30
30
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -0,0 +1,90 @@
|
|
1
|
+
=begin
|
2
|
+
#Datadog API V1 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::V1
|
20
|
+
# Object containing options to override the default daily limit reset time.
|
21
|
+
class LogsDailyLimitReset
|
22
|
+
include BaseGenericModel
|
23
|
+
|
24
|
+
# String in `HH:00` format representing the time of day the daily limit should be reset. The hours must be between 00 and 23 (inclusive).
|
25
|
+
attr_accessor :reset_time
|
26
|
+
|
27
|
+
# String in `(-|+)HH:00` format representing the UTC offset to apply to the given reset time. The hours must be between -12 and +14 (inclusive).
|
28
|
+
attr_accessor :reset_utc_offset
|
29
|
+
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
31
|
+
# @!visibility private
|
32
|
+
def self.attribute_map
|
33
|
+
{
|
34
|
+
:'reset_time' => :'reset_time',
|
35
|
+
:'reset_utc_offset' => :'reset_utc_offset'
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# Attribute type mapping.
|
40
|
+
# @!visibility private
|
41
|
+
def self.openapi_types
|
42
|
+
{
|
43
|
+
:'reset_time' => :'String',
|
44
|
+
:'reset_utc_offset' => :'String'
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
# Initializes the object
|
49
|
+
# @param attributes [Hash] Model attributes in the form of hash
|
50
|
+
# @!visibility private
|
51
|
+
def initialize(attributes = {})
|
52
|
+
if (!attributes.is_a?(Hash))
|
53
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::LogsDailyLimitReset` initialize method"
|
54
|
+
end
|
55
|
+
|
56
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
57
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
58
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
59
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::LogsDailyLimitReset`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
60
|
+
end
|
61
|
+
h[k.to_sym] = v
|
62
|
+
}
|
63
|
+
|
64
|
+
if attributes.key?(:'reset_time')
|
65
|
+
self.reset_time = attributes[:'reset_time']
|
66
|
+
end
|
67
|
+
|
68
|
+
if attributes.key?(:'reset_utc_offset')
|
69
|
+
self.reset_utc_offset = attributes[:'reset_utc_offset']
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
# Checks equality by comparing each attribute.
|
74
|
+
# @param o [Object] Object to be compared
|
75
|
+
# @!visibility private
|
76
|
+
def ==(o)
|
77
|
+
return true if self.equal?(o)
|
78
|
+
self.class == o.class &&
|
79
|
+
reset_time == o.reset_time &&
|
80
|
+
reset_utc_offset == o.reset_utc_offset
|
81
|
+
end
|
82
|
+
|
83
|
+
# Calculates hash code according to all attributes.
|
84
|
+
# @return [Integer] Hash code
|
85
|
+
# @!visibility private
|
86
|
+
def hash
|
87
|
+
[reset_time, reset_utc_offset].hash
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
@@ -24,6 +24,12 @@ module DatadogAPIClient::V1
|
|
24
24
|
# The number of log events you can send in this index per day before you are rate-limited.
|
25
25
|
attr_accessor :daily_limit
|
26
26
|
|
27
|
+
# Object containing options to override the default daily limit reset time.
|
28
|
+
attr_accessor :daily_limit_reset
|
29
|
+
|
30
|
+
# A percentage threshold of the daily quota at which a Datadog warning event is generated.
|
31
|
+
attr_reader :daily_limit_warning_threshold_percentage
|
32
|
+
|
27
33
|
# An array of exclusion objects. The logs are tested against the query of each filter,
|
28
34
|
# following the order of the array. Only the first matching active exclusion matters,
|
29
35
|
# others (if any) are ignored.
|
@@ -48,6 +54,8 @@ module DatadogAPIClient::V1
|
|
48
54
|
def self.attribute_map
|
49
55
|
{
|
50
56
|
:'daily_limit' => :'daily_limit',
|
57
|
+
:'daily_limit_reset' => :'daily_limit_reset',
|
58
|
+
:'daily_limit_warning_threshold_percentage' => :'daily_limit_warning_threshold_percentage',
|
51
59
|
:'exclusion_filters' => :'exclusion_filters',
|
52
60
|
:'filter' => :'filter',
|
53
61
|
:'is_rate_limited' => :'is_rate_limited',
|
@@ -61,6 +69,8 @@ module DatadogAPIClient::V1
|
|
61
69
|
def self.openapi_types
|
62
70
|
{
|
63
71
|
:'daily_limit' => :'Integer',
|
72
|
+
:'daily_limit_reset' => :'LogsDailyLimitReset',
|
73
|
+
:'daily_limit_warning_threshold_percentage' => :'Float',
|
64
74
|
:'exclusion_filters' => :'Array<LogsExclusion>',
|
65
75
|
:'filter' => :'LogsFilter',
|
66
76
|
:'is_rate_limited' => :'Boolean',
|
@@ -89,6 +99,14 @@ module DatadogAPIClient::V1
|
|
89
99
|
self.daily_limit = attributes[:'daily_limit']
|
90
100
|
end
|
91
101
|
|
102
|
+
if attributes.key?(:'daily_limit_reset')
|
103
|
+
self.daily_limit_reset = attributes[:'daily_limit_reset']
|
104
|
+
end
|
105
|
+
|
106
|
+
if attributes.key?(:'daily_limit_warning_threshold_percentage')
|
107
|
+
self.daily_limit_warning_threshold_percentage = attributes[:'daily_limit_warning_threshold_percentage']
|
108
|
+
end
|
109
|
+
|
92
110
|
if attributes.key?(:'exclusion_filters')
|
93
111
|
if (value = attributes[:'exclusion_filters']).is_a?(Array)
|
94
112
|
self.exclusion_filters = value
|
@@ -116,11 +134,26 @@ module DatadogAPIClient::V1
|
|
116
134
|
# @return true if the model is valid
|
117
135
|
# @!visibility private
|
118
136
|
def valid?
|
137
|
+
return false if !@daily_limit_warning_threshold_percentage.nil? && @daily_limit_warning_threshold_percentage > 99.99
|
138
|
+
return false if !@daily_limit_warning_threshold_percentage.nil? && @daily_limit_warning_threshold_percentage < 50
|
119
139
|
return false if @filter.nil?
|
120
140
|
return false if @name.nil?
|
121
141
|
true
|
122
142
|
end
|
123
143
|
|
144
|
+
# Custom attribute writer method with validation
|
145
|
+
# @param daily_limit_warning_threshold_percentage [Object] Object to be assigned
|
146
|
+
# @!visibility private
|
147
|
+
def daily_limit_warning_threshold_percentage=(daily_limit_warning_threshold_percentage)
|
148
|
+
if !daily_limit_warning_threshold_percentage.nil? && daily_limit_warning_threshold_percentage > 99.99
|
149
|
+
fail ArgumentError, 'invalid value for "daily_limit_warning_threshold_percentage", must be smaller than or equal to 99.99.'
|
150
|
+
end
|
151
|
+
if !daily_limit_warning_threshold_percentage.nil? && daily_limit_warning_threshold_percentage < 50
|
152
|
+
fail ArgumentError, 'invalid value for "daily_limit_warning_threshold_percentage", must be greater than or equal to 50.'
|
153
|
+
end
|
154
|
+
@daily_limit_warning_threshold_percentage = daily_limit_warning_threshold_percentage
|
155
|
+
end
|
156
|
+
|
124
157
|
# Custom attribute writer method with validation
|
125
158
|
# @param filter [Object] Object to be assigned
|
126
159
|
# @!visibility private
|
@@ -148,6 +181,8 @@ module DatadogAPIClient::V1
|
|
148
181
|
return true if self.equal?(o)
|
149
182
|
self.class == o.class &&
|
150
183
|
daily_limit == o.daily_limit &&
|
184
|
+
daily_limit_reset == o.daily_limit_reset &&
|
185
|
+
daily_limit_warning_threshold_percentage == o.daily_limit_warning_threshold_percentage &&
|
151
186
|
exclusion_filters == o.exclusion_filters &&
|
152
187
|
filter == o.filter &&
|
153
188
|
is_rate_limited == o.is_rate_limited &&
|
@@ -159,7 +194,7 @@ module DatadogAPIClient::V1
|
|
159
194
|
# @return [Integer] Hash code
|
160
195
|
# @!visibility private
|
161
196
|
def hash
|
162
|
-
[daily_limit, exclusion_filters, filter, is_rate_limited, name, num_retention_days].hash
|
197
|
+
[daily_limit, daily_limit_reset, daily_limit_warning_threshold_percentage, exclusion_filters, filter, is_rate_limited, name, num_retention_days].hash
|
163
198
|
end
|
164
199
|
end
|
165
200
|
end
|
@@ -24,6 +24,12 @@ module DatadogAPIClient::V1
|
|
24
24
|
# The number of log events you can send in this index per day before you are rate-limited.
|
25
25
|
attr_accessor :daily_limit
|
26
26
|
|
27
|
+
# Object containing options to override the default daily limit reset time.
|
28
|
+
attr_accessor :daily_limit_reset
|
29
|
+
|
30
|
+
# A percentage threshold of the daily quota at which a Datadog warning event is generated.
|
31
|
+
attr_reader :daily_limit_warning_threshold_percentage
|
32
|
+
|
27
33
|
# If true, sets the `daily_limit` value to null and the index is not limited on a daily basis (any
|
28
34
|
# specified `daily_limit` value in the request is ignored). If false or omitted, the index's current
|
29
35
|
# `daily_limit` is maintained.
|
@@ -49,6 +55,8 @@ module DatadogAPIClient::V1
|
|
49
55
|
def self.attribute_map
|
50
56
|
{
|
51
57
|
:'daily_limit' => :'daily_limit',
|
58
|
+
:'daily_limit_reset' => :'daily_limit_reset',
|
59
|
+
:'daily_limit_warning_threshold_percentage' => :'daily_limit_warning_threshold_percentage',
|
52
60
|
:'disable_daily_limit' => :'disable_daily_limit',
|
53
61
|
:'exclusion_filters' => :'exclusion_filters',
|
54
62
|
:'filter' => :'filter',
|
@@ -61,6 +69,8 @@ module DatadogAPIClient::V1
|
|
61
69
|
def self.openapi_types
|
62
70
|
{
|
63
71
|
:'daily_limit' => :'Integer',
|
72
|
+
:'daily_limit_reset' => :'LogsDailyLimitReset',
|
73
|
+
:'daily_limit_warning_threshold_percentage' => :'Float',
|
64
74
|
:'disable_daily_limit' => :'Boolean',
|
65
75
|
:'exclusion_filters' => :'Array<LogsExclusion>',
|
66
76
|
:'filter' => :'LogsFilter',
|
@@ -88,6 +98,14 @@ module DatadogAPIClient::V1
|
|
88
98
|
self.daily_limit = attributes[:'daily_limit']
|
89
99
|
end
|
90
100
|
|
101
|
+
if attributes.key?(:'daily_limit_reset')
|
102
|
+
self.daily_limit_reset = attributes[:'daily_limit_reset']
|
103
|
+
end
|
104
|
+
|
105
|
+
if attributes.key?(:'daily_limit_warning_threshold_percentage')
|
106
|
+
self.daily_limit_warning_threshold_percentage = attributes[:'daily_limit_warning_threshold_percentage']
|
107
|
+
end
|
108
|
+
|
91
109
|
if attributes.key?(:'disable_daily_limit')
|
92
110
|
self.disable_daily_limit = attributes[:'disable_daily_limit']
|
93
111
|
end
|
@@ -111,10 +129,25 @@ module DatadogAPIClient::V1
|
|
111
129
|
# @return true if the model is valid
|
112
130
|
# @!visibility private
|
113
131
|
def valid?
|
132
|
+
return false if !@daily_limit_warning_threshold_percentage.nil? && @daily_limit_warning_threshold_percentage > 99.99
|
133
|
+
return false if !@daily_limit_warning_threshold_percentage.nil? && @daily_limit_warning_threshold_percentage < 50
|
114
134
|
return false if @filter.nil?
|
115
135
|
true
|
116
136
|
end
|
117
137
|
|
138
|
+
# Custom attribute writer method with validation
|
139
|
+
# @param daily_limit_warning_threshold_percentage [Object] Object to be assigned
|
140
|
+
# @!visibility private
|
141
|
+
def daily_limit_warning_threshold_percentage=(daily_limit_warning_threshold_percentage)
|
142
|
+
if !daily_limit_warning_threshold_percentage.nil? && daily_limit_warning_threshold_percentage > 99.99
|
143
|
+
fail ArgumentError, 'invalid value for "daily_limit_warning_threshold_percentage", must be smaller than or equal to 99.99.'
|
144
|
+
end
|
145
|
+
if !daily_limit_warning_threshold_percentage.nil? && daily_limit_warning_threshold_percentage < 50
|
146
|
+
fail ArgumentError, 'invalid value for "daily_limit_warning_threshold_percentage", must be greater than or equal to 50.'
|
147
|
+
end
|
148
|
+
@daily_limit_warning_threshold_percentage = daily_limit_warning_threshold_percentage
|
149
|
+
end
|
150
|
+
|
118
151
|
# Custom attribute writer method with validation
|
119
152
|
# @param filter [Object] Object to be assigned
|
120
153
|
# @!visibility private
|
@@ -132,6 +165,8 @@ module DatadogAPIClient::V1
|
|
132
165
|
return true if self.equal?(o)
|
133
166
|
self.class == o.class &&
|
134
167
|
daily_limit == o.daily_limit &&
|
168
|
+
daily_limit_reset == o.daily_limit_reset &&
|
169
|
+
daily_limit_warning_threshold_percentage == o.daily_limit_warning_threshold_percentage &&
|
135
170
|
disable_daily_limit == o.disable_daily_limit &&
|
136
171
|
exclusion_filters == o.exclusion_filters &&
|
137
172
|
filter == o.filter &&
|
@@ -142,7 +177,7 @@ module DatadogAPIClient::V1
|
|
142
177
|
# @return [Integer] Hash code
|
143
178
|
# @!visibility private
|
144
179
|
def hash
|
145
|
-
[daily_limit, disable_daily_limit, exclusion_filters, filter, num_retention_days].hash
|
180
|
+
[daily_limit, daily_limit_reset, daily_limit_warning_threshold_percentage, disable_daily_limit, exclusion_filters, filter, num_retention_days].hash
|
146
181
|
end
|
147
182
|
end
|
148
183
|
end
|
@@ -21,7 +21,7 @@ module DatadogAPIClient::V1
|
|
21
21
|
class MetricsPayload
|
22
22
|
include BaseGenericModel
|
23
23
|
|
24
|
-
# A list of
|
24
|
+
# A list of timeseries to submit to Datadog.
|
25
25
|
attr_reader :series
|
26
26
|
|
27
27
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -42,7 +42,7 @@ module DatadogAPIClient::V1
|
|
42
42
|
# Metric name.
|
43
43
|
attr_accessor :metric
|
44
44
|
|
45
|
-
# List of points of the
|
45
|
+
# List of points of the timeseries in milliseconds.
|
46
46
|
attr_accessor :pointlist
|
47
47
|
|
48
48
|
# The index of the series' query within the request.
|
@@ -30,7 +30,7 @@ module DatadogAPIClient::V1
|
|
30
30
|
# Description of the organization.
|
31
31
|
attr_accessor :description
|
32
32
|
|
33
|
-
# The name of the
|
33
|
+
# The name of the child organization, limited to 32 characters.
|
34
34
|
attr_reader :name
|
35
35
|
|
36
36
|
# The `public_id` of the organization you are operating within.
|
@@ -73,6 +73,9 @@ module DatadogAPIClient::V1
|
|
73
73
|
# min of all of those requests.
|
74
74
|
attr_accessor :query
|
75
75
|
|
76
|
+
# A generic SLI specification. This is currently used for time-slice SLOs only.
|
77
|
+
attr_accessor :sli_specification
|
78
|
+
|
76
79
|
# A list of tags associated with this service level objective.
|
77
80
|
# Always included in service level objective responses (but may be empty).
|
78
81
|
# Optional in create/update requests.
|
@@ -112,6 +115,7 @@ module DatadogAPIClient::V1
|
|
112
115
|
:'monitor_tags' => :'monitor_tags',
|
113
116
|
:'name' => :'name',
|
114
117
|
:'query' => :'query',
|
118
|
+
:'sli_specification' => :'sli_specification',
|
115
119
|
:'tags' => :'tags',
|
116
120
|
:'target_threshold' => :'target_threshold',
|
117
121
|
:'thresholds' => :'thresholds',
|
@@ -135,6 +139,7 @@ module DatadogAPIClient::V1
|
|
135
139
|
:'monitor_tags' => :'Array<String>',
|
136
140
|
:'name' => :'String',
|
137
141
|
:'query' => :'ServiceLevelObjectiveQuery',
|
142
|
+
:'sli_specification' => :'SLOSliSpec',
|
138
143
|
:'tags' => :'Array<String>',
|
139
144
|
:'target_threshold' => :'Float',
|
140
145
|
:'thresholds' => :'Array<SLOThreshold>',
|
@@ -214,6 +219,10 @@ module DatadogAPIClient::V1
|
|
214
219
|
self.query = attributes[:'query']
|
215
220
|
end
|
216
221
|
|
222
|
+
if attributes.key?(:'sli_specification')
|
223
|
+
self.sli_specification = attributes[:'sli_specification']
|
224
|
+
end
|
225
|
+
|
217
226
|
if attributes.key?(:'tags')
|
218
227
|
if (value = attributes[:'tags']).is_a?(Array)
|
219
228
|
self.tags = value
|
@@ -299,6 +308,7 @@ module DatadogAPIClient::V1
|
|
299
308
|
monitor_tags == o.monitor_tags &&
|
300
309
|
name == o.name &&
|
301
310
|
query == o.query &&
|
311
|
+
sli_specification == o.sli_specification &&
|
302
312
|
tags == o.tags &&
|
303
313
|
target_threshold == o.target_threshold &&
|
304
314
|
thresholds == o.thresholds &&
|
@@ -311,7 +321,7 @@ module DatadogAPIClient::V1
|
|
311
321
|
# @return [Integer] Hash code
|
312
322
|
# @!visibility private
|
313
323
|
def hash
|
314
|
-
[created_at, creator, description, groups, id, modified_at, monitor_ids, monitor_tags, name, query, tags, target_threshold, thresholds, timeframe, type, warning_threshold].hash
|
324
|
+
[created_at, creator, description, groups, id, modified_at, monitor_ids, monitor_tags, name, query, sli_specification, tags, target_threshold, thresholds, timeframe, type, warning_threshold].hash
|
315
325
|
end
|
316
326
|
end
|
317
327
|
end
|
@@ -47,6 +47,9 @@ module DatadogAPIClient::V1
|
|
47
47
|
# min of all of those requests.
|
48
48
|
attr_accessor :query
|
49
49
|
|
50
|
+
# A generic SLI specification. This is currently used for time-slice SLOs only.
|
51
|
+
attr_accessor :sli_specification
|
52
|
+
|
50
53
|
# A list of tags associated with this service level objective.
|
51
54
|
# Always included in service level objective responses (but may be empty).
|
52
55
|
# Optional in create/update requests.
|
@@ -81,6 +84,7 @@ module DatadogAPIClient::V1
|
|
81
84
|
:'monitor_ids' => :'monitor_ids',
|
82
85
|
:'name' => :'name',
|
83
86
|
:'query' => :'query',
|
87
|
+
:'sli_specification' => :'sli_specification',
|
84
88
|
:'tags' => :'tags',
|
85
89
|
:'target_threshold' => :'target_threshold',
|
86
90
|
:'thresholds' => :'thresholds',
|
@@ -99,6 +103,7 @@ module DatadogAPIClient::V1
|
|
99
103
|
:'monitor_ids' => :'Array<Integer>',
|
100
104
|
:'name' => :'String',
|
101
105
|
:'query' => :'ServiceLevelObjectiveQuery',
|
106
|
+
:'sli_specification' => :'SLOSliSpec',
|
102
107
|
:'tags' => :'Array<String>',
|
103
108
|
:'target_threshold' => :'Float',
|
104
109
|
:'thresholds' => :'Array<SLOThreshold>',
|
@@ -156,6 +161,10 @@ module DatadogAPIClient::V1
|
|
156
161
|
self.query = attributes[:'query']
|
157
162
|
end
|
158
163
|
|
164
|
+
if attributes.key?(:'sli_specification')
|
165
|
+
self.sli_specification = attributes[:'sli_specification']
|
166
|
+
end
|
167
|
+
|
159
168
|
if attributes.key?(:'tags')
|
160
169
|
if (value = attributes[:'tags']).is_a?(Array)
|
161
170
|
self.tags = value
|
@@ -236,6 +245,7 @@ module DatadogAPIClient::V1
|
|
236
245
|
monitor_ids == o.monitor_ids &&
|
237
246
|
name == o.name &&
|
238
247
|
query == o.query &&
|
248
|
+
sli_specification == o.sli_specification &&
|
239
249
|
tags == o.tags &&
|
240
250
|
target_threshold == o.target_threshold &&
|
241
251
|
thresholds == o.thresholds &&
|
@@ -248,7 +258,7 @@ module DatadogAPIClient::V1
|
|
248
258
|
# @return [Integer] Hash code
|
249
259
|
# @!visibility private
|
250
260
|
def hash
|
251
|
-
[description, groups, monitor_ids, name, query, tags, target_threshold, thresholds, timeframe, type, warning_threshold].hash
|
261
|
+
[description, groups, monitor_ids, name, query, sli_specification, tags, target_threshold, thresholds, timeframe, type, warning_threshold].hash
|
252
262
|
end
|
253
263
|
end
|
254
264
|
end
|
@@ -34,7 +34,7 @@ module DatadogAPIClient::V1
|
|
34
34
|
attr_accessor :_end
|
35
35
|
|
36
36
|
# The recurrence rules as defined in the iCalendar RFC 5545. The supported rules for SLO corrections
|
37
|
-
# are `FREQ`, `INTERVAL`, `COUNT` and `
|
37
|
+
# are `FREQ`, `INTERVAL`, `COUNT`, `UNTIL` and `BYDAY`.
|
38
38
|
attr_accessor :rrule
|
39
39
|
|
40
40
|
# ID of the SLO that this correction applies to.
|
@@ -46,7 +46,7 @@ module DatadogAPIClient::V1
|
|
46
46
|
attr_accessor :modifier
|
47
47
|
|
48
48
|
# The recurrence rules as defined in the iCalendar RFC 5545. The supported rules for SLO corrections
|
49
|
-
# are `FREQ`, `INTERVAL`, `COUNT`, and `
|
49
|
+
# are `FREQ`, `INTERVAL`, `COUNT`, `UNTIL` and `BYDAY`.
|
50
50
|
attr_accessor :rrule
|
51
51
|
|
52
52
|
# ID of the SLO that this correction applies to.
|
@@ -34,7 +34,7 @@ module DatadogAPIClient::V1
|
|
34
34
|
attr_accessor :_end
|
35
35
|
|
36
36
|
# The recurrence rules as defined in the iCalendar RFC 5545. The supported rules for SLO corrections
|
37
|
-
# are `FREQ`, `INTERVAL`, `COUNT`, and `
|
37
|
+
# are `FREQ`, `INTERVAL`, `COUNT`, `UNTIL` and `BYDAY`.
|
38
38
|
attr_accessor :rrule
|
39
39
|
|
40
40
|
# Starting time of the correction in epoch seconds.
|
@@ -0,0 +1,62 @@
|
|
1
|
+
=begin
|
2
|
+
#Datadog API V1 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::V1
|
20
|
+
# A formula and function query.
|
21
|
+
module SLODataSourceQueryDefinition
|
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
|
+
:'FormulaAndFunctionMetricQueryDefinition'
|
30
|
+
]
|
31
|
+
end
|
32
|
+
# Builds the object
|
33
|
+
# @param data [Mixed] Data to be matched against the list of oneOf items
|
34
|
+
# @return [Object] Returns the model or the data itself
|
35
|
+
def build(data)
|
36
|
+
# Go through the list of oneOf items and attempt to identify the appropriate one.
|
37
|
+
# Note:
|
38
|
+
# - We do not attempt to check whether exactly one item matches.
|
39
|
+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
40
|
+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
41
|
+
# - TODO: scalar values are de facto behaving as if they were nullable.
|
42
|
+
# - TODO: logging when debugging is set.
|
43
|
+
openapi_one_of.each do |klass|
|
44
|
+
begin
|
45
|
+
next if klass == :AnyType # "nullable: true"
|
46
|
+
typed_data = find_and_cast_into_type(klass, data)
|
47
|
+
next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed
|
48
|
+
return typed_data if typed_data
|
49
|
+
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
if openapi_one_of.include?(:AnyType)
|
54
|
+
data
|
55
|
+
else
|
56
|
+
self._unparsed = true
|
57
|
+
DatadogAPIClient::UnparsedObject.new(data)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|