datadog_api_client 1.9.0 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. checksums.yaml +4 -4
  2. data/.apigentools-info +4 -4
  3. data/.generator/schemas/v1/openapi.yaml +489 -124
  4. data/.generator/schemas/v2/openapi.yaml +701 -28
  5. data/.generator/src/generator/formatter.py +6 -1
  6. data/.generator/src/generator/openapi.py +5 -5
  7. data/.generator/src/generator/templates/api_client.j2 +1 -4
  8. data/.generator/src/generator/templates/model_generic.j2 +42 -3
  9. data/.github/workflows/prepare_release.yml +15 -3
  10. data/CHANGELOG.md +32 -0
  11. data/Makefile +1 -1
  12. data/README.md +16 -0
  13. data/check-examples.sh +0 -2
  14. data/examples/v1/aws-integration/UpdateAWSAccount.rb +8 -4
  15. data/examples/v1/downtimes/CreateDowntime_2908359488.rb +1 -0
  16. data/examples/v1/downtimes/CreateDowntime_3059354445.rb +1 -0
  17. data/examples/v1/downtimes/UpdateDowntime.rb +1 -0
  18. data/examples/v1/monitors/CreateMonitor_1969035628.rb +52 -0
  19. data/examples/v1/monitors/CreateMonitor_2520912138.rb +22 -0
  20. data/examples/v1/security-monitoring/AddSecurityMonitoringSignalToIncident.rb +9 -0
  21. data/examples/v1/security-monitoring/EditSecurityMonitoringSignalAssignee.rb +9 -0
  22. data/examples/v1/security-monitoring/EditSecurityMonitoringSignalState.rb +10 -0
  23. data/examples/v1/service-level-objective-corrections/CreateSLOCorrection.rb +0 -3
  24. data/examples/v1/service-level-objective-corrections/CreateSLOCorrection_1326388368.rb +0 -3
  25. data/examples/v1/service-level-objective-corrections/DeleteSLOCorrection.rb +0 -3
  26. data/examples/v1/service-level-objective-corrections/GetSLOCorrection.rb +0 -3
  27. data/examples/v1/service-level-objective-corrections/ListSLOCorrection.rb +0 -3
  28. data/examples/v1/service-level-objective-corrections/UpdateSLOCorrection.rb +0 -3
  29. data/examples/v1/service-level-objectives/GetSLOCorrections.rb +0 -3
  30. data/examples/v1/synthetics/CreateSyntheticsAPITest.rb +5 -0
  31. data/examples/v1/synthetics/CreateSyntheticsAPITest_1402674167.rb +44 -0
  32. data/examples/v1/synthetics/CreateSyntheticsBrowserTest_2932742688.rb +64 -0
  33. data/examples/v1/synthetics/UpdateBrowserTest.rb +5 -0
  34. data/examples/v1/usage-metering/GetHourlyUsageAttribution.rb +1 -1
  35. data/examples/v1/usage-metering/GetMonthlyUsageAttribution.rb +1 -1
  36. data/examples/v1/usage-metering/{GetMonthlyUsageAttribution_3738504447.rb → GetMonthlyUsageAttribution_3849653599.rb} +1 -1
  37. data/examples/v1/usage-metering/GetUsageAttribution.rb +1 -1
  38. data/examples/v1/usage-metering/GetUsageRumSessions_3271366243.rb +9 -0
  39. data/examples/v2/logs/SubmitLog.rb +1 -0
  40. data/examples/v2/logs-archives/CreateLogsArchive.rb +1 -0
  41. data/examples/v2/logs-archives/UpdateLogsArchive.rb +1 -0
  42. data/examples/v2/metrics/EstimateMetricsOutputSeries.rb +9 -0
  43. data/examples/v2/metrics/SubmitMetrics.rb +20 -0
  44. data/examples/v2/security-monitoring/UpdateSecurityMonitoringRule.rb +1 -0
  45. data/examples/v2/usage-metering/GetCostByOrg.rb +5 -0
  46. data/examples/v2/usage-metering/GetUsageApplicationSecurityMonitoring.rb +8 -0
  47. data/examples/v2/usage-metering/GetUsageLambdaTracedInvocations.rb +8 -0
  48. data/lib/datadog_api_client/v1/api/metrics_api.rb +1 -1
  49. data/lib/datadog_api_client/v1/api/monitors_api.rb +69 -56
  50. data/lib/datadog_api_client/v1/api/security_monitoring_api.rb +266 -0
  51. data/lib/datadog_api_client/v1/api/service_level_objective_corrections_api.rb +1 -1
  52. data/lib/datadog_api_client/v1/api/usage_metering_api.rb +10 -10
  53. data/lib/datadog_api_client/v1/api_client.rb +1 -4
  54. data/lib/datadog_api_client/v1/configuration.rb +0 -6
  55. data/lib/datadog_api_client/v1/models/add_signal_to_incident_request.rb +142 -0
  56. data/lib/datadog_api_client/v1/models/downtime.rb +11 -1
  57. data/lib/datadog_api_client/v1/models/downtime_child.rb +11 -1
  58. data/lib/datadog_api_client/v1/models/event.rb +1 -1
  59. data/lib/datadog_api_client/v1/models/http_log_item.rb +29 -4
  60. data/lib/datadog_api_client/v1/models/logs_category_processor.rb +1 -1
  61. data/lib/datadog_api_client/v1/models/logs_list_request.rb +1 -1
  62. data/lib/datadog_api_client/v1/models/logs_sort.rb +1 -1
  63. data/lib/datadog_api_client/v1/models/monitor_formula_and_function_events_data_source.rb +1 -0
  64. data/lib/datadog_api_client/v1/models/monitor_group_search_response_counts.rb +2 -2
  65. data/lib/datadog_api_client/v1/models/{monitor_search_response_counts_tag_item.rb → monitor_search_count_item.rb} +3 -3
  66. data/lib/datadog_api_client/v1/models/monitor_search_response_counts.rb +4 -4
  67. data/lib/datadog_api_client/v1/models/monitor_type.rb +1 -0
  68. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_response.rb +1 -1
  69. data/lib/datadog_api_client/v1/models/notebook_cell_create_request.rb +146 -0
  70. data/lib/datadog_api_client/v1/models/notebook_cell_create_request_attributes.rb +68 -0
  71. data/lib/datadog_api_client/v1/models/series.rb +2 -2
  72. data/lib/datadog_api_client/v1/models/signal_archive_reason.rb +29 -0
  73. data/lib/datadog_api_client/v1/models/signal_assignee_update_request.rb +132 -0
  74. data/lib/datadog_api_client/v1/models/signal_state_update_request.rb +152 -0
  75. data/lib/datadog_api_client/v1/models/signal_triage_state.rb +28 -0
  76. data/lib/datadog_api_client/v1/models/slo_correction_create_request_attributes.rb +1 -1
  77. data/lib/datadog_api_client/v1/models/slo_correction_response_attributes.rb +4 -4
  78. data/lib/datadog_api_client/v1/models/slo_correction_update_request_attributes.rb +1 -1
  79. data/lib/datadog_api_client/v1/models/{monitor_search_response_counts_status_item.rb → successful_signal_update_response.rb} +12 -22
  80. data/lib/datadog_api_client/v1/models/synthetics_api_test.rb +1 -1
  81. data/lib/datadog_api_client/v1/models/synthetics_assertion_type.rb +2 -0
  82. data/lib/datadog_api_client/v1/models/synthetics_browser_test_rum_settings.rb +152 -0
  83. data/lib/datadog_api_client/v1/models/synthetics_test_details.rb +1 -1
  84. data/lib/datadog_api_client/v1/models/synthetics_test_details_sub_type.rb +2 -1
  85. data/lib/datadog_api_client/v1/models/synthetics_test_options.rb +21 -1
  86. data/lib/datadog_api_client/v1/models/synthetics_test_request.rb +21 -1
  87. data/lib/datadog_api_client/v1/models/usage_attribution_response.rb +1 -1
  88. data/lib/datadog_api_client/v1/models/usage_rum_sessions_hour.rb +18 -4
  89. data/lib/datadog_api_client/v1/models/usage_summary_date.rb +11 -1
  90. data/lib/datadog_api_client/v1/models/usage_summary_date_org.rb +11 -1
  91. data/lib/datadog_api_client/v1/models/usage_summary_response.rb +11 -1
  92. data/lib/datadog_api_client/v1.rb +11 -6
  93. data/lib/datadog_api_client/v2/api/authn_mappings_api.rb +0 -2
  94. data/lib/datadog_api_client/v2/api/metrics_api.rb +173 -0
  95. data/lib/datadog_api_client/v2/api/usage_metering_api.rb +228 -0
  96. data/lib/datadog_api_client/v2/api_client.rb +1 -4
  97. data/lib/datadog_api_client/v2/models/authn_mapping.rb +1 -13
  98. data/lib/datadog_api_client/v2/models/authn_mapping_attributes.rb +1 -12
  99. data/lib/datadog_api_client/v2/models/authn_mapping_response.rb +16 -4
  100. data/lib/datadog_api_client/v2/models/authn_mappings_response.rb +13 -1
  101. data/lib/datadog_api_client/v2/models/chargeback_breakdown.rb +131 -0
  102. data/lib/datadog_api_client/v2/models/cost_by_org.rb +133 -0
  103. data/lib/datadog_api_client/v2/models/cost_by_org_attributes.rb +153 -0
  104. data/lib/datadog_api_client/v2/models/cost_by_org_response.rb +113 -0
  105. data/lib/datadog_api_client/v2/models/cost_by_org_type.rb +26 -0
  106. data/lib/datadog_api_client/v2/models/hourly_usage_type.rb +2 -0
  107. data/lib/datadog_api_client/v2/models/http_log_item.rb +40 -4
  108. data/lib/datadog_api_client/v2/models/intake_payload_accepted.rb +111 -0
  109. data/lib/datadog_api_client/v2/models/logs_archive_attributes.rb +12 -1
  110. data/lib/datadog_api_client/v2/models/logs_archive_create_request_attributes.rb +12 -1
  111. data/lib/datadog_api_client/v2/models/metric_content_encoding.rb +26 -0
  112. data/lib/datadog_api_client/v2/models/metric_estimate.rb +133 -0
  113. data/lib/datadog_api_client/v2/models/metric_estimate_attributes.rb +133 -0
  114. data/lib/datadog_api_client/v2/models/metric_estimate_resource_type.rb +26 -0
  115. data/lib/datadog_api_client/v2/models/metric_estimate_response.rb +111 -0
  116. data/lib/datadog_api_client/v2/models/metric_estimate_type.rb +28 -0
  117. data/lib/datadog_api_client/v2/models/metric_intake_type.rb +30 -0
  118. data/lib/datadog_api_client/v2/models/metric_metadata.rb +111 -0
  119. data/lib/datadog_api_client/v2/models/metric_origin.rb +170 -0
  120. data/lib/datadog_api_client/{v1/models/monitor_group_search_response_counts_type_item.rb → v2/models/metric_payload.rb} +27 -24
  121. data/lib/datadog_api_client/v2/models/metric_point.rb +122 -0
  122. data/lib/datadog_api_client/{v1/models/monitor_search_response_counts_type_item.rb → v2/models/metric_resource.rb} +21 -21
  123. data/lib/datadog_api_client/v2/models/metric_series.rb +220 -0
  124. data/lib/datadog_api_client/v2/models/relationship_to_saml_assertion_attribute_data.rb +1 -5
  125. data/lib/datadog_api_client/v2/models/saml_assertion_attribute.rb +1 -5
  126. data/lib/datadog_api_client/v2/models/security_monitoring_rule_detection_method.rb +1 -0
  127. data/lib/datadog_api_client/v2/models/security_monitoring_rule_hardcoded_evaluator_type.rb +26 -0
  128. data/lib/datadog_api_client/v2/models/security_monitoring_rule_options.rb +11 -1
  129. data/lib/datadog_api_client/{v1/models/monitor_group_search_response_counts_status_item.rb → v2/models/usage_application_security_monitoring_response.rb} +16 -24
  130. data/lib/datadog_api_client/{v1/models/monitor_search_response_counts_muted_item.rb → v2/models/usage_lambda_traced_invocations_response.rb} +16 -24
  131. data/lib/datadog_api_client/v2.rb +22 -0
  132. data/lib/datadog_api_client/version.rb +1 -1
  133. data/spec/v1/api_client_spec.rb +3 -3
  134. data/spec/v2/api_client_spec.rb +3 -3
  135. metadata +49 -11
  136. data/extract-code-blocks.awk +0 -81
  137. data/extract-code-blocks.sh +0 -3
