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
@@ -17,7 +17,7 @@ require 'date'
17
17
  require 'time'
18
18
 
19
19
  module DatadogAPIClient::V1
20
- # The attribute object associated with the SLO correction to be created
20
+ # The attribute object associated with the SLO correction to be created.
21
21
  class SLOCorrectionCreateRequestAttributes
22
22
  # whether the object has unparsed attributes
23
23
  attr_accessor :_unparsed
@@ -27,16 +27,16 @@ module DatadogAPIClient::V1
27
27
  # Description of the correction being made.
28
28
  attr_accessor :description
29
29
 
30
- # Ending time of the correction in epoch seconds
30
+ # Ending time of the correction in epoch seconds.
31
31
  attr_accessor :_end
32
32
 
33
- # ID of the SLO that this correction will be applied to
33
+ # ID of the SLO that this correction will be applied to.
34
34
  attr_accessor :slo_id
35
35
 
36
- # Starting time of the correction in epoch seconds
36
+ # Starting time of the correction in epoch seconds.
37
37
  attr_accessor :start
38
38
 
39
- # The timezone to display in the UI for the correction times (defaults to \"UTC\")
39
+ # The timezone to display in the UI for the correction times (defaults to \"UTC\").
40
40
  attr_accessor :timezone
41
41
 
42
42
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -17,12 +17,12 @@ require 'date'
17
17
  require 'time'
18
18
 
19
19
  module DatadogAPIClient::V1
20
- # A list of SLO correction objects
20
+ # A list of SLO correction objects.
21
21
  class SLOCorrectionListResponse
22
22
  # whether the object has unparsed attributes
23
23
  attr_accessor :_unparsed
24
24
 
25
- # The list of of SLO corrections objects
25
+ # The list of of SLO corrections objects.
26
26
  attr_accessor :data
27
27
 
28
28
  attr_accessor :meta
@@ -17,7 +17,7 @@ require 'date'
17
17
  require 'time'
18
18
 
19
19
  module DatadogAPIClient::V1
20
- # The response object of an SLO correction
20
+ # The response object of an SLO correction.
21
21
  class SLOCorrectionResponse
22
22
  # whether the object has unparsed attributes
23
23
  attr_accessor :_unparsed
@@ -17,7 +17,7 @@ require 'date'
17
17
  require 'time'
18
18
 
19
19
  module DatadogAPIClient::V1
20
- # The attribute object associated with the SLO correction
20
+ # The attribute object associated with the SLO correction.
21
21
  class SLOCorrectionResponseAttributes
22
22
  # whether the object has unparsed attributes
23
23
  attr_accessor :_unparsed
@@ -29,16 +29,16 @@ module DatadogAPIClient::V1
29
29
  # Description of the correction being made.
30
30
  attr_accessor :description
31
31
 
32
- # Ending time of the correction in epoch seconds
32
+ # Ending time of the correction in epoch seconds.
33
33
  attr_accessor :_end
34
34
 
35
- # ID of the SLO that this correction will be applied to
35
+ # ID of the SLO that this correction will be applied to.
36
36
  attr_accessor :slo_id
37
37
 
38
- # Starting time of the correction in epoch seconds
38
+ # Starting time of the correction in epoch seconds.
39
39
  attr_accessor :start
40
40
 
41
- # The timezone to display in the UI for the correction times (defaults to \"UTC\")
41
+ # The timezone to display in the UI for the correction times (defaults to \"UTC\").
42
42
  attr_accessor :timezone
43
43
 
44
44
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -17,7 +17,7 @@ require 'date'
17
17
  require 'time'
18
18
 
19
19
  module DatadogAPIClient::V1
20
- # The data object associated with the SLO correction to be updated
20
+ # The data object associated with the SLO correction to be updated.
21
21
  class SLOCorrectionUpdateData
22
22
  # whether the object has unparsed attributes
23
23
  attr_accessor :_unparsed
@@ -17,7 +17,7 @@ require 'date'
17
17
  require 'time'
18
18
 
19
19
  module DatadogAPIClient::V1
20
- # An object that defines a correction to be applied to an SLO
20
+ # An object that defines a correction to be applied to an SLO.
21
21
  class SLOCorrectionUpdateRequest
22
22
  # whether the object has unparsed attributes
23
23
  attr_accessor :_unparsed
@@ -17,7 +17,7 @@ require 'date'
17
17
  require 'time'
