Skip to content
Open
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
6 changes: 6 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125771,6 +125771,12 @@ paths:
name: filter[provider]
schema:
type: string
- description: When `true`, only return metrics for currently enabled accounts. When omitted or `false`, return all metrics present in tag metadata. Metrics not recognized by Cloud Cost Management are always excluded.
example: true
in: query
name: filter[enabled_metrics_only]
schema:
type: boolean
responses:
"200":
content:
Expand Down
14 changes: 14 additions & 0 deletions src/datadogV2/api/api_cloud_cost_management.rs
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,8 @@ impl ListCostTagMetadataOptionalParams {
pub struct ListCostTagMetadataMetricsOptionalParams {
/// Filter results to a specific provider. Common cloud values are `aws`, `azure`, `gcp`, `Oracle` (OCI), and `custom`. SaaS billing integrations (for example, `Snowflake`, `MongoDB`, `Databricks`) are also accepted using their display-name string. Values are case-sensitive.
pub filter_provider: Option<String>,
/// When `true`, only return metrics for currently enabled accounts. When omitted or `false`, return all metrics present in tag metadata. Metrics not recognized by Cloud Cost Management are always excluded.
pub filter_enabled_metrics_only: Option<bool>,
}

impl ListCostTagMetadataMetricsOptionalParams {
Expand All @@ -442,6 +444,11 @@ impl ListCostTagMetadataMetricsOptionalParams {
self.filter_provider = Some(value);
self
}
/// When `true`, only return metrics for currently enabled accounts. When omitted or `false`, return all metrics present in tag metadata. Metrics not recognized by Cloud Cost Management are always excluded.
pub fn filter_enabled_metrics_only(mut self, value: bool) -> Self {
self.filter_enabled_metrics_only = Some(value);
self
}
}

/// ListCostTagMetadataOrchestratorsOptionalParams is a struct for passing parameters to the method [`CloudCostManagementAPI::list_cost_tag_metadata_orchestrators`]
Expand Down Expand Up @@ -6500,6 +6507,7 @@ impl CloudCostManagementAPI {

// unbox and build optional parameters
let filter_provider = params.filter_provider;
let filter_enabled_metrics_only = params.filter_enabled_metrics_only;

let local_client = &self.client;

Expand All @@ -6516,6 +6524,12 @@ impl CloudCostManagementAPI {
local_req_builder =
local_req_builder.query(&[("filter[provider]", &local_query_param.to_string())]);
};
if let Some(ref local_query_param) = filter_enabled_metrics_only {
local_req_builder = local_req_builder.query(&[(
"filter[enabled_metrics_only]",
&local_query_param.to_string(),
)]);
};

// build headers
let mut headers = HeaderMap::new();
Expand Down
4 changes: 4 additions & 0 deletions tests/scenarios/function_mappings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32175,9 +32175,13 @@ fn test_v2_list_cost_tag_metadata_metrics(
let filter_provider = _parameters
.get("filter[provider]")
.and_then(|param| Some(serde_json::from_value(param.clone()).unwrap()));
let filter_enabled_metrics_only = _parameters
.get("filter[enabled_metrics_only]")
.and_then(|param| Some(serde_json::from_value(param.clone()).unwrap()));
let mut params =
datadogV2::api_cloud_cost_management::ListCostTagMetadataMetricsOptionalParams::default();
params.filter_provider = filter_provider;
params.filter_enabled_metrics_only = filter_enabled_metrics_only;
let response =
match block_on(api.list_cost_tag_metadata_metrics_with_http_info(filter_month, params)) {
Ok(response) => response,
Expand Down
Loading