@@ -0,0 +1,111 @@
1
+ =begin
2
+ #Datadog API V2 Collection
3
+
4
+ #Collection of all Datadog Public endpoints.
5
+
6
+ The version of the OpenAPI document: 1.0
7
+ Contact: support@datadoghq.com
8
+ Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9
+
10
+ Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11
+ This product includes software developed at Datadog (https://www.datadoghq.com/).
12
+ Copyright 2020-Present Datadog, Inc.
13
+
14
+ =end
15
+
16
+ require 'date'
17
+ require 'time'
18
+
19
+ module DatadogAPIClient::V2
20
+ # Response object that includes metric cardinality estimates.
21
+ class MetricEstimateResponse
22
+ include BaseGenericModel
23
+
24
+ # Whether the object has unparsed attributes
25
+ # @!visibility private
26
+ attr_accessor :_unparsed
27
+
28
+ # Object for a metric cardinality estimate.
29
+ attr_accessor :data
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ # @!visibility private
33
+ def self.attribute_map
34
+ {
35
+ :'data' => :'data'
36
+ }
37
+ end
38
+
39
+ # Returns all the JSON keys this model knows about
40
+ # @!visibility private
41
+ def self.acceptable_attributes
42
+ attribute_map.values
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ # @!visibility private
47
+ def self.openapi_types
48
+ {
49
+ :'data' => :'MetricEstimate'
50
+ }
51
+ end
52
+
53
+ # List of attributes with nullable: true
54
+ # @!visibility private
55
+ def self.openapi_nullable
56
+ Set.new([
57
+ ])
58
+ end
59
+
60
+ # Initializes the object
61
+ # @param attributes [Hash] Model attributes in the form of hash
62
+ # @!visibility private
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MetricEstimateResponse` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!self.class.attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::MetricEstimateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
75
+
76
+ if attributes.key?(:'data')
77
+ self.data = attributes[:'data']
78
+ end
79
+ end
80
+
81
+ # Check to see if the all the properties in the model are valid
82
+ # @return true if the model is valid
83
+ # @!visibility private
84
+ def valid?
85
+ true
86
+ end
87
+
88
+ # Checks equality by comparing each attribute.
89
+ # @param o [Object] Object to be compared
90
+ # @!visibility private
91
+ def ==(o)
92
+ return true if self.equal?(o)
93
+ self.class == o.class &&
94
+ data == o.data
95
+ end
96
+
97
+ # @see the `==` method
98
+ # @param o [Object] Object to be compared
99
+ # @!visibility private
100
+ def eql?(o)
101
+ self == o
102
+ end
103
+
104
+ # Calculates hash code according to all attributes.
105
+ # @return [Integer] Hash code
106
+ # @!visibility private
107
+ def hash
108
+ [data].hash
109
+ end
110
+ end
111
+ end
@@ -0,0 +1,28 @@
1
+ =begin
2
+ #Datadog API V2 Collection
3
+
4
+ #Collection of all Datadog Public endpoints.
5
+
6
+ The version of the OpenAPI document: 1.0
7
+ Contact: support@datadoghq.com
8
+ Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9
+
10
+ Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11
+ This product includes software developed at Datadog (https://www.datadoghq.com/).
12
+ Copyright 2020-Present Datadog, Inc.
13
+
14
+ =end
15
+
16
+ require 'date'
17
+ require 'time'
18
+
19
+ module DatadogAPIClient::V2
20
+ # Estimate type based on the queried configuration. By default, `count_or_gauge` is returned. `distribution` is returned for distribution metrics without percentiles enabled. Lastly, `percentile` is returned if `filter[pct]=true` is queried with a distribution metric.
21
+ class MetricEstimateType
22
+ include BaseEnumModel
23
+
24
+ COUNT_OR_GAUGE = "count_or_gauge".freeze
25
+ DISTRIBUTION = "distribution".freeze
26
+ PERCENTILE = "percentile".freeze
27
+ end
28
+ end
@@ -0,0 +1,30 @@
1
+ =begin
2
+ #Datadog API V2 Collection
3
+
4
+ #Collection of all Datadog Public endpoints.
5
+
6
+ The version of the OpenAPI document: 1.0
7
+ Contact: support@datadoghq.com
8
+ Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9
+
10
+ Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11
+ This product includes software developed at Datadog (https://www.datadoghq.com/).
12
+ Copyright 2020-Present Datadog, Inc.
13
+
14
+ =end
15
+
16
+ require 'date'
17
+ require 'time'
18
+
19
+ module DatadogAPIClient::V2
20
+ # The type of metric.
21
+ class MetricIntakeType
22
+ include BaseEnumModel
23
+
24
+ UNSPECIFIED = 0.freeze
25
+ COUNT = 1.freeze
26
+ RATE = 2.freeze
27
+ GAUGE = 3.freeze
28
+ UNSPECIFIED_LEGACY = 15.freeze
29
+ end
30
+ end
@@ -0,0 +1,111 @@
1
+ =begin
2
+ #Datadog API V2 Collection
3
+
4
+ #Collection of all Datadog Public endpoints.
5
+
6
+ The version of the OpenAPI document: 1.0
7
+ Contact: support@datadoghq.com
8
+ Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9
+
10
+ Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11
+ This product includes software developed at Datadog (https://www.datadoghq.com/).
12
+ Copyright 2020-Present Datadog, Inc.
13
+
14
+ =end
15
+
16
+ require 'date'
17
+ require 'time'
18
+
19
+ module DatadogAPIClient::V2
20
+ # Metadata for the metric.
21
+ class MetricMetadata
22
+ include BaseGenericModel
23
+
24
+ # Whether the object has unparsed attributes
25
+ # @!visibility private
26
+ attr_accessor :_unparsed
27
+
28
+ # Metric origin information.
29
+ attr_accessor :origin
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ # @!visibility private
33
+ def self.attribute_map
34
+ {
35
+ :'origin' => :'origin'
36
+ }
37
+ end
38
+
39
+ # Returns all the JSON keys this model knows about
40
+ # @!visibility private
41
+ def self.acceptable_attributes
42
+ attribute_map.values
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ # @!visibility private
47
+ def self.openapi_types
48
+ {
49
+ :'origin' => :'MetricOrigin'
50
+ }
51
+ end
52
+
53
+ # List of attributes with nullable: true
54
+ # @!visibility private
55
+ def self.openapi_nullable
56
+ Set.new([
57
+ ])
58
+ end
59
+
60
+ # Initializes the object
61
+ # @param attributes [Hash] Model attributes in the form of hash
62
+ # @!visibility private
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MetricMetadata` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!self.class.attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::MetricMetadata`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
75
+
76
+ if attributes.key?(:'origin')
77
+ self.origin = attributes[:'origin']
78
+ end
79
+ end
80
+
81
+ # Check to see if the all the properties in the model are valid
82
+ # @return true if the model is valid
83
+ # @!visibility private
84
+ def valid?
85
+ true
86
+ end
87
+
88
+ # Checks equality by comparing each attribute.
89
+ # @param o [Object] Object to be compared
90
+ # @!visibility private
91
+ def ==(o)
92
+ return true if self.equal?(o)
93
+ self.class == o.class &&
94
+ origin == o.origin
95
+ end
96
+
97
+ # @see the `==` method
98
+ # @param o [Object] Object to be compared
99
+ # @!visibility private
100
+ def eql?(o)
101
+ self == o
102
+ end
103
+
104
+ # Calculates hash code according to all attributes.
105
+ # @return [Integer] Hash code
106
+ # @!visibility private
107
+ def hash
108
+ [origin].hash
109
+ end
110
+ end
111
+ end
@@ -0,0 +1,170 @@
1
+ =begin
2
+ #Datadog API V2 Collection
3
+
4
+ #Collection of all Datadog Public endpoints.
5
+
6
+ The version of the OpenAPI document: 1.0
7
+ Contact: support@datadoghq.com
8
+ Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9
+
10
+ Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11
+ This product includes software developed at Datadog (https://www.datadoghq.com/).
12
+ Copyright 2020-Present Datadog, Inc.
13
+
14
+ =end
15
+
16
+ require 'date'
17
+ require 'time'
18
+
19
+ module DatadogAPIClient::V2
20
+ # Metric origin information.
21
+ class MetricOrigin
22
+ include BaseGenericModel
23
+
24
+ # Whether the object has unparsed attributes
25
+ # @!visibility private
26
+ attr_accessor :_unparsed
27
+
28
+ # The origin metric type code
29
+ attr_accessor :metric_type
30
+
31
+ # The origin product code
32
+ attr_accessor :product
33
+
34
+ # The origin service code
35
+ attr_accessor :service
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ # @!visibility private
39
+ def self.attribute_map
40
+ {
41
+ :'metric_type' => :'metric_type',
42
+ :'product' => :'product',
43
+ :'service' => :'service'
44
+ }
45
+ end
46
+
47
+ # Returns all the JSON keys this model knows about
48
+ # @!visibility private
49
+ def self.acceptable_attributes
50
+ attribute_map.values
51
+ end
52
+
53
+ # Attribute type mapping.
54
+ # @!visibility private
55
+ def self.openapi_types
56
+ {
57
+ :'metric_type' => :'Integer',
58
+ :'product' => :'Integer',
59
+ :'service' => :'Integer'
60
+ }
61
+ end
62
+
63
+ # List of attributes with nullable: true
64
+ # @!visibility private
65
+ def self.openapi_nullable
66
+ Set.new([
67
+ ])
68
+ end
69
+
70
+ # Initializes the object
71
+ # @param attributes [Hash] Model attributes in the form of hash
72
+ # @!visibility private
73
+ def initialize(attributes = {})
74
+ if (!attributes.is_a?(Hash))
75
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MetricOrigin` initialize method"
76
+ end
77
+
78
+ # check to see if the attribute exists and convert string to symbol for hash key
79
+ attributes = attributes.each_with_object({}) { |(k, v), h|
80
+ if (!self.class.attribute_map.key?(k.to_sym))
81
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::MetricOrigin`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
82
+ end
83
+ h[k.to_sym] = v
84
+ }
85
+
86
+ if attributes.key?(:'metric_type')
87
+ self.metric_type = attributes[:'metric_type']
88
+ else
89
+ self.metric_type = 0
90
+ end
91
+
92
+ if attributes.key?(:'product')
93
+ self.product = attributes[:'product']
94
+ else
95
+ self.product = 0
96
+ end
97
+
98
+ if attributes.key?(:'service')
99
+ self.service = attributes[:'service']
100
+ else
101
+ self.service = 0
102
+ end
103
+ end
104
+
105
+ # Check to see if the all the properties in the model are valid
106
+ # @return true if the model is valid
107
+ # @!visibility private
108
+ def valid?
109
+ return false if !@metric_type.nil? && @metric_type > 1000
110
+ return false if !@product.nil? && @product > 1000
111
+ return false if !@service.nil? && @service > 1000
112
+ true
113
+ end
114
+
115
+ # Custom attribute writer method with validation
116
+ # @param metric_type [Object] Object to be assigned
117
+ # @!visibility private
118
+ def metric_type=(metric_type)
119
+ if !metric_type.nil? && metric_type > 1000
120
+ fail ArgumentError, 'invalid value for "metric_type", must be smaller than or equal to 1000.'
121
+ end
122
+ @metric_type = metric_type
123
+ end
124
+
125
+ # Custom attribute writer method with validation
126
+ # @param product [Object] Object to be assigned
127
+ # @!visibility private
128
+ def product=(product)
129
+ if !product.nil? && product > 1000
130
+ fail ArgumentError, 'invalid value for "product", must be smaller than or equal to 1000.'
131
+ end
132
+ @product = product
133
+ end
134
+
135
+ # Custom attribute writer method with validation
136
+ # @param service [Object] Object to be assigned
137
+ # @!visibility private
138
+ def service=(service)
139
+ if !service.nil? && service > 1000
140
+ fail ArgumentError, 'invalid value for "service", must be smaller than or equal to 1000.'
141
+ end
142
+ @service = service
143
+ end
144
+
145
+ # Checks equality by comparing each attribute.
146
+ # @param o [Object] Object to be compared
147
+ # @!visibility private
148
+ def ==(o)
149
+ return true if self.equal?(o)
150
+ self.class == o.class &&
151
+ metric_type == o.metric_type &&
152
+ product == o.product &&
153
+ service == o.service
154
+ end
155
+
156
+ # @see the `==` method
157
+ # @param o [Object] Object to be compared
158
+ # @!visibility private
159
+ def eql?(o)
160
+ self == o
161
+ end
162
+
163
+ # Calculates hash code according to all attributes.
164
+ # @return [Integer] Hash code
165
+ # @!visibility private
166
+ def hash
167
+ [metric_type, product, service].hash
168
+ end
169
+ end
170
+ end
@@ -1,5 +1,5 @@
1
1
  =begin
2
- #Datadog API V1 Collection
2
+ #Datadog API V2 Collection
3
3
 
4
4
  #Collection of all Datadog Public endpoints.
5
5
 
@@ -16,27 +16,23 @@ Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.ge
16
16
  require 'date'
17
17
  require 'time'
18
18
 
19
- module DatadogAPIClient::V1
20
- # A facet item.
21
- class MonitorGroupSearchResponseCountsTypeItem
19
+ module DatadogAPIClient::V2
20
+ # The metrics' payload.
21
+ class MetricPayload
22
22
  include BaseGenericModel
23
23
 
24
24
  # Whether the object has unparsed attributes
25
25
  # @!visibility private
26
26
  attr_accessor :_unparsed
27
27
 
28
- # The number of found monitors with the listed value.
29
- attr_accessor :count
30
-
31
- # The facet value.
32
- attr_accessor :name
28
+ # A list of time series to submit to Datadog.
29
+ attr_accessor :series
33
30
 
34
31
  # Attribute mapping from ruby-style variable name to JSON key.
35
32
  # @!visibility private
36
33
  def self.attribute_map
37
34
  {
38
- :'count' => :'count',
39
- :'name' => :'name'
35
+ :'series' => :'series'
40
36
  }
41
37
  end
42
38
 
@@ -50,8 +46,7 @@ module DatadogAPIClient::V1
50
46
  # @!visibility private
51
47
  def self.openapi_types
52
48
  {
53
- :'count' => :'Integer',
54
- :'name' => :'Object'
49
+ :'series' => :'Array<MetricSeries>'
55
50
  }
56
51
  end
57
52
 
@@ -67,23 +62,21 @@ module DatadogAPIClient::V1
67
62
  # @!visibility private
68
63
  def initialize(attributes = {})
69
64
  if (!attributes.is_a?(Hash))
70
- fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::MonitorGroupSearchResponseCountsTypeItem` initialize method"
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MetricPayload` initialize method"
71
66
  end
72
67
 
73
68
  # check to see if the attribute exists and convert string to symbol for hash key
74
69
  attributes = attributes.each_with_object({}) { |(k, v), h|
75
70
  if (!self.class.attribute_map.key?(k.to_sym))
76
- fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::MonitorGroupSearchResponseCountsTypeItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::MetricPayload`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
77
72
  end
78
73
  h[k.to_sym] = v
79
74
  }
80
75
 
81
- if attributes.key?(:'count')
82
- self.count = attributes[:'count']
83
- end
84
-
85
- if attributes.key?(:'name')
86
- self.name = attributes[:'name']
76
+ if attributes.key?(:'series')
77
+ if (value = attributes[:'series']).is_a?(Array)
78
+ self.series = value
79
+ end
87
80
  end
88
81
  end
89
82
 
@@ -91,17 +84,27 @@ module DatadogAPIClient::V1
91
84
  # @return true if the model is valid
92
85
  # @!visibility private
93
86
  def valid?
87
+ return false if @series.nil?
94
88
  true
95
89
  end
96
90
 
91
+ # Custom attribute writer method with validation
92
+ # @param series [Object] Object to be assigned
93
+ # @!visibility private
94
+ def series=(series)
95
+ if series.nil?
96
+ fail ArgumentError, 'invalid value for "series", series cannot be nil.'
97
+ end
98
+ @series = series
99
+ end
100
+
97
101
  # Checks equality by comparing each attribute.
98
102
  # @param o [Object] Object to be compared
99
103
  # @!visibility private
100
104
  def ==(o)
101
105
  return true if self.equal?(o)
102
106
  self.class == o.class &&
103
- count == o.count &&
104
- name == o.name
107
+ series == o.series
105
108
  end
106
109
 
107
110
  # @see the `==` method
@@ -115,7 +118,7 @@ module DatadogAPIClient::V1
115
118
  # @return [Integer] Hash code
116
119
  # @!visibility private
117
120
  def hash
118
- [count, name].hash
121
+ [series].hash
119
122
  end
120
123
  end
121
124
  end
@@ -0,0 +1,122 @@
1
+ =begin
2
+ #Datadog API V2 Collection
3
+
4
+ #Collection of all Datadog Public endpoints.
5
+
6
+ The version of the OpenAPI document: 1.0
7
+ Contact: support@datadoghq.com
8
+ Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9
+
10
+ Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11
+ This product includes software developed at Datadog (https://www.datadoghq.com/).
12
+ Copyright 2020-Present Datadog, Inc.
13
+
14
+ =end
15
+
16
+ require 'date'
17
+ require 'time'
18
+
19
+ module DatadogAPIClient::V2
20
+ # A point object is of the form `{POSIX_timestamp, numeric_value}`.
21
+ class MetricPoint
22
+ include BaseGenericModel
23
+
24
+ # Whether the object has unparsed attributes
25
+ # @!visibility private
26
+ attr_accessor :_unparsed
27
+
28
+ # The timestamp should be in seconds and current.
29
+ # Current is defined as not more than 10 minutes in the future or more than 1 hour in the past.
30
+ attr_accessor :timestamp
31
+
32
+ # The numeric value format should be a 64bit float gauge-type value.
33
+ attr_accessor :value
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ # @!visibility private
37
+ def self.attribute_map
38
+ {
39
+ :'timestamp' => :'timestamp',
40
+ :'value' => :'value'
41
+ }
42
+ end
43
+
44
+ # Returns all the JSON keys this model knows about
45
+ # @!visibility private
46
+ def self.acceptable_attributes
47
+ attribute_map.values
48
+ end
49
+
50
+ # Attribute type mapping.
51
+ # @!visibility private
52
+ def self.openapi_types
53
+ {
54
+ :'timestamp' => :'Integer',
55
+ :'value' => :'Float'
56
+ }
57
+ end
58
+
59
+ # List of attributes with nullable: true
60
+ # @!visibility private
61
+ def self.openapi_nullable
62
+ Set.new([
63
+ ])
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param attributes [Hash] Model attributes in the form of hash
68
+ # @!visibility private
69
+ def initialize(attributes = {})
70
+ if (!attributes.is_a?(Hash))
71
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MetricPoint` initialize method"
72
+ end
73
+
74
+ # check to see if the attribute exists and convert string to symbol for hash key
75
+ attributes = attributes.each_with_object({}) { |(k, v), h|
76
+ if (!self.class.attribute_map.key?(k.to_sym))
77
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::MetricPoint`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
78
+ end
79
+ h[k.to_sym] = v
80
+ }
81
+
82
+ if attributes.key?(:'timestamp')
83
+ self.timestamp = attributes[:'timestamp']
84
+ end
85
+
86
+ if attributes.key?(:'value')
87
+ self.value = attributes[:'value']
88
+ end
89
+ end
90
+
91
+ # Check to see if the all the properties in the model are valid
92
+ # @return true if the model is valid
93
+ # @!visibility private
94
+ def valid?
95
+ true
96
+ end
97
+
98
+ # Checks equality by comparing each attribute.
99
+ # @param o [Object] Object to be compared
100
+ # @!visibility private
101
+ def ==(o)
102
+ return true if self.equal?(o)
103
+ self.class == o.class &&
104
+ timestamp == o.timestamp &&
105
+ value == o.value
106
+ end
107
+
108
+ # @see the `==` method
109
+ # @param o [Object] Object to be compared
110
+ # @!visibility private
111
+ def eql?(o)
112
+ self == o
113
+ end
114
+
115
+ # Calculates hash code according to all attributes.
116
+ # @return [Integer] Hash code
117
+ # @!visibility private
118
+ def hash
119
+ [timestamp, value].hash
120
+ end
121
+ end
122
+ end