Skip to content

Commit f8d3ffd

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Enable auto-merging for keys routes. (#244)
Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent bc2105d commit f8d3ffd

11 files changed

+409
-12
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-08-14 22:02:41.175864",
8-
"spec_repo_commit": "5e33062a"
7+
"regenerated": "2024-08-14 22:32:06.462762",
8+
"spec_repo_commit": "07d72513"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-08-14 22:02:41.194584",
13-
"spec_repo_commit": "5e33062a"
12+
"regenerated": "2024-08-14 22:32:06.480578",
13+
"spec_repo_commit": "07d72513"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,10 +673,16 @@ components:
673673
APIKeyCreateAttributes:
674674
description: Attributes used to create an API Key.
675675
properties:
676+
category:
677+
description: The APIKeyCreateAttributes category.
678+
type: string
676679
name:
677680
description: Name of the API key.
678681
example: API Key for submitting metrics
679682
type: string
683+
remote_config_read_enabled:
684+
description: The APIKeyCreateAttributes remote_config_read_enabled.
685+
type: boolean
680686
required:
681687
- name
682688
type: object
@@ -722,13 +728,20 @@ components:
722728
description: An object related to an API key.
723729
oneOf:
724730
- $ref: '#/components/schemas/User'
731+
- $ref: '#/components/schemas/LeakedKey'
725732
APIKeyUpdateAttributes:
726733
description: Attributes used to update an API Key.
727734
properties:
735+
category:
736+
description: The APIKeyUpdateAttributes category.
737+
type: string
728738
name:
729739
description: Name of the API key.
730740
example: API Key for submitting metrics
731741
type: string
742+
remote_config_read_enabled:
743+
description: The APIKeyUpdateAttributes remote_config_read_enabled.
744+
type: boolean
732745
required:
733746
- name
734747
type: object
@@ -981,6 +994,7 @@ components:
981994
oneOf:
982995
- $ref: '#/components/schemas/User'
983996
- $ref: '#/components/schemas/Role'
997+
- $ref: '#/components/schemas/LeakedKey'
984998
ApplicationKeyResponseMeta:
985999
description: Additional information related to the application key response.
9861000
properties:
@@ -8461,6 +8475,7 @@ components:
84618475
created_at:
84628476
description: Creation date of the API key.
84638477
example: '2020-11-23T10:00:00.000Z'
8478+
format: date-time
84648479
readOnly: true
84658480
type: string
84668481
key:
@@ -8477,6 +8492,7 @@ components:
84778492
modified_at:
84788493
description: Date the API key was last modified.
84798494
example: '2020-11-23T10:00:00.000Z'
8495+
format: date-time
84808496
readOnly: true
84818497
type: string
84828498
name:
@@ -11140,6 +11156,45 @@ components:
1114011156
description: Jira project key
1114111157
type: string
1114211158
type: object
11159+
LeakedKey:
11160+
description: The definition of LeakedKey object.
11161+
properties:
11162+
attributes:
11163+
$ref: '#/components/schemas/LeakedKeyAttributes'
11164+
id:
11165+
description: The LeakedKey id.
11166+
example: id
11167+
type: string
11168+
type:
11169+
$ref: '#/components/schemas/LeakedKeyType'
11170+
required:
11171+
- attributes
11172+
- id
11173+
- type
11174+
type: object
11175+
LeakedKeyAttributes:
11176+
description: The definition of LeakedKeyAttributes object.
11177+
properties:
11178+
date:
11179+
description: The LeakedKeyAttributes date.
11180+
example: '2017-07-21T17:32:28Z'
11181+
format: date-time
11182+
type: string
11183+
leak_source:
11184+
description: The LeakedKeyAttributes leak_source.
11185+
type: string
11186+
required:
11187+
- date
11188+
type: object
11189+
LeakedKeyType:
11190+
default: leaked_keys
11191+
description: The definition of LeakedKeyType object.
11192+
enum:
11193+
- leaked_keys
11194+
example: leaked_keys
11195+
type: string
11196+
x-enum-varnames:
11197+
- LEAKED_KEYS
1114311198
ListAPIsResponse:
1114411199
description: Response for `ListAPIs`.
1114511200
properties:

src/datadogV2/model/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ pub mod model_relationship_to_role_data;
4646
pub use self::model_relationship_to_role_data::RelationshipToRoleData;
4747
pub mod model_roles_type;
4848
pub use self::model_roles_type::RolesType;
49+
pub mod model_leaked_key;
50+
pub use self::model_leaked_key::LeakedKey;
51+
pub mod model_leaked_key_attributes;
52+
pub use self::model_leaked_key_attributes::LeakedKeyAttributes;
53+
pub mod model_leaked_key_type;
54+
pub use self::model_leaked_key_type::LeakedKeyType;
4955
pub mod model_api_key_response_included_item;
5056
pub use self::model_api_key_response_included_item::APIKeyResponseIncludedItem;
5157
pub mod model_api_keys_response_meta;

src/datadogV2/model/model_api_key_create_attributes.rs

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,15 @@ use std::fmt::{self, Formatter};
1111
#[skip_serializing_none]
1212
#[derive(Clone, Debug, PartialEq, Serialize)]
1313
pub struct APIKeyCreateAttributes {
14+
/// The APIKeyCreateAttributes category.
15+
#[serde(rename = "category")]
16+
pub category: Option<String>,
1417
/// Name of the API key.
1518
#[serde(rename = "name")]
1619
pub name: String,
20+
/// The APIKeyCreateAttributes remote_config_read_enabled.
21+
#[serde(rename = "remote_config_read_enabled")]
22+
pub remote_config_read_enabled: Option<bool>,
1723
#[serde(skip)]
1824
#[serde(default)]
1925
pub(crate) _unparsed: bool,
@@ -22,10 +28,22 @@ pub struct APIKeyCreateAttributes {
2228
impl APIKeyCreateAttributes {
2329
pub fn new(name: String) -> APIKeyCreateAttributes {
2430
APIKeyCreateAttributes {
31+
category: None,
2532
name,
33+
remote_config_read_enabled: None,
2634
_unparsed: false,
2735
}
2836
}
37+
38+
pub fn category(mut self, value: String) -> Self {
39+
self.category = Some(value);
40+
self
41+
}
42+
43+
pub fn remote_config_read_enabled(mut self, value: bool) -> Self {
44+
self.remote_config_read_enabled = Some(value);
45+
self
46+
}
2947
}
3048

3149
impl<'de> Deserialize<'de> for APIKeyCreateAttributes {
@@ -45,20 +63,40 @@ impl<'de> Deserialize<'de> for APIKeyCreateAttributes {
4563
where
4664
M: MapAccess<'a>,
4765
{
66+
let mut category: Option<String> = None;
4867
let mut name: Option<String> = None;
68+
let mut remote_config_read_enabled: Option<bool> = None;
4969
let mut _unparsed = false;
5070

5171
while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
5272
match k.as_str() {
73+
"category" => {
74+
if v.is_null() {
75+
continue;
76+
}
77+
category = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
78+
}
5379
"name" => {
5480
name = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
5581
}
82+
"remote_config_read_enabled" => {
83+
if v.is_null() {
84+
continue;
85+
}
86+
remote_config_read_enabled =
87+
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
88+
}
5689
&_ => {}
5790
}
5891
}
5992
let name = name.ok_or_else(|| M::Error::missing_field("name"))?;
6093

61-
let content = APIKeyCreateAttributes { name, _unparsed };
94+
let content = APIKeyCreateAttributes {
95+
category,
96+
name,
97+
remote_config_read_enabled,
98+
_unparsed,
99+
};
62100

63101
Ok(content)
64102
}

src/datadogV2/model/model_api_key_response_included_item.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use serde::{Deserialize, Deserializer, Serialize};
99
#[serde(untagged)]
1010
pub enum APIKeyResponseIncludedItem {
1111
User(Box<crate::datadogV2::model::User>),
12+
LeakedKey(Box<crate::datadogV2::model::LeakedKey>),
1213
UnparsedObject(crate::datadog::UnparsedObject),
1314
}
1415

@@ -24,6 +25,13 @@ impl<'de> Deserialize<'de> for APIKeyResponseIncludedItem {
2425
return Ok(APIKeyResponseIncludedItem::User(_v));
2526
}
2627
}
28+
if let Ok(_v) =
29+
serde_json::from_value::<Box<crate::datadogV2::model::LeakedKey>>(value.clone())
30+
{
31+
if !_v._unparsed {
32+
return Ok(APIKeyResponseIncludedItem::LeakedKey(_v));
33+
}
34+
}
2735

2836
return Ok(APIKeyResponseIncludedItem::UnparsedObject(
2937
crate::datadog::UnparsedObject { value },

src/datadogV2/model/model_api_key_update_attributes.rs

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,15 @@ use std::fmt::{self, Formatter};
1111
#[skip_serializing_none]
1212
#[derive(Clone, Debug, PartialEq, Serialize)]
1313
pub struct APIKeyUpdateAttributes {
14+
/// The APIKeyUpdateAttributes category.
15+
#[serde(rename = "category")]
16+
pub category: Option<String>,
1417
/// Name of the API key.
1518
#[serde(rename = "name")]
1619
pub name: String,
20+
/// The APIKeyUpdateAttributes remote_config_read_enabled.
21+
#[serde(rename = "remote_config_read_enabled")]
22+
pub remote_config_read_enabled: Option<bool>,
1723
#[serde(skip)]
1824
#[serde(default)]
1925
pub(crate) _unparsed: bool,
@@ -22,10 +28,22 @@ pub struct APIKeyUpdateAttributes {
2228
impl APIKeyUpdateAttributes {
2329
pub fn new(name: String) -> APIKeyUpdateAttributes {
2430
APIKeyUpdateAttributes {
31+
category: None,
2532
name,
33+
remote_config_read_enabled: None,
2634
_unparsed: false,
2735
}
2836
}
37+
38+
pub fn category(mut self, value: String) -> Self {
39+
self.category = Some(value);
40+
self
41+
}
42+
43+
pub fn remote_config_read_enabled(mut self, value: bool) -> Self {
44+
self.remote_config_read_enabled = Some(value);
45+
self
46+
}
2947
}
3048

3149
impl<'de> Deserialize<'de> for APIKeyUpdateAttributes {
@@ -45,20 +63,40 @@ impl<'de> Deserialize<'de> for APIKeyUpdateAttributes {
4563
where
4664
M: MapAccess<'a>,
4765
{
66+
let mut category: Option<String> = None;
4867
let mut name: Option<String> = None;
68+
let mut remote_config_read_enabled: Option<bool> = None;
4969
let mut _unparsed = false;
5070

5171
while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
5272
match k.as_str() {
73+
"category" => {
74+
if v.is_null() {
75+
continue;
76+
}
77+
category = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
78+
}
5379
"name" => {
5480
name = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
5581
}
82+
"remote_config_read_enabled" => {
83+
if v.is_null() {
84+
continue;
85+
}
86+
remote_config_read_enabled =
87+
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
88+
}
5689
&_ => {}
5790
}
5891
}
5992
let name = name.ok_or_else(|| M::Error::missing_field("name"))?;
6093

61-
let content = APIKeyUpdateAttributes { name, _unparsed };
94+
let content = APIKeyUpdateAttributes {
95+
category,
96+
name,
97+
remote_config_read_enabled,
98+
_unparsed,
99+
};
62100

63101
Ok(content)
64102
}

src/datadogV2/model/model_application_key_response_included_item.rs

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

@@ -31,6 +32,13 @@ impl<'de> Deserialize<'de> for ApplicationKeyResponseIncludedItem {
3132
return Ok(ApplicationKeyResponseIncludedItem::Role(_v));
3233
}
3334
}
35+
if let Ok(_v) =
36+
serde_json::from_value::<Box<crate::datadogV2::model::LeakedKey>>(value.clone())
37+
{
38+
if !_v._unparsed {
39+
return Ok(ApplicationKeyResponseIncludedItem::LeakedKey(_v));
40+
}
41+
}
3442

3543
return Ok(ApplicationKeyResponseIncludedItem::UnparsedObject(
3644
crate::datadog::UnparsedObject { value },

src/datadogV2/model/model_full_api_key_attributes.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub struct FullAPIKeyAttributes {
1616
pub category: Option<String>,
1717
/// Creation date of the API key.
1818
#[serde(rename = "created_at")]
19-
pub created_at: Option<String>,
19+
pub created_at: Option<chrono::DateTime<chrono::Utc>>,
2020
/// The API key.
2121
#[serde(rename = "key")]
2222
pub key: Option<String>,
@@ -25,7 +25,7 @@ pub struct FullAPIKeyAttributes {
2525
pub last4: Option<String>,
2626
/// Date the API key was last modified.
2727
#[serde(rename = "modified_at")]
28-
pub modified_at: Option<String>,
28+
pub modified_at: Option<chrono::DateTime<chrono::Utc>>,
2929
/// Name of the API key.
3030
#[serde(rename = "name")]
3131
pub name: Option<String>,
@@ -56,7 +56,7 @@ impl FullAPIKeyAttributes {
5656
self
5757
}
5858

59-
pub fn created_at(mut self, value: String) -> Self {
59+
pub fn created_at(mut self, value: chrono::DateTime<chrono::Utc>) -> Self {
6060
self.created_at = Some(value);
6161
self
6262
}
@@ -71,7 +71,7 @@ impl FullAPIKeyAttributes {
7171
self
7272
}
7373

74-
pub fn modified_at(mut self, value: String) -> Self {
74+
pub fn modified_at(mut self, value: chrono::DateTime<chrono::Utc>) -> Self {
7575
self.modified_at = Some(value);
7676
self
7777
}
@@ -111,10 +111,10 @@ impl<'de> Deserialize<'de> for FullAPIKeyAttributes {
111111
M: MapAccess<'a>,
112112
{
113113
let mut category: Option<String> = None;
114-
let mut created_at: Option<String> = None;
114+
let mut created_at: Option<chrono::DateTime<chrono::Utc>> = None;
115115
let mut key: Option<String> = None;
116116
let mut last4: Option<String> = None;
117-
let mut modified_at: Option<String> = None;
117+
let mut modified_at: Option<chrono::DateTime<chrono::Utc>> = None;
118118
let mut name: Option<String> = None;
119119
let mut remote_config_read_enabled: Option<bool> = None;
120120
let mut _unparsed = false;

0 commit comments

Comments
 (0)