diff --git a/core/messaging_api/src/models/audio_message.rs b/core/messaging_api/src/models/audio_message.rs index 60ed36a5..f83d786e 100644 --- a/core/messaging_api/src/models/audio_message.rs +++ b/core/messaging_api/src/models/audio_message.rs @@ -26,9 +26,6 @@ #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AudioMessage { - /// Type of message - #[serde(rename = "type")] - pub r#type: String, #[serde(rename = "quickReply", skip_serializing_if = "Option::is_none")] pub quick_reply: Option>, #[serde(rename = "sender", skip_serializing_if = "Option::is_none")] @@ -40,9 +37,8 @@ pub struct AudioMessage { } impl AudioMessage { - pub fn new(r#type: String, original_content_url: String, duration: i64) -> AudioMessage { + pub fn new(original_content_url: String, duration: i64) -> AudioMessage { AudioMessage { - r#type, quick_reply: None, sender: None, original_content_url, diff --git a/core/messaging_api/src/models/flex_message.rs b/core/messaging_api/src/models/flex_message.rs index 693a8a9d..21d7b73d 100644 --- a/core/messaging_api/src/models/flex_message.rs +++ b/core/messaging_api/src/models/flex_message.rs @@ -26,9 +26,6 @@ #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FlexMessage { - /// Type of message - #[serde(rename = "type")] - pub r#type: String, #[serde(rename = "quickReply", skip_serializing_if = "Option::is_none")] pub quick_reply: Option>, #[serde(rename = "sender", skip_serializing_if = "Option::is_none")] @@ -40,13 +37,8 @@ pub struct FlexMessage { } impl FlexMessage { - pub fn new( - r#type: String, - alt_text: String, - contents: crate::models::FlexContainer, - ) -> FlexMessage { + pub fn new(alt_text: String, contents: crate::models::FlexContainer) -> FlexMessage { FlexMessage { - r#type, quick_reply: None, sender: None, alt_text, diff --git a/core/messaging_api/src/models/image_message.rs b/core/messaging_api/src/models/image_message.rs index fbebb1f0..cec245d5 100644 --- a/core/messaging_api/src/models/image_message.rs +++ b/core/messaging_api/src/models/image_message.rs @@ -26,9 +26,6 @@ #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ImageMessage { - /// Type of message - #[serde(rename = "type")] - pub r#type: String, #[serde(rename = "quickReply", skip_serializing_if = "Option::is_none")] pub quick_reply: Option>, #[serde(rename = "sender", skip_serializing_if = "Option::is_none")] @@ -40,13 +37,8 @@ pub struct ImageMessage { } impl ImageMessage { - pub fn new( - r#type: String, - original_content_url: String, - preview_image_url: String, - ) -> ImageMessage { + pub fn new(original_content_url: String, preview_image_url: String) -> ImageMessage { ImageMessage { - r#type, quick_reply: None, sender: None, original_content_url, diff --git a/core/messaging_api/src/models/imagemap_message.rs b/core/messaging_api/src/models/imagemap_message.rs index ae4891b3..c8c0f6af 100644 --- a/core/messaging_api/src/models/imagemap_message.rs +++ b/core/messaging_api/src/models/imagemap_message.rs @@ -26,9 +26,6 @@ #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ImagemapMessage { - /// Type of message - #[serde(rename = "type")] - pub r#type: String, #[serde(rename = "quickReply", skip_serializing_if = "Option::is_none")] pub quick_reply: Option>, #[serde(rename = "sender", skip_serializing_if = "Option::is_none")] @@ -47,14 +44,12 @@ pub struct ImagemapMessage { impl ImagemapMessage { pub fn new( - r#type: String, base_url: String, alt_text: String, base_size: crate::models::ImagemapBaseSize, actions: Vec, ) -> ImagemapMessage { ImagemapMessage { - r#type, quick_reply: None, sender: None, base_url, diff --git a/core/messaging_api/src/models/location_message.rs b/core/messaging_api/src/models/location_message.rs index 247279eb..6dbc0e1c 100644 --- a/core/messaging_api/src/models/location_message.rs +++ b/core/messaging_api/src/models/location_message.rs @@ -26,9 +26,6 @@ #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct LocationMessage { - /// Type of message - #[serde(rename = "type")] - pub r#type: String, #[serde(rename = "quickReply", skip_serializing_if = "Option::is_none")] pub quick_reply: Option>, #[serde(rename = "sender", skip_serializing_if = "Option::is_none")] @@ -44,15 +41,8 @@ pub struct LocationMessage { } impl LocationMessage { - pub fn new( - r#type: String, - title: String, - address: String, - latitude: f64, - longitude: f64, - ) -> LocationMessage { + pub fn new(title: String, address: String, latitude: f64, longitude: f64) -> LocationMessage { LocationMessage { - r#type, quick_reply: None, sender: None, title, diff --git a/core/messaging_api/src/models/sticker_message.rs b/core/messaging_api/src/models/sticker_message.rs index aa95a601..5aa32865 100644 --- a/core/messaging_api/src/models/sticker_message.rs +++ b/core/messaging_api/src/models/sticker_message.rs @@ -26,9 +26,6 @@ #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct StickerMessage { - /// Type of message - #[serde(rename = "type")] - pub r#type: String, #[serde(rename = "quickReply", skip_serializing_if = "Option::is_none")] pub quick_reply: Option>, #[serde(rename = "sender", skip_serializing_if = "Option::is_none")] @@ -43,9 +40,8 @@ pub struct StickerMessage { } impl StickerMessage { - pub fn new(r#type: String, package_id: String, sticker_id: String) -> StickerMessage { + pub fn new(package_id: String, sticker_id: String) -> StickerMessage { StickerMessage { - r#type, quick_reply: None, sender: None, package_id, diff --git a/core/messaging_api/src/models/template_message.rs b/core/messaging_api/src/models/template_message.rs index 6d0e4213..db6571ec 100644 --- a/core/messaging_api/src/models/template_message.rs +++ b/core/messaging_api/src/models/template_message.rs @@ -26,9 +26,6 @@ #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TemplateMessage { - /// Type of message - #[serde(rename = "type")] - pub r#type: String, #[serde(rename = "quickReply", skip_serializing_if = "Option::is_none")] pub quick_reply: Option>, #[serde(rename = "sender", skip_serializing_if = "Option::is_none")] @@ -40,13 +37,8 @@ pub struct TemplateMessage { } impl TemplateMessage { - pub fn new( - r#type: String, - alt_text: String, - template: crate::models::Template, - ) -> TemplateMessage { + pub fn new(alt_text: String, template: crate::models::Template) -> TemplateMessage { TemplateMessage { - r#type, quick_reply: None, sender: None, alt_text, diff --git a/core/messaging_api/src/models/text_message.rs b/core/messaging_api/src/models/text_message.rs index 1a03369f..b0e2a494 100644 --- a/core/messaging_api/src/models/text_message.rs +++ b/core/messaging_api/src/models/text_message.rs @@ -26,9 +26,6 @@ #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TextMessage { - /// Type of message - #[serde(rename = "type")] - pub r#type: String, #[serde(rename = "quickReply", skip_serializing_if = "Option::is_none")] pub quick_reply: Option>, #[serde(rename = "sender", skip_serializing_if = "Option::is_none")] @@ -43,9 +40,8 @@ pub struct TextMessage { } impl TextMessage { - pub fn new(r#type: String, text: String) -> TextMessage { + pub fn new(text: String) -> TextMessage { TextMessage { - r#type, quick_reply: None, sender: None, text, diff --git a/core/messaging_api/src/models/video_message.rs b/core/messaging_api/src/models/video_message.rs index 277fff23..daa1f2d1 100644 --- a/core/messaging_api/src/models/video_message.rs +++ b/core/messaging_api/src/models/video_message.rs @@ -26,9 +26,6 @@ #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct VideoMessage { - /// Type of message - #[serde(rename = "type")] - pub r#type: String, #[serde(rename = "quickReply", skip_serializing_if = "Option::is_none")] pub quick_reply: Option>, #[serde(rename = "sender", skip_serializing_if = "Option::is_none")] @@ -42,13 +39,8 @@ pub struct VideoMessage { } impl VideoMessage { - pub fn new( - r#type: String, - original_content_url: String, - preview_image_url: String, - ) -> VideoMessage { + pub fn new(original_content_url: String, preview_image_url: String) -> VideoMessage { VideoMessage { - r#type, quick_reply: None, sender: None, original_content_url, diff --git a/core/webhook/src/models/account_link_event.rs b/core/webhook/src/models/account_link_event.rs index 83a1a113..5b1cd05b 100644 --- a/core/webhook/src/models/account_link_event.rs +++ b/core/webhook/src/models/account_link_event.rs @@ -28,9 +28,6 @@ #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AccountLinkEvent { - /// Type of the event - #[serde(rename = "type")] - pub r#type: String, #[serde(rename = "source", skip_serializing_if = "Option::is_none")] pub source: Option>, /// Time of the event in milliseconds. @@ -53,7 +50,6 @@ pub struct AccountLinkEvent { impl AccountLinkEvent { /// Event object for when a user has linked their LINE account with a provider's service account. You can reply to account link events. pub fn new( - r#type: String, timestamp: i64, mode: crate::models::EventMode, webhook_event_id: String, @@ -61,7 +57,6 @@ impl AccountLinkEvent { link: crate::models::LinkContent, ) -> AccountLinkEvent { AccountLinkEvent { - r#type, source: None, timestamp, mode, diff --git a/core/webhook/src/models/activated_event.rs b/core/webhook/src/models/activated_event.rs index 551749ba..aea5149b 100644 --- a/core/webhook/src/models/activated_event.rs +++ b/core/webhook/src/models/activated_event.rs @@ -28,9 +28,6 @@ #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ActivatedEvent { - /// Type of the event - #[serde(rename = "type")] - pub r#type: String, #[serde(rename = "source", skip_serializing_if = "Option::is_none")] pub source: Option>, /// Time of the event in milliseconds. @@ -50,7 +47,6 @@ pub struct ActivatedEvent { impl ActivatedEvent { /// This event indicates that the module channel has been switched to Active Channel by calling the Acquire Control API. Sent to the webhook URL server of the module channel. pub fn new( - r#type: String, timestamp: i64, mode: crate::models::EventMode, webhook_event_id: String, @@ -58,7 +54,6 @@ impl ActivatedEvent { chat_control: crate::models::ChatControl, ) -> ActivatedEvent { ActivatedEvent { - r#type, source: None, timestamp, mode, diff --git a/core/webhook/src/models/audio_message_content.rs b/core/webhook/src/models/audio_message_content.rs index 828c17ed..1313bf67 100644 --- a/core/webhook/src/models/audio_message_content.rs +++ b/core/webhook/src/models/audio_message_content.rs @@ -26,9 +26,6 @@ #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AudioMessageContent { - /// Type - #[serde(rename = "type")] - pub r#type: String, /// Message ID #[serde(rename = "id")] pub id: String, @@ -41,12 +38,10 @@ pub struct AudioMessageContent { impl AudioMessageContent { pub fn new( - r#type: String, id: String, content_provider: crate::models::ContentProvider, ) -> AudioMessageContent { AudioMessageContent { - r#type, id, content_provider: Box::new(content_provider), duration: None, diff --git a/core/webhook/src/models/beacon_event.rs b/core/webhook/src/models/beacon_event.rs index 4bf7c0b2..bd5d8c0f 100644 --- a/core/webhook/src/models/beacon_event.rs +++ b/core/webhook/src/models/beacon_event.rs @@ -28,9 +28,6 @@ #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BeaconEvent { - /// Type of the event - #[serde(rename = "type")] - pub r#type: String, #[serde(rename = "source", skip_serializing_if = "Option::is_none")] pub source: Option>, /// Time of the event in milliseconds. @@ -53,7 +50,6 @@ pub struct BeaconEvent { impl BeaconEvent { /// Event object for when a user enters the range of a LINE Beacon. You can reply to beacon events. pub fn new( - r#type: String, timestamp: i64, mode: crate::models::EventMode, webhook_event_id: String, @@ -62,7 +58,6 @@ impl BeaconEvent { beacon: crate::models::BeaconContent, ) -> BeaconEvent { BeaconEvent { - r#type, source: None, timestamp, mode, diff --git a/core/webhook/src/models/bot_resumed_event.rs b/core/webhook/src/models/bot_resumed_event.rs index 7c2783a7..99c32ac4 100644 --- a/core/webhook/src/models/bot_resumed_event.rs +++ b/core/webhook/src/models/bot_resumed_event.rs @@ -28,9 +28,6 @@ #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BotResumedEvent { - /// Type of the event - #[serde(rename = "type")] - pub r#type: String, #[serde(rename = "source", skip_serializing_if = "Option::is_none")] pub source: Option>, /// Time of the event in milliseconds. @@ -48,14 +45,12 @@ pub struct BotResumedEvent { impl BotResumedEvent { /// This event indicates that the LINE Official Account has returned from the suspended state. Sent to the webhook URL server of the module channel. pub fn new( - r#type: String, timestamp: i64, mode: crate::models::EventMode, webhook_event_id: String, delivery_context: crate::models::DeliveryContext, ) -> BotResumedEvent { BotResumedEvent { - r#type, source: None, timestamp, mode, diff --git a/core/webhook/src/models/bot_suspended_event.rs b/core/webhook/src/models/bot_suspended_event.rs index cee7972b..f3adfc69 100644 --- a/core/webhook/src/models/bot_suspended_event.rs +++ b/core/webhook/src/models/bot_suspended_event.rs @@ -28,9 +28,6 @@ #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BotSuspendedEvent { - /// Type of the event - #[serde(rename = "type")] - pub r#type: String, #[serde(rename = "source", skip_serializing_if = "Option::is_none")] pub source: Option>, /// Time of the event in milliseconds. @@ -48,14 +45,12 @@ pub struct BotSuspendedEvent { impl BotSuspendedEvent { /// This event indicates that the LINE Official Account has been suspended (Suspend). Sent to the webhook URL server of the module channel. pub fn new( - r#type: String, timestamp: i64, mode: crate::models::EventMode, webhook_event_id: String, delivery_context: crate::models::DeliveryContext, ) -> BotSuspendedEvent { BotSuspendedEvent { - r#type, source: None, timestamp, mode, diff --git a/core/webhook/src/models/deactivated_event.rs b/core/webhook/src/models/deactivated_event.rs index 8fbe61c2..57b05158 100644 --- a/core/webhook/src/models/deactivated_event.rs +++ b/core/webhook/src/models/deactivated_event.rs @@ -28,9 +28,6 @@ #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DeactivatedEvent { - /// Type of the event - #[serde(rename = "type")] - pub r#type: String, #[serde(rename = "source", skip_serializing_if = "Option::is_none")] pub source: Option>, /// Time of the event in milliseconds. @@ -48,14 +45,12 @@ pub struct DeactivatedEvent { impl DeactivatedEvent { /// This event indicates that the module channel has been switched to Standby Channel by calling Acquire Control API or Release Control API. Sent to the webhook URL server of the module channel. pub fn new( - r#type: String, timestamp: i64, mode: crate::models::EventMode, webhook_event_id: String, delivery_context: crate::models::DeliveryContext, ) -> DeactivatedEvent { DeactivatedEvent { - r#type, source: None, timestamp, mode, diff --git a/core/webhook/src/models/file_message_content.rs b/core/webhook/src/models/file_message_content.rs index 8cc8fdaf..ca737dab 100644 --- a/core/webhook/src/models/file_message_content.rs +++ b/core/webhook/src/models/file_message_content.rs @@ -26,9 +26,6 @@ #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FileMessageContent { - /// Type - #[serde(rename = "type")] - pub r#type: String, /// Message ID #[serde(rename = "id")] pub id: String, @@ -41,14 +38,8 @@ pub struct FileMessageContent { } impl FileMessageContent { - pub fn new( - r#type: String, - id: String, - file_name: String, - file_size: i32, - ) -> FileMessageContent { + pub fn new(id: String, file_name: String, file_size: i32) -> FileMessageContent { FileMessageContent { - r#type, id, file_name, file_size, diff --git a/core/webhook/src/models/follow_event.rs b/core/webhook/src/models/follow_event.rs index 36719771..00526239 100644 --- a/core/webhook/src/models/follow_event.rs +++ b/core/webhook/src/models/follow_event.rs @@ -28,9 +28,6 @@ #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FollowEvent { - /// Type of the event - #[serde(rename = "type")] - pub r#type: String, #[serde(rename = "source", skip_serializing_if = "Option::is_none")] pub source: Option>, /// Time of the event in milliseconds. @@ -51,7 +48,6 @@ pub struct FollowEvent { impl FollowEvent { /// Event object for when your LINE Official Account is added as a friend (or unblocked). You can reply to follow events. pub fn new( - r#type: String, timestamp: i64, mode: crate::models::EventMode, webhook_event_id: String, @@ -59,7 +55,6 @@ impl FollowEvent { reply_token: String, ) -> FollowEvent { FollowEvent { - r#type, source: None, timestamp, mode, diff --git a/core/webhook/src/models/group_source.rs b/core/webhook/src/models/group_source.rs index 0eba4442..65a59c38 100644 --- a/core/webhook/src/models/group_source.rs +++ b/core/webhook/src/models/group_source.rs @@ -26,9 +26,6 @@ #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GroupSource { - /// source type - #[serde(rename = "type")] - pub r#type: String, /// Group ID of the source group chat #[serde(rename = "groupId")] pub group_id: String, @@ -38,9 +35,8 @@ pub struct GroupSource { } impl GroupSource { - pub fn new(r#type: String, group_id: String) -> GroupSource { + pub fn new(group_id: String) -> GroupSource { GroupSource { - r#type, group_id, user_id: None, } diff --git a/core/webhook/src/models/image_message_content.rs b/core/webhook/src/models/image_message_content.rs index e850459d..5f5ad1d5 100644 --- a/core/webhook/src/models/image_message_content.rs +++ b/core/webhook/src/models/image_message_content.rs @@ -26,9 +26,6 @@ #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ImageMessageContent { - /// Type - #[serde(rename = "type")] - pub r#type: String, /// Message ID #[serde(rename = "id")] pub id: String, @@ -43,13 +40,11 @@ pub struct ImageMessageContent { impl ImageMessageContent { pub fn new( - r#type: String, id: String, content_provider: crate::models::ContentProvider, quote_token: String, ) -> ImageMessageContent { ImageMessageContent { - r#type, id, content_provider: Box::new(content_provider), image_set: None, diff --git a/core/webhook/src/models/join_event.rs b/core/webhook/src/models/join_event.rs index 82d5c1cf..36158247 100644 --- a/core/webhook/src/models/join_event.rs +++ b/core/webhook/src/models/join_event.rs @@ -28,9 +28,6 @@ #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct JoinEvent { - /// Type of the event - #[serde(rename = "type")] - pub r#type: String, #[serde(rename = "source", skip_serializing_if = "Option::is_none")] pub source: Option>, /// Time of the event in milliseconds. @@ -51,7 +48,6 @@ pub struct JoinEvent { impl JoinEvent { /// Event object for when your LINE Official Account joins a group chat or multi-person chat. You can reply to join events. pub fn new( - r#type: String, timestamp: i64, mode: crate::models::EventMode, webhook_event_id: String, @@ -59,7 +55,6 @@ impl JoinEvent { reply_token: String, ) -> JoinEvent { JoinEvent { - r#type, source: None, timestamp, mode, diff --git a/core/webhook/src/models/leave_event.rs b/core/webhook/src/models/leave_event.rs index a1aab914..c392bed0 100644 --- a/core/webhook/src/models/leave_event.rs +++ b/core/webhook/src/models/leave_event.rs @@ -28,9 +28,6 @@ #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct LeaveEvent { - /// Type of the event - #[serde(rename = "type")] - pub r#type: String, #[serde(rename = "source", skip_serializing_if = "Option::is_none")] pub source: Option>, /// Time of the event in milliseconds. @@ -48,14 +45,12 @@ pub struct LeaveEvent { impl LeaveEvent { /// Event object for when a user removes your LINE Official Account from a group chat or when your LINE Official Account leaves a group chat or multi-person chat. pub fn new( - r#type: String, timestamp: i64, mode: crate::models::EventMode, webhook_event_id: String, delivery_context: crate::models::DeliveryContext, ) -> LeaveEvent { LeaveEvent { - r#type, source: None, timestamp, mode, diff --git a/core/webhook/src/models/location_message_content.rs b/core/webhook/src/models/location_message_content.rs index 3bd7e0d2..d797f21d 100644 --- a/core/webhook/src/models/location_message_content.rs +++ b/core/webhook/src/models/location_message_content.rs @@ -26,9 +26,6 @@ #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct LocationMessageContent { - /// Type - #[serde(rename = "type")] - pub r#type: String, /// Message ID #[serde(rename = "id")] pub id: String, @@ -47,14 +44,8 @@ pub struct LocationMessageContent { } impl LocationMessageContent { - pub fn new( - r#type: String, - id: String, - latitude: f64, - longitude: f64, - ) -> LocationMessageContent { + pub fn new(id: String, latitude: f64, longitude: f64) -> LocationMessageContent { LocationMessageContent { - r#type, id, title: None, address: None, diff --git a/core/webhook/src/models/member_joined_event.rs b/core/webhook/src/models/member_joined_event.rs index f6a7e24b..8d220349 100644 --- a/core/webhook/src/models/member_joined_event.rs +++ b/core/webhook/src/models/member_joined_event.rs @@ -28,9 +28,6 @@ #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MemberJoinedEvent { - /// Type of the event - #[serde(rename = "type")] - pub r#type: String, #[serde(rename = "source", skip_serializing_if = "Option::is_none")] pub source: Option>, /// Time of the event in milliseconds. @@ -53,7 +50,6 @@ pub struct MemberJoinedEvent { impl MemberJoinedEvent { /// Event object for when a user joins a group chat or multi-person chat that the LINE Official Account is in. pub fn new( - r#type: String, timestamp: i64, mode: crate::models::EventMode, webhook_event_id: String, @@ -62,7 +58,6 @@ impl MemberJoinedEvent { joined: crate::models::JoinedMembers, ) -> MemberJoinedEvent { MemberJoinedEvent { - r#type, source: None, timestamp, mode, diff --git a/core/webhook/src/models/member_left_event.rs b/core/webhook/src/models/member_left_event.rs index a7c0e65a..8d596047 100644 --- a/core/webhook/src/models/member_left_event.rs +++ b/core/webhook/src/models/member_left_event.rs @@ -28,9 +28,6 @@ #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MemberLeftEvent { - /// Type of the event - #[serde(rename = "type")] - pub r#type: String, #[serde(rename = "source", skip_serializing_if = "Option::is_none")] pub source: Option>, /// Time of the event in milliseconds. @@ -50,7 +47,6 @@ pub struct MemberLeftEvent { impl MemberLeftEvent { /// Event object for when a user leaves a group chat or multi-person chat that the LINE Official Account is in. pub fn new( - r#type: String, timestamp: i64, mode: crate::models::EventMode, webhook_event_id: String, @@ -58,7 +54,6 @@ impl MemberLeftEvent { left: crate::models::LeftMembers, ) -> MemberLeftEvent { MemberLeftEvent { - r#type, source: None, timestamp, mode, diff --git a/core/webhook/src/models/message_event.rs b/core/webhook/src/models/message_event.rs index 2ffccec0..463cc0e1 100644 --- a/core/webhook/src/models/message_event.rs +++ b/core/webhook/src/models/message_event.rs @@ -28,9 +28,6 @@ #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MessageEvent { - /// Type of the event - #[serde(rename = "type")] - pub r#type: String, #[serde(rename = "source", skip_serializing_if = "Option::is_none")] pub source: Option>, /// Time of the event in milliseconds. @@ -52,7 +49,6 @@ pub struct MessageEvent { impl MessageEvent { /// Webhook event object which contains the sent message. pub fn new( - r#type: String, timestamp: i64, mode: crate::models::EventMode, webhook_event_id: String, @@ -60,7 +56,6 @@ impl MessageEvent { message: crate::models::MessageContent, ) -> MessageEvent { MessageEvent { - r#type, source: None, timestamp, mode, diff --git a/core/webhook/src/models/module_event.rs b/core/webhook/src/models/module_event.rs index 9a8caaf3..58a1c332 100644 --- a/core/webhook/src/models/module_event.rs +++ b/core/webhook/src/models/module_event.rs @@ -28,9 +28,6 @@ #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ModuleEvent { - /// Type of the event - #[serde(rename = "type")] - pub r#type: String, #[serde(rename = "source", skip_serializing_if = "Option::is_none")] pub source: Option>, /// Time of the event in milliseconds. @@ -50,7 +47,6 @@ pub struct ModuleEvent { impl ModuleEvent { /// This event indicates that the module channel has been attached to the LINE Official Account. Sent to the webhook URL server of the module channel. pub fn new( - r#type: String, timestamp: i64, mode: crate::models::EventMode, webhook_event_id: String, @@ -58,7 +54,6 @@ impl ModuleEvent { module: crate::models::ModuleContent, ) -> ModuleEvent { ModuleEvent { - r#type, source: None, timestamp, mode, diff --git a/core/webhook/src/models/postback_event.rs b/core/webhook/src/models/postback_event.rs index b2867936..96832fce 100644 --- a/core/webhook/src/models/postback_event.rs +++ b/core/webhook/src/models/postback_event.rs @@ -28,9 +28,6 @@ #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PostbackEvent { - /// Type of the event - #[serde(rename = "type")] - pub r#type: String, #[serde(rename = "source", skip_serializing_if = "Option::is_none")] pub source: Option>, /// Time of the event in milliseconds. @@ -53,7 +50,6 @@ pub struct PostbackEvent { impl PostbackEvent { /// Event object for when a user performs a postback action which initiates a postback. You can reply to postback events. pub fn new( - r#type: String, timestamp: i64, mode: crate::models::EventMode, webhook_event_id: String, @@ -61,7 +57,6 @@ impl PostbackEvent { postback: crate::models::PostbackContent, ) -> PostbackEvent { PostbackEvent { - r#type, source: None, timestamp, mode, diff --git a/core/webhook/src/models/room_source.rs b/core/webhook/src/models/room_source.rs index eea1e7eb..1ea26bda 100644 --- a/core/webhook/src/models/room_source.rs +++ b/core/webhook/src/models/room_source.rs @@ -26,9 +26,6 @@ #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RoomSource { - /// source type - #[serde(rename = "type")] - pub r#type: String, /// ID of the source user. Only included in message events. Only users of LINE for iOS and LINE for Android are included in userId. #[serde(rename = "userId", skip_serializing_if = "Option::is_none")] pub user_id: Option, @@ -38,9 +35,8 @@ pub struct RoomSource { } impl RoomSource { - pub fn new(r#type: String, room_id: String) -> RoomSource { + pub fn new(room_id: String) -> RoomSource { RoomSource { - r#type, user_id: None, room_id, } diff --git a/core/webhook/src/models/sticker_message_content.rs b/core/webhook/src/models/sticker_message_content.rs index 46bee787..0aad497b 100644 --- a/core/webhook/src/models/sticker_message_content.rs +++ b/core/webhook/src/models/sticker_message_content.rs @@ -26,9 +26,6 @@ #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct StickerMessageContent { - /// Type - #[serde(rename = "type")] - pub r#type: String, /// Message ID #[serde(rename = "id")] pub id: String, @@ -56,7 +53,6 @@ pub struct StickerMessageContent { impl StickerMessageContent { pub fn new( - r#type: String, id: String, package_id: String, sticker_id: String, @@ -64,7 +60,6 @@ impl StickerMessageContent { quote_token: String, ) -> StickerMessageContent { StickerMessageContent { - r#type, id, package_id, sticker_id, diff --git a/core/webhook/src/models/text_message_content.rs b/core/webhook/src/models/text_message_content.rs index d821e9c7..c8d265fe 100644 --- a/core/webhook/src/models/text_message_content.rs +++ b/core/webhook/src/models/text_message_content.rs @@ -26,9 +26,6 @@ #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TextMessageContent { - /// Type - #[serde(rename = "type")] - pub r#type: String, /// Message ID #[serde(rename = "id")] pub id: String, @@ -49,14 +46,8 @@ pub struct TextMessageContent { } impl TextMessageContent { - pub fn new( - r#type: String, - id: String, - text: String, - quote_token: String, - ) -> TextMessageContent { + pub fn new(id: String, text: String, quote_token: String) -> TextMessageContent { TextMessageContent { - r#type, id, text, emojis: None, diff --git a/core/webhook/src/models/things_event.rs b/core/webhook/src/models/things_event.rs index b9fde640..77eaaf9a 100644 --- a/core/webhook/src/models/things_event.rs +++ b/core/webhook/src/models/things_event.rs @@ -28,9 +28,6 @@ #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ThingsEvent { - /// Type of the event - #[serde(rename = "type")] - pub r#type: String, #[serde(rename = "source", skip_serializing_if = "Option::is_none")] pub source: Option>, /// Time of the event in milliseconds. @@ -53,7 +50,6 @@ pub struct ThingsEvent { impl ThingsEvent { /// Indicates that a user linked a device with LINE. pub fn new( - r#type: String, timestamp: i64, mode: crate::models::EventMode, webhook_event_id: String, @@ -62,7 +58,6 @@ impl ThingsEvent { things: crate::models::ThingsContent, ) -> ThingsEvent { ThingsEvent { - r#type, source: None, timestamp, mode, diff --git a/core/webhook/src/models/unfollow_event.rs b/core/webhook/src/models/unfollow_event.rs index e989ca4c..31328a0f 100644 --- a/core/webhook/src/models/unfollow_event.rs +++ b/core/webhook/src/models/unfollow_event.rs @@ -28,9 +28,6 @@ #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UnfollowEvent { - /// Type of the event - #[serde(rename = "type")] - pub r#type: String, #[serde(rename = "source", skip_serializing_if = "Option::is_none")] pub source: Option>, /// Time of the event in milliseconds. @@ -48,14 +45,12 @@ pub struct UnfollowEvent { impl UnfollowEvent { /// Event object for when your LINE Official Account is blocked. pub fn new( - r#type: String, timestamp: i64, mode: crate::models::EventMode, webhook_event_id: String, delivery_context: crate::models::DeliveryContext, ) -> UnfollowEvent { UnfollowEvent { - r#type, source: None, timestamp, mode, diff --git a/core/webhook/src/models/unsend_event.rs b/core/webhook/src/models/unsend_event.rs index 65643029..5424f29c 100644 --- a/core/webhook/src/models/unsend_event.rs +++ b/core/webhook/src/models/unsend_event.rs @@ -28,9 +28,6 @@ #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UnsendEvent { - /// Type of the event - #[serde(rename = "type")] - pub r#type: String, #[serde(rename = "source", skip_serializing_if = "Option::is_none")] pub source: Option>, /// Time of the event in milliseconds. @@ -50,7 +47,6 @@ pub struct UnsendEvent { impl UnsendEvent { /// Event object for when the user unsends a message. pub fn new( - r#type: String, timestamp: i64, mode: crate::models::EventMode, webhook_event_id: String, @@ -58,7 +54,6 @@ impl UnsendEvent { unsend: crate::models::UnsendDetail, ) -> UnsendEvent { UnsendEvent { - r#type, source: None, timestamp, mode, diff --git a/core/webhook/src/models/user_source.rs b/core/webhook/src/models/user_source.rs index bc219665..2dc1f794 100644 --- a/core/webhook/src/models/user_source.rs +++ b/core/webhook/src/models/user_source.rs @@ -26,19 +26,13 @@ #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UserSource { - /// source type - #[serde(rename = "type")] - pub r#type: String, /// ID of the source user #[serde(rename = "userId", skip_serializing_if = "Option::is_none")] pub user_id: Option, } impl UserSource { - pub fn new(r#type: String) -> UserSource { - UserSource { - r#type, - user_id: None, - } + pub fn new(_type: String) -> UserSource { + UserSource { user_id: None } } } diff --git a/core/webhook/src/models/video_message_content.rs b/core/webhook/src/models/video_message_content.rs index ceba6ffb..9a9a3cfd 100644 --- a/core/webhook/src/models/video_message_content.rs +++ b/core/webhook/src/models/video_message_content.rs @@ -26,9 +26,6 @@ #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct VideoMessageContent { - /// Type - #[serde(rename = "type")] - pub r#type: String, /// Message ID #[serde(rename = "id")] pub id: String, @@ -44,13 +41,11 @@ pub struct VideoMessageContent { impl VideoMessageContent { pub fn new( - r#type: String, id: String, content_provider: crate::models::ContentProvider, quote_token: String, ) -> VideoMessageContent { VideoMessageContent { - r#type, id, duration: None, content_provider: Box::new(content_provider), diff --git a/core/webhook/src/models/video_play_complete_event.rs b/core/webhook/src/models/video_play_complete_event.rs index a3ee7929..dac4b4d8 100644 --- a/core/webhook/src/models/video_play_complete_event.rs +++ b/core/webhook/src/models/video_play_complete_event.rs @@ -28,9 +28,6 @@ #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct VideoPlayCompleteEvent { - /// Type of the event - #[serde(rename = "type")] - pub r#type: String, #[serde(rename = "source", skip_serializing_if = "Option::is_none")] pub source: Option>, /// Time of the event in milliseconds. @@ -53,7 +50,6 @@ pub struct VideoPlayCompleteEvent { impl VideoPlayCompleteEvent { /// Event for when a user finishes viewing a video at least once with the specified trackingId sent by the LINE Official Account. pub fn new( - r#type: String, timestamp: i64, mode: crate::models::EventMode, webhook_event_id: String, @@ -62,7 +58,6 @@ impl VideoPlayCompleteEvent { video_play_complete: crate::models::VideoPlayComplete, ) -> VideoPlayCompleteEvent { VideoPlayCompleteEvent { - r#type, source: None, timestamp, mode,