Skip to content
Closed
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
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ zip = { version = "8", default-features = false, features = ["deflate"], optiona

# Datadog API client — pinned to 0.33.0 tag
# Use default-features = false; feature sets are activated per-target via features above
datadog-api-client = { git = "https://github.com/DataDog/datadog-api-client-rust", rev = "68fea1224e7ce303787b842811103b99c6406cf4", optional = true, default-features = false }
datadog-api-client = { git = "https://github.com/DataDog/datadog-api-client-rust", rev = "3da0c7276a671a23270abbff5fbd218a745fa691", optional = true, default-features = false }

# HTTP middleware (version-matched to DD client; compiles on all targets)
reqwest-middleware = "0.5"
Expand Down
2 changes: 2 additions & 0 deletions src/auth/callback.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Code generated by openapi-transformer. DO NOT EDIT.

#[cfg(not(target_arch = "wasm32"))]
use anyhow::bail;
use anyhow::Result;
Expand Down
2 changes: 2 additions & 0 deletions src/auth/dcr.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Code generated by openapi-transformer. DO NOT EDIT.

#[cfg(not(target_arch = "wasm32"))]
use anyhow::{bail, Context, Result};
#[cfg(not(target_arch = "wasm32"))]
Expand Down
2 changes: 2 additions & 0 deletions src/auth/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Code generated by openapi-transformer. DO NOT EDIT.

pub mod callback;
pub mod dcr;
pub mod pkce;
Expand Down
2 changes: 2 additions & 0 deletions src/auth/pkce.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Code generated by openapi-transformer. DO NOT EDIT.

#[cfg(not(target_arch = "wasm32"))]
use anyhow::Result;
#[cfg(not(target_arch = "wasm32"))]
Expand Down
2 changes: 2 additions & 0 deletions src/auth/storage.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Code generated by openapi-transformer. DO NOT EDIT.

use anyhow::{Context, Result};
use std::path::PathBuf;

Expand Down
4 changes: 3 additions & 1 deletion src/auth/types.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Code generated by openapi-transformer. DO NOT EDIT.

use chrono::Utc;
use serde::{Deserialize, Serialize};

Expand Down Expand Up @@ -260,7 +262,7 @@ pub fn default_scopes() -> Vec<&'static str> {
"synthetics_read",
"synthetics_write",
"synthetics_private_location_read",
// Tag Rules
// Tag Policies
"telemetry_rules_create",
"telemetry_rules_read",
// Teams
Expand Down
42 changes: 11 additions & 31 deletions src/client.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Code generated by openapi-transformer. DO NOT EDIT.

use reqwest_middleware::{ClientBuilder, ClientWithMiddleware};

#[cfg(not(target_arch = "wasm32"))]
Expand Down Expand Up @@ -31,24 +33,6 @@ impl Middleware for BearerAuthMiddleware {
}
}

#[cfg(not(target_arch = "wasm32"))]
struct RateLimitCaptureMiddleware;

#[cfg(not(target_arch = "wasm32"))]
#[async_trait]
impl Middleware for RateLimitCaptureMiddleware {
async fn handle(
&self,
req: reqwest_middleware::reqwest::Request,
extensions: &mut Extensions,
next: Next<'_>,
) -> reqwest_middleware::Result<reqwest_middleware::reqwest::Response> {
let resp = next.run(req, extensions).await?;
crate::rate_limit::store_last(crate::rate_limit::extract_from_headers(resp.headers()));
Ok(resp)
}
}

// The `datadog-api-client` SDK's `Configuration.user_agent` is `pub(crate)`
// with no setter, so the only way to override it from outside the crate is
// via middleware that mutates the header after the SDK builds the request.
Expand Down Expand Up @@ -148,9 +132,7 @@ pub fn make_dd_client(cfg: &Config, send_bearer: bool) -> Option<ClientWithMiddl
let reqwest_client = reqwest_middleware::reqwest::Client::builder()
.build()
.expect("failed to build reqwest client");
let mut builder = ClientBuilder::new(reqwest_client)
.with(UserAgentMiddleware)
.with(RateLimitCaptureMiddleware);
let mut builder = ClientBuilder::new(reqwest_client).with(UserAgentMiddleware);
if send_bearer {
if let Some(token) = cfg.access_token.as_ref() {
builder = builder.with(BearerAuthMiddleware {
Expand Down Expand Up @@ -390,15 +372,13 @@ static UNSTABLE_OPS: &[&str] = &[
"v2.trigger_investigation",
// Cloud Cost Management — Anomalies (1)
"v2.list_cost_anomalies",
// Tag Rules (6)
"v2.create_tag_rule",
"v2.delete_tag_rule",
"v2.get_tag_rule",
"v2.get_tag_rule_score",
"v2.list_tag_rules",
"v2.update_tag_rule",
// RUM Session Replay (1)
"v2.get_segments",
// Tag Policies (6)
"v2.create_tag_policy",
"v2.delete_tag_policy",
"v2.get_tag_policy",
"v2.get_tag_policy_score",
"v2.list_tag_policies",
"v2.update_tag_policy",
// Model Lab (16)
"v2.delete_model_lab_run",
"v2.get_model_lab_artifact_content",
Expand Down Expand Up @@ -538,7 +518,7 @@ mod tests {

#[test]
fn test_unstable_ops_count() {
assert_eq!(UNSTABLE_OPS.len(), 187);
assert_eq!(UNSTABLE_OPS.len(), 186);
}

#[test]
Expand Down
2 changes: 2 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Code generated by openapi-transformer. DO NOT EDIT.

use anyhow::{bail, Result};
#[cfg(not(feature = "browser"))]
use serde::Deserialize;
Expand Down
Loading
Loading