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,259 @@
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
+ # X Axis controls for the distribution widget.
21
+ class DistributionWidgetXAxis
22
+ # True includes zero.
23
+ attr_accessor :include_zero
24
+
25
+ # Specifies maximum value to show on the x-axis. It takes a number, percentile (p90 === 90th percentile), or auto for default behavior.
26
+ attr_accessor :max
27
+
28
+ # Specifies minimum value to show on the x-axis. It takes a number, percentile (p90 === 90th percentile), or auto for default behavior.
29
+ attr_accessor :min
30
+
31
+ # Specifies the scale type. Possible values are `linear`.
32
+ attr_accessor :scale
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'include_zero' => :'include_zero',
38
+ :'max' => :'max',
39
+ :'min' => :'min',
40
+ :'scale' => :'scale'
41
+ }
42
+ end
43
+
44
+ # Returns all the JSON keys this model knows about
45
+ def self.acceptable_attributes
46
+ attribute_map.values
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ def self.openapi_types
51
+ {
52
+ :'include_zero' => :'Boolean',
53
+ :'max' => :'String',
54
+ :'min' => :'String',
55
+ :'scale' => :'String'
56
+ }
57
+ end
58
+
59
+ # List of attributes with nullable: true
60
+ def self.openapi_nullable
61
+ Set.new([
62
+ ])
63
+ end
64
+
65
+ # Initializes the object
66
+ # @param [Hash] attributes Model attributes in the form of hash
67
+ def initialize(attributes = {})
68
+ if (!attributes.is_a?(Hash))
69
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::DistributionWidgetXAxis` initialize method"
70
+ end
71
+
72
+ # check to see if the attribute exists and convert string to symbol for hash key
73
+ attributes = attributes.each_with_object({}) { |(k, v), h|
74
+ if (!self.class.attribute_map.key?(k.to_sym))
75
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::DistributionWidgetXAxis`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
76
+ end
77
+ h[k.to_sym] = v
78
+ }
79
+
80
+ if attributes.key?(:'include_zero')
81
+ self.include_zero = attributes[:'include_zero']
82
+ end
83
+
84
+ if attributes.key?(:'max')
85
+ self.max = attributes[:'max']
86
+ else
87
+ self.max = 'auto'
88
+ end
89
+
90
+ if attributes.key?(:'min')
91
+ self.min = attributes[:'min']
92
+ else
93
+ self.min = 'auto'
94
+ end
95
+
96
+ if attributes.key?(:'scale')
97
+ self.scale = attributes[:'scale']
98
+ else
99
+ self.scale = 'linear'
100
+ end
101
+ end
102
+
103
+ # Show invalid properties with the reasons. Usually used together with valid?
104
+ # @return Array for valid properties with the reasons
105
+ def list_invalid_properties
106
+ invalid_properties = Array.new
107
+ invalid_properties
108
+ end
109
+
110
+ # Check to see if the all the properties in the model are valid
111
+ # @return true if the model is valid
112
+ def valid?
113
+ true
114
+ end
115
+
116
+ # Checks equality by comparing each attribute.
117
+ # @param [Object] Object to be compared
118
+ def ==(o)
119
+ return true if self.equal?(o)
120
+ self.class == o.class &&
121
+ include_zero == o.include_zero &&
122
+ max == o.max &&
123
+ min == o.min &&
124
+ scale == o.scale
125
+ end
126
+
127
+ # @see the `==` method
128
+ # @param [Object] Object to be compared
129
+ def eql?(o)
130
+ self == o
131
+ end
132
+
133
+ # Calculates hash code according to all attributes.
134
+ # @return [Integer] Hash code
135
+ def hash
136
+ [include_zero, max, min, scale].hash
137
+ end
138
+
139
+ # Builds the object from hash
140
+ # @param [Hash] attributes Model attributes in the form of hash
141
+ # @return [Object] Returns the model itself
142
+ def self.build_from_hash(attributes)
143
+ new.build_from_hash(attributes)
144
+ end
145
+
146
+ # Builds the object from hash
147
+ # @param [Hash] attributes Model attributes in the form of hash
148
+ # @return [Object] Returns the model itself
149
+ def build_from_hash(attributes)
150
+ return nil unless attributes.is_a?(Hash)
151
+ self.class.openapi_types.each_pair do |key, type|
152
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
153
+ self.send("#{key}=", nil)
154
+ elsif type =~ /\AArray<(.*)>/i
155
+ # check to ensure the input is an array given that the attribute
156
+ # is documented as an array but the input is not
157
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
158
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
159
+ end
160
+ elsif !attributes[self.class.attribute_map[key]].nil?
161
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
162
+ end
163
+ end
164
+
165
+ self
166
+ end
167
+
168
+ # Deserializes the data based on type
169
+ # @param string type Data type
170
+ # @param string value Value to be deserialized
171
+ # @return [Object] Deserialized data
172
+ def _deserialize(type, value)
173
+ case type.to_sym
174
+ when :Time
175
+ Time.parse(value)
176
+ when :Date
177
+ Date.parse(value)
178
+ when :String
179
+ value.to_s
180
+ when :Integer
181
+ value.to_i
182
+ when :Float
183
+ value.to_f
184
+ when :Boolean
185
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
186
+ true
187
+ else
188
+ false
189
+ end
190
+ when :Object
191
+ # generic object (usually a Hash), return directly
192
+ value
193
+ when /\AArray<(?<inner_type>.+)>\z/
194
+ inner_type = Regexp.last_match[:inner_type]
195
+ value.map { |v| _deserialize(inner_type, v) }
196
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
197
+ k_type = Regexp.last_match[:k_type]
198
+ v_type = Regexp.last_match[:v_type]
199
+ {}.tap do |hash|
200
+ value.each do |k, v|
201
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
202
+ end
203
+ end
204
+ else # model
205
+ # models (e.g. Pet) or oneOf
206
+ klass = DatadogAPIClient::V1.const_get(type)
207
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
208
+ end
209
+ end
210
+
211
+ # Returns the string representation of the object
212
+ # @return [String] String presentation of the object
213
+ def to_s
214
+ to_hash.to_s
215
+ end
216
+
217
+ # to_body is an alias to to_hash (backward compatibility)
218
+ # @return [Hash] Returns the object in the form of hash
219
+ def to_body
220
+ to_hash
221
+ end
222
+
223
+ # Returns the object in the form of hash
224
+ # @return [Hash] Returns the object in the form of hash
225
+ def to_hash
226
+ hash = {}
227
+ self.class.attribute_map.each_pair do |attr, param|
228
+ value = self.send(attr)
229
+ if value.nil?
230
+ is_nullable = self.class.openapi_nullable.include?(attr)
231
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
232
+ end
233
+
234
+ hash[param] = _to_hash(value)
235
+ end
236
+ hash
237
+ end
238
+
239
+ # Outputs non-array value in the form of hash
240
+ # For object, use to_hash. Otherwise, just return the value
241
+ # @param [Object] value Any valid value
242
+ # @return [Hash] Returns the value in the form of hash
243
+ def _to_hash(value)
244
+ if value.is_a?(Array)
245
+ value.compact.map { |v| _to_hash(v) }
246
+ elsif value.is_a?(Hash)
247
+ {}.tap do |hash|
248
+ value.each { |k, v| hash[k] = _to_hash(v) }
249
+ end
250
+ elsif value.respond_to? :to_hash
251
+ value.to_hash
252
+ else
253
+ value
254
+ end
255
+ end
256
+
257
+ end
258
+
259
+ end
@@ -0,0 +1,269 @@
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
+ # Y Axis controls for the distribution widget.
21
+ class DistributionWidgetYAxis
22
+ # True includes zero.
23
+ attr_accessor :include_zero
24
+
25
+ # The label of the axis to display on the graph.
26
+ attr_accessor :label
27
+
28
+ # Specifies the maximum value to show on the y-axis. It takes a number, or auto for default behavior.
29
+ attr_accessor :max
30
+
31
+ # Specifies minimum value to show on the y-axis. It takes a number, or auto for default behavior.
32
+ attr_accessor :min
33
+
34
+ # Specifies the scale type. Possible values are `linear` or `log`.
35
+ attr_accessor :scale
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'include_zero' => :'include_zero',
41
+ :'label' => :'label',
42
+ :'max' => :'max',
43
+ :'min' => :'min',
44
+ :'scale' => :'scale'
45
+ }
46
+ end
47
+
48
+ # Returns all the JSON keys this model knows about
49
+ def self.acceptable_attributes
50
+ attribute_map.values
51
+ end
52
+
53
+ # Attribute type mapping.
54
+ def self.openapi_types
55
+ {
56
+ :'include_zero' => :'Boolean',
57
+ :'label' => :'String',
58
+ :'max' => :'String',
59
+ :'min' => :'String',
60
+ :'scale' => :'String'
61
+ }
62
+ end
63
+
64
+ # List of attributes with nullable: true
65
+ def self.openapi_nullable
66
+ Set.new([
67
+ ])
68
+ end
69
+
70
+ # Initializes the object
71
+ # @param [Hash] attributes Model attributes in the form of hash
72
+ def initialize(attributes = {})
73
+ if (!attributes.is_a?(Hash))
74
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::DistributionWidgetYAxis` initialize method"
75
+ end
76
+
77
+ # check to see if the attribute exists and convert string to symbol for hash key
78
+ attributes = attributes.each_with_object({}) { |(k, v), h|
79
+ if (!self.class.attribute_map.key?(k.to_sym))
80
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::DistributionWidgetYAxis`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
81
+ end
82
+ h[k.to_sym] = v
83
+ }
84
+
85
+ if attributes.key?(:'include_zero')
86
+ self.include_zero = attributes[:'include_zero']
87
+ end
88
+
89
+ if attributes.key?(:'label')
90
+ self.label = attributes[:'label']
91
+ end
92
+
93
+ if attributes.key?(:'max')
94
+ self.max = attributes[:'max']
95
+ else
96
+ self.max = 'auto'
97
+ end
98
+
99
+ if attributes.key?(:'min')
100
+ self.min = attributes[:'min']
101
+ else
102
+ self.min = 'auto'
103
+ end
104
+
105
+ if attributes.key?(:'scale')
106
+ self.scale = attributes[:'scale']
107
+ else
108
+ self.scale = 'linear'
109
+ end
110
+ end
111
+
112
+ # Show invalid properties with the reasons. Usually used together with valid?
113
+ # @return Array for valid properties with the reasons
114
+ def list_invalid_properties
115
+ invalid_properties = Array.new
116
+ invalid_properties
117
+ end
118
+
119
+ # Check to see if the all the properties in the model are valid
120
+ # @return true if the model is valid
121
+ def valid?
122
+ true
123
+ end
124
+
125
+ # Checks equality by comparing each attribute.
126
+ # @param [Object] Object to be compared
127
+ def ==(o)
128
+ return true if self.equal?(o)
129
+ self.class == o.class &&
130
+ include_zero == o.include_zero &&
131
+ label == o.label &&
132
+ max == o.max &&
133
+ min == o.min &&
134
+ scale == o.scale
135
+ end
136
+
137
+ # @see the `==` method
138
+ # @param [Object] Object to be compared
139
+ def eql?(o)
140
+ self == o
141
+ end
142
+
143
+ # Calculates hash code according to all attributes.
144
+ # @return [Integer] Hash code
145
+ def hash
146
+ [include_zero, label, max, min, scale].hash
147
+ end
148
+
149
+ # Builds the object from hash
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ # @return [Object] Returns the model itself
152
+ def self.build_from_hash(attributes)
153
+ new.build_from_hash(attributes)
154
+ end
155
+
156
+ # Builds the object from hash
157
+ # @param [Hash] attributes Model attributes in the form of hash
158
+ # @return [Object] Returns the model itself
159
+ def build_from_hash(attributes)
160
+ return nil unless attributes.is_a?(Hash)
161
+ self.class.openapi_types.each_pair do |key, type|
162
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
163
+ self.send("#{key}=", nil)
164
+ elsif type =~ /\AArray<(.*)>/i
165
+ # check to ensure the input is an array given that the attribute
166
+ # is documented as an array but the input is not
167
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
168
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
169
+ end
170
+ elsif !attributes[self.class.attribute_map[key]].nil?
171
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
172
+ end
173
+ end
174
+
175
+ self
176
+ end
177
+
178
+ # Deserializes the data based on type
179
+ # @param string type Data type
180
+ # @param string value Value to be deserialized
181
+ # @return [Object] Deserialized data
182
+ def _deserialize(type, value)
183
+ case type.to_sym
184
+ when :Time
185
+ Time.parse(value)
186
+ when :Date
187
+ Date.parse(value)
188
+ when :String
189
+ value.to_s
190
+ when :Integer
191
+ value.to_i
192
+ when :Float
193
+ value.to_f
194
+ when :Boolean
195
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
196
+ true
197
+ else
198
+ false
199
+ end
200
+ when :Object
201
+ # generic object (usually a Hash), return directly
202
+ value
203
+ when /\AArray<(?<inner_type>.+)>\z/
204
+ inner_type = Regexp.last_match[:inner_type]
205
+ value.map { |v| _deserialize(inner_type, v) }
206
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
207
+ k_type = Regexp.last_match[:k_type]
208
+ v_type = Regexp.last_match[:v_type]
209
+ {}.tap do |hash|
210
+ value.each do |k, v|
211
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
212
+ end
213
+ end
214
+ else # model
215
+ # models (e.g. Pet) or oneOf
216
+ klass = DatadogAPIClient::V1.const_get(type)
217
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
218
+ end
219
+ end
220
+
221
+ # Returns the string representation of the object
222
+ # @return [String] String presentation of the object
223
+ def to_s
224
+ to_hash.to_s
225
+ end
226
+
227
+ # to_body is an alias to to_hash (backward compatibility)
228
+ # @return [Hash] Returns the object in the form of hash
229
+ def to_body
230
+ to_hash
231
+ end
232
+
233
+ # Returns the object in the form of hash
234
+ # @return [Hash] Returns the object in the form of hash
235
+ def to_hash
236
+ hash = {}
237
+ self.class.attribute_map.each_pair do |attr, param|
238
+ value = self.send(attr)
239
+ if value.nil?
240
+ is_nullable = self.class.openapi_nullable.include?(attr)
241
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
242
+ end
243
+
244
+ hash[param] = _to_hash(value)
245
+ end
246
+ hash
247
+ end
248
+
249
+ # Outputs non-array value in the form of hash
250
+ # For object, use to_hash. Otherwise, just return the value
251
+ # @param [Object] value Any valid value
252
+ # @return [Hash] Returns the value in the form of hash
253
+ def _to_hash(value)
254
+ if value.is_a?(Array)
255
+ value.compact.map { |v| _to_hash(v) }
256
+ elsif value.is_a?(Hash)
257
+ {}.tap do |hash|
258
+ value.each { |k, v| hash[k] = _to_hash(v) }
259
+ end
260
+ elsif value.respond_to? :to_hash
261
+ value.to_hash
262
+ else
263
+ value
264
+ end
265
+ end
266
+
267
+ end
268
+
269
+ end