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.
Files changed (193) hide show
  1. checksums.yaml +4 -4
  2. data/.apigentools-info +4 -4
  3. data/.generator/conftest.py +1 -1
  4. data/.generator/poetry.lock +69 -69
  5. data/.generator/schemas/v1/openapi.yaml +286 -55
  6. data/.generator/schemas/v2/openapi.yaml +2021 -226
  7. data/.generator/src/generator/templates/api.j2 +5 -5
  8. data/.generator/src/generator/templates/model_generic.j2 +2 -2
  9. data/CHANGELOG.md +38 -0
  10. data/examples/v1/azure-integration/CreateAzureIntegration.rb +4 -4
  11. data/examples/v1/azure-integration/DeleteAzureIntegration.rb +2 -15
  12. data/examples/v1/azure-integration/UpdateAzureIntegration.rb +4 -4
  13. data/examples/v1/gcp-integration/CreateGCPIntegration.rb +4 -5
  14. data/examples/v1/gcp-integration/DeleteGCPIntegration.rb +2 -14
  15. data/examples/v1/gcp-integration/UpdateGCPIntegration.rb +4 -5
  16. data/examples/v1/logs-indexes/CreateLogsIndex.rb +5 -0
  17. data/examples/v1/logs-indexes/UpdateLogsIndex.rb +5 -0
  18. data/examples/v1/service-level-objectives/CreateSLO_3765703239.rb +46 -0
  19. data/examples/v1/synthetics/CreateSyntheticsAPITest.rb +1 -1
  20. data/examples/v1/synthetics/CreateSyntheticsBrowserTest.rb +1 -1
  21. data/examples/v1/synthetics/TriggerCITests.rb +1 -1
  22. data/examples/v1/synthetics/UpdateBrowserTest.rb +1 -1
  23. data/examples/v1/usage-metering/GetUsageLambda.rb +5 -2
  24. data/examples/v2/api-management/CreateOpenAPI.rb +11 -0
  25. data/examples/v2/api-management/DeleteOpenAPI.rb +11 -0
  26. data/examples/v2/api-management/GetOpenAPI.rb +11 -0
  27. data/examples/v2/api-management/UpdateOpenAPI.rb +14 -0
  28. data/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent.rb +0 -3
  29. data/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent_129899466.rb +0 -3
  30. data/examples/v2/cloud-cost-management/CreateCostAWSCURConfig.rb +18 -0
  31. data/examples/v2/cloud-cost-management/CreateCostAzureUCConfigs.rb +29 -0
  32. data/examples/v2/cloud-cost-management/DeleteCostAWSCURConfig.rb +5 -0
  33. data/examples/v2/cloud-cost-management/DeleteCostAzureUCConfig.rb +5 -0
  34. data/examples/v2/cloud-cost-management/GetCloudCostActivity.rb +5 -0
  35. data/examples/v2/cloud-cost-management/ListAWSRelatedAccounts.rb +5 -0
  36. data/examples/v2/cloud-cost-management/ListCostAWSCURConfigs.rb +5 -0
  37. data/examples/v2/cloud-cost-management/ListCostAzureUCConfigs.rb +5 -0
  38. data/examples/v2/cloud-cost-management/UpdateCostAWSCURConfig.rb +14 -0
  39. data/examples/v2/cloud-cost-management/UpdateCostAzureUCConfigs.rb +14 -0
  40. data/examples/v2/cloudflare-integration/CreateCloudflareAccount.rb +1 -1
  41. data/examples/v2/cloudflare-integration/UpdateCloudflareAccount.rb +4 -1
  42. data/examples/v2/downtimes/ListMonitorDowntimes_3316718253.rb +5 -0
  43. data/examples/v2/gcp-integration/CreateGCPSTSAccount_130557025.rb +16 -0
  44. data/examples/v2/gcp-integration/CreateGCPSTSAccount_2597004741.rb +16 -0
  45. data/examples/v2/gcp-integration/CreateGCPSTSAccount_4235664992.rb +17 -0
  46. data/examples/v2/gcp-integration/UpdateGCPSTSAccount_3205636354.rb +19 -0
  47. data/examples/v2/okta-integration/CreateOktaAccount.rb +1 -1
  48. data/examples/v2/security-monitoring/CreateSecurityMonitoringRule_3367706049.rb +46 -0
  49. data/examples/v2/security-monitoring/CreateSecurityMonitoringSuppression.rb +19 -0
  50. data/examples/v2/security-monitoring/DeleteSecurityMonitoringSuppression.rb +8 -0
  51. data/examples/v2/security-monitoring/GetSecurityMonitoringSuppression.rb +8 -0
  52. data/examples/v2/security-monitoring/ListSecurityMonitoringSuppressions.rb +5 -0
  53. data/examples/v2/security-monitoring/UpdateSecurityMonitoringSuppression.rb +17 -0
  54. data/examples/v2/sensitive-data-scanner/CreateScanningRule.rb +7 -0
  55. data/examples/v2/sensitive-data-scanner/UpdateScanningRule.rb +7 -10
  56. data/examples/v2/teams/CreateTeamMembership.rb +6 -0
  57. data/examples/v2/teams/GetTeamMemberships_3799131168.rb +8 -0
  58. data/examples/v2/usage-metering/GetUsageLambdaTracedInvocations.rb +1 -1
  59. data/lib/datadog_api_client/configuration.rb +4 -1
  60. data/lib/datadog_api_client/inflector.rb +74 -0
  61. data/lib/datadog_api_client/v1/api/downtimes_api.rb +28 -7
  62. data/lib/datadog_api_client/v1/api/monitors_api.rb +1 -1
  63. data/lib/datadog_api_client/v1/api/organizations_api.rb +1 -1
  64. data/lib/datadog_api_client/v1/api/usage_metering_api.rb +3 -3
  65. data/lib/datadog_api_client/v1/models/dashboard.rb +5 -1
  66. data/lib/datadog_api_client/v1/models/dashboard_summary_definition.rb +2 -0
  67. data/lib/datadog_api_client/v1/models/gcp_account.rb +22 -2
  68. data/lib/datadog_api_client/v1/models/log.rb +1 -1
  69. data/lib/datadog_api_client/v1/models/logs_daily_limit_reset.rb +90 -0
  70. data/lib/datadog_api_client/v1/models/logs_index.rb +36 -1
  71. data/lib/datadog_api_client/v1/models/logs_index_update_request.rb +36 -1
  72. data/lib/datadog_api_client/v1/models/metrics_payload.rb +1 -1
  73. data/lib/datadog_api_client/v1/models/metrics_query_metadata.rb +1 -1
  74. data/lib/datadog_api_client/v1/models/organization.rb +1 -1
  75. data/lib/datadog_api_client/v1/models/service_level_objective.rb +11 -1
  76. data/lib/datadog_api_client/v1/models/service_level_objective_request.rb +11 -1
  77. data/lib/datadog_api_client/v1/models/slo_correction_create_request_attributes.rb +1 -1
  78. data/lib/datadog_api_client/v1/models/slo_correction_response_attributes.rb +1 -1
  79. data/lib/datadog_api_client/v1/models/slo_correction_update_request_attributes.rb +1 -1
  80. data/lib/datadog_api_client/v1/models/slo_data_source_query_definition.rb +62 -0
  81. data/lib/datadog_api_client/v1/models/slo_formula.rb +98 -0
  82. data/lib/datadog_api_client/v1/models/slo_history_metrics.rb +2 -2
  83. data/lib/datadog_api_client/v1/models/slo_history_metrics_series.rb +1 -1
  84. data/lib/datadog_api_client/v1/models/slo_history_monitor.rb +1 -1
  85. data/lib/datadog_api_client/v1/models/slo_history_sli_data.rb +1 -1
  86. data/lib/datadog_api_client/v1/models/slo_response_data.rb +11 -1
  87. data/lib/datadog_api_client/v1/models/slo_sli_spec.rb +62 -0
  88. data/lib/datadog_api_client/v1/models/slo_time_slice_comparator.rb +29 -0
  89. data/lib/datadog_api_client/v1/models/slo_time_slice_condition.rb +141 -0
  90. data/lib/datadog_api_client/v1/models/slo_time_slice_query.rb +131 -0
  91. data/lib/datadog_api_client/v1/models/slo_time_slice_spec.rb +99 -0
  92. data/lib/datadog_api_client/v1/models/slo_type.rb +1 -0
  93. data/lib/datadog_api_client/v1/models/slo_type_numeric.rb +1 -0
  94. data/lib/datadog_api_client/v1/models/split_config.rb +6 -6
  95. data/lib/datadog_api_client/v1/models/synthetics_test_request.rb +11 -1
  96. data/lib/datadog_api_client/v1/models/usage_lambda_hour.rb +1 -1
  97. data/lib/datadog_api_client/v1/models/usage_lambda_response.rb +1 -1
  98. data/lib/datadog_api_client/v1/models/usage_summary_date.rb +11 -1
  99. data/lib/datadog_api_client/v1/models/usage_summary_date_org.rb +11 -1
  100. data/lib/datadog_api_client/v1/models/usage_summary_response.rb +11 -1
  101. data/lib/datadog_api_client/v2/api/api_management_api.rb +319 -0
  102. data/lib/datadog_api_client/v2/api/ci_visibility_pipelines_api.rb +0 -6
  103. data/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb +680 -0
  104. data/lib/datadog_api_client/v2/api/downtimes_api.rb +25 -0
  105. data/lib/datadog_api_client/v2/api/metrics_api.rb +3 -2
  106. data/lib/datadog_api_client/v2/api/organizations_api.rb +1 -1
  107. data/lib/datadog_api_client/v2/api/security_monitoring_api.rb +329 -0
  108. data/lib/datadog_api_client/v2/api/teams_api.rb +22 -0
  109. data/lib/datadog_api_client/v2/api/usage_metering_api.rb +3 -3
  110. data/lib/datadog_api_client/v2/models/aws_cur_config.rb +129 -0
  111. data/lib/datadog_api_client/v2/models/aws_cur_config_attributes.rb +305 -0
  112. data/lib/datadog_api_client/v2/models/aws_cur_config_patch_data.rb +119 -0
  113. data/lib/datadog_api_client/v2/models/aws_cur_config_patch_request.rb +98 -0
  114. data/lib/datadog_api_client/v2/models/aws_cur_config_patch_request_attributes.rb +98 -0
  115. data/lib/datadog_api_client/v2/models/aws_cur_config_patch_request_type.rb +26 -0
  116. data/lib/datadog_api_client/v2/models/aws_cur_config_post_data.rb +119 -0
  117. data/lib/datadog_api_client/v2/models/aws_cur_config_post_request.rb +98 -0
  118. data/lib/datadog_api_client/v2/models/aws_cur_config_post_request_attributes.rb +202 -0
  119. data/lib/datadog_api_client/v2/models/aws_cur_config_post_request_type.rb +26 -0
  120. data/lib/datadog_api_client/v2/models/aws_cur_config_response.rb +80 -0
  121. data/lib/datadog_api_client/v2/models/aws_cur_config_type.rb +26 -0
  122. data/lib/datadog_api_client/v2/models/aws_cur_configs_response.rb +82 -0
  123. data/lib/datadog_api_client/v2/models/aws_related_account.rb +129 -0
  124. data/lib/datadog_api_client/v2/models/aws_related_account_attributes.rb +90 -0
  125. data/lib/datadog_api_client/v2/models/aws_related_account_type.rb +26 -0
  126. data/lib/datadog_api_client/v2/models/aws_related_accounts_response.rb +82 -0
  127. data/lib/datadog_api_client/v2/models/azure_uc_config.rb +378 -0
  128. data/lib/datadog_api_client/v2/models/azure_uc_config_pair.rb +129 -0
  129. data/lib/datadog_api_client/v2/models/azure_uc_config_pair_attributes.rb +110 -0
  130. data/lib/datadog_api_client/v2/models/azure_uc_config_pair_type.rb +26 -0
  131. data/lib/datadog_api_client/v2/models/azure_uc_config_pairs_response.rb +80 -0
  132. data/lib/datadog_api_client/v2/models/azure_uc_config_patch_data.rb +119 -0
  133. data/lib/datadog_api_client/v2/models/azure_uc_config_patch_request.rb +98 -0
  134. data/lib/datadog_api_client/v2/models/azure_uc_config_patch_request_attributes.rb +98 -0
  135. data/lib/datadog_api_client/v2/models/azure_uc_config_patch_request_type.rb +26 -0
  136. data/lib/datadog_api_client/v2/models/azure_uc_config_post_data.rb +119 -0
  137. data/lib/datadog_api_client/v2/models/azure_uc_config_post_request.rb +98 -0
  138. data/lib/datadog_api_client/v2/models/azure_uc_config_post_request_attributes.rb +192 -0
  139. data/lib/datadog_api_client/v2/models/azure_uc_config_post_request_type.rb +26 -0
  140. data/lib/datadog_api_client/v2/models/azure_uc_configs_response.rb +82 -0
  141. data/lib/datadog_api_client/v2/models/bill_config.rb +161 -0
  142. data/lib/datadog_api_client/v2/models/ci_app_git_info.rb +2 -2
  143. data/lib/datadog_api_client/v2/models/cloud_cost_activity.rb +119 -0
  144. data/lib/datadog_api_client/v2/models/cloud_cost_activity_attributes.rb +98 -0
  145. data/lib/datadog_api_client/v2/models/cloud_cost_activity_response.rb +80 -0
  146. data/lib/datadog_api_client/v2/models/cloud_cost_activity_type.rb +26 -0
  147. data/lib/datadog_api_client/v2/models/cloudflare_account_create_request_attributes.rb +28 -4
  148. data/lib/datadog_api_client/v2/models/cloudflare_account_response_attributes.rb +28 -4
  149. data/lib/datadog_api_client/v2/models/cloudflare_account_update_request_attributes.rb +28 -4
  150. data/lib/datadog_api_client/v2/models/create_open_api_response.rb +80 -0
  151. data/lib/datadog_api_client/v2/models/create_open_api_response_attributes.rb +82 -0
  152. data/lib/datadog_api_client/v2/models/create_open_api_response_data.rb +90 -0
  153. data/lib/datadog_api_client/v2/models/dora_deployment_request_attributes.rb +11 -1
  154. data/lib/datadog_api_client/v2/models/dora_git_info.rb +2 -2
  155. data/lib/datadog_api_client/v2/models/dora_incident_request_attributes.rb +11 -1
  156. data/lib/datadog_api_client/v2/models/gcpsts_service_account_attributes.rb +25 -5
  157. data/lib/datadog_api_client/v2/models/metric_payload.rb +1 -1
  158. data/lib/datadog_api_client/v2/models/open_api_endpoint.rb +90 -0
  159. data/lib/datadog_api_client/v2/models/open_api_file.rb +80 -0
  160. data/lib/datadog_api_client/v2/models/relationship_to_user_team_team.rb +98 -0
  161. data/lib/datadog_api_client/v2/models/relationship_to_user_team_team_data.rb +119 -0
  162. data/lib/datadog_api_client/v2/models/security_monitoring_rule_options.rb +14 -4
  163. data/lib/datadog_api_client/v2/models/security_monitoring_rule_third_party_options.rb +114 -0
  164. data/lib/datadog_api_client/v2/models/security_monitoring_rule_update_payload.rb +13 -1
  165. data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_create_payload.rb +13 -1
  166. data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_response.rb +13 -1
  167. data/lib/datadog_api_client/v2/models/security_monitoring_suppression.rb +100 -0
  168. data/lib/datadog_api_client/v2/models/security_monitoring_suppression_attributes.rb +198 -0
  169. data/lib/datadog_api_client/v2/models/security_monitoring_suppression_create_attributes.rb +181 -0
  170. data/lib/datadog_api_client/v2/models/security_monitoring_suppression_create_data.rb +119 -0
  171. data/lib/datadog_api_client/v2/models/security_monitoring_suppression_create_request.rb +98 -0
  172. data/lib/datadog_api_client/v2/models/security_monitoring_suppression_response.rb +80 -0
  173. data/lib/datadog_api_client/v2/models/security_monitoring_suppression_type.rb +26 -0
  174. data/lib/datadog_api_client/v2/models/security_monitoring_suppression_update_attributes.rb +166 -0
  175. data/lib/datadog_api_client/v2/models/security_monitoring_suppression_update_data.rb +119 -0
  176. data/lib/datadog_api_client/v2/models/security_monitoring_suppression_update_request.rb +98 -0
  177. data/lib/datadog_api_client/v2/models/security_monitoring_suppressions_response.rb +82 -0
  178. data/lib/datadog_api_client/v2/models/security_monitoring_third_party_root_query.rb +92 -0
  179. data/lib/datadog_api_client/v2/models/security_monitoring_third_party_rule_case.rb +112 -0
  180. data/lib/datadog_api_client/v2/models/security_monitoring_third_party_rule_case_create.rb +130 -0
  181. data/lib/datadog_api_client/v2/models/security_monitoring_user.rb +98 -0
  182. data/lib/datadog_api_client/v2/models/sensitive_data_scanner_included_keyword_configuration.rb +134 -0
  183. data/lib/datadog_api_client/v2/models/sensitive_data_scanner_rule_attributes.rb +46 -1
  184. data/lib/datadog_api_client/v2/models/sensitive_data_scanner_standard_pattern_attributes.rb +33 -1
  185. data/lib/datadog_api_client/v2/models/update_open_api_response.rb +80 -0
  186. data/lib/datadog_api_client/v2/models/update_open_api_response_attributes.rb +82 -0
  187. data/lib/datadog_api_client/v2/models/update_open_api_response_data.rb +90 -0
  188. data/lib/datadog_api_client/v2/models/user_team_attributes.rb +24 -1
  189. data/lib/datadog_api_client/v2/models/user_team_relationships.rb +11 -1
  190. data/lib/datadog_api_client/v2/models/user_team_team_type.rb +26 -0
  191. data/lib/datadog_api_client/version.rb +1 -1
  192. metadata +103 -3
  193. data/examples/v1/usage-metering/GetUsageLambda_3132428705.rb +0 -8
