Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update model case classes according to comments #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 1 addition & 127 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,132 +15,6 @@ project/plugins/project/
# Scala-IDE specific
.scala_dependencies
.worksheet
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio

*.iml

## Directory-based project format:
.idea/
# if you remove the above rule, at least ignore the following:

# User-specific stuff:
# .idea/workspace.xml
# .idea/tasks.xml
# .idea/dictionaries

# Sensitive or high-churn files:
# .idea/dataSources.ids
# .idea/dataSources.xml
# .idea/sqlDataSources.xml
# .idea/dynamic.xml
# .idea/uiDesigner.xml

# Gradle:
# .idea/gradle.xml
# .idea/libraries

# Mongo Explorer plugin:
# .idea/mongoSettings.xml

## File-based project format:
*.ipr
*.iws

## Plugin-specific files:

# IntelliJ
/out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
### Eclipse template
*.pydevproject
.metadata
.gradle
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath

# Eclipse Core
.project

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

# CDT-specific
.cproject

# JDT-specific (Eclipse Java Development Tools)
.classpath

# Java annotation processor (APT)
.factorypath

# PDT-specific
.buildpath

# sbteclipse plugin
.target

# TeXlipse plugin
.texlipse
### SBT template
# Simple Build Tool
# http://www.scala-sbt.org/release/docs/Getting-Started/Directories.html#configuring-version-control

target/
lib_managed/
src_managed/
project/boot/
.history
.cache
### Java template
*.class

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.ear

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
### Scala template
*.class
*.log

