Skip to content

Deprecate metadata fields in api spec #700

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2025-05-27 17:12:16.501759",
"spec_repo_commit": "ed439f7c"
"regenerated": "2025-06-03 19:04:23.178679",
"spec_repo_commit": "91411f12"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-05-27 17:12:16.518477",
"spec_repo_commit": "ed439f7c"
"regenerated": "2025-06-03 19:04:23.195368",
"spec_repo_commit": "91411f12"
}
}
}
5 changes: 5 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10939,19 +10939,24 @@ components:
example: {}
properties:
aggr:
deprecated: true
description: Query aggregator function.
type: string
expression:
deprecated: true
description: Query expression.
type: string
metric:
deprecated: true
description: Query metric used.
type: string
query_index:
deprecated: true
description: Query index from original combined query.
format: int64
type: integer
scope:
deprecated: true
description: Query scope.
type: string
unit:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,23 @@ use std::fmt::{self, Formatter};
#[derive(Clone, Debug, PartialEq, Serialize)]
pub struct SLOHistoryMetricsSeriesMetadata {
/// Query aggregator function.
#[deprecated]
#[serde(rename = "aggr")]
pub aggr: Option<String>,
/// Query expression.
#[deprecated]
#[serde(rename = "expression")]
pub expression: Option<String>,
/// Query metric used.
#[deprecated]
#[serde(rename = "metric")]
pub metric: Option<String>,
/// Query index from original combined query.
#[deprecated]
#[serde(rename = "query_index")]
pub query_index: Option<i64>,
/// Query scope.
#[deprecated]
#[serde(rename = "scope")]
pub scope: Option<String>,
/// An array of metric units that contains up to two unit objects.
Expand All @@ -41,6 +46,7 @@ pub struct SLOHistoryMetricsSeriesMetadata {

impl SLOHistoryMetricsSeriesMetadata {
pub fn new() -> SLOHistoryMetricsSeriesMetadata {
#[allow(deprecated)]
SLOHistoryMetricsSeriesMetadata {
aggr: None,
expression: None,
Expand All @@ -53,31 +59,37 @@ impl SLOHistoryMetricsSeriesMetadata {
}
}

#[allow(deprecated)]
pub fn aggr(mut self, value: String) -> Self {
self.aggr = Some(value);
self
}

#[allow(deprecated)]
pub fn expression(mut self, value: String) -> Self {
self.expression = Some(value);
self
}

#[allow(deprecated)]
pub fn metric(mut self, value: String) -> Self {
self.metric = Some(value);
self
}

#[allow(deprecated)]
pub fn query_index(mut self, value: i64) -> Self {
self.query_index = Some(value);
self
}

#[allow(deprecated)]
pub fn scope(mut self, value: String) -> Self {
self.scope = Some(value);
self
}

#[allow(deprecated)]
pub fn unit(
mut self,
value: Option<Vec<Option<crate::datadogV1::model::SLOHistoryMetricsSeriesMetadataUnit>>>,
Expand Down Expand Up @@ -178,6 +190,7 @@ impl<'de> Deserialize<'de> for SLOHistoryMetricsSeriesMetadata {
}
}

#[allow(deprecated)]
let content = SLOHistoryMetricsSeriesMetadata {
aggr,
expression,
Expand Down
Loading