pub struct OwnedGiftUnique {
pub gift: UniqueGift,
pub send_date: Integer,
pub transfer_star_count: Option<Integer>,
pub can_be_transferred: Option<bool>,
pub is_saved: Option<bool>,
pub next_transfer_date: Option<Integer>,
pub owned_gift_id: Option<String>,
pub sender_user: Option<User>,
}Expand description
Describes a unique gift received and owned by a user or a chat.
Fields§
§gift: UniqueGiftInformation about the unique gift.
send_date: IntegerDate the gift was sent in Unix time.
transfer_star_count: Option<Integer>Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift.
can_be_transferred: Option<bool>Whether the gift can be transferred to another owner; for gifts received on behalf of business accounts only.
is_saved: Option<bool>Whether the gift is displayed on the account’s profile page; for gifts received on behalf of business accounts only.
next_transfer_date: Option<Integer>Point in time (Unix timestamp) when the gift can be transferred.
If it is in the past, then the gift can be transferred now.
owned_gift_id: Option<String>Unique identifier of the received gift for the bot; for gifts received on behalf of business accounts only.
sender_user: Option<User>Sender of the gift if it is a known user.
Implementations§
Source§impl OwnedGiftUnique
impl OwnedGiftUnique
Sourcepub fn new(gift: UniqueGift, send_date: Integer) -> Self
pub fn new(gift: UniqueGift, send_date: Integer) -> Self
Creates a new OwnedGiftUnique.
§Arguments
gift- Information about the unique gift.send_date- Date the gift was sent in Unix time.
Sourcepub fn with_transfer_star_count(self, value: Integer) -> Self
pub fn with_transfer_star_count(self, value: Integer) -> Self
Sets a new transfer star count.
§Arguments
valueNumber of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift.
Sourcepub fn with_can_be_transferred(self, value: bool) -> Self
pub fn with_can_be_transferred(self, value: bool) -> Self
Sets a new value for the can_be_transferred flag.
§Arguments
value- Whether the gift can be transferred to another owner; for gifts received on behalf of business accounts only.
Sourcepub fn with_is_saved(self, value: bool) -> Self
pub fn with_is_saved(self, value: bool) -> Self
Sets a new value for the is_saved flag.
§Arguments
value- Whether the gift is displayed on the account’s profile page; for gifts received on behalf of business accounts only.
Sourcepub fn with_next_transfer_date(self, value: Integer) -> Self
pub fn with_next_transfer_date(self, value: Integer) -> Self
Sets a new next transfer date.
§Arguments
value- Point in time (Unix timestamp) when the gift can be transferred.
Sourcepub fn with_owned_gift_id<T>(self, value: T) -> Self
pub fn with_owned_gift_id<T>(self, value: T) -> Self
Sets a new owned gift ID.
§Arguments
value- Unique identifier of the received gift for the bot; for gifts received on behalf of business accounts only.
Sourcepub fn with_sender_user(self, value: User) -> Self
pub fn with_sender_user(self, value: User) -> Self
Trait Implementations§
Source§impl Clone for OwnedGiftUnique
impl Clone for OwnedGiftUnique
Source§fn clone(&self) -> OwnedGiftUnique
fn clone(&self) -> OwnedGiftUnique
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more