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,322 @@
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
+ # The funnel visualization displays a funnel of user sessions that maps a sequence of view navigation and user interaction in your application.
21
+ class FunnelWidgetDefinition
22
+ # whether the object has unparsed attributes
23
+ attr_accessor :_unparsed
24
+
25
+ # Request payload used to query items.
26
+ attr_accessor :requests
27
+
28
+ attr_accessor :time
29
+
30
+ # The title of the widget.
31
+ attr_accessor :title
32
+
33
+ attr_accessor :title_align
34
+
35
+ # The size of the title.
36
+ attr_accessor :title_size
37
+
38
+ attr_accessor :type
39
+
40
+ # Attribute mapping from ruby-style variable name to JSON key.
41
+ def self.attribute_map
42
+ {
43
+ :'requests' => :'requests',
44
+ :'time' => :'time',
45
+ :'title' => :'title',
46
+ :'title_align' => :'title_align',
47
+ :'title_size' => :'title_size',
48
+ :'type' => :'type'
49
+ }
50
+ end
51
+
52
+ # Returns all the JSON keys this model knows about
53
+ def self.acceptable_attributes
54
+ attribute_map.values
55
+ end
56
+
57
+ # Attribute type mapping.
58
+ def self.openapi_types
59
+ {
60
+ :'requests' => :'Array<FunnelWidgetRequest>',
61
+ :'time' => :'WidgetTime',
62
+ :'title' => :'String',
63
+ :'title_align' => :'WidgetTextAlign',
64
+ :'title_size' => :'String',
65
+ :'type' => :'FunnelWidgetDefinitionType'
66
+ }
67
+ end
68
+
69
+ # List of attributes with nullable: true
70
+ def self.openapi_nullable
71
+ Set.new([
72
+ ])
73
+ end
74
+
75
+ # Initializes the object
76
+ # @param [Hash] attributes Model attributes in the form of hash
77
+ def initialize(attributes = {})
78
+ if (!attributes.is_a?(Hash))
79
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::FunnelWidgetDefinition` initialize method"
80
+ end
81
+
82
+ # check to see if the attribute exists and convert string to symbol for hash key
83
+ attributes = attributes.each_with_object({}) { |(k, v), h|
84
+ if (!self.class.attribute_map.key?(k.to_sym))
85
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::FunnelWidgetDefinition`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
86
+ end
87
+ h[k.to_sym] = v
88
+ }
89
+
90
+ if attributes.key?(:'requests')
91
+ if (value = attributes[:'requests']).is_a?(Array)
92
+ self.requests = value
93
+ end
94
+ end
95
+
96
+ if attributes.key?(:'time')
97
+ self.time = attributes[:'time']
98
+ end
99
+
100
+ if attributes.key?(:'title')
101
+ self.title = attributes[:'title']
102
+ end
103
+
104
+ if attributes.key?(:'title_align')
105
+ self.title_align = attributes[:'title_align']
106
+ end
107
+
108
+ if attributes.key?(:'title_size')
109
+ self.title_size = attributes[:'title_size']
110
+ end
111
+
112
+ if attributes.key?(:'type')
113
+ self.type = attributes[:'type']
114
+ else
115
+ self.type = 'funnel'
116
+ end
117
+ end
118
+
119
+ # Show invalid properties with the reasons. Usually used together with valid?
120
+ # @return Array for valid properties with the reasons
121
+ def list_invalid_properties
122
+ invalid_properties = Array.new
123
+ if @requests.nil?
124
+ invalid_properties.push('invalid value for "requests", requests cannot be nil.')
125
+ end
126
+
127
+ if @requests.length > 1
128
+ invalid_properties.push('invalid value for "requests", number of items must be less than or equal to 1.')
129
+ end
130
+
131
+ if @requests.length < 1
132
+ invalid_properties.push('invalid value for "requests", number of items must be greater than or equal to 1.')
133
+ end
134
+
135
+ if @type.nil?
136
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
137
+ end
138
+
139
+ invalid_properties
140
+ end
141
+
142
+ # Check to see if the all the properties in the model are valid
143
+ # @return true if the model is valid
144
+ def valid?
145
+ return false if @requests.nil?
146
+ return false if @requests.length > 1
147
+ return false if @requests.length < 1
148
+ return false if @type.nil?
149
+ true
150
+ end
151
+
152
+ # Custom attribute writer method with validation
153
+ # @param [Object] requests Value to be assigned
154
+ def requests=(requests)
155
+ if requests.nil?
156
+ fail ArgumentError, 'requests cannot be nil'
157
+ end
158
+
159
+ if requests.length > 1
160
+ fail ArgumentError, 'invalid value for "requests", number of items must be less than or equal to 1.'
161
+ end
162
+
163
+ if requests.length < 1
164
+ fail ArgumentError, 'invalid value for "requests", number of items must be greater than or equal to 1.'
165
+ end
166
+
167
+ @requests = requests
168
+ end
169
+
170
+ # Checks equality by comparing each attribute.
171
+ # @param [Object] Object to be compared
172
+ def ==(o)
173
+ return true if self.equal?(o)
174
+ self.class == o.class &&
175
+ requests == o.requests &&
176
+ time == o.time &&
177
+ title == o.title &&
178
+ title_align == o.title_align &&
179
+ title_size == o.title_size &&
180
+ type == o.type
181
+ end
182
+
183
+ # @see the `==` method
184
+ # @param [Object] Object to be compared
185
+ def eql?(o)
186
+ self == o
187
+ end
188
+
189
+ # Calculates hash code according to all attributes.
190
+ # @return [Integer] Hash code
191
+ def hash
192
+ [requests, time, title, title_align, title_size, type].hash
193
+ end
194
+
195
+ # Builds the object from hash
196
+ # @param [Hash] attributes Model attributes in the form of hash
197
+ # @return [Object] Returns the model itself
198
+ def self.build_from_hash(attributes)
199
+ new.build_from_hash(attributes)
200
+ end
201
+
202
+ # Builds the object from hash
203
+ # @param [Hash] attributes Model attributes in the form of hash
204
+ # @return [Object] Returns the model itself
205
+ def build_from_hash(attributes)
206
+ return nil unless attributes.is_a?(Hash)
207
+ self.class.openapi_types.each_pair do |key, type|
208
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
209
+ self.send("#{key}=", nil)
210
+ elsif type =~ /\AArray<(.*)>/i
211
+ # check to ensure the input is an array given that the attribute
212
+ # is documented as an array but the input is not
213
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
214
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
215
+ end
216
+ elsif !attributes[self.class.attribute_map[key]].nil?
217
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
218
+ end
219
+ end
220
+
221
+ self
222
+ end
223
+
224
+ # Deserializes the data based on type
225
+ # @param string type Data type
226
+ # @param string value Value to be deserialized
227
+ # @return [Object] Deserialized data
228
+ def _deserialize(type, value)
229
+ case type.to_sym
230
+ when :Time
231
+ Time.parse(value)
232
+ when :Date
233
+ Date.parse(value)
234
+ when :String
235
+ value.to_s
236
+ when :Integer
237
+ value.to_i
238
+ when :Float
239
+ value.to_f
240
+ when :Boolean
241
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
242
+ true
243
+ else
244
+ false
245
+ end
246
+ when :Object
247
+ # generic object (usually a Hash), return directly
248
+ value
249
+ when :Array
250
+ # generic array, return directly
251
+ value
252
+ when /\AArray<(?<inner_type>.+)>\z/
253
+ inner_type = Regexp.last_match[:inner_type]
254
+ value.map { |v| _deserialize(inner_type, v) }
255
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
256
+ k_type = Regexp.last_match[:k_type]
257
+ v_type = Regexp.last_match[:v_type]
258
+ {}.tap do |hash|
259
+ value.each do |k, v|
260
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
261
+ end
262
+ end
263
+ else # model
264
+ # models (e.g. Pet) or oneOf
265
+ klass = DatadogAPIClient::V1.const_get(type)
266
+ res = klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
267
+ if res.instance_of? DatadogAPIClient::V1::UnparsedObject
268
+ self._unparsed = true
269
+ end
270
+ res
271
+ end
272
+ end
273
+
274
+ # Returns the string representation of the object
275
+ # @return [String] String presentation of the object
276
+ def to_s
277
+ to_hash.to_s
278
+ end
279
+
280
+ # to_body is an alias to to_hash (backward compatibility)
281
+ # @return [Hash] Returns the object in the form of hash
282
+ def to_body
283
+ to_hash
284
+ end
285
+
286
+ # Returns the object in the form of hash
287
+ # @return [Hash] Returns the object in the form of hash
288
+ def to_hash
289
+ hash = {}
290
+ self.class.attribute_map.each_pair do |attr, param|
291
+ value = self.send(attr)
292
+ if value.nil?
293
+ is_nullable = self.class.openapi_nullable.include?(attr)
294
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
295
+ end
296
+
297
+ hash[param] = _to_hash(value)
298
+ end
299
+ hash
300
+ end
301
+
302
+ # Outputs non-array value in the form of hash
303
+ # For object, use to_hash. Otherwise, just return the value
304
+ # @param [Object] value Any valid value
305
+ # @return [Hash] Returns the value in the form of hash
306
+ def _to_hash(value)
307
+ if value.is_a?(Array)
308
+ value.compact.map { |v| _to_hash(v) }
309
+ elsif value.is_a?(Hash)
310
+ {}.tap do |hash|
311
+ value.each { |k, v| hash[k] = _to_hash(v) }
312
+ end
313
+ elsif value.respond_to? :to_hash
314
+ value.to_hash
315
+ else
316
+ value
317
+ end
318
+ end
319
+
320
+ end
321
+
322
+ 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 FunnelWidgetDefinitionType
21
+ FUNNEL = "funnel".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 = FunnelWidgetDefinitionType.constants.select { |c| FunnelWidgetDefinitionType::const_get(c) == value }
35
+ constantValues.empty? ? DatadogAPIClient::V1::UnparsedObject.new(value) : value
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,251 @@
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
+ # Updated funnel widget.
21
+ class FunnelWidgetRequest
22
+ # whether the object has unparsed attributes
23
+ attr_accessor :_unparsed
24
+
25
+ attr_accessor :query
26
+
27
+ attr_accessor :request_type
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'query' => :'query',
33
+ :'request_type' => :'request_type'
34
+ }
35
+ end
36
+
37
+ # Returns all the JSON keys this model knows about
38
+ def self.acceptable_attributes
39
+ attribute_map.values
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.openapi_types
44
+ {
45
+ :'query' => :'FunnelQuery',
46
+ :'request_type' => :'FunnelRequestType'
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ ])
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::FunnelWidgetRequest` initialize method"
61
+ end
62
+
63
+ # check to see if the attribute exists and convert string to symbol for hash key
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!self.class.attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::FunnelWidgetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'query')
72
+ self.query = attributes[:'query']
73
+ end
74
+
75
+ if attributes.key?(:'request_type')
76
+ self.request_type = attributes[:'request_type']
77
+ end
78
+ end
79
+
80
+ # Show invalid properties with the reasons. Usually used together with valid?
81
+ # @return Array for valid properties with the reasons
82
+ def list_invalid_properties
83
+ invalid_properties = Array.new
84
+ if @query.nil?
85
+ invalid_properties.push('invalid value for "query", query cannot be nil.')
86
+ end
87
+
88
+ if @request_type.nil?
89
+ invalid_properties.push('invalid value for "request_type", request_type cannot be nil.')
90
+ end
91
+
92
+ invalid_properties
93
+ end
94
+
95
+ # Check to see if the all the properties in the model are valid
96
+ # @return true if the model is valid
97
+ def valid?
98
+ return false if @query.nil?
99
+ return false if @request_type.nil?
100
+ true
101
+ end
102
+
103
+ # Checks equality by comparing each attribute.
104
+ # @param [Object] Object to be compared
105
+ def ==(o)
106
+ return true if self.equal?(o)
107
+ self.class == o.class &&
108
+ query == o.query &&
109
+ request_type == o.request_type
110
+ end
111
+
112
+ # @see the `==` method
113
+ # @param [Object] Object to be compared
114
+ def eql?(o)
115
+ self == o
116
+ end
117
+
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Integer] Hash code
120
+ def hash
121
+ [query, request_type].hash
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def self.build_from_hash(attributes)
128
+ new.build_from_hash(attributes)
129
+ end
130
+
131
+ # Builds the object from hash
132
+ # @param [Hash] attributes Model attributes in the form of hash
133
+ # @return [Object] Returns the model itself
134
+ def build_from_hash(attributes)
135
+ return nil unless attributes.is_a?(Hash)
136
+ self.class.openapi_types.each_pair do |key, type|
137
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
138
+ self.send("#{key}=", nil)
139
+ elsif type =~ /\AArray<(.*)>/i
140
+ # check to ensure the input is an array given that the attribute
141
+ # is documented as an array but the input is not
142
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
143
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
144
+ end
145
+ elsif !attributes[self.class.attribute_map[key]].nil?
146
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
147
+ end
148
+ end
149
+
150
+ self
151
+ end
152
+
153
+ # Deserializes the data based on type
154
+ # @param string type Data type
155
+ # @param string value Value to be deserialized
156
+ # @return [Object] Deserialized data
157
+ def _deserialize(type, value)
158
+ case type.to_sym
159
+ when :Time
160
+ Time.parse(value)
161
+ when :Date
162
+ Date.parse(value)
163
+ when :String
164
+ value.to_s
165
+ when :Integer
166
+ value.to_i
167
+ when :Float
168
+ value.to_f
169
+ when :Boolean
170
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
171
+ true
172
+ else
173
+ false
174
+ end
175
+ when :Object
176
+ # generic object (usually a Hash), return directly
177
+ value
178
+ when :Array
179
+ # generic array, return directly
180
+ value
181
+ when /\AArray<(?<inner_type>.+)>\z/
182
+ inner_type = Regexp.last_match[:inner_type]
183
+ value.map { |v| _deserialize(inner_type, v) }
184
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
185
+ k_type = Regexp.last_match[:k_type]
186
+ v_type = Regexp.last_match[:v_type]
187
+ {}.tap do |hash|
188
+ value.each do |k, v|
189
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
190
+ end
191
+ end
192
+ else # model
193
+ # models (e.g. Pet) or oneOf
194
+ klass = DatadogAPIClient::V1.const_get(type)
195
+ res = klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
196
+ if res.instance_of? DatadogAPIClient::V1::UnparsedObject
197
+ self._unparsed = true
198
+ end
199
+ res
200
+ end
201
+ end
202
+
203
+ # Returns the string representation of the object
204
+ # @return [String] String presentation of the object
205
+ def to_s
206
+ to_hash.to_s
207
+ end
208
+
209
+ # to_body is an alias to to_hash (backward compatibility)
210
+ # @return [Hash] Returns the object in the form of hash
211
+ def to_body
212
+ to_hash
213
+ end
214
+
215
+ # Returns the object in the form of hash
216
+ # @return [Hash] Returns the object in the form of hash
217
+ def to_hash
218
+ hash = {}
219
+ self.class.attribute_map.each_pair do |attr, param|
220
+ value = self.send(attr)
221
+ if value.nil?
222
+ is_nullable = self.class.openapi_nullable.include?(attr)
223
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
224
+ end
225
+
226
+ hash[param] = _to_hash(value)
227
+ end
228
+ hash
229
+ end
230
+
231
+ # Outputs non-array value in the form of hash
232
+ # For object, use to_hash. Otherwise, just return the value
233
+ # @param [Object] value Any valid value
234
+ # @return [Hash] Returns the value in the form of hash
235
+ def _to_hash(value)
236
+ if value.is_a?(Array)
237
+ value.compact.map { |v| _to_hash(v) }
238
+ elsif value.is_a?(Hash)
239
+ {}.tap do |hash|
240
+ value.each { |k, v| hash[k] = _to_hash(v) }
241
+ end
242
+ elsif value.respond_to? :to_hash
243
+ value.to_hash
244
+ else
245
+ value
246
+ end
247
+ end
248
+
249
+ end
250
+
251
+ 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 MetricContentEncoding
21
+ DEFLATE = "deflate".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 = MetricContentEncoding.constants.select { |c| MetricContentEncoding::const_get(c) == value }
35
+ constantValues.empty? ? DatadogAPIClient::V1::UnparsedObject.new(value) : value
36
+ end
37
+ end
38
+ end
@@ -107,6 +107,7 @@ module DatadogAPIClient::V1
107
107
  # List of attributes with nullable: true
108
108
  def self.openapi_nullable
109
109
  Set.new([
110
+ :'aggr',
110
111
  ])
111
112
  end
112
113
 
@@ -118,6 +118,8 @@ module DatadogAPIClient::V1
118
118
  def self.openapi_nullable
119
119
  Set.new([
120
120
  :'deleted',
121
+ :'priority',
122
+ :'restricted_roles',
121
123
  ])
122
124
  end
123
125