datadog_api_client 1.0.0.beta.3 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (245) hide show
  1. checksums.yaml +4 -4
  2. data/.apigentools-info +4 -4
  3. data/.azure-pipelines/all.yml +0 -1
  4. data/.rubocop.yml +1 -1
  5. data/CHANGELOG.md +23 -0
  6. data/Gemfile +1 -1
  7. data/LICENSE-3rdparty.csv +0 -1
  8. data/check-examples.sh +7 -2
  9. data/data/v1/openapi.yaml +1963 -245
  10. data/data/v2/openapi.yaml +67 -13
  11. data/docs/v1/DashboardsAPI.md +10 -5
  12. data/docs/v1/DistributionWidgetDefinition.md +9 -3
  13. data/docs/v1/DistributionWidgetXAxis.md +24 -0
  14. data/docs/v1/DistributionWidgetYAxis.md +26 -0
  15. data/docs/v1/EventsAPI.md +7 -3
  16. data/docs/v1/GroupWidgetDefinition.md +8 -0
  17. data/docs/v1/ImageWidgetDefinition.md +11 -1
  18. data/docs/v1/LogsByRetention.md +22 -0
  19. data/docs/v1/LogsByRetentionMonthlyUsage.md +20 -0
  20. data/docs/v1/LogsByRetentionOrgUsage.md +18 -0
  21. data/docs/v1/LogsByRetentionOrgs.md +18 -0
  22. data/docs/v1/LogsRetentionAggSumUsage.md +24 -0
  23. data/docs/v1/LogsRetentionSumUsage.md +24 -0
  24. data/docs/v1/MonitorsAPI.md +1 -1
  25. data/docs/v1/NoteWidgetDefinition.md +5 -1
  26. data/docs/v1/NotebookAbsoluteTime.md +22 -0
  27. data/docs/v1/NotebookAuthor.md +34 -0
  28. data/docs/v1/NotebookCellCreateRequest.md +20 -0
  29. data/docs/v1/NotebookCellCreateRequestAttributes.md +57 -0
  30. data/docs/v1/NotebookCellResourceType.md +15 -0
  31. data/docs/v1/NotebookCellResponse.md +22 -0
  32. data/docs/v1/NotebookCellResponseAttributes.md +57 -0
  33. data/docs/v1/NotebookCellTime.md +49 -0
  34. data/docs/v1/NotebookCellUpdateRequest.md +22 -0
  35. data/docs/v1/NotebookCellUpdateRequestAttributes.md +57 -0
  36. data/docs/v1/NotebookCreateData.md +20 -0
  37. data/docs/v1/NotebookCreateDataAttributes.md +24 -0
  38. data/docs/v1/NotebookCreateRequest.md +18 -0
  39. data/docs/v1/NotebookDistributionCellAttributes.md +24 -0
  40. data/docs/v1/NotebookGlobalTime.md +49 -0
  41. data/docs/v1/NotebookGraphSize.md +15 -0
  42. data/docs/v1/NotebookHeatMapCellAttributes.md +24 -0
  43. data/docs/v1/NotebookLogStreamCellAttributes.md +22 -0
  44. data/docs/v1/NotebookMarkdownCellAttributes.md +18 -0
  45. data/docs/v1/NotebookMarkdownCellDefinition.md +21 -0
  46. data/docs/v1/NotebookMarkdownCellDefinitionType.md +15 -0
  47. data/docs/v1/NotebookRelativeTime.md +18 -0
  48. data/docs/v1/NotebookResourceType.md +15 -0
  49. data/docs/v1/NotebookResponse.md +18 -0
  50. data/docs/v1/NotebookResponseData.md +22 -0
  51. data/docs/v1/NotebookResponseDataAttributes.md +30 -0
  52. data/docs/v1/NotebookSplitBy.md +20 -0
  53. data/docs/v1/NotebookStatus.md +15 -0
  54. data/docs/v1/NotebookTimeseriesCellAttributes.md +24 -0
  55. data/docs/v1/NotebookToplistCellAttributes.md +24 -0
  56. data/docs/v1/NotebookUpdateCell.md +49 -0
  57. data/docs/v1/NotebookUpdateData.md +20 -0
  58. data/docs/v1/NotebookUpdateDataAttributes.md +24 -0
  59. data/docs/v1/NotebookUpdateRequest.md +18 -0
  60. data/docs/v1/NotebooksAPI.md +339 -0
  61. data/docs/v1/NotebooksResponse.md +20 -0
  62. data/docs/v1/NotebooksResponseMeta.md +18 -0
  63. data/docs/v1/NotebooksResponsePage.md +20 -0
  64. data/docs/v1/README.md +66 -9
  65. data/docs/v1/SLOListResponse.md +3 -1
  66. data/docs/v1/SLOListResponseMetadata.md +18 -0
  67. data/docs/v1/SLOListResponseMetadataPage.md +20 -0
  68. data/docs/v1/SLOResponse.md +1 -1
  69. data/docs/v1/SLOResponseData.md +44 -0
  70. data/docs/v1/ServiceLevelObjectivesAPI.md +8 -4
  71. data/docs/v1/SyntheticsAPI.md +28 -156
  72. data/docs/v1/SyntheticsAPIStep.md +4 -0
  73. data/docs/v1/SyntheticsBrowserTestConfig.md +2 -0
  74. data/docs/v1/SyntheticsTestConfig.md +1 -1
  75. data/docs/v1/SyntheticsTestOptions.md +1 -1
  76. data/docs/v1/SyntheticsTestRequest.md +6 -0
  77. data/docs/v1/UsageAttributionSupportedMetrics.md +15 -0
  78. data/docs/v1/UsageAttributionValues.md +8 -0
  79. data/docs/v1/UsageHostHour.md +3 -1
  80. data/docs/v1/UsageIoTHour.md +1 -1
  81. data/docs/v1/UsageLogsByRetentionHour.md +24 -0
  82. data/docs/v1/UsageLogsByRetentionResponse.md +18 -0
  83. data/docs/v1/UsageMeteringAPI.md +69 -2
  84. data/docs/v1/UsageSummaryDate.md +11 -9
  85. data/docs/v1/UsageSummaryDateOrg.md +3 -1
  86. data/docs/v1/UsageSummaryResponse.md +5 -1
  87. data/docs/v1/WidgetHorizontalAlign.md +15 -0
  88. data/docs/v1/WidgetLayout.md +2 -0
  89. data/docs/v1/WidgetMarker.md +1 -1
  90. data/docs/v1/WidgetVerticalAlign.md +15 -0
  91. data/docs/v2/IncidentServiceUpdateData.md +1 -1
  92. data/docs/v2/IncidentServicesAPI.md +1 -1
  93. data/docs/v2/IncidentTeamUpdateData.md +1 -1
  94. data/docs/v2/IncidentTeamsAPI.md +1 -1
  95. data/docs/v2/MetricsAPI.md +1 -11
  96. data/extract-code-blocks.sh +6 -2
  97. data/lib/datadog_api_client/v1.rb +54 -0
  98. data/lib/datadog_api_client/v1/api/dashboards_api.rb +3 -0
  99. data/lib/datadog_api_client/v1/api/events_api.rb +14 -4
  100. data/lib/datadog_api_client/v1/api/monitors_api.rb +2 -2
  101. data/lib/datadog_api_client/v1/api/notebooks_api.rb +418 -0
  102. data/lib/datadog_api_client/v1/api/service_level_objectives_api.rb +3 -0
  103. data/lib/datadog_api_client/v1/api/synthetics_api.rb +14 -170
  104. data/lib/datadog_api_client/v1/api/usage_metering_api.rb +79 -2
  105. data/lib/datadog_api_client/v1/models/distribution_widget_definition.rb +36 -6
  106. data/lib/datadog_api_client/v1/models/distribution_widget_x_axis.rb +259 -0
  107. data/lib/datadog_api_client/v1/models/distribution_widget_y_axis.rb +269 -0
  108. data/lib/datadog_api_client/v1/models/group_widget_definition.rb +42 -1
  109. data/lib/datadog_api_client/v1/models/image_widget_definition.rb +56 -4
  110. data/lib/datadog_api_client/v1/models/logs_by_retention.rb +243 -0
  111. data/lib/datadog_api_client/v1/models/logs_by_retention_monthly_usage.rb +235 -0
  112. data/lib/datadog_api_client/v1/models/logs_by_retention_org_usage.rb +225 -0
  113. data/lib/datadog_api_client/v1/models/logs_by_retention_orgs.rb +225 -0
  114. data/lib/datadog_api_client/v1/models/logs_retention_agg_sum_usage.rb +253 -0
  115. data/lib/datadog_api_client/v1/models/logs_retention_sum_usage.rb +253 -0
  116. data/lib/datadog_api_client/v1/models/note_widget_definition.rb +25 -4
  117. data/lib/datadog_api_client/v1/models/notebook_absolute_time.rb +253 -0
  118. data/lib/datadog_api_client/v1/models/notebook_author.rb +303 -0
  119. data/lib/datadog_api_client/v1/models/notebook_cell_create_request.rb +243 -0
  120. data/lib/datadog_api_client/v1/models/notebook_cell_create_request_attributes.rb +113 -0
  121. data/lib/datadog_api_client/v1/models/notebook_cell_resource_type.rb +39 -0
  122. data/lib/datadog_api_client/v1/models/notebook_cell_response.rb +258 -0
  123. data/lib/datadog_api_client/v1/models/notebook_cell_response_attributes.rb +113 -0
  124. data/lib/datadog_api_client/v1/models/notebook_cell_time.rb +109 -0
  125. data/lib/datadog_api_client/v1/models/notebook_cell_update_request.rb +258 -0
  126. data/lib/datadog_api_client/v1/models/notebook_cell_update_request_attributes.rb +113 -0
  127. data/lib/datadog_api_client/v1/models/notebook_create_data.rb +243 -0
  128. data/lib/datadog_api_client/v1/models/notebook_create_data_attributes.rb +298 -0
  129. data/lib/datadog_api_client/v1/models/notebook_create_request.rb +227 -0
  130. data/lib/datadog_api_client/v1/models/notebook_distribution_cell_attributes.rb +255 -0
  131. data/lib/datadog_api_client/v1/models/notebook_global_time.rb +109 -0
  132. data/lib/datadog_api_client/v1/models/notebook_graph_size.rb +43 -0
  133. data/lib/datadog_api_client/v1/models/notebook_heat_map_cell_attributes.rb +255 -0
  134. data/lib/datadog_api_client/v1/models/notebook_log_stream_cell_attributes.rb +246 -0
  135. data/lib/datadog_api_client/v1/models/notebook_markdown_cell_attributes.rb +227 -0
  136. data/lib/datadog_api_client/v1/models/notebook_markdown_cell_definition.rb +244 -0
  137. data/lib/datadog_api_client/v1/models/notebook_markdown_cell_definition_type.rb +39 -0
  138. data/lib/datadog_api_client/v1/models/notebook_relative_time.rb +227 -0
  139. data/lib/datadog_api_client/v1/models/notebook_resource_type.rb +39 -0
  140. data/lib/datadog_api_client/v1/models/notebook_response.rb +222 -0
  141. data/lib/datadog_api_client/v1/models/notebook_response_data.rb +258 -0
  142. data/lib/datadog_api_client/v1/models/notebook_response_data_attributes.rb +327 -0
  143. data/lib/datadog_api_client/v1/models/notebook_split_by.rb +247 -0
  144. data/lib/datadog_api_client/v1/models/notebook_status.rb +39 -0
  145. data/lib/datadog_api_client/v1/models/notebook_timeseries_cell_attributes.rb +255 -0
  146. data/lib/datadog_api_client/v1/models/notebook_toplist_cell_attributes.rb +255 -0
  147. data/lib/datadog_api_client/v1/models/notebook_update_cell.rb +109 -0
  148. data/lib/datadog_api_client/v1/models/notebook_update_data.rb +243 -0
  149. data/lib/datadog_api_client/v1/models/notebook_update_data_attributes.rb +298 -0
  150. data/lib/datadog_api_client/v1/models/notebook_update_request.rb +227 -0
  151. data/lib/datadog_api_client/v1/models/notebooks_response.rb +234 -0
  152. data/lib/datadog_api_client/v1/models/notebooks_response_meta.rb +222 -0
  153. data/lib/datadog_api_client/v1/models/notebooks_response_page.rb +233 -0
  154. data/lib/datadog_api_client/v1/models/slo_list_response.rb +13 -4
  155. data/lib/datadog_api_client/v1/models/slo_list_response_metadata.rb +222 -0
  156. data/lib/datadog_api_client/v1/models/slo_list_response_metadata_page.rb +233 -0
  157. data/lib/datadog_api_client/v1/models/slo_response.rb +1 -1
  158. data/lib/datadog_api_client/v1/models/slo_response_data.rb +363 -0
  159. data/lib/datadog_api_client/v1/models/synthetics_api_step.rb +21 -1
  160. data/lib/datadog_api_client/v1/models/synthetics_assertion_type.rb +4 -0
  161. data/lib/datadog_api_client/v1/models/synthetics_browser_test_config.rb +11 -1
  162. data/lib/datadog_api_client/v1/models/synthetics_test_config.rb +0 -5
  163. data/lib/datadog_api_client/v1/models/synthetics_test_details_sub_type.rb +1 -0
  164. data/lib/datadog_api_client/v1/models/synthetics_test_options.rb +1 -1
  165. data/lib/datadog_api_client/v1/models/synthetics_test_request.rb +79 -1
  166. data/lib/datadog_api_client/v1/models/synthetics_tick_interval.rb +1 -0
  167. data/lib/datadog_api_client/v1/models/usage_attribution_supported_metrics.rb +67 -0
  168. data/lib/datadog_api_client/v1/models/usage_attribution_values.rb +41 -1
  169. data/lib/datadog_api_client/v1/models/usage_host_hour.rb +14 -4
  170. data/lib/datadog_api_client/v1/models/usage_io_t_hour.rb +1 -1
  171. data/lib/datadog_api_client/v1/models/usage_logs_by_retention_hour.rb +253 -0
  172. data/lib/datadog_api_client/v1/models/usage_logs_by_retention_response.rb +225 -0
  173. data/lib/datadog_api_client/v1/models/usage_summary_date.rb +38 -28
  174. data/lib/datadog_api_client/v1/models/usage_summary_date_org.rb +14 -4
  175. data/lib/datadog_api_client/v1/models/usage_summary_response.rb +23 -4
  176. data/lib/datadog_api_client/v1/models/widget.rb +1 -1
  177. data/lib/datadog_api_client/v1/models/widget_horizontal_align.rb +41 -0
  178. data/lib/datadog_api_client/v1/models/widget_image_sizing.rb +5 -0
  179. data/lib/datadog_api_client/v1/models/widget_layout.rb +12 -2
  180. data/lib/datadog_api_client/v1/models/widget_margin.rb +3 -0
  181. data/lib/datadog_api_client/v1/models/widget_marker.rb +1 -1
  182. data/lib/datadog_api_client/v1/models/widget_vertical_align.rb +41 -0
  183. data/lib/datadog_api_client/v2/api/metrics_api.rb +2 -2
  184. data/lib/datadog_api_client/v2/configuration.rb +0 -2
  185. data/lib/datadog_api_client/v2/models/incident_service_update_data.rb +0 -5
  186. data/lib/datadog_api_client/v2/models/incident_team_update_data.rb +0 -5
  187. data/lib/datadog_api_client/v2/models/metric_tag_configuration_metric_types.rb +1 -0
  188. data/lib/datadog_api_client/v2/models/security_monitoring_rule_detection_method.rb +1 -0
  189. data/lib/datadog_api_client/version.rb +1 -1
  190. data/run-tests.sh +0 -6
  191. data/spec/v1/api/notebooks_api_spec.rb +106 -0
  192. data/spec/v1/models/distribution_widget_x_axis_spec.rb +55 -0
  193. data/spec/v1/models/distribution_widget_y_axis_spec.rb +61 -0
  194. data/spec/v1/models/logs_by_retention_monthly_usage_spec.rb +43 -0
  195. data/spec/v1/models/logs_by_retention_org_usage_spec.rb +37 -0
  196. data/spec/v1/models/logs_by_retention_orgs_spec.rb +37 -0
  197. data/spec/v1/models/logs_by_retention_spec.rb +49 -0
  198. data/spec/v1/models/logs_retention_agg_sum_usage_spec.rb +55 -0
  199. data/spec/v1/models/logs_retention_sum_usage_spec.rb +55 -0
  200. data/spec/v1/models/notebook_absolute_time_spec.rb +49 -0
  201. data/spec/v1/models/notebook_author_spec.rb +85 -0
  202. data/spec/v1/models/notebook_cell_create_request_attributes_spec.rb +34 -0
  203. data/spec/v1/models/notebook_cell_create_request_spec.rb +43 -0
  204. data/spec/v1/models/notebook_cell_resource_type_spec.rb +31 -0
  205. data/spec/v1/models/notebook_cell_response_attributes_spec.rb +34 -0
  206. data/spec/v1/models/notebook_cell_response_spec.rb +49 -0
  207. data/spec/v1/models/notebook_cell_time_spec.rb +34 -0
  208. data/spec/v1/models/notebook_cell_update_request_attributes_spec.rb +34 -0
  209. data/spec/v1/models/notebook_cell_update_request_spec.rb +49 -0
  210. data/spec/v1/models/notebook_create_data_attributes_spec.rb +55 -0
  211. data/spec/v1/models/notebook_create_data_spec.rb +43 -0
  212. data/spec/v1/models/notebook_create_request_spec.rb +37 -0
  213. data/spec/v1/models/notebook_distribution_cell_attributes_spec.rb +55 -0
  214. data/spec/v1/models/notebook_global_time_spec.rb +34 -0
  215. data/spec/v1/models/notebook_graph_size_spec.rb +31 -0
  216. data/spec/v1/models/notebook_heat_map_cell_attributes_spec.rb +55 -0
  217. data/spec/v1/models/notebook_log_stream_cell_attributes_spec.rb +49 -0
  218. data/spec/v1/models/notebook_markdown_cell_attributes_spec.rb +37 -0
  219. data/spec/v1/models/notebook_markdown_cell_definition_spec.rb +43 -0
  220. data/spec/v1/models/notebook_markdown_cell_definition_type_spec.rb +31 -0
  221. data/spec/v1/models/notebook_relative_time_spec.rb +37 -0
  222. data/spec/v1/models/notebook_resource_type_spec.rb +31 -0
  223. data/spec/v1/models/notebook_response_data_attributes_spec.rb +73 -0
  224. data/spec/v1/models/notebook_response_data_spec.rb +49 -0
  225. data/spec/v1/models/notebook_response_spec.rb +37 -0
  226. data/spec/v1/models/notebook_split_by_spec.rb +43 -0
  227. data/spec/v1/models/notebook_status_spec.rb +31 -0
  228. data/spec/v1/models/notebook_timeseries_cell_attributes_spec.rb +55 -0
  229. data/spec/v1/models/notebook_toplist_cell_attributes_spec.rb +55 -0
  230. data/spec/v1/models/notebook_update_cell_spec.rb +34 -0
  231. data/spec/v1/models/notebook_update_data_attributes_spec.rb +55 -0
  232. data/spec/v1/models/notebook_update_data_spec.rb +43 -0
  233. data/spec/v1/models/notebook_update_request_spec.rb +37 -0
  234. data/spec/v1/models/notebooks_response_meta_spec.rb +37 -0
  235. data/spec/v1/models/notebooks_response_page_spec.rb +43 -0
  236. data/spec/v1/models/notebooks_response_spec.rb +43 -0
  237. data/spec/v1/models/slo_list_response_metadata_page_spec.rb +43 -0
  238. data/spec/v1/models/slo_list_response_metadata_spec.rb +37 -0
  239. data/spec/v1/models/slo_response_data_spec.rb +115 -0
  240. data/spec/v1/models/usage_attribution_supported_metrics_spec.rb +31 -0
  241. data/spec/v1/models/usage_logs_by_retention_hour_spec.rb +55 -0
  242. data/spec/v1/models/usage_logs_by_retention_response_spec.rb +37 -0
  243. data/spec/v1/models/widget_horizontal_align_spec.rb +31 -0
  244. data/spec/v1/models/widget_vertical_align_spec.rb +31 -0
  245. metadata +220 -4
