datadog_api_client 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (190) hide show
  1. checksums.yaml +4 -4
  2. data/.apigentools-info +6 -6
  3. data/.github/workflows/scripts/test_integration.js +24 -0
  4. data/.github/workflows/test.yml +4 -0
  5. data/.github/workflows/test_integration.yml +87 -0
  6. data/.openapi-generator/FILES +48 -0
  7. data/CHANGELOG.md +18 -0
  8. data/README.md +1 -1
  9. data/data/v1/openapi.yaml +1133 -99
  10. data/data/v2/openapi.yaml +420 -13
  11. data/docs/v1/Downtime.md +2 -0
  12. data/docs/v1/DowntimeChild.md +48 -0
  13. data/docs/v1/MetricsAPI.md +1 -1
  14. data/docs/v1/Monitor.md +3 -3
  15. data/docs/v1/MonitorGroupSearchResponse.md +22 -0
  16. data/docs/v1/MonitorGroupSearchResponseCounts.md +20 -0
  17. data/docs/v1/MonitorGroupSearchResult.md +30 -0
  18. data/docs/v1/MonitorOptions.md +1 -1
  19. data/docs/v1/MonitorSearchResponse.md +22 -0
  20. data/docs/v1/MonitorSearchResponseCounts.md +24 -0
  21. data/docs/v1/MonitorSearchResponseMetadata.md +24 -0
  22. data/docs/v1/MonitorSearchResult.md +40 -0
  23. data/docs/v1/MonitorSearchResultNotification.md +20 -0
  24. data/docs/v1/MonitorsAPI.md +155 -13
  25. data/docs/v1/NotebookCreateDataAttributes.md +1 -1
  26. data/docs/v1/NotebookResponseDataAttributes.md +3 -3
  27. data/docs/v1/NotebookUpdateDataAttributes.md +1 -1
  28. data/docs/v1/NotebooksResponse.md +1 -1
  29. data/docs/v1/NotebooksResponseData.md +22 -0
  30. data/docs/v1/NotebooksResponseDataAttributes.md +30 -0
  31. data/docs/v1/README.md +25 -4
  32. data/docs/v1/SyntheticsAPI.md +62 -2
  33. data/docs/v1/SyntheticsAPITest.md +2 -2
  34. data/docs/v1/SyntheticsAPITestConfig.md +1 -1
  35. data/docs/v1/SyntheticsBrowserTest.md +2 -2
  36. data/docs/v1/SyntheticsConfigVariable.md +3 -1
  37. data/docs/v1/SyntheticsGlobalVariableValue.md +1 -1
  38. data/docs/v1/SyntheticsListGlobalVariablesResponse.md +18 -0
  39. data/docs/v1/SyntheticsTestConfig.md +1 -1
  40. data/docs/v1/SyntheticsTestDetails.md +2 -2
  41. data/docs/v1/UsageAttributionBody.md +2 -0
  42. data/docs/v1/UsageAttributionPagination.md +3 -7
  43. data/docs/v1/UsageAttributionValues.md +8 -0
  44. data/docs/v1/UsageAuditLogsHour.md +20 -0
  45. data/docs/v1/UsageAuditLogsResponse.md +18 -0
  46. data/docs/v1/UsageCWSHour.md +22 -0
  47. data/docs/v1/UsageCWSResponse.md +18 -0
  48. data/docs/v1/UsageCloudSecurityPostureManagementHour.md +22 -0
  49. data/docs/v1/UsageCloudSecurityPostureManagementResponse.md +18 -0
  50. data/docs/v1/UsageMeteringAPI.md +157 -21
  51. data/docs/v1/UsageSummaryDate.md +12 -4
  52. data/docs/v1/UsageSummaryDateOrg.md +12 -4
  53. data/docs/v1/UsageSummaryResponse.md +12 -4
  54. data/docs/v1/UsageTopAvgMetricsMetadata.md +2 -2
  55. data/docs/v1/WidgetCustomLink.md +7 -3
  56. data/docs/v2/IncidentServicesAPI.md +2 -2
  57. data/docs/v2/IncidentTeamsAPI.md +2 -2
  58. data/docs/v2/IncidentsAPI.md +2 -2
  59. data/docs/v2/IncidentsResponse.md +1 -1
  60. data/docs/v2/KeyManagementAPI.md +6 -6
  61. data/docs/v2/README.md +21 -0
  62. data/docs/v2/RelationshipToIncidentIntegrationMetadataData.md +1 -1
  63. data/docs/v2/RelationshipToIncidentIntegrationMetadatas.md +1 -1
  64. data/docs/v2/RolesAPI.md +4 -4
  65. data/docs/v2/SecurityFilter.md +22 -0
  66. data/docs/v2/SecurityFilterAttributes.md +30 -0
  67. data/docs/v2/SecurityFilterCreateAttributes.md +26 -0
  68. data/docs/v2/SecurityFilterCreateData.md +20 -0
  69. data/docs/v2/SecurityFilterCreateRequest.md +18 -0
  70. data/docs/v2/SecurityFilterDeleteResponse.md +18 -0
  71. data/docs/v2/SecurityFilterExclusionFilter.md +20 -0
  72. data/docs/v2/SecurityFilterExclusionFilterResponse.md +20 -0
  73. data/docs/v2/SecurityFilterFilteredDataType.md +15 -0
  74. data/docs/v2/SecurityFilterMeta.md +18 -0
  75. data/docs/v2/SecurityFilterResponse.md +20 -0
  76. data/docs/v2/SecurityFilterType.md +15 -0
  77. data/docs/v2/SecurityFilterUpdateAttributes.md +28 -0
  78. data/docs/v2/SecurityFilterUpdateData.md +20 -0
  79. data/docs/v2/SecurityFilterUpdateRequest.md +18 -0
  80. data/docs/v2/SecurityFiltersResponse.md +20 -0
  81. data/docs/v2/SecurityMonitoringAPI.md +316 -2
  82. data/docs/v2/UsersAPI.md +10 -10
  83. data/lib/datadog_api_client/v1.rb +18 -2
  84. data/lib/datadog_api_client/v1/api/metrics_api.rb +2 -2
  85. data/lib/datadog_api_client/v1/api/monitors_api.rb +163 -5
  86. data/lib/datadog_api_client/v1/api/synthetics_api.rb +67 -0
  87. data/lib/datadog_api_client/v1/api/usage_metering_api.rb +180 -23
  88. data/lib/datadog_api_client/v1/models/downtime.rb +11 -1
  89. data/lib/datadog_api_client/v1/models/downtime_child.rb +427 -0
  90. data/lib/datadog_api_client/v1/models/monitor.rb +10 -0
  91. data/lib/datadog_api_client/v1/models/monitor_group_search_response.rb +243 -0
  92. data/lib/datadog_api_client/v1/models/monitor_group_search_response_counts.rb +237 -0
  93. data/lib/datadog_api_client/v1/models/monitor_group_search_result.rb +285 -0
  94. data/lib/datadog_api_client/v1/models/monitor_options.rb +1 -1
  95. data/lib/datadog_api_client/v1/models/monitor_search_response.rb +243 -0
  96. data/lib/datadog_api_client/v1/models/monitor_search_response_counts.rb +261 -0
  97. data/lib/datadog_api_client/v1/models/monitor_search_response_metadata.rb +253 -0
  98. data/lib/datadog_api_client/v1/models/monitor_search_result.rb +339 -0
  99. data/lib/datadog_api_client/v1/models/monitor_search_result_notification.rb +233 -0
  100. data/lib/datadog_api_client/v1/models/notebook_create_data_attributes.rb +1 -1
  101. data/lib/datadog_api_client/v1/models/notebook_distribution_cell_attributes.rb +1 -1
  102. data/lib/datadog_api_client/v1/models/notebook_heat_map_cell_attributes.rb +1 -1
  103. data/lib/datadog_api_client/v1/models/notebook_log_stream_cell_attributes.rb +1 -1
  104. data/lib/datadog_api_client/v1/models/notebook_markdown_cell_attributes.rb +1 -1
  105. data/lib/datadog_api_client/v1/models/notebook_response_data_attributes.rb +3 -3
  106. data/lib/datadog_api_client/v1/models/notebook_timeseries_cell_attributes.rb +1 -1
  107. data/lib/datadog_api_client/v1/models/notebook_toplist_cell_attributes.rb +1 -1
  108. data/lib/datadog_api_client/v1/models/notebook_update_data_attributes.rb +1 -1
  109. data/lib/datadog_api_client/v1/models/notebooks_response.rb +1 -1
  110. data/lib/datadog_api_client/v1/models/notebooks_response_data.rb +258 -0
  111. data/lib/datadog_api_client/v1/models/notebooks_response_data_attributes.rb +317 -0
  112. data/lib/datadog_api_client/v1/models/synthetics_api_test_config.rb +0 -5
  113. data/lib/datadog_api_client/v1/models/synthetics_config_variable.rb +11 -6
  114. data/lib/datadog_api_client/v1/models/synthetics_config_variable_type.rb +1 -0
  115. data/lib/datadog_api_client/v1/models/synthetics_global_variable_value.rb +0 -5
  116. data/lib/datadog_api_client/v1/models/synthetics_list_global_variables_response.rb +225 -0
  117. data/lib/datadog_api_client/v1/models/synthetics_test_config.rb +0 -5
  118. data/lib/datadog_api_client/v1/models/usage_attribution_body.rb +11 -1
  119. data/lib/datadog_api_client/v1/models/usage_attribution_pagination.rb +10 -30
  120. data/lib/datadog_api_client/v1/models/usage_attribution_values.rb +41 -1
  121. data/lib/datadog_api_client/v1/models/usage_audit_logs_hour.rb +233 -0
  122. data/lib/datadog_api_client/v1/models/{usage_compliance_response.rb → usage_audit_logs_response.rb} +6 -6
  123. data/lib/datadog_api_client/v1/models/{usage_compliance_hour.rb → usage_cloud_security_posture_management_hour.rb} +19 -19
  124. data/lib/datadog_api_client/v1/models/usage_cloud_security_posture_management_response.rb +225 -0
  125. data/lib/datadog_api_client/v1/models/usage_cws_hour.rb +243 -0
  126. data/lib/datadog_api_client/v1/models/usage_cws_response.rb +225 -0
  127. data/lib/datadog_api_client/v1/models/usage_summary_date.rb +61 -22
  128. data/lib/datadog_api_client/v1/models/usage_summary_date_org.rb +61 -22
  129. data/lib/datadog_api_client/v1/models/usage_summary_response.rb +61 -22
  130. data/lib/datadog_api_client/v1/models/usage_top_avg_metrics_metadata.rb +2 -4
  131. data/lib/datadog_api_client/v1/models/widget_custom_link.rb +24 -14
  132. data/lib/datadog_api_client/v2.rb +16 -0
  133. data/lib/datadog_api_client/v2/api/security_monitoring_api.rb +369 -0
  134. data/lib/datadog_api_client/v2/models/incident_integration_metadata_type.rb +1 -1
  135. data/lib/datadog_api_client/v2/models/relationship_to_incident_integration_metadata_data.rb +1 -1
  136. data/lib/datadog_api_client/v2/models/security_filter.rb +243 -0
  137. data/lib/datadog_api_client/v2/models/security_filter_attributes.rb +299 -0
  138. data/lib/datadog_api_client/v2/models/security_filter_create_attributes.rb +289 -0
  139. data/lib/datadog_api_client/v2/models/security_filter_create_data.rb +243 -0
  140. data/lib/datadog_api_client/v2/models/security_filter_create_request.rb +227 -0
  141. data/lib/datadog_api_client/v2/models/security_filter_delete_response.rb +222 -0
  142. data/lib/datadog_api_client/v2/models/security_filter_exclusion_filter.rb +243 -0
  143. data/lib/datadog_api_client/v2/models/security_filter_exclusion_filter_response.rb +233 -0
  144. data/lib/datadog_api_client/v2/models/security_filter_filtered_data_type.rb +39 -0
  145. data/lib/datadog_api_client/v2/models/security_filter_meta.rb +223 -0
  146. data/lib/datadog_api_client/v2/models/security_filter_response.rb +231 -0
  147. data/lib/datadog_api_client/v2/models/security_filter_type.rb +39 -0
  148. data/lib/datadog_api_client/v2/models/security_filter_update_attributes.rb +289 -0
  149. data/lib/datadog_api_client/v2/models/security_filter_update_data.rb +243 -0
  150. data/lib/datadog_api_client/v2/models/security_filter_update_request.rb +227 -0
  151. data/lib/datadog_api_client/v2/models/security_filters_response.rb +234 -0
  152. data/lib/datadog_api_client/version.rb +1 -1
  153. data/spec/v1/models/downtime_child_spec.rb +127 -0
  154. data/spec/v1/models/monitor_group_search_response_counts_spec.rb +43 -0
  155. data/spec/v1/models/monitor_group_search_response_spec.rb +49 -0
  156. data/spec/v1/models/monitor_group_search_result_spec.rb +73 -0
  157. data/spec/v1/models/monitor_search_response_counts_spec.rb +55 -0
  158. data/spec/v1/models/monitor_search_response_metadata_spec.rb +55 -0
  159. data/spec/v1/models/monitor_search_response_spec.rb +49 -0
  160. data/spec/v1/models/monitor_search_result_notification_spec.rb +43 -0
  161. data/spec/v1/models/monitor_search_result_spec.rb +103 -0
  162. data/spec/v1/models/notebooks_response_data_attributes_spec.rb +73 -0
  163. data/spec/v1/models/notebooks_response_data_spec.rb +49 -0
  164. data/spec/v1/models/synthetics_list_global_variables_response_spec.rb +37 -0
  165. data/spec/v1/models/usage_audit_logs_hour_spec.rb +43 -0
  166. data/spec/v1/models/{usage_compliance_response_spec.rb → usage_audit_logs_response_spec.rb} +6 -6
  167. data/spec/v1/models/usage_cloud_security_posture_management_hour_spec.rb +49 -0
  168. data/spec/v1/models/usage_cloud_security_posture_management_response_spec.rb +37 -0
  169. data/spec/v1/models/{usage_compliance_hour_spec.rb → usage_cws_hour_spec.rb} +8 -8
  170. data/spec/v1/models/usage_cws_response_spec.rb +37 -0
  171. data/spec/v2/models/security_filter_attributes_spec.rb +73 -0
  172. data/spec/v2/models/security_filter_create_attributes_spec.rb +61 -0
  173. data/spec/v2/models/security_filter_create_data_spec.rb +43 -0
  174. data/spec/v2/models/security_filter_create_request_spec.rb +37 -0
  175. data/spec/v2/models/security_filter_delete_response_spec.rb +37 -0
  176. data/spec/v2/models/security_filter_exclusion_filter_response_spec.rb +43 -0
  177. data/spec/v2/models/security_filter_exclusion_filter_spec.rb +43 -0
  178. data/spec/v2/models/security_filter_filtered_data_type_spec.rb +31 -0
  179. data/spec/v2/models/security_filter_meta_spec.rb +37 -0
  180. data/spec/v2/models/security_filter_response_spec.rb +43 -0
  181. data/spec/v2/models/security_filter_spec.rb +49 -0
  182. data/spec/v2/models/security_filter_type_spec.rb +31 -0
  183. data/spec/v2/models/security_filter_update_attributes_spec.rb +67 -0
  184. data/spec/v2/models/security_filter_update_data_spec.rb +43 -0
  185. data/spec/v2/models/security_filter_update_request_spec.rb +37 -0
  186. data/spec/v2/models/security_filters_response_spec.rb +43 -0
  187. metadata +140 -11
  188. data/.azure-pipelines/all.yml +0 -50
  189. data/docs/v1/UsageComplianceHour.md +0 -22
  190. data/docs/v1/UsageComplianceResponse.md +0 -18
