datadog_api_client 2.21.0 → 2.22.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/.apigentools-info +4 -4
  3. data/.generator/schemas/v1/openapi.yaml +180 -637
  4. data/.generator/schemas/v2/openapi.yaml +515 -33
  5. data/.github/workflows/prepare_release.yml +2 -2
  6. data/.github/workflows/publish.yml +2 -2
  7. data/.github/workflows/release.yml +2 -2
  8. data/.github/workflows/test.yml +1 -1
  9. data/CHANGELOG.md +24 -0
  10. data/Gemfile +1 -1
  11. data/examples/v1/aws-integration/CreateAWSAccount.rb +1 -1
  12. data/examples/v1/aws-integration/CreateNewAWSExternalID.rb +1 -0
  13. data/examples/v1/aws-integration/UpdateAWSAccount.rb +1 -1
  14. data/examples/v1/synthetics/CreateSyntheticsAPITest_1241981394.rb +118 -0
  15. data/examples/v1/synthetics/UpdateBrowserTest.rb +3 -0
  16. data/examples/v2/apm-retention-filters/UpdateApmRetentionFilter.rb +2 -2
  17. data/examples/v2/authn-mappings/CreateAuthNMapping.rb +1 -1
  18. data/examples/v2/authn-mappings/UpdateAuthNMapping.rb +1 -1
  19. data/examples/v2/cloud-workload-security/CreateCSMThreatsAgentRule.rb +1 -1
  20. data/examples/v2/gcp-integration/CreateGCPSTSAccount.rb +1 -1
  21. data/examples/v2/gcp-integration/CreateGCPSTSAccount_109518525.rb +1 -1
  22. data/examples/v2/gcp-integration/CreateGCPSTSAccount_130557025.rb +1 -1
  23. data/examples/v2/gcp-integration/CreateGCPSTSAccount_194782945.rb +1 -1
  24. data/examples/v2/gcp-integration/CreateGCPSTSAccount_2597004741.rb +1 -1
  25. data/examples/v2/gcp-integration/CreateGCPSTSAccount_4235664992.rb +1 -1
  26. data/examples/v2/gcp-integration/UpdateGCPSTSAccount.rb +1 -1
  27. data/examples/v2/gcp-integration/UpdateGCPSTSAccount_2241994060.rb +1 -1
  28. data/examples/v2/gcp-integration/UpdateGCPSTSAccount_3205636354.rb +1 -1
  29. data/examples/v2/logs-custom-destinations/UpdateLogsCustomDestination.rb +4 -0
  30. data/examples/v2/metrics/QueryScalarData_3112571352.rb +2 -2
  31. data/examples/v2/metrics/QueryTimeseriesData_301142940.rb +3 -3
  32. data/examples/v2/security-monitoring/CreateSecurityMonitoringSuppression_3192265332.rb +19 -0
  33. data/examples/v2/security-monitoring/ValidateSecurityMonitoringRule.rb +42 -0
  34. data/examples/v2/service-definition/CreateOrUpdateServiceDefinitions.rb +4 -0
  35. data/examples/v2/service-level-objectives/CreateSLOReportJob.rb +20 -0
  36. data/examples/v2/service-level-objectives/GetSLOReport.rb +8 -0
  37. data/examples/v2/service-level-objectives/GetSLOReportJobStatus.rb +11 -0
  38. data/lib/datadog_api_client/configuration.rb +3 -0
  39. data/lib/datadog_api_client/inflector.rb +20 -7
  40. data/lib/datadog_api_client/v1/api/usage_metering_api.rb +104 -131
  41. data/lib/datadog_api_client/v1/models/aws_account.rb +12 -2
  42. data/lib/datadog_api_client/v1/models/hourly_usage_attribution_usage_type.rb +2 -0
  43. data/lib/datadog_api_client/v1/models/monitor_options.rb +4 -1
  44. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_supported_metrics.rb +4 -0
  45. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_values.rb +41 -1
  46. data/lib/datadog_api_client/v1/models/series.rb +1 -1
  47. data/lib/datadog_api_client/v1/models/slo_time_slice_condition.rb +14 -2
  48. data/lib/datadog_api_client/v1/models/slo_time_slice_interval.rb +29 -0
  49. data/lib/datadog_api_client/v1/models/slo_time_slice_spec.rb +1 -1
  50. data/lib/datadog_api_client/v1/models/synthetics_test_request.rb +13 -1
  51. data/lib/datadog_api_client/v1/models/synthetics_test_request_body_file.rb +175 -0
  52. data/lib/datadog_api_client/v1/models/synthetics_test_request_body_type.rb +2 -0
  53. data/lib/datadog_api_client/v2/api/apm_retention_filters_api.rb +6 -0
  54. data/lib/datadog_api_client/v2/api/metrics_api.rb +1 -1
  55. data/lib/datadog_api_client/v2/api/security_monitoring_api.rb +67 -0
  56. data/lib/datadog_api_client/v2/api/service_level_objectives_api.rb +245 -0
  57. data/lib/datadog_api_client/v2/api/usage_metering_api.rb +12 -3
  58. data/lib/datadog_api_client/v2/models/authn_mapping_create_data.rb +1 -1
  59. data/lib/datadog_api_client/v2/models/authn_mapping_create_relationships.rb +37 -54
  60. data/lib/datadog_api_client/v2/models/authn_mapping_included.rb +2 -1
  61. data/lib/datadog_api_client/v2/models/authn_mapping_relationship_to_role.rb +98 -0
  62. data/lib/datadog_api_client/v2/models/authn_mapping_relationship_to_team.rb +98 -0
  63. data/lib/datadog_api_client/v2/models/authn_mapping_relationships.rb +14 -4
  64. data/lib/datadog_api_client/{v1/models/usage_attribution_metadata.rb → v2/models/authn_mapping_team.rb} +31 -23
  65. data/lib/datadog_api_client/v2/models/authn_mapping_team_attributes.rb +212 -0
  66. data/lib/datadog_api_client/v2/models/authn_mapping_update_data.rb +1 -1
  67. data/lib/datadog_api_client/v2/models/authn_mapping_update_relationships.rb +37 -54
  68. data/lib/datadog_api_client/v2/models/custom_destination_type.rb +1 -1
  69. data/lib/datadog_api_client/v2/models/dora_deployment_request_attributes.rb +1 -1
  70. data/lib/datadog_api_client/v2/models/metric_series.rb +1 -1
  71. data/lib/datadog_api_client/v2/models/relationship_to_team.rb +80 -0
  72. data/lib/datadog_api_client/{v1/models/usage_attribution_response.rb → v2/models/relationship_to_team_data.rb} +21 -23
  73. data/lib/datadog_api_client/v2/models/retention_filter_update_attributes.rb +183 -0
  74. data/lib/datadog_api_client/v2/models/retention_filter_update_data.rb +1 -1
  75. data/lib/datadog_api_client/v2/models/security_monitoring_rule_update_payload.rb +1 -1
  76. data/lib/datadog_api_client/v2/models/security_monitoring_signal_rule_create_payload.rb +1 -1
  77. data/lib/datadog_api_client/v2/models/security_monitoring_signal_rule_response.rb +1 -1
  78. data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_create_payload.rb +1 -1
  79. data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_response.rb +1 -1
  80. data/lib/datadog_api_client/v2/models/security_monitoring_suppression_attributes.rb +11 -1
  81. data/lib/datadog_api_client/v2/models/security_monitoring_suppression_create_attributes.rb +13 -14
  82. data/lib/datadog_api_client/v2/models/security_monitoring_suppression_update_attributes.rb +11 -1
  83. data/lib/datadog_api_client/v2/models/service_definition_v2_dot2.rb +13 -1
  84. data/lib/datadog_api_client/v2/models/slo_report_create_request.rb +98 -0
  85. data/lib/datadog_api_client/v2/models/slo_report_create_request_attributes.rb +160 -0
  86. data/lib/datadog_api_client/{v1/models/usage_attribution_pagination.rb → v2/models/slo_report_create_request_data.rb} +29 -51
  87. data/lib/datadog_api_client/v2/models/slo_report_interval.rb +27 -0
  88. data/lib/datadog_api_client/v2/models/slo_report_post_response.rb +80 -0
  89. data/lib/datadog_api_client/v2/models/slo_report_post_response_data.rb +90 -0
  90. data/lib/datadog_api_client/v2/models/slo_report_status.rb +29 -0
  91. data/lib/datadog_api_client/v2/models/slo_report_status_get_response.rb +80 -0
  92. data/lib/datadog_api_client/v2/models/slo_report_status_get_response_attributes.rb +80 -0
  93. data/lib/datadog_api_client/v2/models/slo_report_status_get_response_data.rb +100 -0
  94. data/lib/datadog_api_client/v2/models/timeseries_response_series.rb +8 -0
  95. data/lib/datadog_api_client/v2/models/user_teams_response.rb +13 -1
  96. data/lib/datadog_api_client/version.rb +1 -1
  97. metadata +51 -33
  98. data/examples/v1/usage-metering/GetUsageAttribution.rb +0 -9
  99. data/lib/datadog_api_client/v1/models/usage_attribution_body.rb +0 -152
  100. data/lib/datadog_api_client/v1/models/usage_attribution_sort.rb +0 -63
  101. data/lib/datadog_api_client/v1/models/usage_attribution_supported_metrics.rb +0 -74
  102. data/lib/datadog_api_client/v1/models/usage_attribution_values.rb +0 -590
