mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 14:35:36 +01:00
Added PhotoSize, removed use serde::...
in **/types/*
This commit is contained in:
parent
e41d62a27f
commit
2d074e73e2
36 changed files with 18 additions and 65 deletions
|
@ -1,5 +1,3 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
pub struct AnswerPreCheckoutQuery {
|
||||
pub pre_checkout_query_id: String,
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
use crate::core::types::ShippingOption;
|
||||
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use crate::core::types::PhotoSize;
|
||||
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, Hash, PartialEq, Eq)]
|
||||
#[derive(Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
||||
pub struct Audio {
|
||||
pub file_id: String,
|
||||
pub duration: u32,
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
/// This object represents an incoming callback query from a callback button in an inline keyboard.
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
pub struct CallbackQuery {
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
use crate::core::types::{ChatPermissions, ChatPhoto, Message};
|
||||
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
pub struct ChatPermissions {
|
||||
pub can_send_messages: Option<bool>,
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
pub struct ChatPhoto {
|
||||
pub small_file_id: String,
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
use crate::core::types::user::User;
|
||||
|
||||
#[derive(Debug, Deserealize)]
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
use crate::core::types::{PhotoSize, UnsignedInteger};
|
||||
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
|
||||
#[derive(Debug, Deserialize, Eq, Hash, PartialEq)]
|
||||
pub struct Document {
|
||||
pub file_id: String,
|
||||
pub thumb: Option<PhotoSize>,
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
/// Upon receiving a message with this object, Telegram clients will
|
||||
/// display a reply interface to the user (act as if the user has
|
||||
/// selected the bot‘s message and tapped ’Reply'). This can be
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
/// This object represents one button of an inline keyboard.
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
pub struct InlineKeyboardButton {
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
/// This object represents an inline keyboard that appears right next to the message it belongs to.
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
pub struct InlineKeyboardMarkup {
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
#[derive(Debug, Hash, PartialEq, Eq)]
|
||||
pub enum InputFile {
|
||||
File(std::path::PathBuf),
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
use serde::Deserialize;
|
||||
use crate::core::types::{InputFile, ParseMode};
|
||||
|
||||
// TODO: should variants use new-type?
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
pub struct Invoice {
|
||||
pub title: String,
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
/// This object represents one button of the reply keyboard.
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
pub struct KeyboardButton {
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
pub struct LabeledPrice {
|
||||
pub label: String,
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
pub struct LoginUrl {
|
||||
url: String,
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
pub struct MaskPosition {
|
||||
pub point: String,
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
// use serde::Deserialize;
|
||||
|
||||
use crate::core::types::{
|
||||
Animation, Audio, Chat, Contact, Document, Game, InlineKeyboardMarkup, Invoice, Location,
|
||||
MessageEntity, PassportData, PhotoSize, Poll, Sticker, SuccessfulPayment, User, Venue, Video,
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
use crate::core::types::User;
|
||||
|
||||
#[derive(Deserialize, Debug, PartialEq, Hash, Eq)]
|
||||
|
||||
#[derive(Debug, Deserialize, Eq, Hash, PartialEq)]
|
||||
pub struct MessageEntity {
|
||||
#[serde(flatten)]
|
||||
pub kind: MessageEntityKind,
|
||||
|
@ -8,6 +9,7 @@ pub struct MessageEntity {
|
|||
pub length: usize,
|
||||
}
|
||||
|
||||
|
||||
#[derive(Deserialize, Debug, PartialEq, Hash, Eq)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
#[serde(tag = "type")]
|
||||
|
|
|
@ -19,6 +19,7 @@ pub use self::{
|
|||
message::Message,
|
||||
message_entity::MessageEntity,
|
||||
order_info::OrderInfo,
|
||||
photo_size::PhotoSize,
|
||||
pre_checkout_query::PreCheckoutQuery,
|
||||
send_invoice::SendInvoice,
|
||||
shipping_address::ShippingAddress,
|
||||
|
@ -46,6 +47,7 @@ mod message;
|
|||
mod message_entity;
|
||||
mod not_implemented_types;
|
||||
mod order_info;
|
||||
mod photo_size;
|
||||
mod pre_checkout_query;
|
||||
mod send_invoice;
|
||||
mod shipping_address;
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
#[derive(Debug, Deserialize, Serialize, PartialEq, Hash, Eq)]
|
||||
pub struct PhotoSize;
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, PartialEq, Hash, Eq)]
|
||||
pub struct Location;
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
use crate::core::types::ShippingAddress;
|
||||
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
|
|
10
src/core/types/photo_size.rs
Normal file
10
src/core/types/photo_size.rs
Normal file
|
@ -0,0 +1,10 @@
|
|||
use crate::core::types::{Integer, UnsignedInteger};
|
||||
|
||||
|
||||
#[derive(Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
||||
pub struct PhotoSize {
|
||||
pub file_id: String,
|
||||
pub width: Integer,
|
||||
pub heigth: Integer,
|
||||
pub file_size: Option<UnsignedInteger>
|
||||
}
|
|
@ -1,5 +1,3 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
use crate::core::types::{OrderInfo, User};
|
||||
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
/// This object represents a custom keyboard with reply options.
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
pub struct ReplyKeyboardMarkup {
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
/// Upon receiving a message with this object, Telegram clients will remove
|
||||
/// the current custom keyboard and display the default letter-keyboard.
|
||||
/// By default, custom keyboards are displayed until a new keyboard is sent
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
pub struct ResponseParameters {
|
||||
migrate_to_chat_id: Option<i64>,
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
pub struct ShippingAddress {
|
||||
pub country_code: String,
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
use crate::core::types::LabeledPrice;
|
||||
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
use crate::core::types::{ShippingAddress, User};
|
||||
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
use crate::core::types::{MaskPosition, PhotoSize};
|
||||
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
use crate::core::types::Sticker;
|
||||
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
use crate::core::types::OrderInfo;
|
||||
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
pub struct User {
|
||||
pub id: i64,
|
||||
|
|
Loading…
Reference in a new issue