@@ -0,0 +1,98 @@
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 that specifies how to combine the results of multiple queries.
21
+ class SLOFormula
22
+ include BaseGenericModel
23
+
24
+ # The formula string, which is an expression involving named queries.
25
+ attr_reader :formula
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ # @!visibility private
29
+ def self.attribute_map
30
+ {
31
+ :'formula' => :'formula'
32
+ }
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ # @!visibility private
37
+ def self.openapi_types
38
+ {
39
+ :'formula' => :'String'
40
+ }
41
+ end
42
+
43
+ # Initializes the object
44
+ # @param attributes [Hash] Model attributes in the form of hash
45
+ # @!visibility private
46
+ def initialize(attributes = {})
47
+ if (!attributes.is_a?(Hash))
48
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::SLOFormula` initialize method"
49
+ end
50
+
51
+ # check to see if the attribute exists and convert string to symbol for hash key
52
+ attributes = attributes.each_with_object({}) { |(k, v), h|
53
+ if (!self.class.attribute_map.key?(k.to_sym))
54
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::SLOFormula`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
55
+ end
56
+ h[k.to_sym] = v
57
+ }
58
+
59
+ if attributes.key?(:'formula')
60
+ self.formula = attributes[:'formula']
61
+ end
62
+ end
63
+
64
+ # Check to see if the all the properties in the model are valid
65
+ # @return true if the model is valid
66
+ # @!visibility private
67
+ def valid?
68
+ return false if @formula.nil?
69
+ true
70
+ end
71
+
72
+ # Custom attribute writer method with validation
73
+ # @param formula [Object] Object to be assigned
74
+ # @!visibility private
75
+ def formula=(formula)
76
+ if formula.nil?
77
+ fail ArgumentError, 'invalid value for "formula", formula cannot be nil.'
78
+ end
79
+ @formula = formula
80
+ end
81
+
82
+ # Checks equality by comparing each attribute.
83
+ # @param o [Object] Object to be compared
84
+ # @!visibility private
85
+ def ==(o)
86
+ return true if self.equal?(o)
87
+ self.class == o.class &&
88
+ formula == o.formula
89
+ end
90
+
91
+ # Calculates hash code according to all attributes.
92
+ # @return [Integer] Hash code
93
+ # @!visibility private
94
+ def hash
95
+ [formula].hash
96
+ end
97
+ end
98
+ end
@@ -23,7 +23,7 @@ module DatadogAPIClient::V1
23
23
  class SLOHistoryMetrics
