Skip to content

Commit bb8b7e2

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit f28ad048 of spec repo
1 parent 6df3f51 commit bb8b7e2

File tree

6 files changed

+286
-4
lines changed

6 files changed

+286
-4
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2024-10-04 10:38:16.608195",
8-
"spec_repo_commit": "7a63d530"
7+
"regenerated": "2024-10-04 15:31:58.294860",
8+
"spec_repo_commit": "f28ad048"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-10-04 10:38:16.622752",
13-
"spec_repo_commit": "7a63d530"
12+
"regenerated": "2024-10-04 15:31:58.309733",
13+
"spec_repo_commit": "f28ad048"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10640,6 +10640,7 @@ components:
1064010640
oneOf:
1064110641
- $ref: '#/components/schemas/SlackIntegrationMetadata'
1064210642
- $ref: '#/components/schemas/JiraIntegrationMetadata'
10643+
- $ref: '#/components/schemas/MSTeamsIntegrationMetadata'
1064310644
IncidentIntegrationMetadataPatchData:
1064410645
description: Incident integration metadata data for a patch request.
1064510646
properties:
@@ -13634,6 +13635,43 @@ components:
1363413635
from the other indexes
1363513636
type: string
1363613637
type: object
13638+
MSTeamsIntegrationMetadata:
13639+
description: Incident integration metadata for the Microsoft Teams integration.
13640+
properties:
13641+
teams:
13642+
description: Array of Microsoft Teams in this integration metadata.
13643+
example: []
13644+
items:
13645+
$ref: '#/components/schemas/MSTeamsIntegrationMetadataTeamsItem'
13646+
type: array
13647+
required:
13648+
- teams
13649+
type: object
13650+
MSTeamsIntegrationMetadataTeamsItem:
13651+
description: Item in the Microsoft Teams integration metadata teams array.
13652+
properties:
13653+
ms_channel_id:
13654+
description: Microsoft Teams channel ID.
13655+
example: 19:[email protected]
13656+
type: string
13657+
ms_channel_name:
13658+
description: Microsoft Teams channel name.
13659+
example: incident-0001-example
13660+
type: string
13661+
ms_tenant_id:
13662+
description: Microsoft Teams tenant ID.
13663+
example: 00000000-abcd-0005-0000-000000000000
13664+
type: string
13665+
redirect_url:
13666+
description: URL redirecting to the Microsoft Teams channel.
13667+
example: https://teams.microsoft.com/l/channel/19%3Aabc00abcdef00a0abcdef0abcdef0a%40thread.tacv2/conversations?groupId=12345678-abcd-dcba-abcd-1234567890ab&tenantId=00000000-abcd-0005-0000-000000000000
13668+
type: string
13669+
required:
13670+
- ms_tenant_id
13671+
- ms_channel_id
13672+
- ms_channel_name
13673+
- redirect_url
13674+
type: object
1363713675
Metric:
1363813676
description: Object for a single metric tag configuration.
1363913677
example:

src/datadogV2/model/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,6 +1216,10 @@ pub mod model_jira_integration_metadata;
12161216
pub use self::model_jira_integration_metadata::JiraIntegrationMetadata;
12171217
pub mod model_jira_integration_metadata_issues_item;
12181218
pub use self::model_jira_integration_metadata_issues_item::JiraIntegrationMetadataIssuesItem;
1219+
pub mod model_ms_teams_integration_metadata;
1220+
pub use self::model_ms_teams_integration_metadata::MSTeamsIntegrationMetadata;
1221+
pub mod model_ms_teams_integration_metadata_teams_item;
1222+
pub use self::model_ms_teams_integration_metadata_teams_item::MSTeamsIntegrationMetadataTeamsItem;
12191223
pub mod model_incident_integration_metadata_metadata;
12201224
pub use self::model_incident_integration_metadata_metadata::IncidentIntegrationMetadataMetadata;
12211225
pub mod model_incident_integration_relationships;

src/datadogV2/model/model_incident_integration_metadata_metadata.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use serde::{Deserialize, Deserializer, Serialize};
1010
pub enum IncidentIntegrationMetadataMetadata {
1111
SlackIntegrationMetadata(Box<crate::datadogV2::model::SlackIntegrationMetadata>),
1212
JiraIntegrationMetadata(Box<crate::datadogV2::model::JiraIntegrationMetadata>),
13+
MSTeamsIntegrationMetadata(Box<crate::datadogV2::model::MSTeamsIntegrationMetadata>),
1314
UnparsedObject(crate::datadog::UnparsedObject),
1415
}
1516

