Skip to content

Commit 009e262

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add OpenAPI spec for sourcemap-admin public endpoints (#1685)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 53494cb commit 009e262

40 files changed

Lines changed: 8075 additions & 110 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 1570 additions & 0 deletions
Large diffs are not rendered by default.

src/datadog/configuration.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,11 @@ impl Default for Configuration {
592592
("v2.update_connection".to_owned(), false),
593593
("v2.get_pruned_trace_by_id".to_owned(), false),
594594
("v2.get_trace_by_id".to_owned(), false),
595+
("v2.delete_sourcemaps".to_owned(), false),
596+
("v2.get_service_repository_info".to_owned(), false),
597+
("v2.get_sourcemaps".to_owned(), false),
598+
("v2.list_sourcemaps".to_owned(), false),
599+
("v2.restore_sourcemaps".to_owned(), false),
595600
("v2.query_aggregated_long_tasks".to_owned(), false),
596601
("v2.query_aggregated_signals_problems".to_owned(), false),
597602
("v2.query_aggregated_waterfall".to_owned(), false),

src/datadogV2/api/api_rum.rs

Lines changed: 1627 additions & 110 deletions
Large diffs are not rendered by default.

src/datadogV2/model/mod.rs

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10388,6 +10388,76 @@ pub mod model_raw_error_budget_remaining;
1038810388
pub use self::model_raw_error_budget_remaining::RawErrorBudgetRemaining;
1038910389
pub mod model_slo_status_type;
1039010390
pub use self::model_slo_status_type::SloStatusType;
10391+
pub mod model_sourcemap_map_kind;
10392+
pub use self::model_sourcemap_map_kind::SourcemapMapKind;
10393+
pub mod model_sourcemaps_response;
10394+
pub use self::model_sourcemaps_response::SourcemapsResponse;
10395+
pub mod model_js_sourcemap_data;
10396+
pub use self::model_js_sourcemap_data::JSSourcemapData;
10397+
pub mod model_js_sourcemap_attributes;
10398+
pub use self::model_js_sourcemap_attributes::JSSourcemapAttributes;
10399+
pub mod model_sourcemap_data_type;
10400+
pub use self::model_sourcemap_data_type::SourcemapDataType;
10401+
pub mod model_react_native_sourcemap_data;
10402+
pub use self::model_react_native_sourcemap_data::ReactNativeSourcemapData;
10403+
pub mod model_react_native_sourcemap_attributes;
10404+
pub use self::model_react_native_sourcemap_attributes::ReactNativeSourcemapAttributes;
10405+
pub mod model_ios_sourcemap_data;
10406+
pub use self::model_ios_sourcemap_data::IOSSourcemapData;
10407+
pub mod model_ios_sourcemap_attributes;
10408+
pub use self::model_ios_sourcemap_attributes::IOSSourcemapAttributes;
10409+
pub mod model_jvm_sourcemap_data;
10410+
pub use self::model_jvm_sourcemap_data::JVMSourcemapData;
10411+
pub mod model_jvm_sourcemap_attributes;
10412+
pub use self::model_jvm_sourcemap_attributes::JVMSourcemapAttributes;
10413+
pub mod model_flutter_sourcemap_data;
10414+
pub use self::model_flutter_sourcemap_data::FlutterSourcemapData;
10415+
pub mod model_flutter_sourcemap_attributes;
10416+
pub use self::model_flutter_sourcemap_attributes::FlutterSourcemapAttributes;
10417+
pub mod model_elf_sourcemap_data;
10418+
pub use self::model_elf_sourcemap_data::ELFSourcemapData;
10419+
pub mod model_elf_sourcemap_attributes;
10420+
pub use self::model_elf_sourcemap_attributes::ELFSourcemapAttributes;
10421+
pub mod model_ndk_sourcemap_data;
10422+
pub use self::model_ndk_sourcemap_data::NDKSourcemapData;
10423+
pub mod model_ndk_sourcemap_attributes;
10424+
pub use self::model_ndk_sourcemap_attributes::NDKSourcemapAttributes;
10425+
pub mod model_il2_cpp_sourcemap_data;
10426+
pub use self::model_il2_cpp_sourcemap_data::IL2CPPSourcemapData;
10427+
pub mod model_il2_cpp_sourcemap_attributes;
10428+
pub use self::model_il2_cpp_sourcemap_attributes::IL2CPPSourcemapAttributes;
10429+
pub mod model_sourcemap_item;
10430+
pub use self::model_sourcemap_item::SourcemapItem;
10431+
pub mod model_sourcemap_file_response;
10432+
pub use self::model_sourcemap_file_response::SourcemapFileResponse;
10433+
pub mod model_sourcemap_file_data;
10434+
pub use self::model_sourcemap_file_data::SourcemapFileData;
10435+
pub mod model_sourcemap_file_attributes;
10436+
pub use self::model_sourcemap_file_attributes::SourcemapFileAttributes;
10437+
pub mod model_sourcemap_file_data_type;
10438+
pub use self::model_sourcemap_file_data_type::SourcemapFileDataType;
10439+
pub mod model_list_sourcemaps_response;
10440+
pub use self::model_list_sourcemaps_response::ListSourcemapsResponse;
10441+
pub mod model_sourcemaps_list_meta;
10442+
pub use self::model_sourcemaps_list_meta::SourcemapsListMeta;
10443+
pub mod model_sourcemaps_list_meta_page;
10444+
pub use self::model_sourcemaps_list_meta_page::SourcemapsListMetaPage;
10445+
pub mod model_service_repository_info_request;
10446+
pub use self::model_service_repository_info_request::ServiceRepositoryInfoRequest;
10447+
pub mod model_service_repository_info_request_data;
10448+
pub use self::model_service_repository_info_request_data::ServiceRepositoryInfoRequestData;
10449+
pub mod model_service_repository_info_request_attributes;
10450+
pub use self::model_service_repository_info_request_attributes::ServiceRepositoryInfoRequestAttributes;
10451+
pub mod model_service_repository_info_data_type;
10452+
pub use self::model_service_repository_info_data_type::ServiceRepositoryInfoDataType;
10453+
pub mod model_service_repository_info_response;
10454+
pub use self::model_service_repository_info_response::ServiceRepositoryInfoResponse;
10455+
pub mod model_service_repository_info_response_data;
10456+
pub use self::model_service_repository_info_response_data::ServiceRepositoryInfoResponseData;
10457+
pub mod model_service_repository_info_response_attributes;
10458+
pub use self::model_service_repository_info_response_attributes::ServiceRepositoryInfoResponseAttributes;
10459+
pub mod model_service_repository_info_status;
10460+
pub use self::model_service_repository_info_status::ServiceRepositoryInfoStatus;
1039110461
pub mod model_recommendation_document;
1039210462
pub use self::model_recommendation_document::RecommendationDocument;
1039310463
pub mod model_recommendation_data;
Lines changed: 256 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,256 @@
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+
/// Attributes of an ELF symbol file.
10+
#[non_exhaustive]
11+
#[skip_serializing_none]
12+
#[derive(Clone, Debug, PartialEq, Serialize)]
13+
pub struct ELFSourcemapAttributes {
14+
/// The target CPU architecture.
15+
#[serde(rename = "arch")]
16+
pub arch: Option<String>,
17+
/// The timestamp when the symbol file was created.
18+
#[serde(rename = "created_at")]
19+
pub created_at: chrono::DateTime<chrono::Utc>,
20+
/// The SHA256 hash of the ELF file.
21+
#[serde(rename = "file_hash")]
22+
pub file_hash: Option<String>,
23+
/// The ELF file name.
24+
#[serde(rename = "file_name")]
25+
pub file_name: Option<String>,
26+
/// The GNU build ID (UUID format).
27+
#[serde(rename = "gnu_build_id")]
28+
pub gnu_build_id: Option<String>,
29+
/// The Go build ID (UUID format).
30+
#[serde(rename = "go_build_id")]
31+
pub go_build_id: Option<String>,
32+
/// The type of source map.
33+
#[serde(rename = "mapkind")]
34+
pub mapkind: String,
35+
/// The origin of the ELF file.
36+
#[serde(rename = "origin")]
37+
pub origin: Option<String>,
38+
/// The version of the origin package.
39+
#[serde(rename = "origin_version")]
40+
pub origin_version: Option<String>,
41+
/// The size of the ELF file in bytes.
42+
#[serde(rename = "size")]
43+
pub size: i64,
44+
/// The source of the debug symbols.
45+
#[serde(rename = "symbol_source")]
46+
pub symbol_source: Option<String>,
47+
#[serde(flatten)]
48+
pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
49+
#[serde(skip)]
50+
#[serde(default)]
51+
pub(crate) _unparsed: bool,
52+
}
53+
54+
impl ELFSourcemapAttributes {
55+
pub fn new(
56+
created_at: chrono::DateTime<chrono::Utc>,
57+
mapkind: String,
58+
size: i64,
59+
) -> ELFSourcemapAttributes {
60+
ELFSourcemapAttributes {
61+
arch: None,
62+
created_at,
63+
file_hash: None,
64+
file_name: None,
65+
gnu_build_id: None,
66+
go_build_id: None,
67+
mapkind,
68+
origin: None,
69+
origin_version: None,
70+
size,
71+
symbol_source: None,
72+
additional_properties: std::collections::BTreeMap::new(),
73+
_unparsed: false,
74+
}
75+
}
76+
77+
pub fn arch(mut self, value: String) -> Self {
78+
self.arch = Some(value);
79+
self
80+
}
81+
82+
pub fn file_hash(mut self, value: String) -> Self {
83+
self.file_hash = Some(value);
84+
self
85+
}
86+
87+
pub fn file_name(mut self, value: String) -> Self {
88+
self.file_name = Some(value);
89+
self
90+
}
91+
92+
pub fn gnu_build_id(mut self, value: String) -> Self {
93+
self.gnu_build_id = Some(value);
94+
self
95+
}
96+
97+
pub fn go_build_id(mut self, value: String) -> Self {
98+
self.go_build_id = Some(value);
99+
self
100+
}
101+
102+
pub fn origin(mut self, value: String) -> Self {
103+
self.origin = Some(value);
104+
self
105+
}
106+
107+
pub fn origin_version(mut self, value: String) -> Self {
108+
self.origin_version = Some(value);
109+
self
110+
}
111+
112+
pub fn symbol_source(mut self, value: String) -> Self {
113+
self.symbol_source = Some(value);
114+
self
115+
}
116+
117+
pub fn additional_properties(
118+
mut self,
119+
value: std::collections::BTreeMap<String, serde_json::Value>,
120+
) -> Self {
121+
self.additional_properties = value;
122+
self
123+
}
124+
}
125+
126+
impl<'de> Deserialize<'de> for ELFSourcemapAttributes {
127+
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
128+
where
129+
D: Deserializer<'de>,
130+
{
131+
struct ELFSourcemapAttributesVisitor;
132+
impl<'a> Visitor<'a> for ELFSourcemapAttributesVisitor {
133+
type Value = ELFSourcemapAttributes;
134+
135+
fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
136+
f.write_str("a mapping")
137+
}
138+
139+
fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
140+
where
141+
M: MapAccess<'a>,
142+
{
143+
let mut arch: Option<String> = None;
144+
let mut created_at: Option<chrono::DateTime<chrono::Utc>> = None;
145+
let mut file_hash: Option<String> = None;
146+
let mut file_name: Option<String> = None;
147+
let mut gnu_build_id: Option<String> = None;
148+
let mut go_build_id: Option<String> = None;
149+
let mut mapkind: Option<String> = None;
150+
let mut origin: Option<String> = None;
151+
let mut origin_version: Option<String> = None;
152+
let mut size: Option<i64> = None;
153+
let mut symbol_source: Option<String> = None;
154+
let mut additional_properties: std::collections::BTreeMap<
155+
String,
156+
serde_json::Value,
157+
> = std::collections::BTreeMap::new();
158+
let mut _unparsed = false;
159+
160+
while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
161+
match k.as_str() {
162+
"arch" => {
163+
if v.is_null() {
164+
continue;
165+
}
166+
arch = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
167+
}
168+
"created_at" => {
169+
created_at = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
170+
}
171+
"file_hash" => {
172+
if v.is_null() {
173+
continue;
174+
}
175+
file_hash = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
176+
}
177+
"file_name" => {
178+
if v.is_null() {
179+
continue;
180+
}
181+
file_name = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
182+
}
183+
"gnu_build_id" => {
184+
if v.is_null() {
185+
continue;
186+
}
187+
gnu_build_id =
188+
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
189+
}
190+
"go_build_id" => {
191+
if v.is_null() {
192+
continue;
193+
}
194+
go_build_id =
195+
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
196+
}
197+
"mapkind" => {
198+
mapkind = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
199+
}
200+
"origin" => {
201+
if v.is_null() {
202+
continue;
203+
}
204+
origin = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
205+
}
206+
"origin_version" => {
207+
if v.is_null() {
208+
continue;
209+
}
210+
origin_version =
211+
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
212+
}
213+
"size" => {
214+
size = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
215+
}
216+
"symbol_source" => {
217+
if v.is_null() {
218+
continue;
219+
}
220+
symbol_source =
221+
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
222+
}
223+
&_ => {
224+
if let Ok(value) = serde_json::from_value(v.clone()) {
225+
additional_properties.insert(k, value);
226+
}
227+
}
228+
}
229+
}
230+
let created_at = created_at.ok_or_else(|| M::Error::missing_field("created_at"))?;
231+
let mapkind = mapkind.ok_or_else(|| M::Error::missing_field("mapkind"))?;
232+
let size = size.ok_or_else(|| M::Error::missing_field("size"))?;
233+
234+
let content = ELFSourcemapAttributes {
235+
arch,
236+
created_at,
237+
file_hash,
238+
file_name,
239+
gnu_build_id,
240+
go_build_id,
241+
mapkind,
242+
origin,
243+
origin_version,
244+
size,
245+
symbol_source,
246+
additional_properties,
247+
_unparsed,
248+
};
249+
250+
Ok(content)
251+
}
252+
}
253+
254+
deserializer.deserialize_any(ELFSourcemapAttributesVisitor)
255+
}
256+
}

0 commit comments

Comments
 (0)