Skip to content

Commit 71e3b2f

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 86a61b6 of spec repo (DataDog#3583)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 467de0a commit 71e3b2f

21 files changed

Lines changed: 2566 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 482 additions & 0 deletions
Large diffs are not rendered by default.

features/scenarios_model_mapping.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3109,6 +3109,12 @@
31093109
"dataset_id" => "String",
31103110
"body" => "DatasetUpdateRequest",
31113111
},
3112+
"v2.ExecuteDdsqlTabularQuery" => {
3113+
"body" => "DdsqlTabularQueryRequest",
3114+
},
3115+
"v2.FetchDdsqlTabularQuery" => {
3116+
"body" => "DdsqlTabularQueryFetchRequest",
3117+
},
31123118
"v2.CreateDataDeletionRequest" => {
31133119
"product" => "String",
31143120
"body" => "CreateDataDeletionRequestBody",

lib/datadog_api_client/configuration.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,8 @@ def initialize
467467
"v2.get_all_datasets": false,
468468
"v2.get_dataset": false,
469469
"v2.update_dataset": false,
470+
"v2.execute_ddsql_tabular_query": false,
471+
"v2.fetch_ddsql_tabular_query": false,
470472
"v2.cancel_data_deletion_request": false,
471473
"v2.create_data_deletion_request": false,
472474
"v2.get_data_deletion_requests": false,

lib/datadog_api_client/inflector.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2834,6 +2834,22 @@ def overrides
28342834
"v2.data_transform" => "DataTransform",
28352835
"v2.data_transform_properties" => "DataTransformProperties",
28362836
"v2.data_transform_type" => "DataTransformType",
2837+
"v2.ddsql_tabular_query_column" => "DdsqlTabularQueryColumn",
2838+
"v2.ddsql_tabular_query_fetch_request" => "DdsqlTabularQueryFetchRequest",
2839+
"v2.ddsql_tabular_query_fetch_request_attributes" => "DdsqlTabularQueryFetchRequestAttributes",
2840+
"v2.ddsql_tabular_query_fetch_request_data" => "DdsqlTabularQueryFetchRequestData",
2841+
"v2.ddsql_tabular_query_fetch_request_type" => "DdsqlTabularQueryFetchRequestType",
2842+
"v2.ddsql_tabular_query_request" => "DdsqlTabularQueryRequest",
2843+
"v2.ddsql_tabular_query_request_attributes" => "DdsqlTabularQueryRequestAttributes",
2844+
"v2.ddsql_tabular_query_request_data" => "DdsqlTabularQueryRequestData",
2845+
"v2.ddsql_tabular_query_request_type" => "DdsqlTabularQueryRequestType",
2846+
"v2.ddsql_tabular_query_response" => "DdsqlTabularQueryResponse",
2847+
"v2.ddsql_tabular_query_response_attributes" => "DdsqlTabularQueryResponseAttributes",
2848+
"v2.ddsql_tabular_query_response_data" => "DdsqlTabularQueryResponseData",
2849+
"v2.ddsql_tabular_query_response_meta" => "DdsqlTabularQueryResponseMeta",
2850+
"v2.ddsql_tabular_query_response_type" => "DdsqlTabularQueryResponseType",
2851+
"v2.ddsql_tabular_query_state" => "DdsqlTabularQueryState",
2852+
"v2.ddsql_tabular_query_time_window" => "DdsqlTabularQueryTimeWindow",
28372853
"v2.default_rulesets_per_language_data" => "DefaultRulesetsPerLanguageData",
28382854
"v2.default_rulesets_per_language_data_attributes" => "DefaultRulesetsPerLanguageDataAttributes",
28392855
"v2.default_rulesets_per_language_data_type" => "DefaultRulesetsPerLanguageDataType",
@@ -8151,6 +8167,7 @@ def overrides
81518167
"v2.data_deletion_api" => "DataDeletionAPI",
81528168
"v2.data_observability_api" => "DataObservabilityAPI",
81538169
"v2.datasets_api" => "DatasetsAPI",
8170+
"v2.ddsql_api" => "DDSQLAPI",
81548171
"v2.deployment_gates_api" => "DeploymentGatesAPI",
81558172
"v2.domain_allowlist_api" => "DomainAllowlistAPI",
81568173
"v2.dora_metrics_api" => "DORAMetricsAPI",
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
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 DDSQLAPI
20+
attr_accessor :api_client
21+
22+
def initialize(api_client = DatadogAPIClient::APIClient.default)
23+
@api_client = api_client
24+
end
25+
26+
# Execute a tabular DDSQL query.
27+
#
28+
# @see #execute_ddsql_tabular_query_with_http_info
29+
def execute_ddsql_tabular_query(body, opts = {})
30+
data, _status_code, _headers = execute_ddsql_tabular_query_with_http_info(body, opts)
31+
data
32+
end
33+
34+
# Execute a tabular DDSQL query.
35+
#
36+
# Submit a DDSQL statement and return either a `running` state with an opaque `query_id`
37+
# for the client to poll, or a `completed` state with the column-major result set inlined
38+
# when the query finishes quickly enough to be served synchronously.
39+
#
40+
# @param body [DdsqlTabularQueryRequest]
41+
# @param opts [Hash] the optional parameters
42+
# @return [Array<(DdsqlTabularQueryResponse, Integer, Hash)>] DdsqlTabularQueryResponse data, response status code and response headers
43+
def execute_ddsql_tabular_query_with_http_info(body, opts = {})
44+
unstable_enabled = @api_client.config.unstable_operations["v2.execute_ddsql_tabular_query".to_sym]
45+
if unstable_enabled
46+
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.execute_ddsql_tabular_query")
47+
else
48+
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.execute_ddsql_tabular_query"))
49+
end
50+
51+
if @api_client.config.debugging
52+
@api_client.config.logger.debug 'Calling API: DDSQLAPI.execute_ddsql_tabular_query ...'
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 DDSQLAPI.execute_ddsql_tabular_query"
57+
end
58+
# resource path
59+
local_var_path = '/api/v2/ddsql/query/tabular'
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] || 'DdsqlTabularQueryResponse'
79+
80+
# auth_names
81+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
82+
83+
new_options = opts.merge(
84+
:operation => :execute_ddsql_tabular_query,
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: DDSQLAPI#execute_ddsql_tabular_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
97+
end
98+
return data, status_code, headers
99+
end
100+
101+
# Fetch the result of a DDSQL query.
102+
#
103+
# @see #fetch_ddsql_tabular_query_with_http_info
104+
def fetch_ddsql_tabular_query(body, opts = {})
105+
data, _status_code, _headers = fetch_ddsql_tabular_query_with_http_info(body, opts)
106+
data
107+
end
108+
109+
# Fetch the result of a DDSQL query.
110+
#
111+
# Poll a previously submitted DDSQL query for results. Pass the opaque `query_id` returned
112+
# by a prior `ExecuteDdsqlTabularQuery` (or by a prior `FetchDdsqlTabularQuery` that
113+
# returned `state: running`) and the server returns either a `running` state to poll again
114+
# or a `completed` state with the column-major result set inlined.
115+
#
116+
# @param body [DdsqlTabularQueryFetchRequest]
117+
# @param opts [Hash] the optional parameters
118+
# @return [Array<(DdsqlTabularQueryResponse, Integer, Hash)>] DdsqlTabularQueryResponse data, response status code and response headers
119+
def fetch_ddsql_tabular_query_with_http_info(body, opts = {})
120+
unstable_enabled = @api_client.config.unstable_operations["v2.fetch_ddsql_tabular_query".to_sym]
121+
if unstable_enabled
122+
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.fetch_ddsql_tabular_query")
123+
else
124+
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.fetch_ddsql_tabular_query"))
125+
end
126+
127+
if @api_client.config.debugging
128+
@api_client.config.logger.debug 'Calling API: DDSQLAPI.fetch_ddsql_tabular_query ...'
129+
end
130+
# verify the required parameter 'body' is set
131+
if @api_client.config.client_side_validation && body.nil?
132+
fail ArgumentError, "Missing the required parameter 'body' when calling DDSQLAPI.fetch_ddsql_tabular_query"
133+
end
134+
# resource path
135+
local_var_path = '/api/v2/ddsql/query/tabular/fetch'
136+
137+
# query parameters
138+
query_params = opts[:query_params] || {}
139+
140+
# header parameters
141+
header_params = opts[:header_params] || {}
142+
# HTTP header 'Accept' (if needed)
143+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
144+
# HTTP header 'Content-Type'
145+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
146+
147+
# form parameters
148+
form_params = opts[:form_params] || {}
149+
150+
# http body (model)
151+
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
152+
153+
# return_type
154+
return_type = opts[:debug_return_type] || 'DdsqlTabularQueryResponse'
155+
156+
# auth_names
157+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
158+
159+
new_options = opts.merge(
160+
:operation => :fetch_ddsql_tabular_query,
161+
:header_params => header_params,
162+
:query_params => query_params,
163+
:form_params => form_params,
164+
:body => post_body,
165+
:auth_names => auth_names,
166+
:return_type => return_type,
167+
:api_version => "V2"
168+
)
169+
170+
data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
171+
if @api_client.config.debugging
172+
@api_client.config.logger.debug "API called: DDSQLAPI#fetch_ddsql_tabular_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
173+
end
174+
return data, status_code, headers
175+
end
176+
end
177+
end

0 commit comments

Comments
 (0)