//! This code was AUTOGENERATED using the Codama library.
use {carbon_core::graphql::primitives::Json, juniper::GraphQLObject};

#[derive(Debug, Clone, GraphQLObject)]
#[graphql(name = "AgentIdentityUpdateInfo")]
pub struct AgentIdentityUpdateInfoGraphQL {
    pub uri: Option<String>,
    pub lifecycle_checks: Option<Vec<Json>>,
}

impl From<crate::types::AgentIdentityUpdateInfo> for AgentIdentityUpdateInfoGraphQL {
    fn from(original: crate::types::AgentIdentityUpdateInfo) -> Self {
        Self {
            uri: original.uri,
            lifecycle_checks: original.lifecycle_checks.map(|v| {
                v.into_iter()
                    .map(|item| {
                        carbon_core::graphql::primitives::Json(
                            serde_json::to_value(item).unwrap_or(serde_json::Value::Null),
                        )
                    })
                    .collect()
            }),
        }
    }
}