@@ -1798,5 +1798,72 @@ module DatadogAPIClient::V2
1798
1798
  end
1799
1799
  return data, status_code, headers
1800
1800
  end
1801
+
1802
+ # Validate a detection rule.
1803
+ #
1804
+ # @see #validate_security_monitoring_rule_with_http_info
1805
+ def validate_security_monitoring_rule(body, opts = {})
1806
+ validate_security_monitoring_rule_with_http_info(body, opts)
1807
+ nil
1808
+ end
1809
+
1810
+ # Validate a detection rule.
1811
+ #
1812
+ # Validate a detection rule.
1813
+ #
1814
+ # @param body [SecurityMonitoringRuleCreatePayload]
1815
+ # @param opts [Hash] the optional parameters
1816
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
1817
+ def validate_security_monitoring_rule_with_http_info(body, opts = {})
1818
+
1819
+ if @api_client.config.debugging
1820
+ @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.validate_security_monitoring_rule ...'
1821
+ end
1822
+ # verify the required parameter 'body' is set
1823
+ if @api_client.config.client_side_validation && body.nil?
1824
+ fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.validate_security_monitoring_rule"
1825
+ end
1826
+ # resource path
1827
+ local_var_path = '/api/v2/security_monitoring/rules/validation'
1828
+
1829
+ # query parameters
1830
+ query_params = opts[:query_params] || {}
1831
+
1832
+ # header parameters
1833
+ header_params = opts[:header_params] || {}
1834
+ # HTTP header 'Accept' (if needed)
1835
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
1836
+ # HTTP header 'Content-Type'
1837
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1838
+
1839
+ # form parameters
1840
+ form_params = opts[:form_params] || {}
1841
+
1842
+ # http body (model)
1843
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
1844
+
1845
+ # return_type
1846
+ return_type = opts[:debug_return_type]
1847
+
1848
+ # auth_names
1849
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
1850
+
1851
+ new_options = opts.merge(
1852
+ :operation => :validate_security_monitoring_rule,
1853
+ :header_params => header_params,
1854
+ :query_params => query_params,
1855
+ :form_params => form_params,
1856
+ :body => post_body,
1857
+ :auth_names => auth_names,
1858
+ :return_type => return_type,
1859
+ :api_version => "V2"
1860
+ )
1861
+
1862
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
1863
+ if @api_client.config.debugging
1864
+ @api_client.config.logger.debug "API called: SecurityMonitoringAPI#validate_security_monitoring_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1865
+ end
1866
+ return data, status_code, headers
1867
+ end
1801
1868
  end