24
24
  include BaseGenericModel
25
25
 
26
- # A representation of `metric` based SLO time series for the provided queries.
26
+ # A representation of `metric` based SLO timeseries for the provided queries.
27
27
  # This is the same response type from `batch_query` endpoint.
28
28
  attr_reader :denominator
29
29
 
@@ -33,7 +33,7 @@ module DatadogAPIClient::V1
33
33
  # Optional message if there are specific query issues/warnings.
34
34
  attr_accessor :message
35
35
 
36
- # A representation of `metric` based SLO time series for the provided queries.
36
+ # A representation of `metric` based SLO timeseries for the provided queries.
37
37
  # This is the same response type from `batch_query` endpoint.
38
38
  attr_reader :numerator
39
39
 
@@ -17,7 +17,7 @@ require 'date'
17
17
  require 'time'
18
18
 
19
19
  module DatadogAPIClient::V1
20
- # A representation of `metric` based SLO time series for the provided queries.
20
+ # A representation of `metric` based SLO timeseries for the provided queries.
21
21
  # This is the same response type from `batch_query` endpoint.
22
22
  class SLOHistoryMetricsSeries
23
23
  include BaseGenericModel
@@ -31,7 +31,7 @@ module DatadogAPIClient::V1
31
31
  # For groups in a grouped SLO, this is the group name.
