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
4 changes: 4 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33763,6 +33763,10 @@ components:
DetachCaseRequestData:
description: Data for detaching security findings from their case.
properties:
id:
description: Unique identifier of the case.
example: "c1234567-89ab-cdef-0123-456789abcdef"
type: string
relationships:
$ref: "#/components/schemas/DetachCaseRequestDataRelationships"
type:
Expand Down
17 changes: 17 additions & 0 deletions src/datadogV2/model/model_detach_case_request_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ use std::fmt::{self, Formatter};
#[skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Serialize)]
pub struct DetachCaseRequestData {
/// Unique identifier of the case.
#[serde(rename = "id")]
pub id: Option<String>,
/// Relationships detaching security findings from their case.
#[serde(rename = "relationships")]
pub relationships: Option<crate::datadogV2::model::DetachCaseRequestDataRelationships>,
Expand All @@ -27,13 +30,19 @@ pub struct DetachCaseRequestData {
impl DetachCaseRequestData {
pub fn new(type_: crate::datadogV2::model::CaseDataType) -> DetachCaseRequestData {
DetachCaseRequestData {
id: None,
relationships: None,
type_,
additional_properties: std::collections::BTreeMap::new(),
_unparsed: false,
}
}

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

pub fn relationships(
mut self,
value: crate::datadogV2::model::DetachCaseRequestDataRelationships,
Expand Down Expand Up @@ -68,6 +77,7 @@ impl<'de> Deserialize<'de> for DetachCaseRequestData {
where
M: MapAccess<'a>,
{
let mut id: Option<String> = None;
let mut relationships: Option<
crate::datadogV2::model::DetachCaseRequestDataRelationships,
> = None;
Expand All @@ -80,6 +90,12 @@ impl<'de> Deserialize<'de> for DetachCaseRequestData {

while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
match k.as_str() {
"id" => {
if v.is_null() {
continue;
}
id = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
"relationships" => {
if v.is_null() {
continue;
Expand Down Expand Up @@ -110,6 +126,7 @@ impl<'de> Deserialize<'de> for DetachCaseRequestData {
let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?;

let content = DetachCaseRequestData {
id,
relationships,
type_,
additional_properties,
Expand Down
Loading