1802
1869
  end
@@ -0,0 +1,245 @@
1
+ =begin
2
+ #Datadog API V2 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://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
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 'cgi'
17
+
18
+ module DatadogAPIClient::V2
19
+ class ServiceLevelObjectivesAPI
20
+ attr_accessor :api_client
21
+
22
+ def initialize(api_client = DatadogAPIClient::APIClient.default)
23
+ @api_client = api_client
24
+ end
25
+
26
+ # Create a new SLO report.
27
+ #
28
+ # @see #create_slo_report_job_with_http_info
29
+ def create_slo_report_job(body, opts = {})
30
+ data, _status_code, _headers = create_slo_report_job_with_http_info(body, opts)
31
+ data
32
+ end
33
+
34
+ # Create a new SLO report.
35
+ #
36
+ # Create a job to generate an SLO report. The report job is processed asynchronously and eventually results in a CSV report being available for download.
37
+ #
38
+ # Check the status of the job and download the CSV report using the returned `report_id`.
39
+ #
40
+ # @param body [SloReportCreateRequest] Create SLO report job request body.
41
+ # @param opts [Hash] the optional parameters
42
+ # @return [Array<(SLOReportPostResponse, Integer, Hash)>] SLOReportPostResponse data, response status code and response headers
43
+ def create_slo_report_job_with_http_info(body, opts = {})
44
+ unstable_enabled = @api_client.config.unstable_operations["v2.create_slo_report_job".to_sym]
45
+ if unstable_enabled
46
+ @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_slo_report_job")
47
+ else
48
+ raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_slo_report_job"))
49
+ end
50
+
51
+ if @api_client.config.debugging
52
+ @api_client.config.logger.debug 'Calling API: ServiceLevelObjectivesAPI.create_slo_report_job ...'
53
+ end
54
+ # verify the required parameter 'body' is set
55
+ if @api_client.config.client_side_validation && body.nil?
56
+ fail ArgumentError, "Missing the required parameter 'body' when calling ServiceLevelObjectivesAPI.create_slo_report_job"
57
+ end
58
+ # resource path
59
+ local_var_path = '/api/v2/slo/report'
60
+
61
+ # query parameters
62
+ query_params = opts[:query_params] || {}
63
+
64
+ # header parameters
65
+ header_params = opts[:header_params] || {}
66
+ # HTTP header 'Accept' (if needed)
67
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
68
+ # HTTP header 'Content-Type'
69
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
70
+
71
+ # form parameters
72
+ form_params = opts[:form_params] || {}
73
+
74
+ # http body (model)
75
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
76
+
77
+ # return_type
78
+ return_type = opts[:debug_return_type] || 'SLOReportPostResponse'
79
+
80
+ # auth_names
81
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
82
+
83
+ new_options = opts.merge(
84
+ :operation => :create_slo_report_job,
85
+ :header_params => header_params,
86
+ :query_params => query_params,
87
+ :form_params => form_params,
88
+ :body => post_body,
89
+ :auth_names => auth_names,
90
+ :return_type => return_type,
91
+ :api_version => "V2"
92
+ )
93
+
94
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
95
+ if @api_client.config.debugging
96
+ @api_client.config.logger.debug "API called: ServiceLevelObjectivesAPI#create_slo_report_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
97
+ end
98
+ return data, status_code, headers
99
+ end
100
+
101
+ # Get SLO report.
102
+ #
103
+ # @see #get_slo_report_with_http_info
104
+ def get_slo_report(report_id, opts = {})
105
+ data, _status_code, _headers = get_slo_report_with_http_info(report_id, opts)
106
+ data
107
+ end
108
+
109
+ # Get SLO report.
110
+ #
111
+ # Download an SLO report. This can only be performed after the report job has completed.
112
+ #
113
+ # Reports are not guaranteed to exist indefinitely. Datadog recommends that you download the report as soon as it is available.
114
+ #
115
+ # @param report_id [String] The ID of the report job.
116
+ # @param opts [Hash] the optional parameters
117
+ # @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
118
+ def get_slo_report_with_http_info(report_id, opts = {})
119
+ unstable_enabled = @api_client.config.unstable_operations["v2.get_slo_report".to_sym]
120
+ if unstable_enabled
121
+ @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_slo_report")
122
+ else
123
+ raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_slo_report"))
124
+ end
125
+
126
+ if @api_client.config.debugging
127
+ @api_client.config.logger.debug 'Calling API: ServiceLevelObjectivesAPI.get_slo_report ...'
128
+ end
129
+ # verify the required parameter 'report_id' is set
130
+ if @api_client.config.client_side_validation && report_id.nil?
131
+ fail ArgumentError, "Missing the required parameter 'report_id' when calling ServiceLevelObjectivesAPI.get_slo_report"
132
+ end
133
+ # resource path
134
+ local_var_path = '/api/v2/slo/report/{report_id}/download'.sub('{report_id}', CGI.escape(report_id.to_s).gsub('%2F', '/'))
135
+
136
+ # query parameters
137
+ query_params = opts[:query_params] || {}
138
+
139
+ # header parameters
140
+ header_params = opts[:header_params] || {}
141
+ # HTTP header 'Accept' (if needed)
142
+ header_params['Accept'] = @api_client.select_header_accept(['text/csv', 'application/json'])
143
+
144
+ # form parameters
145
+ form_params = opts[:form_params] || {}
146
+
147
+ # http body (model)
148
+ post_body = opts[:debug_body]
149
+
150
+ # return_type
151
+ return_type = opts[:debug_return_type] || 'String'
152
+
153
+ # auth_names
154
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
155
+
156
+ new_options = opts.merge(
157
+ :operation => :get_slo_report,
158
+ :header_params => header_params,
159
+ :query_params => query_params,
160
+ :form_params => form_params,
161
+ :body => post_body,
162
+ :auth_names => auth_names,
163
+ :return_type => return_type,
164
+ :api_version => "V2"
165
+ )
166
+
167
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
168
+ if @api_client.config.debugging
169
+ @api_client.config.logger.debug "API called: ServiceLevelObjectivesAPI#get_slo_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
170
+ end
171
+ return data, status_code, headers
172
+ end
173
+
174
+ # Get SLO report status.
175
+ #
176
+ # @see #get_slo_report_job_status_with_http_info
177
+ def get_slo_report_job_status(report_id, opts = {})
178
+ data, _status_code, _headers = get_slo_report_job_status_with_http_info(report_id, opts)
179
+ data
180
+ end
181
+
182
+ # Get SLO report status.
183
+ #
184
+ # Get the status of the SLO report job.
185
+ #
186
+ # @param report_id [String] The ID of the report job.
187
+ # @param opts [Hash] the optional parameters
188
+ # @return [Array<(SLOReportStatusGetResponse, Integer, Hash)>] SLOReportStatusGetResponse data, response status code and response headers
189
+ def get_slo_report_job_status_with_http_info(report_id, opts = {})
190
+ unstable_enabled = @api_client.config.unstable_operations["v2.get_slo_report_job_status".to_sym]
191
+ if unstable_enabled
192
+ @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_slo_report_job_status")
193
+ else
194
+ raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_slo_report_job_status"))
195
+ end
196
+
197
+ if @api_client.config.debugging
198
+ @api_client.config.logger.debug 'Calling API: ServiceLevelObjectivesAPI.get_slo_report_job_status ...'
199
+ end
200
+ # verify the required parameter 'report_id' is set
201
+ if @api_client.config.client_side_validation && report_id.nil?
202
+ fail ArgumentError, "Missing the required parameter 'report_id' when calling ServiceLevelObjectivesAPI.get_slo_report_job_status"
203
+ end
204
+ # resource path
205
+ local_var_path = '/api/v2/slo/report/{report_id}/status'.sub('{report_id}', CGI.escape(report_id.to_s).gsub('%2F', '/'))
206
+
207
+ # query parameters
208
+ query_params = opts[:query_params] || {}
209
+
210
+ # header parameters
211
+ header_params = opts[:header_params] || {}
212
+ # HTTP header 'Accept' (if needed)
213
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
214
+
215
+ # form parameters
216
+ form_params = opts[:form_params] || {}
217
+
218
+ # http body (model)
219
+ post_body = opts[:debug_body]
220
+
221
+ # return_type
222
+ return_type = opts[:debug_return_type] || 'SLOReportStatusGetResponse'
223
+
224
+ # auth_names
225
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
226
+
227
+ new_options = opts.merge(
228
+ :operation => :get_slo_report_job_status,
229
+ :header_params => header_params,
230
+ :query_params => query_params,
231
+ :form_params => form_params,
232
+ :body => post_body,
233
+ :auth_names => auth_names,
234
+ :return_type => return_type,
235
+ :api_version => "V2"
236
+ )
237
+
238
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
239
+ if @api_client.config.debugging
240
+ @api_client.config.logger.debug "API called: ServiceLevelObjectivesAPI#get_slo_report_job_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
241
+ end
242
+ return data, status_code, headers
243
+ end
244
+ end
245
+ end
@@ -584,13 +584,16 @@ module DatadogAPIClient::V2
584
584
  # Get hourly usage for application security.
