//! This code was AUTOGENERATED using the Codama library.
use {
    crate::types::graphql::{ExtraAccountGraphQL, ValidationResultsOffsetGraphQL},
    carbon_core::graphql::primitives::Pubkey,
    juniper::GraphQLObject,
};

#[derive(Debug, Clone, GraphQLObject)]
#[graphql(name = "Oracle")]
pub struct OracleGraphQL {
    pub base_address: Pubkey,
    pub base_address_config: Option<ExtraAccountGraphQL>,
    pub results_offset: ValidationResultsOffsetGraphQL,
}

impl From<crate::types::Oracle> for OracleGraphQL {
    fn from(original: crate::types::Oracle) -> Self {
        Self {
            base_address: carbon_core::graphql::primitives::Pubkey(original.base_address),
            base_address_config: original.base_address_config.map(|v| v.into()),
            results_offset: original.results_offset.into(),
        }
    }
}