# sbt specific
.cache
.history
.lib/
dist/*
target/
lib_managed/
src_managed/
project/boot/
project/plugins/project/

# Scala-IDE specific
.scala_dependencies
.worksheet

.idea/
4 changes: 2 additions & 2 deletions src/main/scala/scalalab3/chatbotengine/model/Audio.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package scalalab3.chatbotengine.model


case class Audio(val fileId: String, val duration: Integer, val performer: String, val title: String,
val mimeType: String, val fileSize: Integer)
case class Audio(fileId: String, duration: Integer, performer: Option[String] = None, title: Option[String] = None,
mimeType: Option[String] = None, fileSize: Option[Integer] = None)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package scalalab3.chatbotengine.model

case class CallbackQuery(val id: String, val from: User, val message: Message, val inlineMessageId: String,
val data: String)
case class CallbackQuery(id: String, from: User, data: String, message: Option[Message] = None,
inlineMessageId: Option[String] = None)
4 changes: 2 additions & 2 deletions src/main/scala/scalalab3/chatbotengine/model/Chat.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package scalalab3.chatbotengine.model

case class Chat(val id: Integer, val chatType: String, val title: String, val username: String, val firstName: String,
val lastName: String)
case class Chat(id: Integer, chatType: String, title: Option[String] = None, username: Option[String] = None,
firstName: Option[String] = None, lastName: Option[String] = None)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package scalalab3.chatbotengine.model

case class ChosenInlineResult(val resultId: String, val from: User, val location: Location,
val inlineMessageId: String, val query: String)
case class ChosenInlineResult(resultId: String, from: User, query: String, location: Option[Location] = None,
inlineMessageId: Option[String] = None)
3 changes: 2 additions & 1 deletion src/main/scala/scalalab3/chatbotengine/model/Contact.scala
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
package scalalab3.chatbotengine.model

case class Contact(val phoneNumber: String, val firstName: String, val lastName: String, val userId: Integer)
case class Contact(phoneNumber: String, firstName: String, lastName: Option[String] = None,
userId: Option[Integer] = None)
4 changes: 3 additions & 1 deletion src/main/scala/scalalab3/chatbotengine/model/Document.scala
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package scalalab3.chatbotengine.model

case class Document(val fileId: String, val thumb: PhotoSize, val fileName: String, val mimeType: String, fileSize: Integer)
case class Document(fileId: String, thumb: Option[PhotoSize] = None,
fileName: Option[String] = None, mimeType: Option[String] = None,
fileSize: Option[Integer] = None)
2 changes: 1 addition & 1 deletion src/main/scala/scalalab3/chatbotengine/model/File.scala
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package scalalab3.chatbotengine.model

case class File(val fileId: String, val fileSize: Integer, val filePath: String)
case class File(fileId: String, fileSize: Option[Integer] = None, filePath: Option[String] = None)
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package scalalab3.chatbotengine.model

case class InlineQuery(val id: String, val from: User, val location: Location, val query: String, val offset: String)
case class InlineQuery(id: String, from: User, query: String, offset: String, location: Option[Location] = None)
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package scalalab3.chatbotengine.model

case class KeyboardButton(val text: String, val requestContact: Boolean, val requestLocation: Boolean)
case class KeyboardButton(text: String, requestContact: Option[Boolean] = None, requestLocation: Option[Boolean] = None)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package scalalab3.chatbotengine.model


case class Location(val longitude: Float, val latitude: Float)
case class Location(longitude: Float, latitude: Float)
22 changes: 13 additions & 9 deletions src/main/scala/scalalab3/chatbotengine/model/Message.scala
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
package scalalab3.chatbotengine.model

case class Message(val id: Long, val from: User, val date: Integer, val chat: Chat, val forwardFrom: User,
val forwardDate: Integer, val replyToMessage: Message, val text: String,
val entities: Array[MessageEntity], val audio: Audio, val document: Document,
val photo: Array[PhotoSize], val sticker: Sticker, val video: Video, val voice: Voice,
val caption: String, val contact: Contact,
val location: Location, val venue: Venue, val newChatMember: User, val leftChatMember: User,
val newChatTitle: String, val newChatPhoto: Array[PhotoSize], val deleteChatPhoto: Boolean,
val groupChatCreated: Boolean, val superGroupChatCreated: Boolean, val channelChatCreated: Boolean,
val migrateToChatId: Integer, val migrateFromChatId: Integer, val pinnedMessage: Message)
case class Message(id: Long, date: Integer, chat: Chat, from: Option[User] = None,
forwardFrom: Option[User] = None, forwardDate: Option[Integer] = None,
replyToMessage: Option[Message] = None, text: Option[String] = None,
entities: Option[Array[MessageEntity]] = None, audio: Option[Audio] = None,
document: Option[Document] = None, photo: Option[Array[PhotoSize]] = None,
sticker: Option[Sticker] = None, video: Option[Video] = None, voice: Option[Voice] = None,
caption: Option[String] = None, contact: Option[Contact] = None, location: Option[Location] = None,
venue: Option[Venue] = None, newChatMember: Option[User] = None, leftChatMember: Option[User] = None,
newChatTitle: Option[String] = None, newChatPhoto: Option[Array[PhotoSize]] = None,
deleteChatPhoto: Option[Boolean] = None, groupChatCreated: Option[Boolean] = None,
superGroupChatCreated: Option[Boolean] = None, channelChatCreated: Option[Boolean] = None,
migrateToChatId: Option[Integer] = None, migrateFromChatId: Option[Integer] = None,
pinnedMessage: Option[Message] = None)
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package scalalab3.chatbotengine.model

case class MessageEntity(val entityType: String, val offset: Integer, val length: Integer, val url: String)
case class MessageEntity(entityType: String, offset: Integer, length: Integer, url: Option[String] = None)
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package scalalab3.chatbotengine.model

case class PhotoSize(val fileId: String, val width: Integer, val height: Integer, val fileSize: Integer)
case class PhotoSize(fileId: String, width: Integer, height: Integer, fileSize: Option[Integer] = None)
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package scalalab3.chatbotengine.model

case class ReplyKeyboardHide(val hideKeyboard: Boolean = true, val selective: Boolean)
case class ReplyKeyboardHide(hideKeyboard: Boolean = true, selective: Option[Boolean] = None)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package scalalab3.chatbotengine.model

case class ReplyKeyboardMarkup(val keyboard: Array[Array[KeyboardButton]], val resizeKeyboard: Boolean,
val oneTimeKeyboard: Boolean, val selective: Boolean)
case class ReplyKeyboardMarkup(keyboard: Array[Array[KeyboardButton]], resizeKeyboard: Option[Boolean] = None,
oneTimeKeyboard: Option[Boolean] = None, selective: Option[Boolean] = None)
4 changes: 2 additions & 2 deletions src/main/scala/scalalab3/chatbotengine/model/Sticker.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package scalalab3.chatbotengine.model

case class Sticker(val fileId: String, val width: Integer, val height: Integer, val thumb: PhotoSize,
val fileSize: Integer)
case class Sticker(fileId: String, width: Integer, height: Integer, thumb: Option[PhotoSize] = None,
fileSize: Option[Integer] = None)
4 changes: 2 additions & 2 deletions src/main/scala/scalalab3/chatbotengine/model/Update.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package scalalab3.chatbotengine.model

case class Update(val updateId: Integer, val message: Message, val inlineQuery: InlineQuery,
val chosenInlineResult: ChosenInlineResult, val callbackQuery: CallbackQuery)
case class Update(updateId: Integer, message: Option[Message] = None, inlineQuery: Option[InlineQuery] = None,
chosenInlineResult: Option[ChosenInlineResult] = None, callbackQuery: Option[CallbackQuery] = None)
2 changes: 1 addition & 1 deletion src/main/scala/scalalab3/chatbotengine/model/User.scala
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package scalalab3.chatbotengine.model

case class User(val id: Integer, val firstName: String, val lastName: String, val username: String);
case class User(id: Integer, firstName: String, lastName: Option[String] = None, username: Option[String] = None);
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package scalalab3.chatbotengine.model


case class UserProfilePhotos(val totalCount: Integer, val photos: Array[Array[PhotoSize]])
case class UserProfilePhotos(totalCount: Integer, photos: Array[Array[PhotoSize]])
2 changes: 1 addition & 1 deletion src/main/scala/scalalab3/chatbotengine/model/Venue.scala
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package scalalab3.chatbotengine.model

case class Venue(val location: Location, val title: String, val address: String, val foursquareId: String)
case class Venue(location: Location, title: String, address: String, foursquareId: Option[String] = None)
4 changes: 2 additions & 2 deletions src/main/scala/scalalab3/chatbotengine/model/Video.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package scalalab3.chatbotengine.model

case class Video(val fileId: String, val width: Integer, val height: Integer, val duration: Integer,
val thumb: PhotoSize, val mimeType: String, val fileSize: Integer)
case class Video(fileId: String, width: Integer, height: Integer, duration: Integer,
thumb: Option[PhotoSize] = None, mimeType: Option[String] = None, fileSize: Option[Integer] = None)
2 changes: 1 addition & 1 deletion src/main/scala/scalalab3/chatbotengine/model/Voice.scala
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package scalalab3.chatbotengine.model

case class Voice(val fileId: String, val duration: Integer, val mimeType: String, val fileSize: Integer)
case class Voice(fileId: String, duration: Integer, mimeType: Option[String] = None, fileSize: Option[Integer] = None)