diff --git a/src/objects.rs b/src/objects.rs index f926fc2..db69e62 100644 --- a/src/objects.rs +++ b/src/objects.rs @@ -2252,10 +2252,22 @@ pub struct RevenueWithdrawalStateSucceeded { #[derive(Eq)] pub struct RevenueWithdrawalStateFailed {} +#[apply(apistruct!)] +#[derive(Eq)] +pub struct AffiliateInfo { + pub affiliate_user: Option, + pub affiliate_chat: Option, + pub commission_per_mille: u32, + pub amount: u32, + pub nanostar_amount: Option, +} + #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] #[serde(tag = "type", rename_all = "snake_case")] +#[non_exhaustive] pub enum TransactionPartner { User(Box), + AffiliateProgram(TransactionPartnerAffiliateProgram), Fragment(TransactionPartnerFragment), TelegramAds(TransactionPartnerTelegramAds), TelegramApi(TransactionPartnerTelegramApi), @@ -2265,6 +2277,7 @@ pub enum TransactionPartner { #[apply(apistruct!)] pub struct TransactionPartnerUser { pub user: User, + pub affiliate: Option, pub invoice_payload: Option, pub subscription_period: Option, pub paid_media: Option>, @@ -2272,6 +2285,13 @@ pub struct TransactionPartnerUser { pub gift: Option, } +#[apply(apistruct!)] +#[derive(Eq)] +pub struct TransactionPartnerAffiliateProgram { + pub sponsor_user: User, + pub commission_per_mille: u32, +} + #[apply(apistruct!)] #[derive(Eq)] pub struct TransactionPartnerFragment { @@ -2296,6 +2316,7 @@ pub struct TransactionPartnerOther {} pub struct StarTransaction { pub id: String, pub amount: u32, + pub nanostar_amount: u32, pub date: u64, pub source: Option, pub receiver: Option,