datadog_api_client 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (209) hide show
  1. checksums.yaml +4 -4
  2. data/.apigentools-info +6 -6
  3. data/.generator/templates/api.mustache +2 -2
  4. data/.generator/templates/api_client.mustache +7 -0
  5. data/.generator/templates/api_client_typhoeus_partial.mustache +7 -0
  6. data/.generator/templates/configuration.mustache +4 -0
  7. data/.openapi-generator/VERSION +1 -1
  8. data/CHANGELOG.md +27 -0
  9. data/README.md +12 -1
  10. data/data/v1/openapi.yaml +866 -119
  11. data/data/v2/openapi.yaml +113 -0
  12. data/docs/v1/AWSAccount.md +6 -0
  13. data/docs/v1/DowntimeRecurrence.md +1 -1
  14. data/docs/v1/Event.md +1 -1
  15. data/docs/v1/FormulaAndFunctionApmDependencyStatName.md +15 -0
  16. data/docs/v1/FormulaAndFunctionApmDependencyStatsDataSource.md +15 -0
  17. data/docs/v1/FormulaAndFunctionApmDependencyStatsQueryDefinition.md +36 -0
  18. data/docs/v1/FormulaAndFunctionApmResourceStatName.md +15 -0
  19. data/docs/v1/FormulaAndFunctionApmResourceStatsDataSource.md +15 -0
  20. data/docs/v1/FormulaAndFunctionApmResourceStatsQueryDefinition.md +36 -0
  21. data/docs/v1/FormulaAndFunctionQueryDefinition.md +5 -1
  22. data/docs/v1/FunnelQuery.md +22 -0
  23. data/docs/v1/FunnelRequestType.md +15 -0
  24. data/docs/v1/FunnelSource.md +15 -0
  25. data/docs/v1/FunnelWidgetDefinition.md +28 -0
  26. data/docs/v1/FunnelWidgetDefinitionType.md +15 -0
  27. data/docs/v1/FunnelWidgetRequest.md +20 -0
  28. data/docs/v1/LogsAPI.md +1 -1
  29. data/docs/v1/MetricContentEncoding.md +15 -0
  30. data/docs/v1/MetricsAPI.md +10 -6
  31. data/docs/v1/MetricsPayload.md +1 -1
  32. data/docs/v1/MonitorOptions.md +5 -1
  33. data/docs/v1/MonitorRenotifyStatusType.md +15 -0
  34. data/docs/v1/MonitorsAPI.md +9 -9
  35. data/docs/v1/NotebookCreateDataAttributes.md +2 -0
  36. data/docs/v1/NotebookMetadata.md +22 -0
  37. data/docs/v1/NotebookMetadataType.md +15 -0
  38. data/docs/v1/NotebookResponseDataAttributes.md +2 -0
  39. data/docs/v1/NotebookUpdateDataAttributes.md +2 -0
  40. data/docs/v1/NotebooksAPI.md +7 -3
  41. data/docs/v1/NotebooksResponseDataAttributes.md +2 -0
  42. data/docs/v1/ProcessQueryDefinition.md +1 -1
  43. data/docs/v1/README.md +31 -3
  44. data/docs/v1/SLOCorrection.md +1 -1
  45. data/docs/v1/SLOCorrectionCreateData.md +1 -1
  46. data/docs/v1/SLOCorrectionCreateRequestAttributes.md +4 -4
  47. data/docs/v1/SLOCorrectionListResponse.md +1 -1
  48. data/docs/v1/SLOCorrectionResponseAttributes.md +4 -4
  49. data/docs/v1/SLOCorrectionUpdateRequestAttributes.md +3 -3
  50. data/docs/v1/ScatterPlotWidgetDefinitionRequests.md +4 -2
  51. data/docs/v1/ScatterplotDimension.md +15 -0
  52. data/docs/v1/ScatterplotTableRequest.md +22 -0
  53. data/docs/v1/ScatterplotWidgetFormula.md +22 -0
  54. data/docs/v1/Series.md +1 -1
  55. data/docs/v1/ServiceChecksAPI.md +1 -1
  56. data/docs/v1/ServiceLevelObjectiveCorrectionsAPI.md +11 -11
  57. data/docs/v1/SyntheticsAPI.md +61 -0
  58. data/docs/v1/SyntheticsAPIStep.md +1 -1
  59. data/docs/v1/SyntheticsBatchDetails.md +18 -0
  60. data/docs/v1/SyntheticsBatchDetailsData.md +22 -0
  61. data/docs/v1/SyntheticsBatchResult.md +36 -0
  62. data/docs/v1/SyntheticsBrowserError.md +3 -3
  63. data/docs/v1/SyntheticsCIBatchMetadata.md +20 -0
  64. data/docs/v1/{SyntheticsCITestMetadataCi.md → SyntheticsCIBatchMetadataCI.md} +2 -2
  65. data/docs/v1/SyntheticsCIBatchMetadataGit.md +20 -0
  66. data/docs/v1/SyntheticsCITest.md +1 -1
  67. data/docs/v1/SyntheticsStatus.md +15 -0
  68. data/docs/v1/SyntheticsTestDetails.md +2 -0
  69. data/docs/v1/SyntheticsTestExecutionRule.md +15 -0
  70. data/docs/v1/SyntheticsTestRequest.md +2 -0
  71. data/docs/v1/UsageAttributionValues.md +4 -4
  72. data/docs/v1/UsageMeteringAPI.md +65 -0
  73. data/docs/v1/UsageSDSHour.md +22 -0
  74. data/docs/v1/UsageSDSResponse.md +18 -0
  75. data/docs/v1/UsageSummaryDate.md +4 -0
  76. data/docs/v1/UsageSummaryDateOrg.md +6 -2
  77. data/docs/v1/UsageSummaryResponse.md +6 -2
  78. data/docs/v1/UsageTimeseriesHour.md +1 -1
  79. data/docs/v1/WebhooksIntegration.md +1 -1
  80. data/docs/v1/WebhooksIntegrationUpdateRequest.md +1 -1
  81. data/docs/v1/WidgetDefinition.md +2 -0
  82. data/docs/v2/IncidentServicesAPI.md +5 -5
  83. data/docs/v2/IncidentTeamsAPI.md +5 -5
  84. data/docs/v2/IncidentsAPI.md +5 -5
  85. data/docs/v2/README.md +5 -0
  86. data/docs/v2/SecurityMonitoringAPI.md +5 -5
  87. data/examples/v1/metrics/SubmitMetrics.rbbeta +14 -0
  88. data/extract-code-blocks.awk +4 -0
  89. data/lib/datadog_api_client/v1/api/logs_api.rb +1 -1
  90. data/lib/datadog_api_client/v1/api/metrics_api.rb +5 -2
  91. data/lib/datadog_api_client/v1/api/monitors_api.rb +9 -9
  92. data/lib/datadog_api_client/v1/api/notebooks_api.rb +8 -2
  93. data/lib/datadog_api_client/v1/api/service_checks_api.rb +1 -1
  94. data/lib/datadog_api_client/v1/api/service_level_objective_corrections_api.rb +16 -16
  95. data/lib/datadog_api_client/v1/api/synthetics_api.rb +73 -0
  96. data/lib/datadog_api_client/v1/api/usage_metering_api.rb +77 -0
  97. data/lib/datadog_api_client/v1/api_client.rb +14 -0
  98. data/lib/datadog_api_client/v1/configuration.rb +7 -0
  99. data/lib/datadog_api_client/v1/models/aws_account.rb +37 -1
  100. data/lib/datadog_api_client/v1/models/content_encoding.rb +2 -2
  101. data/lib/datadog_api_client/v1/models/creator.rb +1 -0
  102. data/lib/datadog_api_client/v1/models/dashboard_summary_definition.rb +1 -0
  103. data/lib/datadog_api_client/v1/models/downtime_recurrence.rb +1 -1
  104. data/lib/datadog_api_client/v1/models/event.rb +1 -16
  105. data/lib/datadog_api_client/v1/models/formula_and_function_apm_dependency_stat_name.rb +44 -0
  106. data/lib/datadog_api_client/v1/models/formula_and_function_apm_dependency_stats_data_source.rb +38 -0
  107. data/lib/datadog_api_client/v1/models/formula_and_function_apm_dependency_stats_query_definition.rb +356 -0
  108. data/lib/datadog_api_client/v1/models/formula_and_function_apm_resource_stat_name.rb +47 -0
  109. data/lib/datadog_api_client/v1/models/formula_and_function_apm_resource_stats_data_source.rb +38 -0
  110. data/lib/datadog_api_client/v1/models/formula_and_function_apm_resource_stats_query_definition.rb +348 -0
  111. data/lib/datadog_api_client/v1/models/formula_and_function_query_definition.rb +2 -0
  112. data/lib/datadog_api_client/v1/models/funnel_query.rb +271 -0
  113. data/lib/datadog_api_client/v1/models/funnel_request_type.rb +38 -0
  114. data/lib/datadog_api_client/v1/models/funnel_source.rb +38 -0
  115. data/lib/datadog_api_client/v1/models/funnel_widget_definition.rb +322 -0
  116. data/lib/datadog_api_client/v1/models/funnel_widget_definition_type.rb +38 -0
  117. data/lib/datadog_api_client/v1/models/funnel_widget_request.rb +251 -0
  118. data/lib/datadog_api_client/v1/models/metric_content_encoding.rb +38 -0
  119. data/lib/datadog_api_client/v1/models/metrics_query_metadata.rb +1 -0
  120. data/lib/datadog_api_client/v1/models/monitor.rb +2 -0
  121. data/lib/datadog_api_client/v1/models/monitor_options.rb +26 -2
  122. data/lib/datadog_api_client/v1/models/monitor_renotify_status_type.rb +40 -0
  123. data/lib/datadog_api_client/v1/models/notebook_author.rb +2 -0
  124. data/lib/datadog_api_client/v1/models/notebook_create_data_attributes.rb +10 -1
  125. data/lib/datadog_api_client/v1/models/notebook_metadata.rb +259 -0
  126. data/lib/datadog_api_client/v1/models/notebook_metadata_type.rb +42 -0
  127. data/lib/datadog_api_client/v1/models/notebook_response_data_attributes.rb +10 -1
  128. data/lib/datadog_api_client/v1/models/notebook_update_data_attributes.rb +10 -1
  129. data/lib/datadog_api_client/v1/models/notebooks_response_data_attributes.rb +10 -1
  130. data/lib/datadog_api_client/v1/models/notebooks_response_meta.rb +1 -1
  131. data/lib/datadog_api_client/v1/models/scatter_plot_widget_definition_requests.rb +10 -11
  132. data/lib/datadog_api_client/v1/models/scatterplot_dimension.rb +41 -0
  133. data/lib/datadog_api_client/v1/models/scatterplot_table_request.rb +256 -0
  134. data/lib/datadog_api_client/v1/models/scatterplot_widget_formula.rb +262 -0
  135. data/lib/datadog_api_client/v1/models/slo_correction.rb +2 -2
  136. data/lib/datadog_api_client/v1/models/slo_correction_create_data.rb +6 -1
  137. data/lib/datadog_api_client/v1/models/slo_correction_create_request.rb +1 -1
  138. data/lib/datadog_api_client/v1/models/slo_correction_create_request_attributes.rb +5 -5
  139. data/lib/datadog_api_client/v1/models/slo_correction_list_response.rb +2 -2
  140. data/lib/datadog_api_client/v1/models/slo_correction_response.rb +1 -1
  141. data/lib/datadog_api_client/v1/models/slo_correction_response_attributes.rb +5 -5
  142. data/lib/datadog_api_client/v1/models/slo_correction_update_data.rb +1 -1
  143. data/lib/datadog_api_client/v1/models/slo_correction_update_request.rb +1 -1
  144. data/lib/datadog_api_client/v1/models/slo_correction_update_request_attributes.rb +4 -4
  145. data/lib/datadog_api_client/v1/models/synthetics_batch_details.rb +232 -0
  146. data/lib/datadog_api_client/v1/models/synthetics_batch_details_data.rb +253 -0
  147. data/lib/datadog_api_client/v1/models/synthetics_batch_result.rb +319 -0
  148. data/lib/datadog_api_client/v1/models/{synthetics_ci_test_metadata.rb → synthetics_ci_batch_metadata.rb} +6 -6
  149. data/lib/datadog_api_client/v1/models/{synthetics_ci_test_metadata_ci.rb → synthetics_ci_batch_metadata_ci.rb} +4 -4
  150. data/lib/datadog_api_client/v1/models/{synthetics_ci_test_metadata_git.rb → synthetics_ci_batch_metadata_git.rb} +5 -5
  151. data/lib/datadog_api_client/v1/models/synthetics_ci_test.rb +1 -1
  152. data/lib/datadog_api_client/v1/models/synthetics_status.rb +40 -0
  153. data/lib/datadog_api_client/v1/models/synthetics_test_details.rb +10 -1
  154. data/lib/datadog_api_client/v1/models/synthetics_test_execution_rule.rb +40 -0
  155. data/lib/datadog_api_client/v1/models/synthetics_test_request.rb +11 -1
  156. data/lib/datadog_api_client/v1/models/usage_attribution_values.rb +13 -13
  157. data/lib/datadog_api_client/v1/models/usage_sds_hour.rb +253 -0
  158. data/lib/datadog_api_client/v1/models/usage_sds_response.rb +235 -0
  159. data/lib/datadog_api_client/v1/models/usage_summary_date.rb +21 -1
  160. data/lib/datadog_api_client/v1/models/usage_summary_date_org.rb +28 -8
  161. data/lib/datadog_api_client/v1/models/usage_summary_response.rb +29 -9
  162. data/lib/datadog_api_client/v1/models/usage_timeseries_hour.rb +1 -1
  163. data/lib/datadog_api_client/v1/models/webhooks_integration.rb +1 -1
  164. data/lib/datadog_api_client/v1/models/webhooks_integration_update_request.rb +1 -1
  165. data/lib/datadog_api_client/v1/models/widget_definition.rb +1 -0
  166. data/lib/datadog_api_client/v1.rb +29 -3
  167. data/lib/datadog_api_client/v2/api/incident_services_api.rb +5 -5
  168. data/lib/datadog_api_client/v2/api/incident_teams_api.rb +5 -5
  169. data/lib/datadog_api_client/v2/api/incidents_api.rb +5 -5
  170. data/lib/datadog_api_client/v2/api/security_monitoring_api.rb +5 -5
  171. data/lib/datadog_api_client/v2/api_client.rb +14 -0
  172. data/lib/datadog_api_client/v2/configuration.rb +5 -0
  173. data/lib/datadog_api_client/v2/models/incident_field_attributes_multiple_value.rb +1 -0
  174. data/lib/datadog_api_client/v2/models/incident_field_attributes_single_value.rb +1 -0
  175. data/lib/datadog_api_client/v2/models/incident_response_attributes.rb +1 -0
  176. data/lib/datadog_api_client/v2/models/user_attributes.rb +2 -0
  177. data/lib/datadog_api_client/version.rb +1 -1
  178. data/spec/v1/models/formula_and_function_apm_dependency_stat_name_spec.rb +31 -0
  179. data/spec/v1/models/formula_and_function_apm_dependency_stats_data_source_spec.rb +31 -0
  180. data/spec/v1/models/formula_and_function_apm_dependency_stats_query_definition_spec.rb +91 -0
  181. data/spec/v1/models/formula_and_function_apm_resource_stat_name_spec.rb +31 -0
  182. data/spec/v1/models/formula_and_function_apm_resource_stats_data_source_spec.rb +31 -0
  183. data/spec/v1/models/formula_and_function_apm_resource_stats_query_definition_spec.rb +91 -0
  184. data/spec/v1/models/funnel_query_spec.rb +49 -0
  185. data/spec/v1/models/funnel_request_type_spec.rb +31 -0
  186. data/spec/v1/models/funnel_source_spec.rb +31 -0
  187. data/spec/v1/models/funnel_widget_definition_spec.rb +67 -0
  188. data/spec/v1/models/funnel_widget_definition_type_spec.rb +31 -0
  189. data/spec/v1/models/funnel_widget_request_spec.rb +43 -0
  190. data/spec/v1/models/metric_content_encoding_spec.rb +31 -0
  191. data/spec/v1/models/monitor_renotify_status_type_spec.rb +31 -0
  192. data/spec/v1/models/notebook_metadata_spec.rb +49 -0
  193. data/spec/v1/models/notebook_metadata_type_spec.rb +31 -0
  194. data/spec/v1/models/scatterplot_dimension_spec.rb +31 -0
  195. data/spec/v1/models/scatterplot_table_request_spec.rb +49 -0
  196. data/spec/v1/models/scatterplot_widget_formula_spec.rb +49 -0
  197. data/spec/v1/models/synthetics_batch_details_data_spec.rb +49 -0
  198. data/spec/v1/models/synthetics_batch_details_spec.rb +37 -0
  199. data/spec/v1/models/synthetics_batch_result_spec.rb +91 -0
  200. data/spec/v1/models/{synthetics_ci_test_metadata_ci_spec.rb → synthetics_ci_batch_metadata_ci_spec.rb} +6 -6
  201. data/spec/v1/models/{synthetics_ci_test_metadata_git_spec.rb → synthetics_ci_batch_metadata_git_spec.rb} +6 -6
  202. data/spec/v1/models/{synthetics_ci_test_metadata_spec.rb → synthetics_ci_batch_metadata_spec.rb} +6 -6
  203. data/spec/v1/models/synthetics_status_spec.rb +31 -0
  204. data/spec/v1/models/synthetics_test_execution_rule_spec.rb +31 -0
  205. data/spec/v1/models/usage_sds_hour_spec.rb +49 -0
  206. data/spec/v1/models/usage_sds_response_spec.rb +37 -0
  207. metadata +119 -14
  208. data/docs/v1/SyntheticsCITestMetadata.md +0 -20
  209. data/docs/v1/SyntheticsCITestMetadataGit.md +0 -20
