//! This code was AUTOGENERATED using the Codama library.
use {
    crate::types::graphql::{CreatorGraphQL, RuleSetGraphQL},
    juniper::GraphQLObject,
};

#[derive(Debug, Clone, GraphQLObject)]
#[graphql(name = "Royalties")]
pub struct RoyaltiesGraphQL {
    pub basis_points: i32,
    pub creators: Vec<CreatorGraphQL>,
    pub rule_set: RuleSetGraphQL,
}

impl From<crate::types::Royalties> for RoyaltiesGraphQL {
    fn from(original: crate::types::Royalties) -> Self {
        Self {
            basis_points: original.basis_points as i32,
            creators: original
                .creators
                .into_iter()
                .map(|item| item.into())
                .collect(),
            rule_set: original.rule_set.into(),
        }
    }
}