@@ -103,17 +103,12 @@ module DatadogAPIClient::V1
103
103
  # @return Array for valid properties with the reasons
104
104
  def list_invalid_properties
105
105
  invalid_properties = Array.new
106
- if @assertions.nil?
107
- invalid_properties.push('invalid value for "assertions", assertions cannot be nil.')
108
- end
109
-
110
106
  invalid_properties
111
107
  end
112
108
 
113
109
  # Check to see if the all the properties in the model are valid
114
110
  # @return true if the model is valid
115
111
  def valid?
116
- return false if @assertions.nil?
117
112
  true
118
113
  end
119
114
 
@@ -22,6 +22,9 @@ module DatadogAPIClient::V1
22
22
  # Example for the variable.
23
23
  attr_accessor :example
24
24
 
25
+ # ID of the variable for global variables.
26
+ attr_accessor :id
27
+
25
28
  # Name of the variable.
26
29
  attr_accessor :name
27
30
 
@@ -34,6 +37,7 @@ module DatadogAPIClient::V1
34
37
  def self.attribute_map
35
38
  {
36
39
  :'example' => :'example',
40
+ :'id' => :'id',
37
41
  :'name' => :'name',
38
42
  :'pattern' => :'pattern',
39
43
  :'type' => :'type'
@@ -49,6 +53,7 @@ module DatadogAPIClient::V1
49
53
  def self.openapi_types
50
54
  {
51
55
  :'example' => :'String',
56
+ :'id' => :'String',
52
57
  :'name' => :'String',
53
58
  :'pattern' => :'String',
54
59
  :'type' => :'SyntheticsConfigVariableType'
@@ -80,6 +85,10 @@ module DatadogAPIClient::V1
80
85
  self.example = attributes[:'example']
81
86
  end
82
87
 
88
+ if attributes.key?(:'id')
89
+ self.id = attributes[:'id']
90
+ end
91
+
83
92
  if attributes.key?(:'name')
84
93
  self.name = attributes[:'name']
85
94
  end
@@ -97,10 +106,6 @@ module DatadogAPIClient::V1
97
106
  # @return Array for valid properties with the reasons
98
107
  def list_invalid_properties
99
108
  invalid_properties = Array.new
100
- if @example.nil?
101
- invalid_properties.push('invalid value for "example", example cannot be nil.')
102
- end
103
-
104
109
  if @name.nil?
105
110
  invalid_properties.push('invalid value for "name", name cannot be nil.')
106
111
  end
@@ -115,7 +120,6 @@ module DatadogAPIClient::V1
115
120
  # Check to see if the all the properties in the model are valid
116
121
  # @return true if the model is valid
117
122
  def valid?
118
- return false if @example.nil?
119
123
  return false if @name.nil?
120
124
  return false if @type.nil?
121
125
  true
@@ -127,6 +131,7 @@ module DatadogAPIClient::V1
127
131
  return true if self.equal?(o)
128
132
  self.class == o.class &&
129
133
  example == o.example &&
134
+ id == o.id &&
130
135
  name == o.name &&
131
136
  pattern == o.pattern &&
132
137
  type == o.type
@@ -141,7 +146,7 @@ module DatadogAPIClient::V1
141
146
  # Calculates hash code according to all attributes.
142
147
  # @return [Integer] Hash code
143
148
  def hash
144
- [example, name, pattern, type].hash
149
+ [example, id, name, pattern, type].hash
145
150
  end
146
151
 
147
152
  # Builds the object from hash
@@ -18,6 +18,7 @@ require 'time'
18
18
 
19
19
  module DatadogAPIClient::V1
20
20
  class SyntheticsConfigVariableType
21
+ GLOBAL = "global".freeze
21
22
  TEXT = "text".freeze
22
23
 
23
24
  # Builds the enum from string
@@ -80,17 +80,12 @@ module DatadogAPIClient::V1
80
80
  # @return Array for valid properties with the reasons
81
81
  def list_invalid_properties
82
82
  invalid_properties = Array.new
83
- if @value.nil?
84
- invalid_properties.push('invalid value for "value", value cannot be nil.')
85
- end
86
-
87
83
  invalid_properties
88
84
  end
89
85
 
90
86
  # Check to see if the all the properties in the model are valid
91
87
  # @return true if the model is valid
92
88
  def valid?
93
- return false if @value.nil?
94
89
  true
95
90
  end
96
91
 
@@ -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
+ # Object containing an array of Synthetic global variables.
21
+ class SyntheticsListGlobalVariablesResponse
22
+ # Array of Synthetic global variables.
23
+ attr_accessor :variables
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'variables' => :'variables'
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
+ :'variables' => :'Array<SyntheticsGlobalVariable>'
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::SyntheticsListGlobalVariablesResponse` 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::SyntheticsListGlobalVariablesResponse`. 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?(:'variables')
66
+ if (value = attributes[:'variables']).is_a?(Array)
67
+ self.variables = 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
+ variables == o.variables
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
+ [variables].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
@@ -103,17 +103,12 @@ module DatadogAPIClient::V1
103
103
  # @return Array for valid properties with the reasons
104
104
  def list_invalid_properties
105
105
  invalid_properties = Array.new
106
- if @assertions.nil?
107
- invalid_properties.push('invalid value for "assertions", assertions cannot be nil.')
108
- end
109
-
110
106
  invalid_properties
111
107
  end
112
108
 
113
109
  # Check to see if the all the properties in the model are valid
114
110
  # @return true if the model is valid
115
111
  def valid?
116
- return false if @assertions.nil?
117
112
  true
118
113
  end
119
114
 
@@ -28,6 +28,9 @@ module DatadogAPIClient::V1
28
28
  # The organization public ID.
29
29
  attr_accessor :public_id
30
30
 
31
+ # The source of the usage attribution tag configuration and the selected tags in the format `<source_org_name>:<selected tag 1>-<selected tag 2>-<selected tag 3>`.
32
+ attr_accessor :tag_config_source
33
+
31
34
  # Usage Summary by tag name.
32
35
  attr_accessor :tags
33
36
 
@@ -42,6 +45,7 @@ module DatadogAPIClient::V1
42
45
  :'month' => :'month',
43
46
  :'org_name' => :'org_name',
44
47
  :'public_id' => :'public_id',
48
+ :'tag_config_source' => :'tag_config_source',
45
49
  :'tags' => :'tags',
46
50
  :'updated_at' => :'updated_at',
47
51
  :'values' => :'values'
@@ -59,6 +63,7 @@ module DatadogAPIClient::V1
59
63
  :'month' => :'Time',
60
64
  :'org_name' => :'String',
61
65
  :'public_id' => :'String',
66
+ :'tag_config_source' => :'String',
62
67
  :'tags' => :'Hash<String, Array<String>>',
63
68
  :'updated_at' => :'String',
64
69
  :'values' => :'UsageAttributionValues'
@@ -98,6 +103,10 @@ module DatadogAPIClient::V1
98
103
  self.public_id = attributes[:'public_id']
99
104
  end
100
105
 
106
+ if attributes.key?(:'tag_config_source')
107
+ self.tag_config_source = attributes[:'tag_config_source']
108
+ end
109
+
101
110
  if attributes.key?(:'tags')
102
111
  if (value = attributes[:'tags']).is_a?(Hash)
103
112
  self.tags = value
@@ -134,6 +143,7 @@ module DatadogAPIClient::V1
134
143
  month == o.month &&
135
144
  org_name == o.org_name &&
136
145
  public_id == o.public_id &&
146
+ tag_config_source == o.tag_config_source &&
137
147
  tags == o.tags &&
138
148
  updated_at == o.updated_at &&
139
149
  values == o.values
@@ -148,7 +158,7 @@ module DatadogAPIClient::V1
148
158
  # Calculates hash code according to all attributes.
149
159
  # @return [Integer] Hash code
150
160
  def hash
151
- [month, org_name, public_id, tags, updated_at, values].hash
161
+ [month, org_name, public_id, tag_config_source, tags, updated_at, values].hash
152
162
  end
153
163
 
154
164
  # Builds the object from hash
@@ -17,30 +17,22 @@ require 'date'
17
17
  require 'time'
18
18
 
19
19
  module DatadogAPIClient::V1
20
- # The page count for the current pagination.
20
+ # The metadata for the current pagination.
21
21
  class UsageAttributionPagination
22
22
  # Maximum amount of records to be returned.
23
23
  attr_accessor :limit
24
24
 
25
- # Records to be skipped before beginning to return.
26
- attr_accessor :offset
25
+ # The cursor to use to get the next results, if any. To make the next request, use the same parameters with the addition of this next_record_id.
26
+ attr_accessor :next_record_id
27
27
 
28
- # Direction to sort by.
29
- attr_accessor :sort_direction
30
-
31
- # Field to sort by.
32
- attr_accessor :sort_name
33
-
34
- # Total number of records.
28
+ # Total number of records. (deprecated after May 1st, 2021)
35
29
  attr_accessor :total_number_of_records
36
30
 
37
31
  # Attribute mapping from ruby-style variable name to JSON key.
38
32
  def self.attribute_map
39
33
  {
40
34
  :'limit' => :'limit',
41
- :'offset' => :'offset',
42
- :'sort_direction' => :'sort_direction',
43
- :'sort_name' => :'sort_name',
35
+ :'next_record_id' => :'next_record_id',
44
36
  :'total_number_of_records' => :'total_number_of_records'
45
37
  }
46
38
  end
@@ -54,9 +46,7 @@ module DatadogAPIClient::V1
54
46
  def self.openapi_types
55
47
  {
56
48
  :'limit' => :'Integer',
57
- :'offset' => :'Integer',
58
- :'sort_direction' => :'String',
59
- :'sort_name' => :'String',
49
+ :'next_record_id' => :'String',
60
50
  :'total_number_of_records' => :'Integer'
61
51
  }
62
52
  end
@@ -86,16 +76,8 @@ module DatadogAPIClient::V1
86
76
  self.limit = attributes[:'limit']
87
77
  end
88
78
 
89
- if attributes.key?(:'offset')
90
- self.offset = attributes[:'offset']
91
- end
92
-
93
- if attributes.key?(:'sort_direction')
94
- self.sort_direction = attributes[:'sort_direction']
95
- end
96
-
97
- if attributes.key?(:'sort_name')
98
- self.sort_name = attributes[:'sort_name']
79
+ if attributes.key?(:'next_record_id')
80
+ self.next_record_id = attributes[:'next_record_id']
99
81
  end
100
82
 
101
83
  if attributes.key?(:'total_number_of_records')
@@ -122,9 +104,7 @@ module DatadogAPIClient::V1
122
104
  return true if self.equal?(o)
123
105
  self.class == o.class &&
124
106
  limit == o.limit &&
125
- offset == o.offset &&
126
- sort_direction == o.sort_direction &&
127
- sort_name == o.sort_name &&
107
+ next_record_id == o.next_record_id &&
128
108
  total_number_of_records == o.total_number_of_records
129
109
  end
130
110
 
@@ -137,7 +117,7 @@ module DatadogAPIClient::V1
137
117
  # Calculates hash code according to all attributes.
138
118
  # @return [Integer] Hash code
139
119
  def hash
140
- [limit, offset, sort_direction, sort_name, total_number_of_records].hash
120
+ [limit, next_record_id, total_number_of_records].hash
141
121
  end
142
122
 
143
123
  # Builds the object from hash