Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
482 changes: 482 additions & 0 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion LICENSE-3rdparty.csv
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jni-sys,https://github.com/jni-rs/jni-sys,MIT OR Apache-2.0,"Steven Fackler <sfa
jni-sys-macros,https://github.com/jni-rs/jni-sys,MIT OR Apache-2.0,Robert Bragg <robert@sixbynine.org>
js-sys,https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/js-sys,MIT OR Apache-2.0,The wasm-bindgen Developers
lazy_static,https://github.com/rust-lang-nursery/lazy-static.rs,MIT OR Apache-2.0,Marvin Löbel <loebel.marvin@gmail.com>
libc,https://github.com/rust-lang/libc,MIT OR Apache-2.0,The Rust Project Developers
libc,https://github.com/rust-lang/libc,MIT OR Apache-2.0,The libc Authors
linux-raw-sys,https://github.com/sunfishcode/linux-raw-sys,Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT,Dan Gohman <dev@sunfishcode.online>
litemap,https://github.com/unicode-org/icu4x,Unicode-3.0,The ICU4X Project Developers
lock_api,https://github.com/Amanieu/parking_lot,MIT OR Apache-2.0,Amanieu d'Antras <amanieu@gmail.com>
Expand Down
2 changes: 2 additions & 0 deletions src/datadog/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,8 @@ impl Default for Configuration {
("v2.get_all_datasets".to_owned(), false),
("v2.get_dataset".to_owned(), false),
("v2.update_dataset".to_owned(), false),
("v2.execute_ddsql_tabular_query".to_owned(), false),
("v2.fetch_ddsql_tabular_query".to_owned(), false),
("v2.cancel_data_deletion_request".to_owned(), false),
("v2.create_data_deletion_request".to_owned(), false),
("v2.get_data_deletion_requests".to_owned(), false),
Expand Down
444 changes: 444 additions & 0 deletions src/datadogV2/api/api_ddsql.rs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/datadogV2/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ pub mod api_dashboards;
pub mod api_data_deletion;
pub mod api_data_observability;
pub mod api_datasets;
pub mod api_ddsql;
pub mod api_deployment_gates;
pub mod api_domain_allowlist;
pub mod api_dora_metrics;
Expand Down
1 change: 1 addition & 0 deletions src/datadogV2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ pub use self::api::api_dashboards;
pub use self::api::api_data_deletion;
pub use self::api::api_data_observability;
pub use self::api::api_datasets;
pub use self::api::api_ddsql;
pub use self::api::api_deployment_gates;
pub use self::api::api_domain_allowlist;
pub use self::api::api_dora_metrics;
Expand Down
32 changes: 32 additions & 0 deletions src/datadogV2/model/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3460,6 +3460,38 @@ pub mod model_dataset_response_single;
pub use self::model_dataset_response_single::DatasetResponseSingle;
pub mod model_dataset_update_request;
pub use self::model_dataset_update_request::DatasetUpdateRequest;
pub mod model_ddsql_tabular_query_request;
pub use self::model_ddsql_tabular_query_request::DdsqlTabularQueryRequest;
pub mod model_ddsql_tabular_query_request_data;
pub use self::model_ddsql_tabular_query_request_data::DdsqlTabularQueryRequestData;
pub mod model_ddsql_tabular_query_request_attributes;
pub use self::model_ddsql_tabular_query_request_attributes::DdsqlTabularQueryRequestAttributes;
pub mod model_ddsql_tabular_query_time_window;
pub use self::model_ddsql_tabular_query_time_window::DdsqlTabularQueryTimeWindow;
pub mod model_ddsql_tabular_query_request_type;
pub use self::model_ddsql_tabular_query_request_type::DdsqlTabularQueryRequestType;
pub mod model_ddsql_tabular_query_response;
pub use self::model_ddsql_tabular_query_response::DdsqlTabularQueryResponse;
pub mod model_ddsql_tabular_query_response_data;
pub use self::model_ddsql_tabular_query_response_data::DdsqlTabularQueryResponseData;
pub mod model_ddsql_tabular_query_response_attributes;
pub use self::model_ddsql_tabular_query_response_attributes::DdsqlTabularQueryResponseAttributes;
pub mod model_ddsql_tabular_query_column;
pub use self::model_ddsql_tabular_query_column::DdsqlTabularQueryColumn;
pub mod model_ddsql_tabular_query_state;
pub use self::model_ddsql_tabular_query_state::DdsqlTabularQueryState;
pub mod model_ddsql_tabular_query_response_type;
pub use self::model_ddsql_tabular_query_response_type::DdsqlTabularQueryResponseType;
pub mod model_ddsql_tabular_query_response_meta;
pub use self::model_ddsql_tabular_query_response_meta::DdsqlTabularQueryResponseMeta;
pub mod model_ddsql_tabular_query_fetch_request;
pub use self::model_ddsql_tabular_query_fetch_request::DdsqlTabularQueryFetchRequest;
pub mod model_ddsql_tabular_query_fetch_request_data;
pub use self::model_ddsql_tabular_query_fetch_request_data::DdsqlTabularQueryFetchRequestData;
pub mod model_ddsql_tabular_query_fetch_request_attributes;
pub use self::model_ddsql_tabular_query_fetch_request_attributes::DdsqlTabularQueryFetchRequestAttributes;
pub mod model_ddsql_tabular_query_fetch_request_type;
pub use self::model_ddsql_tabular_query_fetch_request_type::DdsqlTabularQueryFetchRequestType;
pub mod model_create_data_deletion_request_body;
pub use self::model_create_data_deletion_request_body::CreateDataDeletionRequestBody;
pub mod model_create_data_deletion_request_body_data;
Expand Down
122 changes: 122 additions & 0 deletions src/datadogV2/model/model_ddsql_tabular_query_column.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2019-Present Datadog, Inc.
use serde::de::{Error, MapAccess, Visitor};
use serde::{Deserialize, Deserializer, Serialize};
use serde_with::skip_serializing_none;
use std::fmt::{self, Formatter};

/// A single column of a DDSQL tabular query result.
#[non_exhaustive]
#[skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Serialize)]
pub struct DdsqlTabularQueryColumn {
/// Name of the column as projected by the SQL statement.
#[serde(rename = "name")]
pub name: String,
/// DDSQL data type of the column's values, for example `VARCHAR`, `BIGINT`,
/// `DECIMAL`, `BOOLEAN`, `TIMESTAMP`, `JSON`, or an array variant such as
/// `VARCHAR[]`. See the
/// [DDSQL data-types reference](<https://docs.datadoghq.com/ddsql_reference/#data-types>)
/// for the full, up-to-date list.
#[serde(rename = "type")]
pub type_: String,
/// Column values in row order. The element type matches the column's `type`;
/// for example a `VARCHAR` column carries strings, a `TIMESTAMP` column carries
/// Unix-millisecond integers. `null` is allowed for missing values.
#[serde(rename = "values")]
pub values: Vec<serde_json::Value>,
#[serde(flatten)]
pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
#[serde(skip)]
#[serde(default)]
pub(crate) _unparsed: bool,
}

impl DdsqlTabularQueryColumn {
pub fn new(
name: String,
type_: String,
values: Vec<serde_json::Value>,
) -> DdsqlTabularQueryColumn {
DdsqlTabularQueryColumn {
name,
type_,
values,
additional_properties: std::collections::BTreeMap::new(),
_unparsed: false,
}
}

pub fn additional_properties(
mut self,
value: std::collections::BTreeMap<String, serde_json::Value>,
) -> Self {
self.additional_properties = value;
self
}
}

impl<'de> Deserialize<'de> for DdsqlTabularQueryColumn {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: Deserializer<'de>,
{
struct DdsqlTabularQueryColumnVisitor;
impl<'a> Visitor<'a> for DdsqlTabularQueryColumnVisitor {
type Value = DdsqlTabularQueryColumn;

fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.write_str("a mapping")
}

fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
where
M: MapAccess<'a>,
{
let mut name: Option<String> = None;
let mut type_: Option<String> = None;
let mut values: Option<Vec<serde_json::Value>> = None;
let mut additional_properties: std::collections::BTreeMap<
String,
serde_json::Value,
> = std::collections::BTreeMap::new();
let mut _unparsed = false;

while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
match k.as_str() {
"name" => {
name = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
"type" => {
type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
"values" => {
values = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
&_ => {
if let Ok(value) = serde_json::from_value(v.clone()) {
additional_properties.insert(k, value);
}
}
}
}
let name = name.ok_or_else(|| M::Error::missing_field("name"))?;
let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?;
let values = values.ok_or_else(|| M::Error::missing_field("values"))?;

let content = DdsqlTabularQueryColumn {
name,
type_,
values,
additional_properties,
_unparsed,
};

Ok(content)
}
}

deserializer.deserialize_any(DdsqlTabularQueryColumnVisitor)
}
}
95 changes: 95 additions & 0 deletions src/datadogV2/model/model_ddsql_tabular_query_fetch_request.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2019-Present Datadog, Inc.
use serde::de::{Error, MapAccess, Visitor};
use serde::{Deserialize, Deserializer, Serialize};
use serde_with::skip_serializing_none;
use std::fmt::{self, Formatter};

/// Wrapper for a DDSQL tabular query fetch request.
#[non_exhaustive]
#[skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Serialize)]
pub struct DdsqlTabularQueryFetchRequest {
/// JSON:API resource object for a DDSQL tabular query fetch request.
#[serde(rename = "data")]
pub data: crate::datadogV2::model::DdsqlTabularQueryFetchRequestData,
#[serde(flatten)]
pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
#[serde(skip)]
#[serde(default)]
pub(crate) _unparsed: bool,
}

impl DdsqlTabularQueryFetchRequest {
pub fn new(
data: crate::datadogV2::model::DdsqlTabularQueryFetchRequestData,
) -> DdsqlTabularQueryFetchRequest {
DdsqlTabularQueryFetchRequest {
data,
additional_properties: std::collections::BTreeMap::new(),
_unparsed: false,
}
}

pub fn additional_properties(
mut self,
value: std::collections::BTreeMap<String, serde_json::Value>,
) -> Self {
self.additional_properties = value;
self
}
}

impl<'de> Deserialize<'de> for DdsqlTabularQueryFetchRequest {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: Deserializer<'de>,
{
struct DdsqlTabularQueryFetchRequestVisitor;
impl<'a> Visitor<'a> for DdsqlTabularQueryFetchRequestVisitor {
type Value = DdsqlTabularQueryFetchRequest;

fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.write_str("a mapping")
}

fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
where
M: MapAccess<'a>,
{
let mut data: Option<crate::datadogV2::model::DdsqlTabularQueryFetchRequestData> =
None;
let mut additional_properties: std::collections::BTreeMap<
String,
serde_json::Value,
> = std::collections::BTreeMap::new();
let mut _unparsed = false;

while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
match k.as_str() {
"data" => {
data = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
&_ => {
if let Ok(value) = serde_json::from_value(v.clone()) {
additional_properties.insert(k, value);
}
}
}
}
let data = data.ok_or_else(|| M::Error::missing_field("data"))?;

let content = DdsqlTabularQueryFetchRequest {
data,
additional_properties,
_unparsed,
};

Ok(content)
}
}

deserializer.deserialize_any(DdsqlTabularQueryFetchRequestVisitor)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2019-Present Datadog, Inc.
use serde::de::{Error, MapAccess, Visitor};
use serde::{Deserialize, Deserializer, Serialize};
use serde_with::skip_serializing_none;
use std::fmt::{self, Formatter};

/// Attributes describing which previously submitted DDSQL query to fetch.
#[non_exhaustive]
#[skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Serialize)]
pub struct DdsqlTabularQueryFetchRequestAttributes {
/// Opaque token returned by an earlier execute or fetch response that carried
/// `state: running`. Identifies the query to poll for results.
#[serde(rename = "query_id")]
pub query_id: String,
#[serde(flatten)]
pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
#[serde(skip)]
#[serde(default)]
pub(crate) _unparsed: bool,
}

impl DdsqlTabularQueryFetchRequestAttributes {
pub fn new(query_id: String) -> DdsqlTabularQueryFetchRequestAttributes {
DdsqlTabularQueryFetchRequestAttributes {
query_id,
additional_properties: std::collections::BTreeMap::new(),
_unparsed: false,
}
}

pub fn additional_properties(
mut self,
value: std::collections::BTreeMap<String, serde_json::Value>,
) -> Self {
self.additional_properties = value;
self
}
}

impl<'de> Deserialize<'de> for DdsqlTabularQueryFetchRequestAttributes {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: Deserializer<'de>,
{
struct DdsqlTabularQueryFetchRequestAttributesVisitor;
impl<'a> Visitor<'a> for DdsqlTabularQueryFetchRequestAttributesVisitor {
type Value = DdsqlTabularQueryFetchRequestAttributes;

fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.write_str("a mapping")
}

fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
where
M: MapAccess<'a>,
{
let mut query_id: Option<String> = None;
let mut additional_properties: std::collections::BTreeMap<
String,
serde_json::Value,
> = std::collections::BTreeMap::new();
let mut _unparsed = false;

while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
match k.as_str() {
"query_id" => {
query_id = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
&_ => {
if let Ok(value) = serde_json::from_value(v.clone()) {
additional_properties.insert(k, value);
}
}
}
}
let query_id = query_id.ok_or_else(|| M::Error::missing_field("query_id"))?;

let content = DdsqlTabularQueryFetchRequestAttributes {
query_id,
additional_properties,
_unparsed,
};

Ok(content)
}
}

deserializer.deserialize_any(DdsqlTabularQueryFetchRequestAttributesVisitor)
}
}
Loading
Loading