585
585
  #
586
586
  # Get hourly usage for application security .
587
- # **Note:** hourly usage data for all products is now available in the [Get hourly usage by product family API](https://docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family)
587
+ # **Note:** This endpoint has been deprecated. Hourly usage data for all products is now available in the [Get hourly usage by product family API](https://docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family)
588
+ #
589
+ # @deprecated This API is deprecated.
588
590
  #
589
591
  # @param start_hr [Time] Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage beginning at this hour.
590
592
  # @param opts [Hash] the optional parameters
591
593
  # @option opts [Time] :end_hr Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage ending **before** this hour.
592
594
  # @return [Array<(UsageApplicationSecurityMonitoringResponse, Integer, Hash)>] UsageApplicationSecurityMonitoringResponse data, response status code and response headers
593
595
  def get_usage_application_security_monitoring_with_http_info(start_hr, opts = {})
596
+ warn "[DEPRECATION] `GetUsageApplicationSecurityMonitoring` is deprecated."
594
597
 
595
598
  if @api_client.config.debugging
596
599
  @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_application_security_monitoring ...'
@@ -653,13 +656,16 @@ module DatadogAPIClient::V2
653
656
  # Get hourly usage for Lambda traced invocations.
654
657
  #
655
658
  # Get hourly usage for Lambda traced invocations.