32
32
  attr_accessor :group
33
33
 
34
- # For `monitor` based SLOs, this includes the aggregated history as arrays that include time series and uptime data where `0=monitor` is in `OK` state and `1=monitor` is in `alert` state.
34
+ # For `monitor` based SLOs, this includes the aggregated history as arrays that include timeseries and uptime data where `0=monitor` is in `OK` state and `1=monitor` is in `alert` state.
35
35
  attr_accessor :history
36
36
 
37
37
  # For `monitor` based SLOs, this is the last modified timestamp in epoch seconds of the monitor.
@@ -31,7 +31,7 @@ module DatadogAPIClient::V1
31
31
  # For groups in a grouped SLO, this is the group name.
32
32
  attr_accessor :group
33
33
 
34
- # For `monitor` based SLOs, this includes the aggregated history as arrays that include time series and uptime data where `0=monitor` is in `OK` state and `1=monitor` is in `alert` state.
34
+ # For `monitor` based SLOs, this includes the aggregated history as arrays that include timeseries and uptime data where `0=monitor` is in `OK` state and `1=monitor` is in `alert` state.
35
35
  attr_accessor :history
36
36
 
37
37
  # For `monitor` based SLOs, this is the last modified timestamp in epoch seconds of the monitor.
@@ -76,6 +76,9 @@ module DatadogAPIClient::V1
76
76
  # min of all of those requests.
