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,225 @@
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
+ # Indexed logs usage summary for each organization for each retention period with usage.
21
+ class LogsByRetentionOrgs
22
+ # Indexed logs usage summary for each organization.
23
+ attr_accessor :usage
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'usage' => :'usage'
29
+ }
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'usage' => :'Array<LogsByRetentionOrgUsage>'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ ])
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::LogsByRetentionOrgs` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ attributes = attributes.each_with_object({}) { |(k, v), h|
59
+ if (!self.class.attribute_map.key?(k.to_sym))
60
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::LogsByRetentionOrgs`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
61
+ end
62
+ h[k.to_sym] = v
63
+ }
64
+
65
+ if attributes.key?(:'usage')
66
+ if (value = attributes[:'usage']).is_a?(Array)
67
+ self.usage = value
68
+ end
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
+ usage == o.usage
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
+ [usage].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 /\AArray<(?<inner_type>.+)>\z/
160
+ inner_type = Regexp.last_match[:inner_type]
161
+ value.map { |v| _deserialize(inner_type, v) }
162
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
163
+ k_type = Regexp.last_match[:k_type]
164
+ v_type = Regexp.last_match[:v_type]
165
+ {}.tap do |hash|
166
+ value.each do |k, v|
167
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
168
+ end
169
+ end
170
+ else # model
171
+ # models (e.g. Pet) or oneOf
172
+ klass = DatadogAPIClient::V1.const_get(type)
173
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
174
+ end
175
+ end
176
+
177
+ # Returns the string representation of the object
178
+ # @return [String] String presentation of the object
179
+ def to_s
180
+ to_hash.to_s
181
+ end
182
+
183
+ # to_body is an alias to to_hash (backward compatibility)
184
+ # @return [Hash] Returns the object in the form of hash
185
+ def to_body
186
+ to_hash
187
+ end
188
+
189
+ # Returns the object in the form of hash
190
+ # @return [Hash] Returns the object in the form of hash
191
+ def to_hash
192
+ hash = {}
193
+ self.class.attribute_map.each_pair do |attr, param|
194
+ value = self.send(attr)
195
+ if value.nil?
196
+ is_nullable = self.class.openapi_nullable.include?(attr)
197
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
198
+ end
199
+
200
+ hash[param] = _to_hash(value)
201
+ end
202
+ hash
203
+ end
204
+
205
+ # Outputs non-array value in the form of hash
206
+ # For object, use to_hash. Otherwise, just return the value
207
+ # @param [Object] value Any valid value
208
+ # @return [Hash] Returns the value in the form of hash
209
+ def _to_hash(value)
210
+ if value.is_a?(Array)
211
+ value.compact.map { |v| _to_hash(v) }
212
+ elsif value.is_a?(Hash)
213
+ {}.tap do |hash|
214
+ value.each { |k, v| hash[k] = _to_hash(v) }
215
+ end
216
+ elsif value.respond_to? :to_hash
217
+ value.to_hash
218
+ else
219
+ value
220
+ end
221
+ end
222
+
223
+ end
224
+
225
+ 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
+ # Object containing indexed logs usage aggregated across organizations and months for a retention period.
21
+ class LogsRetentionAggSumUsage
22
+ # Total indexed logs for this retention period.
23
+ attr_accessor :logs_indexed_logs_usage_agg_sum
24
+
25
+ # Live indexed logs for this retention period.
26
+ attr_accessor :logs_live_indexed_logs_usage_agg_sum
27
+
28
+ # Rehydrated indexed logs for this retention period.
29
+ attr_accessor :logs_rehydrated_indexed_logs_usage_agg_sum
30
+
31
+ # The retention period in days or \"custom\" for all custom retention periods.
32
+ attr_accessor :retention
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'logs_indexed_logs_usage_agg_sum' => :'logs_indexed_logs_usage_agg_sum',
38
+ :'logs_live_indexed_logs_usage_agg_sum' => :'logs_live_indexed_logs_usage_agg_sum',
39
+ :'logs_rehydrated_indexed_logs_usage_agg_sum' => :'logs_rehydrated_indexed_logs_usage_agg_sum',
40
+ :'retention' => :'retention'
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
+ :'logs_indexed_logs_usage_agg_sum' => :'Integer',
53
+ :'logs_live_indexed_logs_usage_agg_sum' => :'Integer',
54
+ :'logs_rehydrated_indexed_logs_usage_agg_sum' => :'Integer',
55
+ :'retention' => :'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::LogsRetentionAggSumUsage` 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::LogsRetentionAggSumUsage`. 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?(:'logs_indexed_logs_usage_agg_sum')
81
+ self.logs_indexed_logs_usage_agg_sum = attributes[:'logs_indexed_logs_usage_agg_sum']
82
+ end
83
+
84
+ if attributes.key?(:'logs_live_indexed_logs_usage_agg_sum')
85
+ self.logs_live_indexed_logs_usage_agg_sum = attributes[:'logs_live_indexed_logs_usage_agg_sum']
86
+ end
87
+
88
+ if attributes.key?(:'logs_rehydrated_indexed_logs_usage_agg_sum')
89
+ self.logs_rehydrated_indexed_logs_usage_agg_sum = attributes[:'logs_rehydrated_indexed_logs_usage_agg_sum']
90
+ end
91
+
92
+ if attributes.key?(:'retention')
93
+ self.retention = attributes[:'retention']
94
+ end
95
+ end
96
+
97
+ # Show invalid properties with the reasons. Usually used together with valid?
98
+ # @return Array for valid properties with the reasons
99
+ def list_invalid_properties
100
+ invalid_properties = Array.new
101
+ invalid_properties
102
+ end
103
+
104
+ # Check to see if the all the properties in the model are valid
105
+ # @return true if the model is valid
106
+ def valid?
107
+ true
108
+ end
109
+
110
+ # Checks equality by comparing each attribute.
111
+ # @param [Object] Object to be compared
112
+ def ==(o)
113
+ return true if self.equal?(o)
114
+ self.class == o.class &&
115
+ logs_indexed_logs_usage_agg_sum == o.logs_indexed_logs_usage_agg_sum &&
116
+ logs_live_indexed_logs_usage_agg_sum == o.logs_live_indexed_logs_usage_agg_sum &&
117
+ logs_rehydrated_indexed_logs_usage_agg_sum == o.logs_rehydrated_indexed_logs_usage_agg_sum &&
118
+ retention == o.retention
119
+ end
120
+
121
+ # @see the `==` method
122
+ # @param [Object] Object to be compared
123
+ def eql?(o)
124
+ self == o
125
+ end
126
+
127
+ # Calculates hash code according to all attributes.
128
+ # @return [Integer] Hash code
129
+ def hash
130
+ [logs_indexed_logs_usage_agg_sum, logs_live_indexed_logs_usage_agg_sum, logs_rehydrated_indexed_logs_usage_agg_sum, retention].hash
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 self.build_from_hash(attributes)
137
+ new.build_from_hash(attributes)
138
+ end
139
+
140
+ # Builds the object from hash
141
+ # @param [Hash] attributes Model attributes in the form of hash
142
+ # @return [Object] Returns the model itself
143
+ def build_from_hash(attributes)
144
+ return nil unless attributes.is_a?(Hash)
145
+ self.class.openapi_types.each_pair do |key, type|
146
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
147
+ self.send("#{key}=", nil)
148
+ elsif type =~ /\AArray<(.*)>/i
149
+ # check to ensure the input is an array given that the attribute
150
+ # is documented as an array but the input is not
151
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
152
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
153
+ end
154
+ elsif !attributes[self.class.attribute_map[key]].nil?
155
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
156
+ end
157
+ end
158
+
159
+ self
160
+ end
161
+
162
+ # Deserializes the data based on type
163
+ # @param string type Data type
164
+ # @param string value Value to be deserialized
165
+ # @return [Object] Deserialized data
166
+ def _deserialize(type, value)
167
+ case type.to_sym
168
+ when :Time
169
+ Time.parse(value)
170
+ when :Date
171
+ Date.parse(value)
172
+ when :String
173
+ value.to_s
174
+ when :Integer
175
+ value.to_i
176
+ when :Float
177
+ value.to_f
178
+ when :Boolean
179
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
180
+ true
181
+ else
182
+ false
183
+ end
184
+ when :Object
185
+ # generic object (usually a Hash), return directly
186
+ value
187
+ when /\AArray<(?<inner_type>.+)>\z/
188
+ inner_type = Regexp.last_match[:inner_type]
189
+ value.map { |v| _deserialize(inner_type, v) }
190
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
191
+ k_type = Regexp.last_match[:k_type]
192
+ v_type = Regexp.last_match[:v_type]
193
+ {}.tap do |hash|
194
+ value.each do |k, v|
195
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
196
+ end
197
+ end
198
+ else # model
199
+ # models (e.g. Pet) or oneOf
200
+ klass = DatadogAPIClient::V1.const_get(type)
201
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
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