656
- # **Note:** hourly usage data for all products is now available in the [Get hourly usage by product family API](https://docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family)
659
+ # **Note:** This endpoint has been deprecated.. Hourly usage data for all products is now available in the [Get hourly usage by product family API](https://docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family)
660
+ #
661
+ # @deprecated This API is deprecated.
657
662
  #
658
663
  # @param start_hr [Time] Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage beginning at this hour.
659
664
  # @param opts [Hash] the optional parameters
660
665
  # @option opts [Time] :end_hr Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage ending **before** this hour.
661
666
  # @return [Array<(UsageLambdaTracedInvocationsResponse, Integer, Hash)>] UsageLambdaTracedInvocationsResponse data, response status code and response headers
662
667
  def get_usage_lambda_traced_invocations_with_http_info(start_hr, opts = {})
668
+ warn "[DEPRECATION] `GetUsageLambdaTracedInvocations` is deprecated."
663
669
 
664
670
  if @api_client.config.debugging
665
671
  @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_lambda_traced_invocations ...'
@@ -722,13 +728,16 @@ module DatadogAPIClient::V2
722
728
  # Get hourly usage for observability pipelines.
723
729
  #
724
730
  # Get hourly usage for observability pipelines.
725
- # **Note:** hourly usage data for all products is now available in the [Get hourly usage by product family API](https://docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family)
731
+ # **Note:** This endpoint has been deprecated. Hourly usage data for all products is now available in the [Get hourly usage by product family API](https://docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family)
732
+ #
733
+ # @deprecated This API is deprecated.
726
734
  #
