Struct tgbot::types::InputMessageContentInvoice
source · pub struct InputMessageContentInvoice { /* private fields */ }
Expand description
Represents an invoice message to be sent as the result of an inline query.
Implementations§
source§impl InputMessageContentInvoice
impl InputMessageContentInvoice
sourcepub fn new<A, B, C, D, E, F>(
currency: A,
description: B,
payload: C,
prices: D,
provider_token: E,
title: F
) -> Self
pub fn new<A, B, C, D, E, F>( currency: A, description: B, payload: C, prices: D, provider_token: E, title: F ) -> Self
Creates a new InputMessageContentInvoice
.
§Arguments
currency
- Three-letter ISO 4217 currency code.description
- Product description; 1-255 characters.payload
- Bot-defined invoice payload; 1-128 bytes; this will not be displayed to the user, use for your internal processes.prices
- Price breakdown (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.).provider_token
- Payment provider token, obtained via Bot Father.title
- Product name; 1-32 characters.
sourcepub fn with_is_flexible(self, value: bool) -> Self
pub fn with_is_flexible(self, value: bool) -> Self
Sets a new value for an is_flexible
flag.
§Arguments
value
- Indicates whether the final price depends on the shipping method.
sourcepub fn with_max_tip_amount(self, value: Integer) -> Self
pub fn with_max_tip_amount(self, value: Integer) -> Self
Sets a new max tip amount.
§Arguments
value
- Maximum accepted amount for tips in the smallest units of the currency; default - 0.
For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
sourcepub fn with_need_email(self, value: bool) -> Self
pub fn with_need_email(self, value: bool) -> Self
Sets a new value for a need_email
flag.
§Arguments
value
- Indicates whether an email address of a user is required to complete the order.
sourcepub fn with_need_name(self, value: bool) -> Self
pub fn with_need_name(self, value: bool) -> Self
Sets a new value for a need_name
flag.
§Arguments
value
- Indicates whether a full name of a user is required to complete the order.
sourcepub fn with_need_phone_number(self, value: bool) -> Self
pub fn with_need_phone_number(self, value: bool) -> Self
Sets a new value for a need_phone_number
flag.
§Arguments
value
- Indicates whether a phone number of a user is required to complete the order.
sourcepub fn with_need_shipping_address(self, value: bool) -> Self
pub fn with_need_shipping_address(self, value: bool) -> Self
Sets a new value for a need_shipping_address
flag.
§Arguments
value
- Indicates whether a shipping address of a user is required to complete the order.
sourcepub fn with_photo_height(self, value: Integer) -> Self
pub fn with_photo_height(self, value: Integer) -> Self
sourcepub fn with_photo_size(self, value: Integer) -> Self
pub fn with_photo_size(self, value: Integer) -> Self
sourcepub fn with_photo_width(self, value: Integer) -> Self
pub fn with_photo_width(self, value: Integer) -> Self
sourcepub fn with_photo_url<T>(self, value: T) -> Self
pub fn with_photo_url<T>(self, value: T) -> Self
Sets a new photo URL.
§Arguments
value
- URL of the product photo for the invoice.
Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for.
sourcepub fn with_provider_data<T>(self, value: &T) -> Result<Self, JsonError>where
T: Serialize,
pub fn with_provider_data<T>(self, value: &T) -> Result<Self, JsonError>where
T: Serialize,
Sets a new provider data.
§Arguments
value
- An object for data about the invoice, which will be shared with the payment provider.
A detailed description of the required fields should be provided by the payment provider.
sourcepub fn with_send_email_to_provider(self, value: bool) -> Self
pub fn with_send_email_to_provider(self, value: bool) -> Self
Sets a new value for a send_email_to_provider
flag.
§Arguments
value
- Indicates whether an email address of a user should be sent to provider.
sourcepub fn with_send_phone_number_to_provider(self, value: bool) -> Self
pub fn with_send_phone_number_to_provider(self, value: bool) -> Self
Sets a new value for a send_phone_number_to_provider
flag.
§Arguments
value
- Indicates whether a phone number of a user should be sent to provider.
sourcepub fn with_suggested_tip_amounts<T>(self, value: T) -> Selfwhere
T: IntoIterator<Item = Integer>,
pub fn with_suggested_tip_amounts<T>(self, value: T) -> Selfwhere
T: IntoIterator<Item = Integer>,
Sets a new suggested tip amounts.
§Arguments
value
- Array of suggested amounts of tip in the smallest units of the currency.
At most 4 suggested tip amounts can be specified.
The suggested tip amounts must be positive, passed
in a strictly increased order and must not exceed max_tip_amount
.
Trait Implementations§
source§impl Clone for InputMessageContentInvoice
impl Clone for InputMessageContentInvoice
source§fn clone(&self) -> InputMessageContentInvoice
fn clone(&self) -> InputMessageContentInvoice
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for InputMessageContentInvoice
impl Debug for InputMessageContentInvoice
source§impl<'de> Deserialize<'de> for InputMessageContentInvoice
impl<'de> Deserialize<'de> for InputMessageContentInvoice
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl From<InputMessageContentInvoice> for InputMessageContent
impl From<InputMessageContentInvoice> for InputMessageContent
source§fn from(original: InputMessageContentInvoice) -> InputMessageContent
fn from(original: InputMessageContentInvoice) -> InputMessageContent
source§impl PartialEq for InputMessageContentInvoice
impl PartialEq for InputMessageContentInvoice
source§fn eq(&self, other: &InputMessageContentInvoice) -> bool
fn eq(&self, other: &InputMessageContentInvoice) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for InputMessageContentInvoice
impl PartialOrd for InputMessageContentInvoice
source§fn partial_cmp(&self, other: &InputMessageContentInvoice) -> Option<Ordering>
fn partial_cmp(&self, other: &InputMessageContentInvoice) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl StructuralPartialEq for InputMessageContentInvoice
Auto Trait Implementations§
impl Freeze for InputMessageContentInvoice
impl RefUnwindSafe for InputMessageContentInvoice
impl Send for InputMessageContentInvoice
impl Sync for InputMessageContentInvoice
impl Unpin for InputMessageContentInvoice
impl UnwindSafe for InputMessageContentInvoice
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more