@@ -35,6 +36,14 @@ impl<'de> Deserialize<'de> for IncidentIntegrationMetadataMetadata {
3536
return Ok(IncidentIntegrationMetadataMetadata::JiraIntegrationMetadata(_v));
3637
}
3738
}
39+
if let Ok(_v) = serde_json::from_value::<
40+
Box<crate::datadogV2::model::MSTeamsIntegrationMetadata>,
41+
>(value.clone())
42+
{
43+
if !_v._unparsed {
44+
return Ok(IncidentIntegrationMetadataMetadata::MSTeamsIntegrationMetadata(_v));
45+
}
46+
}
3847

3948
return Ok(IncidentIntegrationMetadataMetadata::UnparsedObject(
4049
crate::datadog::UnparsedObject { value },
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
// This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
// Copyright 2019-Present Datadog, Inc.
4+
use serde::de::{Error, MapAccess, Visitor};
5+
use serde::{Deserialize, Deserializer, Serialize};
6+
use serde_with::skip_serializing_none;
7+
use std::fmt::{self, Formatter};
8+
9+
/// Incident integration metadata for the Microsoft Teams integration.
10+
#[non_exhaustive]
11+
#[skip_serializing_none]
12+
#[derive(Clone, Debug, PartialEq, Serialize)]
13+
pub struct MSTeamsIntegrationMetadata {
14+
/// Array of Microsoft Teams in this integration metadata.
15+
#[serde(rename = "teams")]
16+
pub teams: Vec<crate::datadogV2::model::MSTeamsIntegrationMetadataTeamsItem>,
17+
#[serde(flatten)]
18+
pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
19+
#[serde(skip)]
20+
#[serde(default)]
21+
pub(crate) _unparsed: bool,
22+
}
23+
24+
impl MSTeamsIntegrationMetadata {
25+
pub fn new(
26+
teams: Vec<crate::datadogV2::model::MSTeamsIntegrationMetadataTeamsItem>,
27+
) -> MSTeamsIntegrationMetadata {
28+
MSTeamsIntegrationMetadata {
29+
teams,
30+
additional_properties: std::collections::BTreeMap::new(),
31+
_unparsed: false,
32+
}
33+
}
34+
35+
pub fn additional_properties(
36+
mut self,
37+
value: std::collections::BTreeMap<String, serde_json::Value>,
38+
) -> Self {
39+
self.additional_properties = value;
40+
self
41+
}
42+
}
43+
44+
impl<'de> Deserialize<'de> for MSTeamsIntegrationMetadata {
45+
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
46+
where
47+
D: Deserializer<'de>,
48+
{
49+
struct MSTeamsIntegrationMetadataVisitor;
50+
impl<'a> Visitor<'a> for MSTeamsIntegrationMetadataVisitor {
51+
type Value = MSTeamsIntegrationMetadata;
52+
53+
fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
54+
f.write_str("a mapping")
55+
}
56+
57+
fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
58+
where
59+
M: MapAccess<'a>,
60+
{
61+
let mut teams: Option<
62+
Vec<crate::datadogV2::model::MSTeamsIntegrationMetadataTeamsItem>,
63+
> = None;
64+
let mut additional_properties: std::collections::BTreeMap<
65+
String,
66+
serde_json::Value,
67+
> = std::collections::BTreeMap::new();
68+
let mut _unparsed = false;
69+
70+
while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
71+
match k.as_str() {
72+
"teams" => {
73+
teams = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
74+
}
75+
&_ => {
76+
if let Ok(value) = serde_json::from_value(v.clone()) {
77+
additional_properties.insert(k, value);
78+
}
79+
}
80+
}
81+
}
82+
let teams = teams.ok_or_else(|| M::Error::missing_field("teams"))?;
83+
84+
let content = MSTeamsIntegrationMetadata {
85+
teams,
86+
additional_properties,
87+
_unparsed,
88+
};
89+
90+
Ok(content)
91+
}
92+
}
93+
94+
deserializer.deserialize_any(MSTeamsIntegrationMetadataVisitor)
95+
}
96+
}
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
// This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
// Copyright 2019-Present Datadog, Inc.
4+
use serde::de::{Error, MapAccess, Visitor};
5+
use serde::{Deserialize, Deserializer, Serialize};
6+
use serde_with::skip_serializing_none;
7+
use std::fmt::{self, Formatter};
8+
9+
/// Item in the Microsoft Teams integration metadata teams array.
10+
#[non_exhaustive]
11+
#[skip_serializing_none]
12+
#[derive(Clone, Debug, PartialEq, Serialize)]
13+
pub struct MSTeamsIntegrationMetadataTeamsItem {
14+
/// Microsoft Teams channel ID.
15+
#[serde(rename = "ms_channel_id")]
16+
pub ms_channel_id: String,
17+
/// Microsoft Teams channel name.
18+
#[serde(rename = "ms_channel_name")]
19+
pub ms_channel_name: String,
20+
/// Microsoft Teams tenant ID.
21+
#[serde(rename = "ms_tenant_id")]
22+
pub ms_tenant_id: String,
23+
/// URL redirecting to the Microsoft Teams channel.
24+
#[serde(rename = "redirect_url")]
25+
pub redirect_url: String,
26+
#[serde(flatten)]
27+
pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
28+
#[serde(skip)]
29+
#[serde(default)]
30+
pub(crate) _unparsed: bool,
31+
}
32+
33+
impl MSTeamsIntegrationMetadataTeamsItem {
34+
pub fn new(
35+
ms_channel_id: String,
36+
ms_channel_name: String,
37+
ms_tenant_id: String,
38+
redirect_url: String,
39+
) -> MSTeamsIntegrationMetadataTeamsItem {
40+
MSTeamsIntegrationMetadataTeamsItem {
41+
ms_channel_id,
42+
ms_channel_name,
43+
ms_tenant_id,
44+
redirect_url,
45+
additional_properties: std::collections::BTreeMap::new(),
46+
_unparsed: false,
47+
}
48+
}
49+
50+
pub fn additional_properties(
51+
mut self,
52+
value: std::collections::BTreeMap<String, serde_json::Value>,
53+
) -> Self {
54+
self.additional_properties = value;
55+
self
56+
}
57+
}
58+
59+
impl<'de> Deserialize<'de> for MSTeamsIntegrationMetadataTeamsItem {
60+
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
61+
where
62+
D: Deserializer<'de>,
63+
{
64+
struct MSTeamsIntegrationMetadataTeamsItemVisitor;
65+
impl<'a> Visitor<'a> for MSTeamsIntegrationMetadataTeamsItemVisitor {
66+
type Value = MSTeamsIntegrationMetadataTeamsItem;
67+
68+
fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
69+
f.write_str("a mapping")
70+
}
71+
72+
fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
73+
where
74+
M: MapAccess<'a>,
75+
{
76+
let mut ms_channel_id: Option<String> = None;
77+
let mut ms_channel_name: Option<String> = None;
78+
let mut ms_tenant_id: Option<String> = None;
79+
let mut redirect_url: Option<String> = None;
80+
let mut additional_properties: std::collections::BTreeMap<
81+
String,
82+
serde_json::Value,
83+
> = std::collections::BTreeMap::new();
84+
let mut _unparsed = false;
85+
86+
while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
87+
match k.as_str() {
88+
"ms_channel_id" => {
89+
ms_channel_id =
90+
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
91+
}
92+
"ms_channel_name" => {
93+
ms_channel_name =
94+
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
95+
}
96+
"ms_tenant_id" => {
97+
ms_tenant_id =
98+
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
99+
}
100+
"redirect_url" => {
101+
redirect_url =
102+
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
103+
}
104+
&_ => {
105+
if let Ok(value) = serde_json::from_value(v.clone()) {
106+
additional_properties.insert(k, value);
107+
}
108+
}
109+
}
110+
}
111+
let ms_channel_id =
112+
ms_channel_id.ok_or_else(|| M::Error::missing_field("ms_channel_id"))?;
113+
let ms_channel_name =
114+
ms_channel_name.ok_or_else(|| M::Error::missing_field("ms_channel_name"))?;
115+
let ms_tenant_id =
116+
ms_tenant_id.ok_or_else(|| M::Error::missing_field("ms_tenant_id"))?;
117+
let redirect_url =
118+
redirect_url.ok_or_else(|| M::Error::missing_field("redirect_url"))?;
119+
120+
let content = MSTeamsIntegrationMetadataTeamsItem {
121+
ms_channel_id,
122+
ms_channel_name,
123+
ms_tenant_id,
124+
redirect_url,
125+
additional_properties,
126+
_unparsed,
127+
};
128+
129+
Ok(content)
130+
}
131+
}
132+
133+
deserializer.deserialize_any(MSTeamsIntegrationMetadataTeamsItemVisitor)
134+
}
135+
}

0 commit comments

Comments
 (0)