18
18
 
19
19
  module DatadogAPIClient::V1
20
- # The attribute object associated with the SLO correction to be updated
20
+ # The attribute object associated with the SLO correction to be updated.
21
21
  class SLOCorrectionUpdateRequestAttributes
22
22
  # whether the object has unparsed attributes
23
23
  attr_accessor :_unparsed
@@ -27,13 +27,13 @@ module DatadogAPIClient::V1
27
27
  # Description of the correction being made.
28
28
  attr_accessor :description
29
29
 
30
- # Ending time of the correction in epoch seconds
30
+ # Ending time of the correction in epoch seconds.
31
31
  attr_accessor :_end
32
32
 
33
- # Starting time of the correction in epoch seconds
33
+ # Starting time of the correction in epoch seconds.
34
34
  attr_accessor :start
35
35
 
36
- # The timezone to display in the UI for the correction times (defaults to \"UTC\")
36
+ # The timezone to display in the UI for the correction times (defaults to \"UTC\").
37
37
  attr_accessor :timezone
38
38
 
39
39
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -0,0 +1,232 @@
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
+ # Details about a batch response.
21
+ class SyntheticsBatchDetails
22
+ # whether the object has unparsed attributes
23
+ attr_accessor :_unparsed
24
+
25
+ attr_accessor :data
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'data' => :'data'
31
+ }
32
+ end
33
+
34
+ # Returns all the JSON keys this model knows about
35
+ def self.acceptable_attributes
36
+ attribute_map.values
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.openapi_types
41
+ {
42
+ :'data' => :'SyntheticsBatchDetailsData'
43
+ }
44
+ end
45
+
46
+ # List of attributes with nullable: true
47
+ def self.openapi_nullable
48
+ Set.new([
49
+ ])
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ if (!attributes.is_a?(Hash))
56
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::SyntheticsBatchDetails` initialize method"
57
+ end
58
+
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!self.class.attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::SyntheticsBatchDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'data')
68
+ self.data = attributes[:'data']
69
+ end
70
+ end
71
+
72
+ # Show invalid properties with the reasons. Usually used together with valid?
73
+ # @return Array for valid properties with the reasons
74
+ def list_invalid_properties
75
+ invalid_properties = Array.new
76
+ invalid_properties
77
+ end
78
+
79
+ # Check to see if the all the properties in the model are valid
80
+ # @return true if the model is valid
81
+ def valid?
82
+ true
83
+ end
84
+
85
+ # Checks equality by comparing each attribute.
86
+ # @param [Object] Object to be compared
87
+ def ==(o)
88
+ return true if self.equal?(o)
89
+ self.class == o.class &&
90
+ data == o.data
91
+ end
92
+
93
+ # @see the `==` method
94
+ # @param [Object] Object to be compared
95
+ def eql?(o)
96
+ self == o
97
+ end
98
+
99
+ # Calculates hash code according to all attributes.
100
+ # @return [Integer] Hash code
101
+ def hash
102
+ [data].hash
103
+ end
104
+
105
+ # Builds the object from hash
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ # @return [Object] Returns the model itself
108
+ def self.build_from_hash(attributes)
109
+ new.build_from_hash(attributes)
110
+ end
111
+
112
+ # Builds the object from hash
113
+ # @param [Hash] attributes Model attributes in the form of hash
114
+ # @return [Object] Returns the model itself
115
+ def build_from_hash(attributes)
116
+ return nil unless attributes.is_a?(Hash)
117
+ self.class.openapi_types.each_pair do |key, type|
118
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
119
+ self.send("#{key}=", nil)
120
+ elsif type =~ /\AArray<(.*)>/i
121
+ # check to ensure the input is an array given that the attribute
122
+ # is documented as an array but the input is not
123
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
124
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
125
+ end
126
+ elsif !attributes[self.class.attribute_map[key]].nil?
127
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
128
+ end
129
+ end
130
+
131
+ self
132
+ end
133
+
134
+ # Deserializes the data based on type
135
+ # @param string type Data type
136
+ # @param string value Value to be deserialized
137
+ # @return [Object] Deserialized data
138
+ def _deserialize(type, value)
139
+ case type.to_sym
140
+ when :Time
141
+ Time.parse(value)
142
+ when :Date
143
+ Date.parse(value)
144
+ when :String
145
+ value.to_s
146
+ when :Integer
147
+ value.to_i
148
+ when :Float
149
+ value.to_f
150
+ when :Boolean
151
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
152
+ true
153
+ else
154
+ false
155
+ end
156
+ when :Object
157
+ # generic object (usually a Hash), return directly
158
+ value
159
+ when :Array
160
+ # generic array, return directly
161
+ value
162
+ when /\AArray<(?<inner_type>.+)>\z/
163
+ inner_type = Regexp.last_match[:inner_type]
164
+ value.map { |v| _deserialize(inner_type, v) }
165
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
166
+ k_type = Regexp.last_match[:k_type]
167
+ v_type = Regexp.last_match[:v_type]
168
+ {}.tap do |hash|
169
+ value.each do |k, v|
170
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
171
+ end
172
+ end
173
+ else # model
174
+ # models (e.g. Pet) or oneOf
175
+ klass = DatadogAPIClient::V1.const_get(type)
176
+ res = klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
177
+ if res.instance_of? DatadogAPIClient::V1::UnparsedObject
178
+ self._unparsed = true
179
+ end
180
+ res
181
+ end
182
+ end
183
+
184
+ # Returns the string representation of the object
185
+ # @return [String] String presentation of the object
186
+ def to_s
187
+ to_hash.to_s
188
+ end
189
+
190
+ # to_body is an alias to to_hash (backward compatibility)
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_body
193
+ to_hash
194
+ end
195
+
196
+ # Returns the object in the form of hash
197
+ # @return [Hash] Returns the object in the form of hash
198
+ def to_hash
199
+ hash = {}
200
+ self.class.attribute_map.each_pair do |attr, param|
201
+ value = self.send(attr)
202
+ if value.nil?
203
+ is_nullable = self.class.openapi_nullable.include?(attr)
204
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
205
+ end
206
+
207
+ hash[param] = _to_hash(value)
208
+ end
209
+ hash
210
+ end
211
+
212
+ # Outputs non-array value in the form of hash
213
+ # For object, use to_hash. Otherwise, just return the value
214
+ # @param [Object] value Any valid value
215
+ # @return [Hash] Returns the value in the form of hash
216
+ def _to_hash(value)
217
+ if value.is_a?(Array)
218
+ value.compact.map { |v| _to_hash(v) }
219
+ elsif value.is_a?(Hash)
220
+ {}.tap do |hash|
221
+ value.each { |k, v| hash[k] = _to_hash(v) }
222
+ end
223
+ elsif value.respond_to? :to_hash
224
+ value.to_hash
225
+ else
226
+ value
227
+ end
228
+ end
229
+
230
+ end
231
+
232
+ end
@@ -0,0 +1,253 @@
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
+ # Wrapper object that contains the details of a batch.
21
+ class SyntheticsBatchDetailsData
22
+ # whether the object has unparsed attributes
23
+ attr_accessor :_unparsed
24
+
25
+ attr_accessor :metadata
26
+
27
+ # List of results for the batch.
28
+ attr_accessor :results
29
+
30
+ attr_accessor :status
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'metadata' => :'metadata',
36
+ :'results' => :'results',
37
+ :'status' => :'status'
38
+ }
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'metadata' => :'SyntheticsCIBatchMetadata',
50
+ :'results' => :'Array<SyntheticsBatchResult>',
51
+ :'status' => :'SyntheticsStatus'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::SyntheticsBatchDetailsData` 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::V1::SyntheticsBatchDetailsData`. 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?(:'metadata')
77
+ self.metadata = attributes[:'metadata']
78
+ end
79
+
80
+ if attributes.key?(:'results')
81
+ if (value = attributes[:'results']).is_a?(Array)
82
+ self.results = value
83
+ end
84
+ end
85
+
86
+ if attributes.key?(:'status')
87
+ self.status = attributes[:'status']
88
+ end
89
+ end
90
+
91
+ # Show invalid properties with the reasons. Usually used together with valid?
92
+ # @return Array for valid properties with the reasons
93
+ def list_invalid_properties
94
+ invalid_properties = Array.new
95
+ invalid_properties
96
+ end
97
+
98
+ # Check to see if the all the properties in the model are valid
99
+ # @return true if the model is valid
100
+ def valid?
101
+ true
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(o)
107
+ return true if self.equal?(o)
108
+ self.class == o.class &&
109
+ metadata == o.metadata &&
110
+ results == o.results &&
111
+ status == o.status
112
+ end
113
+
114
+ # @see the `==` method
115
+ # @param [Object] Object to be compared
116
+ def eql?(o)
117
+ self == o
118
+ end
119
+
120
+ # Calculates hash code according to all attributes.
121
+ # @return [Integer] Hash code
122
+ def hash
123
+ [metadata, results, status].hash
124
+ end
125
+
126
+ # Builds the object from hash
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ # @return [Object] Returns the model itself
129
+ def self.build_from_hash(attributes)
130
+ new.build_from_hash(attributes)
131
+ end
132
+
133
+ # Builds the object from hash
134
+ # @param [Hash] attributes Model attributes in the form of hash
135
+ # @return [Object] Returns the model itself
136
+ def build_from_hash(attributes)
137
+ return nil unless attributes.is_a?(Hash)
138
+ self.class.openapi_types.each_pair do |key, type|
139
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
140
+ self.send("#{key}=", nil)
141
+ elsif type =~ /\AArray<(.*)>/i
142
+ # check to ensure the input is an array given that the attribute
143
+ # is documented as an array but the input is not
144
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
145
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
146
+ end
147
+ elsif !attributes[self.class.attribute_map[key]].nil?
148
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
149
+ end
150
+ end
151
+
152
+ self
153
+ end
154
+
155
+ # Deserializes the data based on type
156
+ # @param string type Data type
157
+ # @param string value Value to be deserialized
158
+ # @return [Object] Deserialized data
159
+ def _deserialize(type, value)
160
+ case type.to_sym
161
+ when :Time
162
+ Time.parse(value)
163
+ when :Date
164
+ Date.parse(value)
165
+ when :String
166
+ value.to_s
167
+ when :Integer
168
+ value.to_i
169
+ when :Float
170
+ value.to_f
171
+ when :Boolean
172
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
173
+ true
174
+ else
175
+ false
176
+ end
177
+ when :Object
178
+ # generic object (usually a Hash), return directly
179
+ value
180
+ when :Array
181
+ # generic array, return directly
182
+ value
183
+ when /\AArray<(?<inner_type>.+)>\z/
184
+ inner_type = Regexp.last_match[:inner_type]
185
+ value.map { |v| _deserialize(inner_type, v) }
186
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
187
+ k_type = Regexp.last_match[:k_type]
188
+ v_type = Regexp.last_match[:v_type]
189
+ {}.tap do |hash|
190
+ value.each do |k, v|
191
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
192
+ end
193
+ end
194
+ else # model
195
+ # models (e.g. Pet) or oneOf
196
+ klass = DatadogAPIClient::V1.const_get(type)
197
+ res = klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
198
+ if res.instance_of? DatadogAPIClient::V1::UnparsedObject
199
+ self._unparsed = true
200
+ end
201
+ res
202
+ end
203
+ end
204
+
205
+ # Returns the string representation of the object
206
+ # @return [String] String presentation of the object
207
+ def to_s
208
+ to_hash.to_s
209
+ end
210
+
211
+ # to_body is an alias to to_hash (backward compatibility)
212
+ # @return [Hash] Returns the object in the form of hash
213
+ def to_body
214
+ to_hash
215
+ end
216
+
217
+ # Returns the object in the form of hash
218
+ # @return [Hash] Returns the object in the form of hash
219
+ def to_hash
220
+ hash = {}
221
+ self.class.attribute_map.each_pair do |attr, param|
222
+ value = self.send(attr)
223
+ if value.nil?
224
+ is_nullable = self.class.openapi_nullable.include?(attr)
225
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
226
+ end
227
+
228
+ hash[param] = _to_hash(value)
229
+ end
230
+ hash
231
+ end
232
+
233
+ # Outputs non-array value in the form of hash
234
+ # For object, use to_hash. Otherwise, just return the value
235
+ # @param [Object] value Any valid value
236
+ # @return [Hash] Returns the value in the form of hash
237
+ def _to_hash(value)
238
+ if value.is_a?(Array)
239
+ value.compact.map { |v| _to_hash(v) }
240
+ elsif value.is_a?(Hash)
241
+ {}.tap do |hash|
242
+ value.each { |k, v| hash[k] = _to_hash(v) }
243
+ end
244
+ elsif value.respond_to? :to_hash
245
+ value.to_hash
246
+ else
247
+ value
248
+ end
249
+ end
250
+
251
+ end
252
+
253
+ end