@@ -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