Skip to content

Commit cfb2759

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 4c1510f of spec repo
1 parent 0773181 commit cfb2759

File tree

2 files changed

+5
-33
lines changed

2 files changed

+5
-33
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37791,18 +37791,13 @@ components:
3779137791
example: 10.0
3779237792
format: double
3779337793
type: number
37794-
rate:
37795-
description: Number of events to sample (1 in N).
37796-
example: 10
37797-
format: int64
37798-
minimum: 1
37799-
type: integer
3780037794
type:
3780137795
$ref: '#/components/schemas/ObservabilityPipelineSampleProcessorType'
3780237796
required:
3780337797
- id
3780437798
- type
3780537799
- include
37800+
- percentage
3780637801
- enabled
3780737802
type: object
3780837803
ObservabilityPipelineSampleProcessorType:

src/datadogV2/model/model_observability_pipeline_sample_processor.rs

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ pub struct ObservabilityPipelineSampleProcessor {
2525
pub include: String,
2626
/// The percentage of logs to sample.
2727
#[serde(rename = "percentage")]
28-
pub percentage: Option<f64>,
29-
/// Number of events to sample (1 in N).
30-
#[serde(rename = "rate")]
31-
pub rate: Option<i64>,
28+
pub percentage: f64,
3229
/// The processor type. The value should always be `sample`.
3330
#[serde(rename = "type")]
3431
pub type_: crate::datadogV2::model::ObservabilityPipelineSampleProcessorType,
@@ -44,15 +41,15 @@ impl ObservabilityPipelineSampleProcessor {
4441
enabled: bool,
4542
id: String,
4643
include: String,
44+
percentage: f64,
4745
type_: crate::datadogV2::model::ObservabilityPipelineSampleProcessorType,
4846
) -> ObservabilityPipelineSampleProcessor {
4947
ObservabilityPipelineSampleProcessor {
5048
display_name: None,
5149
enabled,
5250
id,
5351
include,
54-
percentage: None,
55-
rate: None,
52+
percentage,
5653
type_,
5754
additional_properties: std::collections::BTreeMap::new(),
5855
_unparsed: false,
@@ -64,16 +61,6 @@ impl ObservabilityPipelineSampleProcessor {
6461
self
6562
}
6663

67-
pub fn percentage(mut self, value: f64) -> Self {
68-
self.percentage = Some(value);
69-
self
70-
}
71-
72-
pub fn rate(mut self, value: i64) -> Self {
73-
self.rate = Some(value);
74-
self
75-
}
76-
7764
pub fn additional_properties(
7865
mut self,
7966
value: std::collections::BTreeMap<String, serde_json::Value>,
@@ -105,7 +92,6 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineSampleProcessor {
10592
let mut id: Option<String> = None;
10693
let mut include: Option<String> = None;
10794
let mut percentage: Option<f64> = None;
108-
let mut rate: Option<i64> = None;
10995
let mut type_: Option<
11096
crate::datadogV2::model::ObservabilityPipelineSampleProcessorType,
11197
> = None;
@@ -134,17 +120,8 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineSampleProcessor {
134120
include = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
135121
}
136122
"percentage" => {
137-
if v.is_null() {
138-
continue;
139-
}
140123
percentage = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
141124
}
142-
"rate" => {
143-
if v.is_null() {
144-
continue;
145-
}
146-
rate = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
147-
}
148125
"type" => {
149126
type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
150127
if let Some(ref _type_) = type_ {
@@ -166,6 +143,7 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineSampleProcessor {
166143
let enabled = enabled.ok_or_else(|| M::Error::missing_field("enabled"))?;
167144
let id = id.ok_or_else(|| M::Error::missing_field("id"))?;
168145
let include = include.ok_or_else(|| M::Error::missing_field("include"))?;
146+
let percentage = percentage.ok_or_else(|| M::Error::missing_field("percentage"))?;
169147
let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?;
170148

171149
let content = ObservabilityPipelineSampleProcessor {
@@ -174,7 +152,6 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineSampleProcessor {
174152
id,
175153
include,
176154
percentage,
177-
rate,
178155
type_,
179156
additional_properties,
180157
_unparsed,

0 commit comments

Comments
 (0)