727
735
  # @param start_hr [Time] Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage beginning at this hour.
728
736
  # @param opts [Hash] the optional parameters
729
737
  # @option opts [Time] :end_hr Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage ending **before** this hour.
730
738
  # @return [Array<(UsageObservabilityPipelinesResponse, Integer, Hash)>] UsageObservabilityPipelinesResponse data, response status code and response headers
731
739
  def get_usage_observability_pipelines_with_http_info(start_hr, opts = {})
740
+ warn "[DEPRECATION] `GetUsageObservabilityPipelines` is deprecated."
732
741
 
733
742
  if @api_client.config.debugging
734
743
  @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_observability_pipelines ...'
@@ -24,7 +24,7 @@ module DatadogAPIClient::V2
24
24
  # Key/Value pair of attributes used for create request.
25
25
  attr_accessor :attributes
26
26
 
27
- # Relationship of AuthN Mapping create object to Role.
27
+ # Relationship of AuthN Mapping create object to a Role or Team.
28
28
  attr_accessor :relationships
29
29
 
30
30
  # AuthN Mappings resource type.
@@ -17,64 +17,47 @@ require 'date'
17
17
  require 'time'
18
18
 
19
19
  module DatadogAPIClient::V2
20
- # Relationship of AuthN Mapping create object to Role.
21
- class AuthNMappingCreateRelationships
22
- include BaseGenericModel
23
-
24
- # Relationship to role.
25
- attr_accessor :role
26
-
27
- # Attribute mapping from ruby-style variable name to JSON key.
28
- # @!visibility private
29
- def self.attribute_map
30
- {
31
- :'role' => :'role'
32
- }
33
- end
34
-
35
- # Attribute type mapping.
36
- # @!visibility private
37
- def self.openapi_types
38
- {
39
- :'role' => :'RelationshipToRole'
40
- }
41
- end
42
-
43
- # Initializes the object
44
- # @param attributes [Hash] Model attributes in the form of hash
45
- # @!visibility private
46
- def initialize(attributes = {})
47
- if (!attributes.is_a?(Hash))
48
- fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AuthNMappingCreateRelationships` initialize method"
20
+ # Relationship of AuthN Mapping create object to a Role or Team.
21
+ module AuthNMappingCreateRelationships
22
+ class << self
23
+ include BaseOneOfModel
24
+ include BaseOneOfModelNoDiscriminator
25
+
26
+ # List of class defined in oneOf (OpenAPI v3)
27
+ def openapi_one_of
28
+ [
29
+ :'AuthNMappingRelationshipToRole',
30
+ :'AuthNMappingRelationshipToTeam'
31
+ ]
49
32
  end
50
-
51
- # check to see if the attribute exists and convert string to symbol for hash key
52
- attributes = attributes.each_with_object({}) { |(k, v), h|
53
- if (!self.class.attribute_map.key?(k.to_sym))
54
- fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::AuthNMappingCreateRelationships`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
33
+ # Builds the object
34
+ # @param data [Mixed] Data to be matched against the list of oneOf items
35
+ # @return [Object] Returns the model or the data itself
36
+ def build(data)
37
+ # Go through the list of oneOf items and attempt to identify the appropriate one.
38
+ # Note:
39
+ # - We do not attempt to check whether exactly one item matches.
40
+ # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
41
+ # due to the way the deserialization is made in the base_object template (it just casts without verifying).
42
+ # - TODO: scalar values are de facto behaving as if they were nullable.
43
+ # - TODO: logging when debugging is set.
44
+ openapi_one_of.each do |klass|
45
+ begin
46
+ next if klass == :AnyType # "nullable: true"
47
+ typed_data = find_and_cast_into_type(klass, data)
48
+ next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed
49
+ return typed_data if typed_data
50
+ rescue # rescue all errors so we keep iterating even if the current item lookup raises
51
+ end
55
52
  end