@@ -0,0 +1,356 @@
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://openapi-generator.tech
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 functions APM dependency stats query.
21
+ class FormulaAndFunctionApmDependencyStatsQueryDefinition
22
+ # whether the object has unparsed attributes
23
+ attr_accessor :_unparsed
24
+
25
+ attr_accessor :data_source
26
+
27
+ # APM environment.
28
+ attr_accessor :env
29
+
30
+ # Determines whether stats for upstream or downstream dependencies should be queried.
31
+ attr_accessor :is_upstream
32
+
33
+ # Name of query to use in formulas.
34
+ attr_accessor :name
35
+
36
+ # Name of operation on service.
37
+ attr_accessor :operation_name
38
+
39
+ # The name of the second primary tag used within APM; required when `primary_tag_value` is specified. See https://docs.datadoghq.com/tracing/guide/setting_primary_tags_to_scope/#add-a-second-primary-tag-in-datadog.
40
+ attr_accessor :primary_tag_name
41
+
42
+ # Filter APM data by the second primary tag. `primary_tag_name` must also be specified.
43
+ attr_accessor :primary_tag_value
44
+
45
+ # APM resource.
46
+ attr_accessor :resource_name
47
+
48
+ # APM service.
49
+ attr_accessor :service
50
+
51
+ attr_accessor :stat
52
+
53
+ # Attribute mapping from ruby-style variable name to JSON key.
54
+ def self.attribute_map
55
+ {
56
+ :'data_source' => :'data_source',
57
+ :'env' => :'env',
58
+ :'is_upstream' => :'is_upstream',
59
+ :'name' => :'name',
60
+ :'operation_name' => :'operation_name',
61
+ :'primary_tag_name' => :'primary_tag_name',
62
+ :'primary_tag_value' => :'primary_tag_value',
63
+ :'resource_name' => :'resource_name',
64
+ :'service' => :'service',
65
+ :'stat' => :'stat'
66
+ }
67
+ end
68
+
69
+ # Returns all the JSON keys this model knows about
70
+ def self.acceptable_attributes
71
+ attribute_map.values
72
+ end
73
+
74
+ # Attribute type mapping.
75
+ def self.openapi_types
76
+ {
77
+ :'data_source' => :'FormulaAndFunctionApmDependencyStatsDataSource',
78
+ :'env' => :'String',
79
+ :'is_upstream' => :'Boolean',
80
+ :'name' => :'String',
81
+ :'operation_name' => :'String',
82
+ :'primary_tag_name' => :'String',
83
+ :'primary_tag_value' => :'String',
84
+ :'resource_name' => :'String',
85
+ :'service' => :'String',
86
+ :'stat' => :'FormulaAndFunctionApmDependencyStatName'
87
+ }
88
+ end
89
+
90
+ # List of attributes with nullable: true
91
+ def self.openapi_nullable
92
+ Set.new([
93
+ ])
94
+ end
95
+
96
+ # Initializes the object
97
+ # @param [Hash] attributes Model attributes in the form of hash
98
+ def initialize(attributes = {})
99
+ if (!attributes.is_a?(Hash))
100
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::FormulaAndFunctionApmDependencyStatsQueryDefinition` initialize method"
101
+ end
102
+
103
+ # check to see if the attribute exists and convert string to symbol for hash key
104
+ attributes = attributes.each_with_object({}) { |(k, v), h|
105
+ if (!self.class.attribute_map.key?(k.to_sym))
106
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::FormulaAndFunctionApmDependencyStatsQueryDefinition`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
107
+ end
108
+ h[k.to_sym] = v
109
+ }
110
+
111
+ if attributes.key?(:'data_source')
112
+ self.data_source = attributes[:'data_source']
113
+ end
114
+
115
+ if attributes.key?(:'env')
116
+ self.env = attributes[:'env']
117
+ end
118
+
119
+ if attributes.key?(:'is_upstream')
120
+ self.is_upstream = attributes[:'is_upstream']
121
+ end
122
+
123
+ if attributes.key?(:'name')
124
+ self.name = attributes[:'name']
125
+ end
126
+
127
+ if attributes.key?(:'operation_name')
128
+ self.operation_name = attributes[:'operation_name']
129
+ end
130
+
131
+ if attributes.key?(:'primary_tag_name')
132
+ self.primary_tag_name = attributes[:'primary_tag_name']
133
+ end
134
+
135
+ if attributes.key?(:'primary_tag_value')
136
+ self.primary_tag_value = attributes[:'primary_tag_value']
137
+ end
138
+
139
+ if attributes.key?(:'resource_name')
140
+ self.resource_name = attributes[:'resource_name']
141
+ end
142
+
143
+ if attributes.key?(:'service')
144
+ self.service = attributes[:'service']
145
+ end
146
+
147
+ if attributes.key?(:'stat')
148
+ self.stat = attributes[:'stat']
149
+ end
150
+ end
151
+
152
+ # Show invalid properties with the reasons. Usually used together with valid?
153
+ # @return Array for valid properties with the reasons
154
+ def list_invalid_properties
155
+ invalid_properties = Array.new
156
+ if @data_source.nil?
157
+ invalid_properties.push('invalid value for "data_source", data_source cannot be nil.')
158
+ end
159
+
160
+ if @env.nil?
161
+ invalid_properties.push('invalid value for "env", env cannot be nil.')
162
+ end
163
+
164
+ if @name.nil?
165
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
166
+ end
167
+
168
+ if @operation_name.nil?
169
+ invalid_properties.push('invalid value for "operation_name", operation_name cannot be nil.')
170
+ end
171
+
172
+ if @resource_name.nil?
173
+ invalid_properties.push('invalid value for "resource_name", resource_name cannot be nil.')
174
+ end
175
+
176
+ if @service.nil?
177
+ invalid_properties.push('invalid value for "service", service cannot be nil.')
178
+ end
179
+
180
+ if @stat.nil?
181
+ invalid_properties.push('invalid value for "stat", stat cannot be nil.')
182
+ end
183
+
184
+ invalid_properties
185
+ end
186
+
187
+ # Check to see if the all the properties in the model are valid
188
+ # @return true if the model is valid
189
+ def valid?
190
+ return false if @data_source.nil?
191
+ return false if @env.nil?
192
+ return false if @name.nil?
193
+ return false if @operation_name.nil?
194
+ return false if @resource_name.nil?
195
+ return false if @service.nil?
196
+ return false if @stat.nil?
197
+ true
198
+ end
199
+
200
+ # Checks equality by comparing each attribute.
201
+ # @param [Object] Object to be compared
202
+ def ==(o)
203
+ return true if self.equal?(o)
204
+ self.class == o.class &&
205
+ data_source == o.data_source &&
206
+ env == o.env &&
207
+ is_upstream == o.is_upstream &&
208
+ name == o.name &&
209
+ operation_name == o.operation_name &&
210
+ primary_tag_name == o.primary_tag_name &&
211
+ primary_tag_value == o.primary_tag_value &&
212
+ resource_name == o.resource_name &&
213
+ service == o.service &&
214
+ stat == o.stat
215
+ end
216
+
217
+ # @see the `==` method
218
+ # @param [Object] Object to be compared
219
+ def eql?(o)
220
+ self == o
221
+ end
222
+
223
+ # Calculates hash code according to all attributes.
224
+ # @return [Integer] Hash code
225
+ def hash
226
+ [data_source, env, is_upstream, name, operation_name, primary_tag_name, primary_tag_value, resource_name, service, stat].hash
227
+ end
228
+
229
+ # Builds the object from hash
230
+ # @param [Hash] attributes Model attributes in the form of hash
231
+ # @return [Object] Returns the model itself
232
+ def self.build_from_hash(attributes)
233
+ new.build_from_hash(attributes)
234
+ end
235
+
236
+ # Builds the object from hash
237
+ # @param [Hash] attributes Model attributes in the form of hash
238
+ # @return [Object] Returns the model itself
239
+ def build_from_hash(attributes)
240
+ return nil unless attributes.is_a?(Hash)
241
+ self.class.openapi_types.each_pair do |key, type|
242
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
243
+ self.send("#{key}=", nil)
244
+ elsif type =~ /\AArray<(.*)>/i
245
+ # check to ensure the input is an array given that the attribute
246
+ # is documented as an array but the input is not
247
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
248
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
249
+ end
250
+ elsif !attributes[self.class.attribute_map[key]].nil?
251
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
252
+ end
253
+ end
254
+
255
+ self
256
+ end
257
+
258
+ # Deserializes the data based on type
259
+ # @param string type Data type
260
+ # @param string value Value to be deserialized
261
+ # @return [Object] Deserialized data
262
+ def _deserialize(type, value)
263
+ case type.to_sym
264
+ when :Time
265
+ Time.parse(value)
266
+ when :Date
267
+ Date.parse(value)
268
+ when :String
269
+ value.to_s
270
+ when :Integer
271
+ value.to_i
272
+ when :Float
273
+ value.to_f
274
+ when :Boolean
275
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
276
+ true
277
+ else
278
+ false
279
+ end
280
+ when :Object
281
+ # generic object (usually a Hash), return directly
282
+ value
283
+ when :Array
284
+ # generic array, return directly
285
+ value
286
+ when /\AArray<(?<inner_type>.+)>\z/
287
+ inner_type = Regexp.last_match[:inner_type]
288
+ value.map { |v| _deserialize(inner_type, v) }
289
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
290
+ k_type = Regexp.last_match[:k_type]
291
+ v_type = Regexp.last_match[:v_type]
292
+ {}.tap do |hash|
293
+ value.each do |k, v|
294
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
295
+ end
296
+ end
297
+ else # model
298
+ # models (e.g. Pet) or oneOf
299
+ klass = DatadogAPIClient::V1.const_get(type)
300
+ res = klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
301
+ if res.instance_of? DatadogAPIClient::V1::UnparsedObject
302
+ self._unparsed = true
303
+ end
304
+ res
305
+ end
306
+ end
307
+
308
+ # Returns the string representation of the object
309
+ # @return [String] String presentation of the object
310
+ def to_s
311
+ to_hash.to_s
312
+ end
313
+
314
+ # to_body is an alias to to_hash (backward compatibility)
315
+ # @return [Hash] Returns the object in the form of hash
316
+ def to_body
317
+ to_hash
318
+ end
319
+
320
+ # Returns the object in the form of hash
321
+ # @return [Hash] Returns the object in the form of hash
322
+ def to_hash
323
+ hash = {}
324
+ self.class.attribute_map.each_pair do |attr, param|
325
+ value = self.send(attr)
326
+ if value.nil?
327
+ is_nullable = self.class.openapi_nullable.include?(attr)
328
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
329
+ end
330
+
331
+ hash[param] = _to_hash(value)
332
+ end
333
+ hash
334
+ end
335
+
336
+ # Outputs non-array value in the form of hash
337
+ # For object, use to_hash. Otherwise, just return the value
338
+ # @param [Object] value Any valid value
339
+ # @return [Hash] Returns the value in the form of hash
340
+ def _to_hash(value)
341
+ if value.is_a?(Array)
342
+ value.compact.map { |v| _to_hash(v) }
343
+ elsif value.is_a?(Hash)
344
+ {}.tap do |hash|
345
+ value.each { |k, v| hash[k] = _to_hash(v) }
346
+ end
347
+ elsif value.respond_to? :to_hash
348
+ value.to_hash
349
+ else
350
+ value
351
+ end
352
+ end
353
+
354
+ end
355
+
356
+ end
@@ -0,0 +1,47 @@
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://openapi-generator.tech
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
+ class FormulaAndFunctionApmResourceStatName
21
+ ERRORS = "errors".freeze
22
+ ERROR_RATE = "error_rate".freeze
23
+ HITS = "hits".freeze
24
+ LATENCY_AVG = "latency_avg".freeze
25
+ LATENCY_MAX = "latency_max".freeze
26
+ LATENCY_P50 = "latency_p50".freeze
27
+ LATENCY_P75 = "latency_p75".freeze
28
+ LATENCY_P90 = "latency_p90".freeze
29
+ LATENCY_P95 = "latency_p95".freeze
30
+ LATENCY_P99 = "latency_p99".freeze
31
+
32
+ # Builds the enum from string
33
+ # @param [String] The enum value in the form of the string
34
+ # @return [String] The enum value
35
+ def self.build_from_hash(value)
36
+ new.build_from_hash(value)
37
+ end
38
+
39
+ # Builds the enum from string
40
+ # @param [String] The enum value in the form of the string
41
+ # @return [String] The enum value
42
+ def build_from_hash(value)
43
+ constantValues = FormulaAndFunctionApmResourceStatName.constants.select { |c| FormulaAndFunctionApmResourceStatName::const_get(c) == value }
44
+ constantValues.empty? ? DatadogAPIClient::V1::UnparsedObject.new(value) : value
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,38 @@
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://openapi-generator.tech
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
+ class FormulaAndFunctionApmResourceStatsDataSource
21
+ APM_RESOURCE_STATS = "apm_resource_stats".freeze
22
+
23
+ # Builds the enum from string
24
+ # @param [String] The enum value in the form of the string
25
+ # @return [String] The enum value
26
+ def self.build_from_hash(value)
27
+ new.build_from_hash(value)
28
+ end
29
+
30
+ # Builds the enum from string
31
+ # @param [String] The enum value in the form of the string
32
+ # @return [String] The enum value
33
+ def build_from_hash(value)
34
+ constantValues = FormulaAndFunctionApmResourceStatsDataSource.constants.select { |c| FormulaAndFunctionApmResourceStatsDataSource::const_get(c) == value }
35
+ constantValues.empty? ? DatadogAPIClient::V1::UnparsedObject.new(value) : value
36
+ end
37
+ end
38
+ end