@@ -0,0 +1,233 @@
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
+ # Pagination metadata returned by the API.
21
+ class NotebooksResponsePage
22
+ # The total number of notebooks that would be returned if the request was not filtered by `start` and `count` parameters.
23
+ attr_accessor :total_count
24
+
25
+ # The total number of notebooks returned.
26
+ attr_accessor :total_filtered_count
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'total_count' => :'total_count',
32
+ :'total_filtered_count' => :'total_filtered_count'
33
+ }
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'total_count' => :'Integer',
45
+ :'total_filtered_count' => :'Integer'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ ])
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::NotebooksResponsePage` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!self.class.attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::NotebooksResponsePage`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'total_count')
71
+ self.total_count = attributes[:'total_count']
72
+ end
73
+
74
+ if attributes.key?(:'total_filtered_count')
75
+ self.total_filtered_count = attributes[:'total_filtered_count']
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ invalid_properties = Array.new
83
+ invalid_properties
84
+ end
85
+
86
+ # Check to see if the all the properties in the model are valid
87
+ # @return true if the model is valid
88
+ def valid?
89
+ true
90
+ end
91
+
92
+ # Checks equality by comparing each attribute.
93
+ # @param [Object] Object to be compared
94
+ def ==(o)
95
+ return true if self.equal?(o)
96
+ self.class == o.class &&
97
+ total_count == o.total_count &&
98
+ total_filtered_count == o.total_filtered_count
99
+ end
100
+
101
+ # @see the `==` method
102
+ # @param [Object] Object to be compared
103
+ def eql?(o)
104
+ self == o
105
+ end
106
+
107
+ # Calculates hash code according to all attributes.
108
+ # @return [Integer] Hash code
109
+ def hash
110
+ [total_count, total_filtered_count].hash
111
+ end
112
+
113
+ # Builds the object from hash
114
+ # @param [Hash] attributes Model attributes in the form of hash
115
+ # @return [Object] Returns the model itself
116
+ def self.build_from_hash(attributes)
117
+ new.build_from_hash(attributes)
118
+ end
119
+
120
+ # Builds the object from hash
121
+ # @param [Hash] attributes Model attributes in the form of hash
122
+ # @return [Object] Returns the model itself
123
+ def build_from_hash(attributes)
124
+ return nil unless attributes.is_a?(Hash)
125
+ self.class.openapi_types.each_pair do |key, type|
126
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
127
+ self.send("#{key}=", nil)
128
+ elsif type =~ /\AArray<(.*)>/i
129
+ # check to ensure the input is an array given that the attribute
130
+ # is documented as an array but the input is not
131
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
132
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
133
+ end
134
+ elsif !attributes[self.class.attribute_map[key]].nil?
135
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
136
+ end
137
+ end
138
+
139
+ self
140
+ end
141
+
142
+ # Deserializes the data based on type
143
+ # @param string type Data type
144
+ # @param string value Value to be deserialized
145
+ # @return [Object] Deserialized data
146
+ def _deserialize(type, value)
147
+ case type.to_sym
148
+ when :Time
149
+ Time.parse(value)
150
+ when :Date
151
+ Date.parse(value)
152
+ when :String
153
+ value.to_s
154
+ when :Integer
155
+ value.to_i
156
+ when :Float
157
+ value.to_f
158
+ when :Boolean
159
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
160
+ true
161
+ else
162
+ false
163
+ end
164
+ when :Object
165
+ # generic object (usually a Hash), return directly
166
+ value
167
+ when /\AArray<(?<inner_type>.+)>\z/
168
+ inner_type = Regexp.last_match[:inner_type]
169
+ value.map { |v| _deserialize(inner_type, v) }
170
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
171
+ k_type = Regexp.last_match[:k_type]
172
+ v_type = Regexp.last_match[:v_type]
173
+ {}.tap do |hash|
174
+ value.each do |k, v|
175
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
176
+ end
177
+ end
178
+ else # model
179
+ # models (e.g. Pet) or oneOf
180
+ klass = DatadogAPIClient::V1.const_get(type)
181
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
182
+ end
183
+ end
184
+
185
+ # Returns the string representation of the object
186
+ # @return [String] String presentation of the object
187
+ def to_s
188
+ to_hash.to_s
189
+ end
190
+
191
+ # to_body is an alias to to_hash (backward compatibility)
192
+ # @return [Hash] Returns the object in the form of hash
193
+ def to_body
194
+ to_hash
195
+ end
196
+
197
+ # Returns the object in the form of hash
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_hash
200
+ hash = {}
201
+ self.class.attribute_map.each_pair do |attr, param|
202
+ value = self.send(attr)
203
+ if value.nil?
204
+ is_nullable = self.class.openapi_nullable.include?(attr)
205
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
206
+ end
207
+
208
+ hash[param] = _to_hash(value)
209
+ end
210
+ hash
211
+ end
212
+
213
+ # Outputs non-array value in the form of hash
214
+ # For object, use to_hash. Otherwise, just return the value
215
+ # @param [Object] value Any valid value
216
+ # @return [Hash] Returns the value in the form of hash
217
+ def _to_hash(value)
218
+ if value.is_a?(Array)
219
+ value.compact.map { |v| _to_hash(v) }
220
+ elsif value.is_a?(Hash)
221
+ {}.tap do |hash|
222
+ value.each { |k, v| hash[k] = _to_hash(v) }
223
+ end
224
+ elsif value.respond_to? :to_hash
225
+ value.to_hash
226
+ else
227
+ value
228
+ end
229
+ end
230
+
231
+ end
232
+
233
+ end
@@ -25,11 +25,14 @@ module DatadogAPIClient::V1
25
25
  # An array of error messages. Each endpoint documents how/whether this field is used.
