Skip to content
Merged
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 @@ -39639,6 +39639,8 @@ components:
$ref: '#/components/schemas/ObservabilityPipelineBufferOptionsDiskType'
when_full:
$ref: '#/components/schemas/ObservabilityPipelineBufferOptionsWhenFull'
required:
- max_size
type: object
ObservabilityPipelineElasticsearchDestination:
description: 'The `elasticsearch` destination writes logs to an Elasticsearch
Expand Down Expand Up @@ -40892,6 +40894,8 @@ components:
$ref: '#/components/schemas/ObservabilityPipelineBufferOptionsMemoryType'
when_full:
$ref: '#/components/schemas/ObservabilityPipelineBufferOptionsWhenFull'
required:
- max_size
type: object
ObservabilityPipelineMemoryBufferSizeOptions:
description: Options for configuring a memory buffer by queue length.
Expand All @@ -40905,6 +40909,8 @@ components:
$ref: '#/components/schemas/ObservabilityPipelineBufferOptionsMemoryType'
when_full:
$ref: '#/components/schemas/ObservabilityPipelineBufferOptionsWhenFull'
required:
- max_events
type: object
ObservabilityPipelineMetadataEntry:
description: A custom metadata entry.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use std::fmt::{self, Formatter};
pub struct ObservabilityPipelineDiskBufferOptions {
/// Maximum size of the disk buffer.
#[serde(rename = "max_size")]
pub max_size: Option<i64>,
pub max_size: i64,
/// The type of the buffer that will be configured, a disk buffer.
#[serde(rename = "type")]
pub type_: Option<crate::datadogV2::model::ObservabilityPipelineBufferOptionsDiskType>,
Expand All @@ -28,21 +28,16 @@ pub struct ObservabilityPipelineDiskBufferOptions {
}

impl ObservabilityPipelineDiskBufferOptions {
pub fn new() -> ObservabilityPipelineDiskBufferOptions {
pub fn new(max_size: i64) -> ObservabilityPipelineDiskBufferOptions {
ObservabilityPipelineDiskBufferOptions {
max_size: None,
max_size,
type_: None,
when_full: None,
additional_properties: std::collections::BTreeMap::new(),
_unparsed: false,
}
}

pub fn max_size(mut self, value: i64) -> Self {
self.max_size = Some(value);
self
}

pub fn type_(
mut self,
value: crate::datadogV2::model::ObservabilityPipelineBufferOptionsDiskType,
Expand All @@ -68,12 +63,6 @@ impl ObservabilityPipelineDiskBufferOptions {
}
}

impl Default for ObservabilityPipelineDiskBufferOptions {
fn default() -> Self {
Self::new()
}
}

impl<'de> Deserialize<'de> for ObservabilityPipelineDiskBufferOptions {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
Expand Down Expand Up @@ -107,9 +96,6 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineDiskBufferOptions {
while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
match k.as_str() {
"max_size" => {
if v.is_null() {
continue;
}
max_size = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
"type" => {
Expand Down Expand Up @@ -147,6 +133,7 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineDiskBufferOptions {
}
}
}
let max_size = max_size.ok_or_else(|| M::Error::missing_field("max_size"))?;

let content = ObservabilityPipelineDiskBufferOptions {
max_size,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use std::fmt::{self, Formatter};
pub struct ObservabilityPipelineMemoryBufferOptions {
/// Maximum size of the memory buffer.
#[serde(rename = "max_size")]
pub max_size: Option<i64>,
pub max_size: i64,
/// The type of the buffer that will be configured, a memory buffer.
#[serde(rename = "type")]
pub type_: Option<crate::datadogV2::model::ObservabilityPipelineBufferOptionsMemoryType>,
Expand All @@ -28,21 +28,16 @@ pub struct ObservabilityPipelineMemoryBufferOptions {
}

impl ObservabilityPipelineMemoryBufferOptions {
pub fn new() -> ObservabilityPipelineMemoryBufferOptions {
pub fn new(max_size: i64) -> ObservabilityPipelineMemoryBufferOptions {
ObservabilityPipelineMemoryBufferOptions {
max_size: None,
max_size,
type_: None,
when_full: None,
additional_properties: std::collections::BTreeMap::new(),
_unparsed: false,
}
}

pub fn max_size(mut self, value: i64) -> Self {
self.max_size = Some(value);
self
}

pub fn type_(
mut self,
value: crate::datadogV2::model::ObservabilityPipelineBufferOptionsMemoryType,
Expand All @@ -68,12 +63,6 @@ impl ObservabilityPipelineMemoryBufferOptions {
}
}

impl Default for ObservabilityPipelineMemoryBufferOptions {
fn default() -> Self {
Self::new()
}
}

impl<'de> Deserialize<'de> for ObservabilityPipelineMemoryBufferOptions {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
Expand Down Expand Up @@ -107,9 +96,6 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineMemoryBufferOptions {
while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
match k.as_str() {
"max_size" => {
if v.is_null() {
continue;
}
max_size = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
"type" => {
Expand Down Expand Up @@ -147,6 +133,7 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineMemoryBufferOptions {
}
}
}
let max_size = max_size.ok_or_else(|| M::Error::missing_field("max_size"))?;

let content = ObservabilityPipelineMemoryBufferOptions {
max_size,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use std::fmt::{self, Formatter};
pub struct ObservabilityPipelineMemoryBufferSizeOptions {
/// Maximum events for the memory buffer.
#[serde(rename = "max_events")]
pub max_events: Option<i64>,
pub max_events: i64,
/// The type of the buffer that will be configured, a memory buffer.
#[serde(rename = "type")]
pub type_: Option<crate::datadogV2::model::ObservabilityPipelineBufferOptionsMemoryType>,
Expand All @@ -28,21 +28,16 @@ pub struct ObservabilityPipelineMemoryBufferSizeOptions {
}

impl ObservabilityPipelineMemoryBufferSizeOptions {
pub fn new() -> ObservabilityPipelineMemoryBufferSizeOptions {
pub fn new(max_events: i64) -> ObservabilityPipelineMemoryBufferSizeOptions {
ObservabilityPipelineMemoryBufferSizeOptions {
max_events: None,
max_events,
type_: None,
when_full: None,
additional_properties: std::collections::BTreeMap::new(),
_unparsed: false,
}
}

pub fn max_events(mut self, value: i64) -> Self {
self.max_events = Some(value);
self
}

pub fn type_(
mut self,
value: crate::datadogV2::model::ObservabilityPipelineBufferOptionsMemoryType,
Expand All @@ -68,12 +63,6 @@ impl ObservabilityPipelineMemoryBufferSizeOptions {
}
}

impl Default for ObservabilityPipelineMemoryBufferSizeOptions {
fn default() -> Self {
Self::new()
}
}

impl<'de> Deserialize<'de> for ObservabilityPipelineMemoryBufferSizeOptions {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
Expand Down Expand Up @@ -107,9 +96,6 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineMemoryBufferSizeOptions {
while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
match k.as_str() {
"max_events" => {
if v.is_null() {
continue;
}
max_events = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
"type" => {
Expand Down Expand Up @@ -147,6 +133,7 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineMemoryBufferSizeOptions {
}
}
}
let max_events = max_events.ok_or_else(|| M::Error::missing_field("max_events"))?;

let content = ObservabilityPipelineMemoryBufferSizeOptions {
max_events,
Expand Down