77
77
  attr_accessor :query
78
78
 
79
+ # A generic SLI specification. This is currently used for time-slice SLOs only.
80
+ attr_accessor :sli_specification
81
+
79
82
  # A list of tags associated with this service level objective.
80
83
  # Always included in service level objective responses (but may be empty).
81
84
  # Optional in create/update requests.
@@ -116,6 +119,7 @@ module DatadogAPIClient::V1
116
119
  :'monitor_tags' => :'monitor_tags',
117
120
  :'name' => :'name',
118
121
  :'query' => :'query',
122
+ :'sli_specification' => :'sli_specification',
119
123
  :'tags' => :'tags',
120
124
  :'target_threshold' => :'target_threshold',
121
125
  :'thresholds' => :'thresholds',
@@ -140,6 +144,7 @@ module DatadogAPIClient::V1
140
144
  :'monitor_tags' => :'Array<String>',
141
145
  :'name' => :'String',
142
146
  :'query' => :'ServiceLevelObjectiveQuery',
147
+ :'sli_specification' => :'SLOSliSpec',
143
148
  :'tags' => :'Array<String>',
144
149
  :'target_threshold' => :'Float',
145
150
  :'thresholds' => :'Array<SLOThreshold>',
@@ -225,6 +230,10 @@ module DatadogAPIClient::V1
225
230
  self.query = attributes[:'query']
