forked from loafle/openapi-generator-original
regenerated client
This commit is contained in:
parent
cb5c2a9708
commit
0d6754e167
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2012 Wordnik, Inc.
|
* Copyright 2014 Wordnik, Inc.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -2,10 +2,10 @@
|
|||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>com.wordnik</groupId>
|
<groupId>com.wordnik</groupId>
|
||||||
<artifactId>swagger-client</artifactId>
|
<artifactId>scala-client</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<name>swagger-client</name>
|
<name>scala-client</name>
|
||||||
<version>1.0</version>
|
<version>1.0.0</version>
|
||||||
<prerequisites>
|
<prerequisites>
|
||||||
<maven>2.2.0</maven>
|
<maven>2.2.0</maven>
|
||||||
</prerequisites>
|
</prerequisites>
|
||||||
@ -170,13 +170,13 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.wordnik</groupId>
|
<groupId>com.wordnik</groupId>
|
||||||
<artifactId>swagger-core_2.9.1</artifactId>
|
<artifactId>swagger-core_${scala-short-version}</artifactId>
|
||||||
<version>${swagger-core-version}</version>
|
<version>${swagger-core-version}</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.scalatest</groupId>
|
<groupId>org.scalatest</groupId>
|
||||||
<artifactId>scalatest_2.9.1</artifactId>
|
<artifactId>scalatest_${scala-short-version}</artifactId>
|
||||||
<version>${scala-test-version}</version>
|
<version>${scala-test-version}</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
@ -187,15 +187,34 @@
|
|||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
<profiles>
|
||||||
|
<profile>
|
||||||
|
<id>scala_2.10</id>
|
||||||
|
<properties>
|
||||||
|
<scala-version>2.10.3</scala-version>
|
||||||
|
<scala-short-version>2.10</scala-short-version>
|
||||||
|
<swagger-core-version>1.3.2</swagger-core-version>
|
||||||
|
<scala-test-version>2.1.2</scala-test-version>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>scala_2.9.1</id>
|
||||||
|
<activation>
|
||||||
|
<activeByDefault>true</activeByDefault>
|
||||||
|
</activation>
|
||||||
|
<properties>
|
||||||
|
<scala-version>2.9.1-1</scala-version>
|
||||||
|
<scala-short-version>2.9.1</scala-short-version>
|
||||||
|
<swagger-core-version>1.1.0</swagger-core-version>
|
||||||
|
<scala-test-version>1.6.1</scala-test-version>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
||||||
<properties>
|
<properties>
|
||||||
<jersey-version>1.7</jersey-version>
|
<jersey-version>1.7</jersey-version>
|
||||||
<swagger-core-version>1.1.0</swagger-core-version>
|
|
||||||
<scala-version>2.9.1-1</scala-version>
|
|
||||||
<junit-version>4.8.1</junit-version>
|
<junit-version>4.8.1</junit-version>
|
||||||
<maven-plugin.version>1.0.0</maven-plugin.version>
|
<maven-plugin.version>1.0.0</maven-plugin.version>
|
||||||
<scala-test-version>1.6.1</scala-test-version>
|
|
||||||
<junit-version>4.8.1</junit-version>
|
<junit-version>4.8.1</junit-version>
|
||||||
<scala-test-version>1.6.1</scala-test-version>
|
|
||||||
<scala-maven-plugin-version>3.1.5</scala-maven-plugin-version>
|
<scala-maven-plugin-version>3.1.5</scala-maven-plugin-version>
|
||||||
</properties>
|
</properties>
|
||||||
</project>
|
</project>
|
||||||
|
@ -44,8 +44,6 @@ object ApiInvoker {
|
|||||||
URLEncoder.encode(value, "utf-8").replaceAll("\\+", "%20")
|
URLEncoder.encode(value, "utf-8").replaceAll("\\+", "%20")
|
||||||
}
|
}
|
||||||
|
|
||||||
def addHeader(key: String, value: String) = defaultHeaders += key -> value
|
|
||||||
|
|
||||||
def escape(value: Long): String = value.toString
|
def escape(value: Long): String = value.toString
|
||||||
def escape(value: Double): String = value.toString
|
def escape(value: Double): String = value.toString
|
||||||
def escape(value: Float): String = value.toString
|
def escape(value: Float): String = value.toString
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package com.wordnik.petstore.api
|
package com.wordnik.petstore.api
|
||||||
|
|
||||||
import java.io.File
|
|
||||||
import com.wordnik.petstore.model.Pet
|
import com.wordnik.petstore.model.Pet
|
||||||
import com.wordnik.client.ApiInvoker
|
import com.wordnik.client.ApiInvoker
|
||||||
import com.wordnik.client.ApiException
|
import com.wordnik.client.ApiException
|
||||||
@ -21,6 +20,7 @@ class PetApi {
|
|||||||
val path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}",apiInvoker.escape(petId))
|
val path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}",apiInvoker.escape(petId))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val contentType = {
|
val contentType = {
|
||||||
"application/json"}
|
"application/json"}
|
||||||
|
|
||||||
@ -49,6 +49,7 @@ class PetApi {
|
|||||||
val path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}",apiInvoker.escape(petId))
|
val path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}",apiInvoker.escape(petId))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val contentType = {
|
val contentType = {
|
||||||
"application/json"}
|
"application/json"}
|
||||||
|
|
||||||
@ -76,6 +77,7 @@ class PetApi {
|
|||||||
val path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}",apiInvoker.escape(petId))
|
val path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}",apiInvoker.escape(petId))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val contentType = {
|
val contentType = {
|
||||||
if(body != null && body.isInstanceOf[File] )
|
if(body != null && body.isInstanceOf[File] )
|
||||||
"multipart/form-data"
|
"multipart/form-data"
|
||||||
@ -107,6 +109,7 @@ class PetApi {
|
|||||||
val path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}",apiInvoker.escape(petId))
|
val path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}",apiInvoker.escape(petId))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val contentType = {
|
val contentType = {
|
||||||
"application/json"}
|
"application/json"}
|
||||||
|
|
||||||
@ -132,6 +135,7 @@ class PetApi {
|
|||||||
def uploadFile (additionalMetadata: String, body: File) = {
|
def uploadFile (additionalMetadata: String, body: File) = {
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
val path = "/pet/uploadImage".replaceAll("\\{format\\}","json")
|
val path = "/pet/uploadImage".replaceAll("\\{format\\}","json")
|
||||||
|
|
||||||
val contentType = {
|
val contentType = {
|
||||||
if(body != null && body.isInstanceOf[File] )
|
if(body != null && body.isInstanceOf[File] )
|
||||||
"multipart/form-data"
|
"multipart/form-data"
|
||||||
@ -155,6 +159,7 @@ class PetApi {
|
|||||||
def addPet (body: Pet) = {
|
def addPet (body: Pet) = {
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
val path = "/pet".replaceAll("\\{format\\}","json")
|
val path = "/pet".replaceAll("\\{format\\}","json")
|
||||||
|
|
||||||
val contentType = {
|
val contentType = {
|
||||||
if(body != null && body.isInstanceOf[File] )
|
if(body != null && body.isInstanceOf[File] )
|
||||||
"multipart/form-data"
|
"multipart/form-data"
|
||||||
@ -183,6 +188,7 @@ class PetApi {
|
|||||||
def updatePet (body: Pet) = {
|
def updatePet (body: Pet) = {
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
val path = "/pet".replaceAll("\\{format\\}","json")
|
val path = "/pet".replaceAll("\\{format\\}","json")
|
||||||
|
|
||||||
val contentType = {
|
val contentType = {
|
||||||
if(body != null && body.isInstanceOf[File] )
|
if(body != null && body.isInstanceOf[File] )
|
||||||
"multipart/form-data"
|
"multipart/form-data"
|
||||||
@ -211,6 +217,7 @@ class PetApi {
|
|||||||
def findPetsByStatus (status: String= "available") : Option[List[Pet]]= {
|
def findPetsByStatus (status: String= "available") : Option[List[Pet]]= {
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
val path = "/pet/findByStatus".replaceAll("\\{format\\}","json")
|
val path = "/pet/findByStatus".replaceAll("\\{format\\}","json")
|
||||||
|
|
||||||
val contentType = {
|
val contentType = {
|
||||||
"application/json"}
|
"application/json"}
|
||||||
|
|
||||||
@ -238,6 +245,7 @@ class PetApi {
|
|||||||
def findPetsByTags (tags: String) : Option[List[Pet]]= {
|
def findPetsByTags (tags: String) : Option[List[Pet]]= {
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
val path = "/pet/findByTags".replaceAll("\\{format\\}","json")
|
val path = "/pet/findByTags".replaceAll("\\{format\\}","json")
|
||||||
|
|
||||||
val contentType = {
|
val contentType = {
|
||||||
"application/json"}
|
"application/json"}
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@ class StoreApi {
|
|||||||
val path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}",apiInvoker.escape(orderId))
|
val path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}",apiInvoker.escape(orderId))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val contentType = {
|
val contentType = {
|
||||||
"application/json"}
|
"application/json"}
|
||||||
|
|
||||||
@ -48,6 +49,7 @@ class StoreApi {
|
|||||||
val path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}",apiInvoker.escape(orderId))
|
val path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}",apiInvoker.escape(orderId))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val contentType = {
|
val contentType = {
|
||||||
"application/json"}
|
"application/json"}
|
||||||
|
|
||||||
@ -73,6 +75,7 @@ class StoreApi {
|
|||||||
def placeOrder (body: Order) = {
|
def placeOrder (body: Order) = {
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
val path = "/store/order".replaceAll("\\{format\\}","json")
|
val path = "/store/order".replaceAll("\\{format\\}","json")
|
||||||
|
|
||||||
val contentType = {
|
val contentType = {
|
||||||
if(body != null && body.isInstanceOf[File] )
|
if(body != null && body.isInstanceOf[File] )
|
||||||
"multipart/form-data"
|
"multipart/form-data"
|
||||||
|
@ -15,95 +15,12 @@ class UserApi {
|
|||||||
|
|
||||||
def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value
|
def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value
|
||||||
|
|
||||||
def createUser (body: User) = {
|
|
||||||
// create path and map variables
|
|
||||||
val path = "/user".replaceAll("\\{format\\}","json")
|
|
||||||
val contentType = {
|
|
||||||
if(body != null && body.isInstanceOf[File] )
|
|
||||||
"multipart/form-data"
|
|
||||||
else "application/json"
|
|
||||||
}
|
|
||||||
|
|
||||||
// query params
|
|
||||||
val queryParams = new HashMap[String, String]
|
|
||||||
val headerParams = new HashMap[String, String]
|
|
||||||
|
|
||||||
// verify required params are set
|
|
||||||
(List(body).filter(_ != null)).size match {
|
|
||||||
case 1 => // all required values set
|
|
||||||
case _ => throw new Exception("missing required params")
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, body, headerParams.toMap, contentType) match {
|
|
||||||
case s: String =>
|
|
||||||
case _ => None
|
|
||||||
}
|
|
||||||
} catch {
|
|
||||||
case ex: ApiException if ex.code == 404 => None
|
|
||||||
case ex: ApiException => throw ex
|
|
||||||
}
|
|
||||||
}
|
|
||||||
def createUsersWithArrayInput (body: List[User]) = {
|
|
||||||
// create path and map variables
|
|
||||||
val path = "/user/createWithArray".replaceAll("\\{format\\}","json")
|
|
||||||
val contentType = {
|
|
||||||
if(body != null && body.isInstanceOf[File] )
|
|
||||||
"multipart/form-data"
|
|
||||||
else "application/json"
|
|
||||||
}
|
|
||||||
|
|
||||||
// query params
|
|
||||||
val queryParams = new HashMap[String, String]
|
|
||||||
val headerParams = new HashMap[String, String]
|
|
||||||
|
|
||||||
// verify required params are set
|
|
||||||
(List(body).filter(_ != null)).size match {
|
|
||||||
case 1 => // all required values set
|
|
||||||
case _ => throw new Exception("missing required params")
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, body, headerParams.toMap, contentType) match {
|
|
||||||
case s: String =>
|
|
||||||
case _ => None
|
|
||||||
}
|
|
||||||
} catch {
|
|
||||||
case ex: ApiException if ex.code == 404 => None
|
|
||||||
case ex: ApiException => throw ex
|
|
||||||
}
|
|
||||||
}
|
|
||||||
def createUsersWithListInput (body: List[User]) = {
|
|
||||||
// create path and map variables
|
|
||||||
val path = "/user/createWithList".replaceAll("\\{format\\}","json")
|
|
||||||
val contentType = {
|
|
||||||
if(body != null && body.isInstanceOf[File] )
|
|
||||||
"multipart/form-data"
|
|
||||||
else "application/json"
|
|
||||||
}
|
|
||||||
|
|
||||||
// query params
|
|
||||||
val queryParams = new HashMap[String, String]
|
|
||||||
val headerParams = new HashMap[String, String]
|
|
||||||
|
|
||||||
// verify required params are set
|
|
||||||
(List(body).filter(_ != null)).size match {
|
|
||||||
case 1 => // all required values set
|
|
||||||
case _ => throw new Exception("missing required params")
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, body, headerParams.toMap, contentType) match {
|
|
||||||
case s: String =>
|
|
||||||
case _ => None
|
|
||||||
}
|
|
||||||
} catch {
|
|
||||||
case ex: ApiException if ex.code == 404 => None
|
|
||||||
case ex: ApiException => throw ex
|
|
||||||
}
|
|
||||||
}
|
|
||||||
def updateUser (username: String, body: User) = {
|
def updateUser (username: String, body: User) = {
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
val path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}",apiInvoker.escape(username))
|
val path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}",apiInvoker.escape(username))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val contentType = {
|
val contentType = {
|
||||||
if(body != null && body.isInstanceOf[File] )
|
if(body != null && body.isInstanceOf[File] )
|
||||||
"multipart/form-data"
|
"multipart/form-data"
|
||||||
@ -134,6 +51,7 @@ class UserApi {
|
|||||||
val path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}",apiInvoker.escape(username))
|
val path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}",apiInvoker.escape(username))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val contentType = {
|
val contentType = {
|
||||||
"application/json"}
|
"application/json"}
|
||||||
|
|
||||||
@ -161,6 +79,7 @@ class UserApi {
|
|||||||
val path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}",apiInvoker.escape(username))
|
val path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}",apiInvoker.escape(username))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val contentType = {
|
val contentType = {
|
||||||
"application/json"}
|
"application/json"}
|
||||||
|
|
||||||
@ -187,6 +106,7 @@ class UserApi {
|
|||||||
def loginUser (username: String, password: String) : Option[String]= {
|
def loginUser (username: String, password: String) : Option[String]= {
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
val path = "/user/login".replaceAll("\\{format\\}","json")
|
val path = "/user/login".replaceAll("\\{format\\}","json")
|
||||||
|
|
||||||
val contentType = {
|
val contentType = {
|
||||||
"application/json"}
|
"application/json"}
|
||||||
|
|
||||||
@ -215,6 +135,7 @@ class UserApi {
|
|||||||
def logoutUser () = {
|
def logoutUser () = {
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
val path = "/user/logout".replaceAll("\\{format\\}","json")
|
val path = "/user/logout".replaceAll("\\{format\\}","json")
|
||||||
|
|
||||||
val contentType = {
|
val contentType = {
|
||||||
"application/json"}
|
"application/json"}
|
||||||
|
|
||||||
@ -232,5 +153,92 @@ class UserApi {
|
|||||||
case ex: ApiException => throw ex
|
case ex: ApiException => throw ex
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
def createUser (body: User) = {
|
||||||
|
// create path and map variables
|
||||||
|
val path = "/user".replaceAll("\\{format\\}","json")
|
||||||
|
|
||||||
|
val contentType = {
|
||||||
|
if(body != null && body.isInstanceOf[File] )
|
||||||
|
"multipart/form-data"
|
||||||
|
else "application/json"
|
||||||
|
}
|
||||||
|
|
||||||
|
// query params
|
||||||
|
val queryParams = new HashMap[String, String]
|
||||||
|
val headerParams = new HashMap[String, String]
|
||||||
|
|
||||||
|
// verify required params are set
|
||||||
|
(List(body).filter(_ != null)).size match {
|
||||||
|
case 1 => // all required values set
|
||||||
|
case _ => throw new Exception("missing required params")
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, body, headerParams.toMap, contentType) match {
|
||||||
|
case s: String =>
|
||||||
|
case _ => None
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
case ex: ApiException if ex.code == 404 => None
|
||||||
|
case ex: ApiException => throw ex
|
||||||
|
}
|
||||||
|
}
|
||||||
|
def createUsersWithArrayInput (body: List[User]) = {
|
||||||
|
// create path and map variables
|
||||||
|
val path = "/user/createWithArray".replaceAll("\\{format\\}","json")
|
||||||
|
|
||||||
|
val contentType = {
|
||||||
|
if(body != null && body.isInstanceOf[File] )
|
||||||
|
"multipart/form-data"
|
||||||
|
else "application/json"
|
||||||
|
}
|
||||||
|
|
||||||
|
// query params
|
||||||
|
val queryParams = new HashMap[String, String]
|
||||||
|
val headerParams = new HashMap[String, String]
|
||||||
|
|
||||||
|
// verify required params are set
|
||||||
|
(List(body).filter(_ != null)).size match {
|
||||||
|
case 1 => // all required values set
|
||||||
|
case _ => throw new Exception("missing required params")
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, body, headerParams.toMap, contentType) match {
|
||||||
|
case s: String =>
|
||||||
|
case _ => None
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
case ex: ApiException if ex.code == 404 => None
|
||||||
|
case ex: ApiException => throw ex
|
||||||
|
}
|
||||||
|
}
|
||||||
|
def createUsersWithListInput (body: List[User]) = {
|
||||||
|
// create path and map variables
|
||||||
|
val path = "/user/createWithList".replaceAll("\\{format\\}","json")
|
||||||
|
|
||||||
|
val contentType = {
|
||||||
|
if(body != null && body.isInstanceOf[File] )
|
||||||
|
"multipart/form-data"
|
||||||
|
else "application/json"
|
||||||
|
}
|
||||||
|
|
||||||
|
// query params
|
||||||
|
val queryParams = new HashMap[String, String]
|
||||||
|
val headerParams = new HashMap[String, String]
|
||||||
|
|
||||||
|
// verify required params are set
|
||||||
|
(List(body).filter(_ != null)).size match {
|
||||||
|
case 1 => // all required values set
|
||||||
|
case _ => throw new Exception("missing required params")
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, body, headerParams.toMap, contentType) match {
|
||||||
|
case s: String =>
|
||||||
|
case _ => None
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
case ex: ApiException if ex.code == 404 => None
|
||||||
|
case ex: ApiException => throw ex
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
package com.wordnik.petstore.model
|
package com.wordnik.petstore.model
|
||||||
|
|
||||||
case class Category (
|
case class Category (
|
||||||
/* Category unique identifier */
|
|
||||||
id: Long,
|
id: Long,
|
||||||
/* Name of the category */
|
|
||||||
name: String)
|
name: String)
|
||||||
|
|
||||||
|
@ -2,14 +2,10 @@ package com.wordnik.petstore.model
|
|||||||
|
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
case class Order (
|
case class Order (
|
||||||
/* Unique identifier for the order */
|
|
||||||
id: Long,
|
id: Long,
|
||||||
/* ID of pet being ordered */
|
|
||||||
petId: Long,
|
petId: Long,
|
||||||
/* Number of pets ordered */
|
|
||||||
quantity: Int,
|
quantity: Int,
|
||||||
/* Status of the order */
|
/* Order Status */
|
||||||
status: String,
|
status: String,
|
||||||
/* Date shipped, only if it has been */
|
|
||||||
shipDate: Date)
|
shipDate: Date)
|
||||||
|
|
||||||
|
@ -3,15 +3,11 @@ package com.wordnik.petstore.model
|
|||||||
import com.wordnik.petstore.model.Category
|
import com.wordnik.petstore.model.Category
|
||||||
import com.wordnik.petstore.model.Tag
|
import com.wordnik.petstore.model.Tag
|
||||||
case class Pet (
|
case class Pet (
|
||||||
/* Unique identifier for the Pet */
|
/* unique identifier for the pet */
|
||||||
id: Long,
|
id: Long,
|
||||||
/* Category the pet is in */
|
|
||||||
category: Category,
|
category: Category,
|
||||||
/* Friendly name of the pet */
|
|
||||||
name: String,
|
name: String,
|
||||||
/* Image URLs */
|
|
||||||
photoUrls: List[String],
|
photoUrls: List[String],
|
||||||
/* Tags assigned to this pet */
|
|
||||||
tags: List[Tag],
|
tags: List[Tag],
|
||||||
/* pet status in the store */
|
/* pet status in the store */
|
||||||
status: String)
|
status: String)
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
package com.wordnik.petstore.model
|
package com.wordnik.petstore.model
|
||||||
|
|
||||||
case class Tag (
|
case class Tag (
|
||||||
/* Unique identifier for the tag */
|
|
||||||
id: Long,
|
id: Long,
|
||||||
/* Friendly name for the tag */
|
|
||||||
name: String)
|
name: String)
|
||||||
|
|
||||||
|
@ -1,19 +1,12 @@
|
|||||||
package com.wordnik.petstore.model
|
package com.wordnik.petstore.model
|
||||||
|
|
||||||
case class User (
|
case class User (
|
||||||
/* Unique identifier for the user */
|
|
||||||
id: Long,
|
id: Long,
|
||||||
/* Unique username */
|
|
||||||
username: String,
|
|
||||||
/* First name of the user */
|
|
||||||
firstName: String,
|
firstName: String,
|
||||||
/* Last name of the user */
|
username: String,
|
||||||
lastName: String,
|
lastName: String,
|
||||||
/* Email address of the user */
|
|
||||||
email: String,
|
email: String,
|
||||||
/* Password name of the user */
|
|
||||||
password: String,
|
password: String,
|
||||||
/* Phone number of the user */
|
|
||||||
phone: String,
|
phone: String,
|
||||||
/* User Status */
|
/* User Status */
|
||||||
userStatus: Int)
|
userStatus: Int)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user