26
26
  attr_accessor :errors
27
27
 
28
+ attr_accessor :metadata
29
+
28
30
  # Attribute mapping from ruby-style variable name to JSON key.
29
31
  def self.attribute_map
30
32
  {
31
33
  :'data' => :'data',
32
- :'errors' => :'errors'
34
+ :'errors' => :'errors',
35
+ :'metadata' => :'metadata'
33
36
  }
34
37
  end
35
38
 
@@ -42,7 +45,8 @@ module DatadogAPIClient::V1
42
45
  def self.openapi_types
43
46
  {
44
47
  :'data' => :'Array<ServiceLevelObjective>',
45
- :'errors' => :'Array<String>'
48
+ :'errors' => :'Array<String>',
49
+ :'metadata' => :'SLOListResponseMetadata'
46
50
  }
47
51
  end
48
52
 
@@ -78,6 +82,10 @@ module DatadogAPIClient::V1
78
82
  self.errors = value
79
83
  end
80
84
  end
85
+
86
+ if attributes.key?(:'metadata')
87
+ self.metadata = attributes[:'metadata']
88
+ end
81
89
  end
82
90
 
83
91
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -99,7 +107,8 @@ module DatadogAPIClient::V1
99
107
  return true if self.equal?(o)
100
108
  self.class == o.class &&
