updated to latest codegen

This commit is contained in:
Tony Tam 2012-12-04 10:36:12 -08:00
parent f4cd02283b
commit 2a9cf7c06d
14 changed files with 43 additions and 43 deletions

View File

@ -20,7 +20,7 @@ case class Definition (
relatedWords: List[Related], relatedWords: List[Related],
sequence: String, sequence: String,
word: String, word: String,
textProns: List[TextPron],
notes: List[Note], notes: List[Note],
textProns: List[TextPron],
partOfSpeech: String) partOfSpeech: String)

View File

@ -5,15 +5,15 @@ import com.wordnik.client.model.ScoredWord
import com.wordnik.client.model.ContentProvider import com.wordnik.client.model.ContentProvider
case class Example ( case class Example (
id: Long, id: Long,
text: String,
title: String,
exampleId: Long, exampleId: Long,
title: String,
text: String,
score: ScoredWord, score: ScoredWord,
sentence: Sentence, sentence: Sentence,
year: Int,
provider: ContentProvider,
word: String, word: String,
provider: ContentProvider,
year: Int,
rating: Float, rating: Float,
url: String, documentId: Long,
documentId: Long) url: String)

View File

@ -2,10 +2,10 @@ package com.wordnik.client.model
case class Related ( case class Related (
label1: String, label1: String,
label2: String,
relationshipType: String, relationshipType: String,
label2: String,
label3: String, label3: String,
words: List[String], words: List[String],
label4: String, gram: String,
gram: String) label4: String)

View File

@ -1,14 +1,14 @@
package com.wordnik.client.model package com.wordnik.client.model
case class ScoredWord ( case class ScoredWord (
id: Long,
position: Int, position: Int,
lemma: String, id: Long,
docTermCount: Int, docTermCount: Int,
lemma: String,
wordType: String, wordType: String,
score: Float, score: Float,
word: String,
sentenceId: Long, sentenceId: Long,
word: String,
stopword: Boolean, stopword: Boolean,
baseWordScore: Double, baseWordScore: Double,
partOfSpeech: String) partOfSpeech: String)

View File

@ -2,8 +2,8 @@ package com.wordnik.client.model
import com.wordnik.client.model.ScoredWord import com.wordnik.client.model.ScoredWord
case class Sentence ( case class Sentence (
id: Long,
hasScoredWords: Boolean, hasScoredWords: Boolean,
id: Long,
scoredWords: List[ScoredWord], scoredWords: List[ScoredWord],
display: String, display: String,
rating: Int, rating: Int,

View File

@ -2,7 +2,7 @@ package com.wordnik.client.model
case class SimpleExample ( case class SimpleExample (
id: Long, id: Long,
text: String,
title: String, title: String,
text: String,
url: String) url: String)

View File

@ -3,8 +3,8 @@ package com.wordnik.client.model
case class User ( case class User (
id: Long, id: Long,
username: String, username: String,
status: Int,
email: String, email: String,
status: Int,
faceBookId: String, faceBookId: String,
userName: String, userName: String,
displayName: String, displayName: String,

View File

@ -3,14 +3,14 @@ package com.wordnik.client.model
import java.util.Date import java.util.Date
case class WordList ( case class WordList (
id: Long, id: Long,
updatedAt: Date,
username: String,
permalink: String, permalink: String,
description: String,
createdAt: Date,
lastActivityAt: Date,
name: String, name: String,
createdAt: Date,
updatedAt: Date,
lastActivityAt: Date,
username: String,
userId: Long, userId: Long,
description: String,
numberWordsInList: Long, numberWordsInList: Long,
`type`: String) `type`: String)

View File

@ -3,10 +3,10 @@ package com.wordnik.client.model
import java.util.Date import java.util.Date
case class WordListWord ( case class WordListWord (
id: Long, id: Long,
username: String,
createdAt: Date,
userId: Long,
numberCommentsOnWord: Long,
word: String, word: String,
username: String,
userId: Long,
createdAt: Date,
numberCommentsOnWord: Long,
numberLists: Long) numberLists: Long)

View File

@ -2,8 +2,8 @@ package com.wordnik.client.model
case class WordObject ( case class WordObject (
id: Long, id: Long,
originalWord: String,
word: String, word: String,
originalWord: String,
suggestions: List[String], suggestions: List[String],
canonicalForm: String, canonicalForm: String,
vulgar: String) vulgar: String)

View File

@ -11,10 +11,10 @@ case class WordOfTheDay (
createdBy: String, createdBy: String,
createdAt: Date, createdAt: Date,
contentProvider: ContentProvider, contentProvider: ContentProvider,
word: String,
htmlExtra: String, htmlExtra: String,
word: String,
definitions: List[SimpleDefinition], definitions: List[SimpleDefinition],
examples: List[SimpleExample], examples: List[SimpleExample],
publishDate: Date, note: String,
note: String) publishDate: Date)

View File

@ -2,6 +2,6 @@ package com.wordnik.client.model
import com.wordnik.client.model.WordSearchResult import com.wordnik.client.model.WordSearchResult
case class WordSearchResults ( case class WordSearchResults (
totalResults: Int, searchResults: List[WordSearchResult],
searchResults: List[WordSearchResult]) totalResults: Int)

View File

@ -25,7 +25,7 @@ class WordApiTest extends FlatSpec with ShouldMatchers with BaseApiTest {
it should "verify the word apis" in { it should "verify the word apis" in {
val json = Source.fromURL("http://api.wordnik.com/v4/word.json").mkString val json = Source.fromURL("http://api.wordnik.com/v4/word.json").mkString
val doc = JsonUtil.getJsonMapper.readValue(json, classOf[Documentation]) val doc = JsonUtil.getJsonMapper.readValue(json, classOf[Documentation])
assert(doc.getApis.size === 11) assert(doc.getApis.size === 12)
} }
it should "fetch a word" in { it should "fetch a word" in {

View File

@ -24,17 +24,17 @@ class WordListApiTest extends FlatSpec with ShouldMatchers with BaseApiTest {
val wordListsApi = new WordListsApi val wordListsApi = new WordListsApi
val wordList = WordList( val wordList = WordList(
0, 0, // id
new java.util.Date, null, // permalink
null, "my test list", // name
null, new java.util.Date, //created at
"some words I want to play with", null, // updated at
null, null, // lastActivityAt
null, null, // username
"my test list", 0, // user id
0, "some words I want to play with", // description
0, 0, // words in list
"PUBLIC") "PUBLIC") // type
var sampleList = wordListsApi.createWordList(wordList, auth.token) match { var sampleList = wordListsApi.createWordList(wordList, auth.token) match {
case Some(wl) => wl case Some(wl) => wl