Skip to content

Make modified by field nullable for get all API keys #189

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-07-19 18:52:02.161100",
"spec_repo_commit": "be099b30"
"regenerated": "2024-07-19 19:37:56.170005",
"spec_repo_commit": "a3f2b7d2"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-07-19 18:52:02.178758",
"spec_repo_commit": "be099b30"
"regenerated": "2024-07-19 19:37:56.188314",
"spec_repo_commit": "a3f2b7d2"
}
}
}
2 changes: 1 addition & 1 deletion .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ components:
created_by:
$ref: '#/components/schemas/RelationshipToUser'
modified_by:
$ref: '#/components/schemas/RelationshipToUser'
$ref: '#/components/schemas/NullableRelationshipToUser'
type: object
APIKeyResponse:
description: Response for retrieving an API key.
Expand Down
8 changes: 4 additions & 4 deletions src/datadogV2/model/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ pub mod model_relationship_to_user_data;
pub use self::model_relationship_to_user_data::RelationshipToUserData;
pub mod model_users_type;
pub use self::model_users_type::UsersType;
pub mod model_nullable_relationship_to_user;
pub use self::model_nullable_relationship_to_user::NullableRelationshipToUser;
pub mod model_nullable_relationship_to_user_data;
pub use self::model_nullable_relationship_to_user_data::NullableRelationshipToUserData;
pub mod model_api_keys_type;
pub use self::model_api_keys_type::APIKeysType;
pub mod model_user;
Expand Down Expand Up @@ -914,10 +918,6 @@ pub mod model_relationship_to_incident_attachment_data;
pub use self::model_relationship_to_incident_attachment_data::RelationshipToIncidentAttachmentData;
pub mod model_incident_attachment_type;
pub use self::model_incident_attachment_type::IncidentAttachmentType;
pub mod model_nullable_relationship_to_user;
pub use self::model_nullable_relationship_to_user::NullableRelationshipToUser;
pub mod model_nullable_relationship_to_user_data;
pub use self::model_nullable_relationship_to_user_data::NullableRelationshipToUserData;
pub mod model_relationship_to_incident_impacts;
pub use self::model_relationship_to_incident_impacts::RelationshipToIncidentImpacts;
pub mod model_relationship_to_incident_impact_data;
Expand Down
20 changes: 13 additions & 7 deletions src/datadogV2/model/model_api_key_relationships.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ pub struct APIKeyRelationships {
#[serde(rename = "created_by")]
pub created_by: Option<crate::datadogV2::model::RelationshipToUser>,
/// Relationship to user.
#[serde(rename = "modified_by")]
pub modified_by: Option<crate::datadogV2::model::RelationshipToUser>,
#[serde(
rename = "modified_by",
default,
with = "::serde_with::rust::double_option"
)]
pub modified_by: Option<Option<crate::datadogV2::model::NullableRelationshipToUser>>,
#[serde(skip)]
#[serde(default)]
pub(crate) _unparsed: bool,
Expand All @@ -36,7 +40,10 @@ impl APIKeyRelationships {
self
}

pub fn modified_by(mut self, value: crate::datadogV2::model::RelationshipToUser) -> Self {
pub fn modified_by(
mut self,
value: Option<crate::datadogV2::model::NullableRelationshipToUser>,
) -> Self {
self.modified_by = Some(value);
self
}
Expand Down Expand Up @@ -66,7 +73,9 @@ impl<'de> Deserialize<'de> for APIKeyRelationships {
M: MapAccess<'a>,
{
let mut created_by: Option<crate::datadogV2::model::RelationshipToUser> = None;
let mut modified_by: Option<crate::datadogV2::model::RelationshipToUser> = None;
let mut modified_by: Option<
Option<crate::datadogV2::model::NullableRelationshipToUser>,
> = None;
let mut _unparsed = false;

while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
Expand All @@ -78,9 +87,6 @@ impl<'de> Deserialize<'de> for APIKeyRelationships {
created_by = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
"modified_by" => {
if v.is_null() {
continue;
}
modified_by =
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
Expand Down
Loading