Skip to content

Commit

Permalink
update: core
Browse files Browse the repository at this point in the history
  • Loading branch information
nanato12 committed Dec 1, 2023
1 parent 1eb9add commit 14d44df
Show file tree
Hide file tree
Showing 37 changed files with 15 additions and 225 deletions.
6 changes: 1 addition & 5 deletions core/messaging_api/src/models/audio_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Box<crate::models::QuickReply>>,
#[serde(rename = "sender", skip_serializing_if = "Option::is_none")]
Expand All @@ -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,
Expand Down
10 changes: 1 addition & 9 deletions core/messaging_api/src/models/flex_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Box<crate::models::QuickReply>>,
#[serde(rename = "sender", skip_serializing_if = "Option::is_none")]
Expand All @@ -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,
Expand Down
10 changes: 1 addition & 9 deletions core/messaging_api/src/models/image_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Box<crate::models::QuickReply>>,
#[serde(rename = "sender", skip_serializing_if = "Option::is_none")]
Expand All @@ -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,
Expand Down
5 changes: 0 additions & 5 deletions core/messaging_api/src/models/imagemap_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Box<crate::models::QuickReply>>,
#[serde(rename = "sender", skip_serializing_if = "Option::is_none")]
Expand All @@ -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<crate::models::ImagemapAction>,
) -> ImagemapMessage {
ImagemapMessage {
r#type,
quick_reply: None,
sender: None,
base_url,
Expand Down
12 changes: 1 addition & 11 deletions core/messaging_api/src/models/location_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Box<crate::models::QuickReply>>,
#[serde(rename = "sender", skip_serializing_if = "Option::is_none")]
Expand All @@ -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,
Expand Down
6 changes: 1 addition & 5 deletions core/messaging_api/src/models/sticker_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Box<crate::models::QuickReply>>,
#[serde(rename = "sender", skip_serializing_if = "Option::is_none")]
Expand All @@ -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,
Expand Down
10 changes: 1 addition & 9 deletions core/messaging_api/src/models/template_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Box<crate::models::QuickReply>>,
#[serde(rename = "sender", skip_serializing_if = "Option::is_none")]
Expand All @@ -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,
Expand Down
6 changes: 1 addition & 5 deletions core/messaging_api/src/models/text_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Box<crate::models::QuickReply>>,
#[serde(rename = "sender", skip_serializing_if = "Option::is_none")]
Expand All @@ -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,
Expand Down
10 changes: 1 addition & 9 deletions core/messaging_api/src/models/video_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Box<crate::models::QuickReply>>,
#[serde(rename = "sender", skip_serializing_if = "Option::is_none")]
Expand All @@ -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,
Expand Down
5 changes: 0 additions & 5 deletions core/webhook/src/models/account_link_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Box<crate::models::Source>>,
/// Time of the event in milliseconds.
Expand All @@ -53,15 +50,13 @@ 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,
delivery_context: crate::models::DeliveryContext,
link: crate::models::LinkContent,
) -> AccountLinkEvent {
AccountLinkEvent {
r#type,
source: None,
timestamp,
mode,
Expand Down
5 changes: 0 additions & 5 deletions core/webhook/src/models/activated_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Box<crate::models::Source>>,
/// Time of the event in milliseconds.
Expand All @@ -50,15 +47,13 @@ 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,
delivery_context: crate::models::DeliveryContext,
chat_control: crate::models::ChatControl,
) -> ActivatedEvent {
ActivatedEvent {
r#type,
source: None,
timestamp,
mode,
Expand Down
5 changes: 0 additions & 5 deletions core/webhook/src/models/audio_message_content.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
5 changes: 0 additions & 5 deletions core/webhook/src/models/beacon_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Box<crate::models::Source>>,
/// Time of the event in milliseconds.
Expand All @@ -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,
Expand All @@ -62,7 +58,6 @@ impl BeaconEvent {
beacon: crate::models::BeaconContent,
) -> BeaconEvent {
BeaconEvent {
r#type,
source: None,
timestamp,
mode,
Expand Down
5 changes: 0 additions & 5 deletions core/webhook/src/models/bot_resumed_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Box<crate::models::Source>>,
/// Time of the event in milliseconds.
Expand All @@ -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,
Expand Down
5 changes: 0 additions & 5 deletions core/webhook/src/models/bot_suspended_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Box<crate::models::Source>>,
/// Time of the event in milliseconds.
Expand All @@ -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,
Expand Down
5 changes: 0 additions & 5 deletions core/webhook/src/models/deactivated_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Box<crate::models::Source>>,
/// Time of the event in milliseconds.
Expand All @@ -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,
Expand Down
Loading

0 comments on commit 14d44df

Please sign in to comment.