101
109
  data == o.data &&
102
- errors == o.errors
110
+ errors == o.errors &&
111
+ metadata == o.metadata
103
112
  end
104
113
 
105
114
  # @see the `==` method
@@ -111,7 +120,7 @@ module DatadogAPIClient::V1
111
120
  # Calculates hash code according to all attributes.
112
121
  # @return [Integer] Hash code
113
122
  def hash
114
- [data, errors].hash
123
+ [data, errors, metadata].hash
115
124
  end
116
125
 
117
126
  # Builds the object from hash
@@ -0,0 +1,222 @@
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 metadata object containing additional information about the list of SLOs.
21
+ class SLOListResponseMetadata
22
+ attr_accessor :page
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'page' => :'page'
28
+ }
29
+ end
30
+
31
+ # Returns all the JSON keys this model knows about
32
+ def self.acceptable_attributes
33
+ attribute_map.values
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.openapi_types
38
+ {
39
+ :'page' => :'SLOListResponseMetadataPage'
40
+ }
41
+ end
42
+
43
+ # List of attributes with nullable: true
44
+ def self.openapi_nullable
45
+ Set.new([
46
+ ])
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ if (!attributes.is_a?(Hash))
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::SLOListResponseMetadata` initialize method"
54
+ end
55
+
56
+ # check to see if the attribute exists and convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h|
58
+ if (!self.class.attribute_map.key?(k.to_sym))
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::SLOListResponseMetadata`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ end
61
+ h[k.to_sym] = v
62
+ }
63
+
64
+ if attributes.key?(:'page')
65
+ self.page = attributes[:'page']
66
+ end
67
+ end
68
+
69
+ # Show invalid properties with the reasons. Usually used together with valid?
70
+ # @return Array for valid properties with the reasons
71
+ def list_invalid_properties
72
+ invalid_properties = Array.new
73
+ invalid_properties
74
+ end
75
+
76
+ # Check to see if the all the properties in the model are valid
77
+ # @return true if the model is valid
78
+ def valid?
79
+ true
80
+ end
81
+
82
+ # Checks equality by comparing each attribute.
83
+ # @param [Object] Object to be compared
84
+ def ==(o)
85
+ return true if self.equal?(o)
86
+ self.class == o.class &&
87
+ page == o.page
88
+ end
89
+
90
+ # @see the `==` method
91
+ # @param [Object] Object to be compared
92
+ def eql?(o)
93
+ self == o
94
+ end
95
+
96
+ # Calculates hash code according to all attributes.
97
+ # @return [Integer] Hash code
98
+ def hash
99
+ [page].hash
100
+ end
101
+
102
+ # Builds the object from hash
103
+ # @param [Hash] attributes Model attributes in the form of hash
104
+ # @return [Object] Returns the model itself
105
+ def self.build_from_hash(attributes)
106
+ new.build_from_hash(attributes)
107
+ end
108
+
109
+ # Builds the object from hash
110
+ # @param [Hash] attributes Model attributes in the form of hash
111
+ # @return [Object] Returns the model itself
112
+ def build_from_hash(attributes)
113
+ return nil unless attributes.is_a?(Hash)
114
+ self.class.openapi_types.each_pair do |key, type|
115
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
116
+ self.send("#{key}=", nil)
117
+ elsif type =~ /\AArray<(.*)>/i
118
+ # check to ensure the input is an array given that the attribute
119
+ # is documented as an array but the input is not
120
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
121
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
122
+ end
123
+ elsif !attributes[self.class.attribute_map[key]].nil?
124
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
125
+ end
126
+ end
127
+
128
+ self
129
+ end
130
+
131
+ # Deserializes the data based on type
132
+ # @param string type Data type
133
+ # @param string value Value to be deserialized
134
+ # @return [Object] Deserialized data
135
+ def _deserialize(type, value)
136
+ case type.to_sym
137
+ when :Time
138
+ Time.parse(value)
139
+ when :Date
140
+ Date.parse(value)
141
+ when :String
142
+ value.to_s
143
+ when :Integer
144
+ value.to_i
145
+ when :Float
146
+ value.to_f
147
+ when :Boolean
148
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
149
+ true
150
+ else
151
+ false
152
+ end
153
+ when :Object
154
+ # generic object (usually a Hash), return directly
155
+ value
156
+ when /\AArray<(?<inner_type>.+)>\z/
157
+ inner_type = Regexp.last_match[:inner_type]
158
+ value.map { |v| _deserialize(inner_type, v) }
159
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
160
+ k_type = Regexp.last_match[:k_type]
161
+ v_type = Regexp.last_match[:v_type]
162
+ {}.tap do |hash|
163
+ value.each do |k, v|
164
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
165
+ end
166
+ end
167
+ else # model
168
+ # models (e.g. Pet) or oneOf
169
+ klass = DatadogAPIClient::V1.const_get(type)
170
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
171
+ end
172
+ end
173
+
174
+ # Returns the string representation of the object
175
+ # @return [String] String presentation of the object
176
+ def to_s
177
+ to_hash.to_s
178
+ end
179
+
180
+ # to_body is an alias to to_hash (backward compatibility)
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_body
183
+ to_hash
184
+ end
185
+
186
+ # Returns the object in the form of hash
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_hash
189
+ hash = {}
190
+ self.class.attribute_map.each_pair do |attr, param|
191
+ value = self.send(attr)
192
+ if value.nil?
193
+ is_nullable = self.class.openapi_nullable.include?(attr)
194
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
195
+ end
196
+
197
+ hash[param] = _to_hash(value)
198
+ end
199
+ hash
200
+ end
201
+
202
+ # Outputs non-array value in the form of hash
203
+ # For object, use to_hash. Otherwise, just return the value
204
+ # @param [Object] value Any valid value
205
+ # @return [Hash] Returns the value in the form of hash
206
+ def _to_hash(value)
207
+ if value.is_a?(Array)
208
+ value.compact.map { |v| _to_hash(v) }
209
+ elsif value.is_a?(Hash)
210
+ {}.tap do |hash|
211
+ value.each { |k, v| hash[k] = _to_hash(v) }
212
+ end
213
+ elsif value.respond_to? :to_hash
214
+ value.to_hash
215
+ else
216
+ value
217
+ end
218
+ end
219
+
220
+ end
221
+
222
+ end