56
- h[k.to_sym] = v
57
- }
58
53
 
59
- if attributes.key?(:'role')
60
- self.role = attributes[:'role']
54
+ if openapi_one_of.include?(:AnyType)
55
+ data
56
+ else
57
+ self._unparsed = true
58
+ DatadogAPIClient::UnparsedObject.new(data)
59
+ end
61
60
  end
62
61
  end
63
-
64
- # Checks equality by comparing each attribute.
65
- # @param o [Object] Object to be compared
66
- # @!visibility private
67
- def ==(o)
68
- return true if self.equal?(o)
69
- self.class == o.class &&
70
- role == o.role
71
- end
72
-
73
- # Calculates hash code according to all attributes.
74
- # @return [Integer] Hash code
75
- # @!visibility private
76
- def hash
77
- [role].hash
78
- end
79
62
  end
80
63
  end
@@ -27,7 +27,8 @@ module DatadogAPIClient::V2
27
27
  def openapi_one_of
28
28
  [
29
29
  :'SAMLAssertionAttribute',
30
- :'Role'
30
+ :'Role',
31
+ :'AuthNMappingTeam'
31
32
  ]
32
33
  end
33
34
  # Builds the object
@@ -0,0 +1,98 @@
1
+ =begin
2
+ #Datadog API V2 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://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
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::V2
20
+ # Relationship of AuthN Mapping to a Role.
21
+ class AuthNMappingRelationshipToRole
22
+ include BaseGenericModel
23
+
24
+ # Relationship to role.
25
+ attr_reader :role
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ # @!visibility private
29
+ def self.attribute_map
30
+ {
31
+ :'role' => :'role'
32
+ }
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ # @!visibility private
37
+ def self.openapi_types
38
+ {
39
+ :'role' => :'RelationshipToRole'
40
+ }
41
+ end
42
+
43
+ # Initializes the object
44
+ # @param attributes [Hash] Model attributes in the form of hash
45
+ # @!visibility private
46
+ def initialize(attributes = {})
47
+ if (!attributes.is_a?(Hash))
48
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AuthNMappingRelationshipToRole` initialize method"
49
+ end
50
+
51
+ # check to see if the attribute exists and convert string to symbol for hash key
52
+ attributes = attributes.each_with_object({}) { |(k, v), h|
53
+ if (!self.class.attribute_map.key?(k.to_sym))
54
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::AuthNMappingRelationshipToRole`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
55
+ end
56
+ h[k.to_sym] = v
57
+ }
58
+
59
+ if attributes.key?(:'role')
60
+ self.role = attributes[:'role']
61
+ end
62
+ end
63
+
64
+ # Check to see if the all the properties in the model are valid
65
+ # @return true if the model is valid
66
+ # @!visibility private
67
+ def valid?
68
+ return false if @role.nil?
69
+ true
70
+ end
71
+
72
+ # Custom attribute writer method with validation
73
+ # @param role [Object] Object to be assigned
74
+ # @!visibility private
75
+ def role=(role)
76
+ if role.nil?
77
+ fail ArgumentError, 'invalid value for "role", role cannot be nil.'
78
+ end
79
+ @role = role
80
+ end
81
+
82
+ # Checks equality by comparing each attribute.
83
+ # @param o [Object] Object to be compared
84
+ # @!visibility private
85
+ def ==(o)
86
+ return true if self.equal?(o)
87
+ self.class == o.class &&
88
+ role == o.role
89
+ end
90
+
91
+ # Calculates hash code according to all attributes.
92
+ # @return [Integer] Hash code
93
+ # @!visibility private
94
+ def hash
95
+ [role].hash
96
+ end
97
+ end
98
+ end