226
231
  end
227
232
 
233
+ if attributes.key?(:'sli_specification')
234
+ self.sli_specification = attributes[:'sli_specification']
235
+ end
236
+
228
237
  if attributes.key?(:'tags')
229
238
  if (value = attributes[:'tags']).is_a?(Array)
230
239
  self.tags = value
@@ -271,6 +280,7 @@ module DatadogAPIClient::V1
271
280
  monitor_tags == o.monitor_tags &&
272
281
  name == o.name &&
273
282
  query == o.query &&
283
+ sli_specification == o.sli_specification &&
274
284
  tags == o.tags &&
275
285
  target_threshold == o.target_threshold &&
276
286
  thresholds == o.thresholds &&
@@ -283,7 +293,7 @@ module DatadogAPIClient::V1
283
293
  # @return [Integer] Hash code
284
294
  # @!visibility private
285
295
  def hash
286
- [configured_alert_ids, created_at, creator, description, groups, id, modified_at, monitor_ids, monitor_tags, name, query, tags, target_threshold, thresholds, timeframe, type, warning_threshold].hash
296
+ [configured_alert_ids, 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
287
297
  end
288
298
  end
289
299
  end
@@ -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 generic SLI specification. This is currently used for time-slice SLOs only.
21
+ module SLOSliSpec
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
+ :'SLOTimeSliceSpec'
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
@@ -0,0 +1,29 @@
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
+ # The comparator used to compare the SLI value to the threshold.
21
+ class SLOTimeSliceComparator
22
+ include BaseEnumModel
23
+
24
+ GREATER = ">".freeze
25
+ GREATER_EQUAL = ">=".freeze
26
+ LESS = "<".freeze
27
+ LESS_EQUAL = "<=".freeze
28
+ end
29
+ end
@@ -0,0 +1,141 @@
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
+ # The time-slice condition, composed of 3 parts: 1. the metric timeseries query, 2. the comparator,
21
+ # and 3. the threshold.
22
+ class SLOTimeSliceCondition
23
+ include BaseGenericModel
24
+
25
+ # The comparator used to compare the SLI value to the threshold.
26
+ attr_reader :comparator
27
+
28
+ # The queries and formula used to calculate the SLI value.
29
+ attr_reader :query
30
+
31
+ # The threshold value to which each SLI value will be compared.
32
+ attr_reader :threshold
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ # @!visibility private
36
+ def self.attribute_map
37
+ {
38
+ :'comparator' => :'comparator',
39
+ :'query' => :'query',
40
+ :'threshold' => :'threshold'
41
+ }
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ # @!visibility private
46
+ def self.openapi_types
47
+ {
48
+ :'comparator' => :'SLOTimeSliceComparator',
49
+ :'query' => :'SLOTimeSliceQuery',
50
+ :'threshold' => :'Float'
51
+ }
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param attributes [Hash] Model attributes in the form of hash
56
+ # @!visibility private
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::SLOTimeSliceCondition` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!self.class.attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::SLOTimeSliceCondition`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'comparator')
71
+ self.comparator = attributes[:'comparator']
72
+ end
73
+
74
+ if attributes.key?(:'query')
75
+ self.query = attributes[:'query']
76
+ end
77
+
78
+ if attributes.key?(:'threshold')
79
+ self.threshold = attributes[:'threshold']
80
+ end
81
+ end
82
+
83
+ # Check to see if the all the properties in the model are valid
84
+ # @return true if the model is valid
85
+ # @!visibility private
86
+ def valid?
87
+ return false if @comparator.nil?
88
+ return false if @query.nil?
89
+ return false if @threshold.nil?
90
+ true
91
+ end
92
+
93
+ # Custom attribute writer method with validation
94
+ # @param comparator [Object] Object to be assigned
95
+ # @!visibility private
96
+ def comparator=(comparator)
97
+ if comparator.nil?
98
+ fail ArgumentError, 'invalid value for "comparator", comparator cannot be nil.'
99
+ end
100
+ @comparator = comparator
101
+ end
102
+
103
+ # Custom attribute writer method with validation
104
+ # @param query [Object] Object to be assigned
105
+ # @!visibility private
106
+ def query=(query)
107
+ if query.nil?
108
+ fail ArgumentError, 'invalid value for "query", query cannot be nil.'
109
+ end
110
+ @query = query
111
+ end
112
+
113
+ # Custom attribute writer method with validation
114
+ # @param threshold [Object] Object to be assigned
115
+ # @!visibility private
116
+ def threshold=(threshold)
117
+ if threshold.nil?
118
+ fail ArgumentError, 'invalid value for "threshold", threshold cannot be nil.'
119
+ end
120
+ @threshold = threshold
121
+ end
122
+
123
+ # Checks equality by comparing each attribute.
124
+ # @param o [Object] Object to be compared
125
+ # @!visibility private
126
+ def ==(o)
127
+ return true if self.equal?(o)
128
+ self.class == o.class &&
129
+ comparator == o.comparator &&
130
+ query == o.query &&
131
+ threshold == o.threshold
132
+ end
133
+
134
+ # Calculates hash code according to all attributes.
135
+ # @return [Integer] Hash code
136
+ # @!visibility private
137
+ def hash
138
+ [comparator, query, threshold].hash
139
+ end
140
+ end
141
+ end
@@ -0,0 +1,131 @@
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
+ # The queries and formula used to calculate the SLI value.
21
+ class SLOTimeSliceQuery
22
+ include BaseGenericModel
23
+
24
+ # A list that contains exactly one formula, as only a single formula may be used in a time-slice SLO.
25
+ attr_reader :formulas
26
+
27
+ # A list of queries that are used to calculate the SLI value.
28
+ attr_reader :queries
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ # @!visibility private
32
+ def self.attribute_map
33
+ {
34
+ :'formulas' => :'formulas',
35
+ :'queries' => :'queries'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ # @!visibility private
41
+ def self.openapi_types
42
+ {
43
+ :'formulas' => :'Array<SLOFormula>',
44
+ :'queries' => :'Array<SLODataSourceQueryDefinition>'
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::SLOTimeSliceQuery` 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::SLOTimeSliceQuery`. 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?(:'formulas')
65
+ if (value = attributes[:'formulas']).is_a?(Array)
66
+ self.formulas = value
67
+ end
68
+ end
69
+
70
+ if attributes.key?(:'queries')
71
+ if (value = attributes[:'queries']).is_a?(Array)
72
+ self.queries = value
73
+ end
74
+ end
75
+ end
76
+
77
+ # Check to see if the all the properties in the model are valid
78
+ # @return true if the model is valid
79
+ # @!visibility private
80
+ def valid?
81
+ return false if @formulas.nil?
82
+ return false if @formulas.length > 1
83
+ return false if @formulas.length < 1
84
+ return false if @queries.nil?
85
+ true
86
+ end
87
+
88
+ # Custom attribute writer method with validation
89
+ # @param formulas [Object] Object to be assigned
90
+ # @!visibility private
91
+ def formulas=(formulas)
92
+ if formulas.nil?
93
+ fail ArgumentError, 'invalid value for "formulas", formulas cannot be nil.'
94
+ end
95
+ if formulas.length > 1
96
+ fail ArgumentError, 'invalid value for "formulas", number of items must be less than or equal to 1.'
97
+ end
98
+ if formulas.length < 1
99
+ fail ArgumentError, 'invalid value for "formulas", number of items must be greater than or equal to 1.'
100
+ end
101
+ @formulas = formulas
102
+ end
103
+
104
+ # Custom attribute writer method with validation
105
+ # @param queries [Object] Object to be assigned
106
+ # @!visibility private
107
+ def queries=(queries)
108
+ if queries.nil?
109
+ fail ArgumentError, 'invalid value for "queries", queries cannot be nil.'
110
+ end
111
+ @queries = queries
112
+ end
113
+
114
+ # Checks equality by comparing each attribute.
115
+ # @param o [Object] Object to be compared
116
+ # @!visibility private
117
+ def ==(o)
118
+ return true if self.equal?(o)
119
+ self.class == o.class &&
120
+ formulas == o.formulas &&
121
+ queries == o.queries
122
+ end
123
+
124
+ # Calculates hash code according to all attributes.
125
+ # @return [Integer] Hash code
126
+ # @!visibility private
127
+ def hash
128
+ [formulas, queries].hash
129
+ end
130
+ end
131
+ end
@@ -0,0 +1,99 @@
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 time-slice SLI specification.
21
+ class SLOTimeSliceSpec
22
+ include BaseGenericModel
23
+
24
+ # The time-slice condition, composed of 3 parts: 1. the metric timeseries query, 2. the comparator,
25
+ # and 3. the threshold.
26
+ attr_reader :time_slice
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ # @!visibility private
30
+ def self.attribute_map
31
+ {
32
+ :'time_slice' => :'time_slice'
33
+ }
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ # @!visibility private
38
+ def self.openapi_types
39
+ {
40
+ :'time_slice' => :'SLOTimeSliceCondition'
41
+ }
42
+ end
43
+
44
+ # Initializes the object
45
+ # @param attributes [Hash] Model attributes in the form of hash
46
+ # @!visibility private
47
+ def initialize(attributes = {})
48
+ if (!attributes.is_a?(Hash))
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::SLOTimeSliceSpec` initialize method"
50
+ end
51
+
52
+ # check to see if the attribute exists and convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h|
54
+ if (!self.class.attribute_map.key?(k.to_sym))
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::SLOTimeSliceSpec`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ end
57
+ h[k.to_sym] = v
58
+ }
59
+
60
+ if attributes.key?(:'time_slice')
61
+ self.time_slice = attributes[:'time_slice']
62
+ end
63
+ end
64
+
65
+ # Check to see if the all the properties in the model are valid
66
+ # @return true if the model is valid
67
+ # @!visibility private
68
+ def valid?
69
+ return false if @time_slice.nil?
70
+ true
71
+ end
72
+
73
+ # Custom attribute writer method with validation
74
+ # @param time_slice [Object] Object to be assigned
75
+ # @!visibility private
76
+ def time_slice=(time_slice)
77
+ if time_slice.nil?
78
+ fail ArgumentError, 'invalid value for "time_slice", time_slice cannot be nil.'
79
+ end
80
+ @time_slice = time_slice
81
+ end
82
+
83
+ # Checks equality by comparing each attribute.
84
+ # @param o [Object] Object to be compared
85
+ # @!visibility private
86
+ def ==(o)
87
+ return true if self.equal?(o)
88
+ self.class == o.class &&
89
+ time_slice == o.time_slice
90
+ end
91
+
92
+ # Calculates hash code according to all attributes.
93
+ # @return [Integer] Hash code
94
+ # @!visibility private
95
+ def hash
96
+ [time_slice].hash
97
+ end
98
+ end
99
+ end
@@ -23,5 +23,6 @@ module DatadogAPIClient::V1
23
23
 
24
24
  METRIC = "metric".freeze
25
25
  MONITOR = "monitor".freeze
26
+ TIME_SLICE = "time_slice".freeze
26
27
  end
27
28
  end
@@ -25,5 +25,6 @@ module DatadogAPIClient::V1
25
25
 
26
26
  MONITOR = 0.freeze
27
27
  METRIC = 1.freeze
28
+ TIME_SLICE = 2.freeze
28
29
  end
29
30
  end