Merge pull request #2620 from wing328/petstore_json_restore

Update shell script to use petstore.yaml instead of petstore.json
This commit is contained in:
wing328 2016-04-16 19:17:07 +08:00
commit bb8db88b95
95 changed files with 2870 additions and 3270 deletions

View File

@ -26,6 +26,6 @@ fi
# if you've executed sbt assembly previously it will use that instead. # if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -t modules/swagger-codegen/src/main/resources/akka-scala -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l akka-scala -o samples/client/petstore/akka-scala" ags="$@ generate -t modules/swagger-codegen/src/main/resources/akka-scala -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l akka-scala -o samples/client/petstore/akka-scala"
java $JAVA_OPTS -jar $executable $ags java $JAVA_OPTS -jar $executable $ags

View File

@ -26,6 +26,6 @@ fi
# if you've executed sbt assembly previously it will use that instead. # if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l dynamic-html -o samples/dynamic-html" ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l dynamic-html -o samples/dynamic-html"
java $JAVA_OPTS -jar $executable $ags java $JAVA_OPTS -jar $executable $ags

View File

@ -26,6 +26,6 @@ fi
# if you've executed sbt assembly previously it will use that instead. # if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -t modules/swagger-codegen/src/main/resources/flash -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l flash -o samples/client/petstore/flash" ags="$@ generate -t modules/swagger-codegen/src/main/resources/flash -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l flash -o samples/client/petstore/flash"
java $JAVA_OPTS -jar $executable $ags java $JAVA_OPTS -jar $executable $ags

View File

@ -26,6 +26,6 @@ fi
# if you've executed sbt assembly previously it will use that instead. # if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -t modules/swagger-codegen/src/main/resources/haskell-servant -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l haskell-servant -o samples/server/petstore/haskell-servant" ags="$@ generate -t modules/swagger-codegen/src/main/resources/haskell-servant -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l haskell-servant -o samples/server/petstore/haskell-servant"
java $JAVA_OPTS -jar $executable $ags java $JAVA_OPTS -jar $executable $ags

View File

@ -26,6 +26,6 @@ fi
# if you've executed sbt assembly previously it will use that instead. # if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l html -o samples/html" ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l html -o samples/html"
java $JAVA_OPTS -jar $executable $ags java $JAVA_OPTS -jar $executable $ags

View File

@ -26,6 +26,6 @@ fi
# if you've executed sbt assembly previously it will use that instead. # if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l javascript-closure-angular -o samples/client/petstore/javascript-closure-angular" ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l javascript-closure-angular -o samples/client/petstore/javascript-closure-angular"
java $JAVA_OPTS -jar $executable $ags java $JAVA_OPTS -jar $executable $ags

View File

@ -26,6 +26,6 @@ fi
# if you've executed sbt assembly previously it will use that instead. # if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -t modules/swagger-codegen/src/main/resources/qt5cpp -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l qt5cpp -o samples/client/petstore/qt5cpp" ags="$@ generate -t modules/swagger-codegen/src/main/resources/qt5cpp -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l qt5cpp -o samples/client/petstore/qt5cpp"
java $JAVA_OPTS -jar $executable $ags java $JAVA_OPTS -jar $executable $ags

View File

@ -26,6 +26,6 @@ fi
# if you've executed sbt assembly previously it will use that instead. # if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -t modules/swagger-codegen/src/main/resources/tizen -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l tizen -o samples/client/petstore/tizen" ags="$@ generate -t modules/swagger-codegen/src/main/resources/tizen -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l tizen -o samples/client/petstore/tizen"
java $JAVA_OPTS -jar $executable $ags java $JAVA_OPTS -jar $executable $ags

View File

@ -168,7 +168,7 @@ public class AkkaScalaClientCodegen extends DefaultCodegen implements CodegenCon
@Override @Override
public String getHelp() { public String getHelp() {
return "Generates a Scala client library base on Akka/Spray."; return "Generates a Scala client library (beta) base on Akka/Spray.";
} }
@Override @Override

View File

@ -79,7 +79,7 @@ public class JavascriptClosureAngularClientCodegen extends DefaultCodegen implem
@Override @Override
public String getHelp() { public String getHelp() {
return "Generates a Javascript AngularJS client library annotated with Google Closure Compiler annotations" + return "Generates a Javascript AngularJS client library (beta) annotated with Google Closure Compiler annotations" +
"(https://developers.google.com/closure/compiler/docs/js-for-compiler?hl=en)"; "(https://developers.google.com/closure/compiler/docs/js-for-compiler?hl=en)";
} }

View File

@ -1,3 +1,8 @@
/**
* NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new
*/
package {{package}} package {{package}}
{{#imports}} {{#imports}}
@ -29,7 +34,7 @@ object {{classname}} {
{{/dataType}}{{^dataType}}.withDefault{{>responseState}}Response[Unit] {{/dataType}}{{^dataType}}.withDefault{{>responseState}}Response[Unit]
{{/dataType}}{{/isWildcard}}{{/responses}}{{^responseHeaders.isEmpty}} {{/dataType}}{{/isWildcard}}{{/responses}}{{^responseHeaders.isEmpty}}
object {{#fnCapitalize}}{{operationId}}{{/fnCapitalize}}Headers { {{#responseHeaders}} object {{#fnCapitalize}}{{operationId}}{{/fnCapitalize}}Headers { {{#responseHeaders}}
def {{name}}(r: ApiReturnWithHeaders) = r.get{{^isContainer}}{{baseType}}{{/isContainer}}{{#isContainer}}String{{/isContainer}}Header("{{baseName}}"){{/responseHeaders}} def {{{name}}}(r: ApiReturnWithHeaders) = r.get{{^isContainer}}{{baseType}}{{/isContainer}}{{#isContainer}}String{{/isContainer}}Header("{{baseName}}"){{/responseHeaders}}
} }
{{/responseHeaders.isEmpty}} {{/responseHeaders.isEmpty}}
{{/operation}} {{/operation}}

View File

@ -1,3 +1,9 @@
/**
* NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new
*/
package {{invokerPackage}} package {{invokerPackage}}
import java.io.File import java.io.File

View File

@ -1,3 +1,8 @@
/**
* NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new
*/
package {{invokerPackage}} package {{invokerPackage}}
sealed trait ResponseState sealed trait ResponseState

View File

@ -1,3 +1,8 @@
/**
* NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new
*/
package {{invokerPackage}} package {{invokerPackage}}
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit

View File

@ -1,3 +1,8 @@
/**
* NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new
*/
package {{apiPackage}} package {{apiPackage}}
import {{modelPackage}}._ import {{modelPackage}}._

View File

@ -1,3 +1,9 @@
/**
* NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new
*/
package {{package}} package {{package}}
import {{invokerPackage}}.ApiModel import {{invokerPackage}}.ApiModel
@ -8,7 +14,7 @@ import org.joda.time.DateTime
case class {{classname}} ( case class {{classname}} (
{{#vars}}{{#description}}/* {{{description}}} */ {{#vars}}{{#description}}/* {{{description}}} */
{{/description}}{{name}}: {{^required}}Option[{{/required}}{{^isEnum}}{{datatype}}{{/isEnum}}{{#isEnum}}{{classname}}Enums.{{datatypeWithEnum}}{{/isEnum}}{{^required}}]{{/required}}{{#hasMore}},{{/hasMore}}{{^hasMore}}){{/hasMore}} {{/description}}{{{name}}}: {{^required}}Option[{{/required}}{{^isEnum}}{{datatype}}{{/isEnum}}{{#isEnum}}{{classname}}Enums.{{datatypeWithEnum}}{{/isEnum}}{{^required}}]{{/required}}{{#hasMore}},{{/hasMore}}{{^hasMore}}){{/hasMore}}
{{/vars}} extends ApiModel {{/vars}} extends ApiModel
{{#hasEnums}} {{#hasEnums}}

View File

@ -1,3 +1,8 @@
/**
* NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new
*/
package {{invokerPackage}} package {{invokerPackage}}
import java.io.File import java.io.File
@ -8,6 +13,8 @@ sealed trait ApiReturnWithHeaders {
def headers: Map[String, String] def headers: Map[String, String]
def header(name: String): Option[String] = headers.get(name) def header(name: String): Option[String] = headers.get(name)
def getStringHeader(name: String) = header(name) def getStringHeader(name: String) = header(name)
// workaround: return date time header in string instead of datetime object
def getDateTimeHeader(name: String) = header(name)
def getIntHeader(name: String) = castedHeader(name, java.lang.Integer.parseInt) def getIntHeader(name: String) = castedHeader(name, java.lang.Integer.parseInt)
def getLongHeader(name: String) = castedHeader(name, java.lang.Long.parseLong) def getLongHeader(name: String) = castedHeader(name, java.lang.Long.parseLong)
def getFloatHeader(name: String) = castedHeader(name, java.lang.Float.parseFloat) def getFloatHeader(name: String) = castedHeader(name, java.lang.Float.parseFloat)

View File

@ -217,7 +217,7 @@
<akka-version>2.3.9</akka-version> <akka-version>2.3.9</akka-version>
<joda-version>1.2</joda-version> <joda-version>1.2</joda-version>
<joda-time-version>2.2</joda-time-version> <joda-time-version>2.2</joda-time-version>
<swagger-core-version>1.5.7</swagger-core-version> <swagger-core-version>1.5.8</swagger-core-version>
<maven-plugin.version>1.0.0</maven-plugin.version> <maven-plugin.version>1.0.0</maven-plugin.version>
<junit-version>4.8.1</junit-version> <junit-version>4.8.1</junit-version>

View File

@ -1,3 +1,8 @@
/**
* NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new
*/
package io.swagger.client.api package io.swagger.client.api
import io.swagger.client.model._ import io.swagger.client.model._
@ -7,8 +12,8 @@ import scala.reflect.ClassTag
object EnumsSerializers { object EnumsSerializers {
def all = Seq[Serializer[_]]() :+ def all = Seq[Serializer[_]]() :+
new EnumNameSerializer(PetEnums.Status) :+ new EnumNameSerializer(OrderEnums.Status) :+
new EnumNameSerializer(OrderEnums.Status) new EnumNameSerializer(PetEnums.Status)

View File

@ -1,6 +1,12 @@
/**
* NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new
*/
package io.swagger.client.api package io.swagger.client.api
import io.swagger.client.model.Pet import io.swagger.client.model.Pet
import io.swagger.client.model.ApiResponse
import java.io.File import java.io.File
import io.swagger.client.core._ import io.swagger.client.core._
import io.swagger.client.core.CollectionFormats._ import io.swagger.client.core.CollectionFormats._
@ -8,22 +14,6 @@ import io.swagger.client.core.ApiKeyLocations._
object PetApi { object PetApi {
/**
*
* Expected answers:
* code 400 : (Invalid ID supplied)
* code 404 : (Pet not found)
* code 405 : (Validation exception)
*
* @param body Pet object that needs to be added to the store
*/
def updatePet(body: Option[Pet] = None): ApiRequest[Unit] =
ApiRequest[Unit](ApiMethods.PUT, "http://petstore.swagger.io/v2", "/pet", "application/json")
.withBody(body)
.withErrorResponse[Unit](400)
.withErrorResponse[Unit](404)
.withErrorResponse[Unit](405)
/** /**
* *
* Expected answers: * Expected answers:
@ -31,79 +21,11 @@ object PetApi {
* *
* @param body Pet object that needs to be added to the store * @param body Pet object that needs to be added to the store
*/ */
def addPet(body: Option[Pet] = None): ApiRequest[Unit] = def addPet(body: Pet): ApiRequest[Unit] =
ApiRequest[Unit](ApiMethods.POST, "http://petstore.swagger.io/v2", "/pet", "application/json") ApiRequest[Unit](ApiMethods.POST, "http://petstore.swagger.io/v2", "/pet", "application/json")
.withBody(body) .withBody(body)
.withErrorResponse[Unit](405) .withErrorResponse[Unit](405)
/**
/**
* Multiple status values can be provided with comma seperated strings
*
* Expected answers:
* code 200 : Seq[Pet] (successful operation)
* code 400 : (Invalid status value)
*
* @param status Status values that need to be considered for filter
*/
def findPetsByStatus(status: Seq[String]): ApiRequest[Seq[Pet]] =
ApiRequest[Seq[Pet]](ApiMethods.GET, "http://petstore.swagger.io/v2", "/pet/findByStatus", "application/json")
.withQueryParam("status", ArrayValues(status, MULTI))
.withSuccessResponse[Seq[Pet]](200)
.withErrorResponse[Unit](400)
/**
* Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
*
* Expected answers:
* code 200 : Seq[Pet] (successful operation)
* code 400 : (Invalid tag value)
*
* @param tags Tags to filter by
*/
def findPetsByTags(tags: Seq[String]): ApiRequest[Seq[Pet]] =
ApiRequest[Seq[Pet]](ApiMethods.GET, "http://petstore.swagger.io/v2", "/pet/findByTags", "application/json")
.withQueryParam("tags", ArrayValues(tags, MULTI))
.withSuccessResponse[Seq[Pet]](200)
.withErrorResponse[Unit](400)
/**
* Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions
*
* Expected answers:
* code 200 : Pet (successful operation)
* code 400 : (Invalid ID supplied)
* code 404 : (Pet not found)
*
* Available security schemes:
* api_key (apiKey)
*
* @param petId ID of pet that needs to be fetched
*/
def getPetById(petId: Long)(implicit apiKey: ApiKeyValue): ApiRequest[Pet] =
ApiRequest[Pet](ApiMethods.GET, "http://petstore.swagger.io/v2", "/pet/{petId}", "application/json")
.withApiKey(apiKey, "api_key", HEADER)
.withPathParam("petId", petId)
.withSuccessResponse[Pet](200)
.withErrorResponse[Unit](400)
.withErrorResponse[Unit](404)
/**
*
* Expected answers:
* code 405 : (Invalid input)
*
* @param petId ID of pet that needs to be updated
* @param name Updated name of the pet
* @param status Updated status of the pet
*/
def updatePetWithForm(petId: String, name: Option[String] = None, status: Option[String] = None): ApiRequest[Unit] =
ApiRequest[Unit](ApiMethods.POST, "http://petstore.swagger.io/v2", "/pet/{petId}", "application/x-www-form-urlencoded")
.withFormParam("name", name)
.withFormParam("status", status)
.withPathParam("petId", petId)
.withErrorResponse[Unit](405)
/**
* *
* Expected answers: * Expected answers:
* code 400 : (Invalid pet value) * code 400 : (Invalid pet value)
@ -116,23 +38,99 @@ object PetApi {
.withPathParam("petId", petId) .withPathParam("petId", petId)
.withHeaderParam("api_key", apiKey) .withHeaderParam("api_key", apiKey)
.withErrorResponse[Unit](400) .withErrorResponse[Unit](400)
/**
/** * Multiple status values can be provided with comma separated strings
* *
* Expected answers: * Expected answers:
* code 0 : (successful operation) * code 200 : Seq[Pet] (successful operation)
* code 400 : (Invalid status value)
*
* @param status Status values that need to be considered for filter
*/
def findPetsByStatus(status: Seq[String]): ApiRequest[Seq[Pet]] =
ApiRequest[Seq[Pet]](ApiMethods.GET, "http://petstore.swagger.io/v2", "/pet/findByStatus", "application/json")
.withQueryParam("status", ArrayValues(status, CSV))
.withSuccessResponse[Seq[Pet]](200)
.withErrorResponse[Unit](400)
/**
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
*
* Expected answers:
* code 200 : Seq[Pet] (successful operation)
* code 400 : (Invalid tag value)
*
* @param tags Tags to filter by
*/
def findPetsByTags(tags: Seq[String]): ApiRequest[Seq[Pet]] =
ApiRequest[Seq[Pet]](ApiMethods.GET, "http://petstore.swagger.io/v2", "/pet/findByTags", "application/json")
.withQueryParam("tags", ArrayValues(tags, CSV))
.withSuccessResponse[Seq[Pet]](200)
.withErrorResponse[Unit](400)
/**
* Returns a single pet
*
* Expected answers:
* code 200 : Pet (successful operation)
* code 400 : (Invalid ID supplied)
* code 404 : (Pet not found)
*
* Available security schemes:
* api_key (apiKey)
*
* @param petId ID of pet to return
*/
def getPetById(petId: Long)(implicit apiKey: ApiKeyValue): ApiRequest[Pet] =
ApiRequest[Pet](ApiMethods.GET, "http://petstore.swagger.io/v2", "/pet/{petId}", "application/json")
.withApiKey(apiKey, "api_key", HEADER)
.withPathParam("petId", petId)
.withSuccessResponse[Pet](200)
.withErrorResponse[Unit](400)
.withErrorResponse[Unit](404)
/**
*
* Expected answers:
* code 400 : (Invalid ID supplied)
* code 404 : (Pet not found)
* code 405 : (Validation exception)
*
* @param body Pet object that needs to be added to the store
*/
def updatePet(body: Pet): ApiRequest[Unit] =
ApiRequest[Unit](ApiMethods.PUT, "http://petstore.swagger.io/v2", "/pet", "application/json")
.withBody(body)
.withErrorResponse[Unit](400)
.withErrorResponse[Unit](404)
.withErrorResponse[Unit](405)
/**
*
* Expected answers:
* code 405 : (Invalid input)
*
* @param petId ID of pet that needs to be updated
* @param name Updated name of the pet
* @param status Updated status of the pet
*/
def updatePetWithForm(petId: Long, name: Option[String] = None, status: Option[String] = None): ApiRequest[Unit] =
ApiRequest[Unit](ApiMethods.POST, "http://petstore.swagger.io/v2", "/pet/{petId}", "application/x-www-form-urlencoded")
.withFormParam("name", name)
.withFormParam("status", status)
.withPathParam("petId", petId)
.withErrorResponse[Unit](405)
/**
*
* Expected answers:
* code 200 : ApiResponse (successful operation)
* *
* @param petId ID of pet to update * @param petId ID of pet to update
* @param additionalMetadata Additional data to pass to server * @param additionalMetadata Additional data to pass to server
* @param file file to upload * @param file file to upload
*/ */
def uploadFile(petId: Long, additionalMetadata: Option[String] = None, file: Option[File] = None): ApiRequest[Unit] = def uploadFile(petId: Long, additionalMetadata: Option[String] = None, file: Option[File] = None): ApiRequest[ApiResponse] =
ApiRequest[Unit](ApiMethods.POST, "http://petstore.swagger.io/v2", "/pet/{petId}/uploadImage", "multipart/form-data") ApiRequest[ApiResponse](ApiMethods.POST, "http://petstore.swagger.io/v2", "/pet/{petId}/uploadImage", "multipart/form-data")
.withFormParam("additionalMetadata", additionalMetadata) .withFormParam("additionalMetadata", additionalMetadata)
.withFormParam("file", file) .withFormParam("file", file)
.withPathParam("petId", petId) .withPathParam("petId", petId)
.withDefaultSuccessResponse[Unit] .withSuccessResponse[ApiResponse](200)
} }

View File

@ -1,3 +1,8 @@
/**
* NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new
*/
package io.swagger.client.api package io.swagger.client.api
import io.swagger.client.model.Order import io.swagger.client.model.Order
@ -7,51 +12,6 @@ import io.swagger.client.core.ApiKeyLocations._
object StoreApi { object StoreApi {
/**
* Returns a map of status codes to quantities
*
* Expected answers:
* code 200 : Map[String, Int] (successful operation)
*
* Available security schemes:
* api_key (apiKey)
*/
def getInventory()(implicit apiKey: ApiKeyValue): ApiRequest[Map[String, Int]] =
ApiRequest[Map[String, Int]](ApiMethods.GET, "http://petstore.swagger.io/v2", "/store/inventory", "application/json")
.withApiKey(apiKey, "api_key", HEADER)
.withSuccessResponse[Map[String, Int]](200)
/**
*
* Expected answers:
* code 200 : Order (successful operation)
* code 400 : (Invalid Order)
*
* @param body order placed for purchasing the pet
*/
def placeOrder(body: Option[Order] = None): ApiRequest[Order] =
ApiRequest[Order](ApiMethods.POST, "http://petstore.swagger.io/v2", "/store/order", "application/json")
.withBody(body)
.withSuccessResponse[Order](200)
.withErrorResponse[Unit](400)
/**
* For valid response try integer IDs with value &lt;= 5 or &gt; 10. Other values will generated exceptions
*
* Expected answers:
* code 200 : Order (successful operation)
* code 400 : (Invalid ID supplied)
* code 404 : (Order not found)
*
* @param orderId ID of pet that needs to be fetched
*/
def getOrderById(orderId: String): ApiRequest[Order] =
ApiRequest[Order](ApiMethods.GET, "http://petstore.swagger.io/v2", "/store/order/{orderId}", "application/json")
.withPathParam("orderId", orderId)
.withSuccessResponse[Order](200)
.withErrorResponse[Unit](400)
.withErrorResponse[Unit](404)
/** /**
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors * For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
* *
@ -66,7 +26,48 @@ object StoreApi {
.withPathParam("orderId", orderId) .withPathParam("orderId", orderId)
.withErrorResponse[Unit](400) .withErrorResponse[Unit](400)
.withErrorResponse[Unit](404) .withErrorResponse[Unit](404)
/**
* Returns a map of status codes to quantities
*
* Expected answers:
* code 200 : Map[String, Int] (successful operation)
*
* Available security schemes:
* api_key (apiKey)
*/
def getInventory()(implicit apiKey: ApiKeyValue): ApiRequest[Map[String, Int]] =
ApiRequest[Map[String, Int]](ApiMethods.GET, "http://petstore.swagger.io/v2", "/store/inventory", "application/json")
.withApiKey(apiKey, "api_key", HEADER)
.withSuccessResponse[Map[String, Int]](200)
/**
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
*
* Expected answers:
* code 200 : Order (successful operation)
* code 400 : (Invalid ID supplied)
* code 404 : (Order not found)
*
* @param orderId ID of pet that needs to be fetched
*/
def getOrderById(orderId: Long): ApiRequest[Order] =
ApiRequest[Order](ApiMethods.GET, "http://petstore.swagger.io/v2", "/store/order/{orderId}", "application/json")
.withPathParam("orderId", orderId)
.withSuccessResponse[Order](200)
.withErrorResponse[Unit](400)
.withErrorResponse[Unit](404)
/**
*
* Expected answers:
* code 200 : Order (successful operation)
* code 400 : (Invalid Order)
*
* @param body order placed for purchasing the pet
*/
def placeOrder(body: Order): ApiRequest[Order] =
ApiRequest[Order](ApiMethods.POST, "http://petstore.swagger.io/v2", "/store/order", "application/json")
.withBody(body)
.withSuccessResponse[Order](200)
.withErrorResponse[Unit](400)
} }

View File

@ -1,3 +1,8 @@
/**
* NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new
*/
package io.swagger.client.api package io.swagger.client.api
import io.swagger.client.model.User import io.swagger.client.model.User
@ -15,12 +20,11 @@ object UserApi {
* *
* @param body Created user object * @param body Created user object
*/ */
def createUser(body: Option[User] = None): ApiRequest[Unit] = def createUser(body: User): ApiRequest[Unit] =
ApiRequest[Unit](ApiMethods.POST, "http://petstore.swagger.io/v2", "/user", "application/json") ApiRequest[Unit](ApiMethods.POST, "http://petstore.swagger.io/v2", "/user", "application/json")
.withBody(body) .withBody(body)
.withDefaultSuccessResponse[Unit] .withDefaultSuccessResponse[Unit]
/**
/**
* *
* Expected answers: * Expected answers:
* code 0 : (successful operation) * code 0 : (successful operation)
@ -31,8 +35,7 @@ object UserApi {
ApiRequest[Unit](ApiMethods.POST, "http://petstore.swagger.io/v2", "/user/createWithArray", "application/json") ApiRequest[Unit](ApiMethods.POST, "http://petstore.swagger.io/v2", "/user/createWithArray", "application/json")
.withBody(body) .withBody(body)
.withDefaultSuccessResponse[Unit] .withDefaultSuccessResponse[Unit]
/**
/**
* *
* Expected answers: * Expected answers:
* code 0 : (successful operation) * code 0 : (successful operation)
@ -43,33 +46,21 @@ object UserApi {
ApiRequest[Unit](ApiMethods.POST, "http://petstore.swagger.io/v2", "/user/createWithList", "application/json") ApiRequest[Unit](ApiMethods.POST, "http://petstore.swagger.io/v2", "/user/createWithList", "application/json")
.withBody(body) .withBody(body)
.withDefaultSuccessResponse[Unit] .withDefaultSuccessResponse[Unit]
/**
/** * This can only be done by the logged in user.
* *
* Expected answers: * Expected answers:
* code 200 : String (successful operation) * code 400 : (Invalid username supplied)
* code 400 : (Invalid username/password supplied) * code 404 : (User not found)
* *
* @param username The user name for login * @param username The name that needs to be deleted
* @param password The password for login in clear text
*/ */
def loginUser(username: Option[String] = None, password: Option[String] = None): ApiRequest[String] = def deleteUser(username: String): ApiRequest[Unit] =
ApiRequest[String](ApiMethods.GET, "http://petstore.swagger.io/v2", "/user/login", "application/json") ApiRequest[Unit](ApiMethods.DELETE, "http://petstore.swagger.io/v2", "/user/{username}", "application/json")
.withQueryParam("username", username) .withPathParam("username", username)
.withQueryParam("password", password)
.withSuccessResponse[String](200)
.withErrorResponse[Unit](400) .withErrorResponse[Unit](400)
.withErrorResponse[Unit](404)
/** /**
*
* Expected answers:
* code 0 : (successful operation)
*/
def logoutUser(): ApiRequest[Unit] =
ApiRequest[Unit](ApiMethods.GET, "http://petstore.swagger.io/v2", "/user/logout", "application/json")
.withDefaultSuccessResponse[Unit]
/**
* *
* Expected answers: * Expected answers:
* code 200 : User (successful operation) * code 200 : User (successful operation)
@ -84,8 +75,38 @@ object UserApi {
.withSuccessResponse[User](200) .withSuccessResponse[User](200)
.withErrorResponse[Unit](400) .withErrorResponse[Unit](400)
.withErrorResponse[Unit](404) .withErrorResponse[Unit](404)
/**
*
* Expected answers:
* code 200 : String (successful operation)
* Headers :
* X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when toekn expires
* code 400 : (Invalid username/password supplied)
*
* @param username The user name for login
* @param password The password for login in clear text
*/
def loginUser(username: String, password: String): ApiRequest[String] =
ApiRequest[String](ApiMethods.GET, "http://petstore.swagger.io/v2", "/user/login", "application/json")
.withQueryParam("username", username)
.withQueryParam("password", password)
.withSuccessResponse[String](200)
.withErrorResponse[Unit](400)
object LoginUserHeaders {
def `x-Rate-Limit`(r: ApiReturnWithHeaders) = r.getIntHeader("X-Rate-Limit")
def `x-Expires-After`(r: ApiReturnWithHeaders) = r.getDateTimeHeader("X-Expires-After")
}
/** /**
*
* Expected answers:
* code 0 : (successful operation)
*/
def logoutUser(): ApiRequest[Unit] =
ApiRequest[Unit](ApiMethods.GET, "http://petstore.swagger.io/v2", "/user/logout", "application/json")
.withDefaultSuccessResponse[Unit]
/**
* This can only be done by the logged in user. * This can only be done by the logged in user.
* *
* Expected answers: * Expected answers:
@ -95,29 +116,13 @@ object UserApi {
* @param username name that need to be deleted * @param username name that need to be deleted
* @param body Updated user object * @param body Updated user object
*/ */
def updateUser(username: String, body: Option[User] = None): ApiRequest[Unit] = def updateUser(username: String, body: User): ApiRequest[Unit] =
ApiRequest[Unit](ApiMethods.PUT, "http://petstore.swagger.io/v2", "/user/{username}", "application/json") ApiRequest[Unit](ApiMethods.PUT, "http://petstore.swagger.io/v2", "/user/{username}", "application/json")
.withBody(body) .withBody(body)
.withPathParam("username", username) .withPathParam("username", username)
.withErrorResponse[Unit](400) .withErrorResponse[Unit](400)
.withErrorResponse[Unit](404) .withErrorResponse[Unit](404)
/**
* This can only be done by the logged in user.
*
* Expected answers:
* code 400 : (Invalid username supplied)
* code 404 : (User not found)
*
* @param username The name that needs to be deleted
*/
def deleteUser(username: String): ApiRequest[Unit] =
ApiRequest[Unit](ApiMethods.DELETE, "http://petstore.swagger.io/v2", "/user/{username}", "application/json")
.withPathParam("username", username)
.withErrorResponse[Unit](400)
.withErrorResponse[Unit](404)
} }

View File

@ -1,3 +1,9 @@
/**
* NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new
*/
package io.swagger.client.core package io.swagger.client.core
import java.io.File import java.io.File

View File

@ -1,3 +1,8 @@
/**
* NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new
*/
package io.swagger.client.core package io.swagger.client.core
sealed trait ResponseState sealed trait ResponseState

View File

@ -1,3 +1,8 @@
/**
* NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new
*/
package io.swagger.client.core package io.swagger.client.core
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit

View File

@ -1,3 +1,8 @@
/**
* NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new
*/
package io.swagger.client.core package io.swagger.client.core
import java.io.File import java.io.File
@ -8,6 +13,8 @@ sealed trait ApiReturnWithHeaders {
def headers: Map[String, String] def headers: Map[String, String]
def header(name: String): Option[String] = headers.get(name) def header(name: String): Option[String] = headers.get(name)
def getStringHeader(name: String) = header(name) def getStringHeader(name: String) = header(name)
// workaround: return date time header in string instead of datetime object
def getDateTimeHeader(name: String) = header(name)
def getIntHeader(name: String) = castedHeader(name, java.lang.Integer.parseInt) def getIntHeader(name: String) = castedHeader(name, java.lang.Integer.parseInt)
def getLongHeader(name: String) = castedHeader(name, java.lang.Long.parseLong) def getLongHeader(name: String) = castedHeader(name, java.lang.Long.parseLong)
def getFloatHeader(name: String) = castedHeader(name, java.lang.Float.parseFloat) def getFloatHeader(name: String) = castedHeader(name, java.lang.Float.parseFloat)

View File

@ -0,0 +1,19 @@
/**
* NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new
*/
package io.swagger.client.model
import io.swagger.client.core.ApiModel
import org.joda.time.DateTime
case class ApiResponse (
code: Option[Int],
`type`: Option[String],
message: Option[String])
extends ApiModel

View File

@ -1,3 +1,9 @@
/**
* NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new
*/
package io.swagger.client.model package io.swagger.client.model
import io.swagger.client.core.ApiModel import io.swagger.client.core.ApiModel

View File

@ -1,3 +1,9 @@
/**
* NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new
*/
package io.swagger.client.model package io.swagger.client.model
import io.swagger.client.core.ApiModel import io.swagger.client.core.ApiModel

View File

@ -1,3 +1,9 @@
/**
* NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new
*/
package io.swagger.client.model package io.swagger.client.model
import io.swagger.client.core.ApiModel import io.swagger.client.core.ApiModel

View File

@ -1,3 +1,9 @@
/**
* NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new
*/
package io.swagger.client.model package io.swagger.client.model
import io.swagger.client.core.ApiModel import io.swagger.client.core.ApiModel

View File

@ -1,3 +1,9 @@
/**
* NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new
*/
package io.swagger.client.model package io.swagger.client.model
import io.swagger.client.core.ApiModel import io.swagger.client.core.ApiModel

View File

@ -7,7 +7,7 @@ import io.swagger.common.ApiUserCredentials;
import io.swagger.event.Response; import io.swagger.event.Response;
import io.swagger.common.SwaggerApi; import io.swagger.common.SwaggerApi;
import io.swagger.client.model.Pet; import io.swagger.client.model.Pet;
import io.swagger.client.model.InlineResponse200; import io.swagger.client.model.ApiResponse;
import flash.filesystem.File; import flash.filesystem.File;
import mx.rpc.AsyncToken; import mx.rpc.AsyncToken;
@ -26,13 +26,10 @@ public class PetApi extends SwaggerApi {
} }
public static const event_add_pet: String = "add_pet"; public static const event_add_pet: String = "add_pet";
public static const event_add_pet_using_byte_array: String = "add_pet_using_byte_array";
public static const event_delete_pet: String = "delete_pet"; public static const event_delete_pet: String = "delete_pet";
public static const event_find_pets_by_status: String = "find_pets_by_status"; public static const event_find_pets_by_status: String = "find_pets_by_status";
public static const event_find_pets_by_tags: String = "find_pets_by_tags"; public static const event_find_pets_by_tags: String = "find_pets_by_tags";
public static const event_get_pet_by_id: String = "get_pet_by_id"; public static const event_get_pet_by_id: String = "get_pet_by_id";
public static const event_get_pet_by_id_in_object: String = "get_pet_by_id_in_object";
public static const event_pet_pet_idtesting_byte_arraytrue_get: String = "pet_pet_idtesting_byte_arraytrue_get";
public static const event_update_pet: String = "update_pet"; public static const event_update_pet: String = "update_pet";
public static const event_update_pet_with_form: String = "update_pet_with_form"; public static const event_update_pet_with_form: String = "update_pet_with_form";
public static const event_upload_file: String = "upload_file"; public static const event_upload_file: String = "upload_file";
@ -68,36 +65,6 @@ public class PetApi extends SwaggerApi {
} }
/*
* Returns void
*/
public function add_pet_using_byte_array (body: String): String {
// create path and map variables
var path: String = "/pet?testing_byte_array&#x3D;true".replace(/{format}/g,"xml");
// query params
var queryParams: Dictionary = new Dictionary();
var headerParams: Dictionary = new Dictionary();
// verify required params are set
if() {
throw new ApiError(400, "missing required params");
}
var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, body, headerParams);
var requestId: String = getUniqueId();
token.requestId = requestId;
token.completionEventType = "add_pet_using_byte_array";
token.returnType = null ;
return requestId;
}
/* /*
* Returns void * Returns void
*/ */
@ -227,66 +194,6 @@ public class PetApi extends SwaggerApi {
} }
/*
* Returns InlineResponse200
*/
public function get_pet_by_id_in_object (petId: Number): String {
// create path and map variables
var path: String = "/pet/{petId}?response&#x3D;inline_arbitrary_object".replace(/{format}/g,"xml").replace("{" + "petId" + "}", getApiInvoker().escapeString(petId));
// query params
var queryParams: Dictionary = new Dictionary();
var headerParams: Dictionary = new Dictionary();
// verify required params are set
if() {
throw new ApiError(400, "missing required params");
}
var token:AsyncToken = getApiInvoker().invokeAPI(path, "GET", queryParams, null, headerParams);
var requestId: String = getUniqueId();
token.requestId = requestId;
token.completionEventType = "get_pet_by_id_in_object";
token.returnType = InlineResponse200;
return requestId;
}
/*
* Returns String
*/
public function pet_pet_idtesting_byte_arraytrue_get (petId: Number): String {
// create path and map variables
var path: String = "/pet/{petId}?testing_byte_array&#x3D;true".replace(/{format}/g,"xml").replace("{" + "petId" + "}", getApiInvoker().escapeString(petId));
// query params
var queryParams: Dictionary = new Dictionary();
var headerParams: Dictionary = new Dictionary();
// verify required params are set
if() {
throw new ApiError(400, "missing required params");
}
var token:AsyncToken = getApiInvoker().invokeAPI(path, "GET", queryParams, null, headerParams);
var requestId: String = getUniqueId();
token.requestId = requestId;
token.completionEventType = "pet_pet_idtesting_byte_arraytrue_get";
token.returnType = String;
return requestId;
}
/* /*
* Returns void * Returns void
*/ */
@ -320,7 +227,7 @@ public class PetApi extends SwaggerApi {
/* /*
* Returns void * Returns void
*/ */
public function update_pet_with_form (petId: String, name: String, status: String): String { public function update_pet_with_form (petId: Number, name: String, status: String): String {
// create path and map variables // create path and map variables
var path: String = "/pet/{petId}".replace(/{format}/g,"xml").replace("{" + "petId" + "}", getApiInvoker().escapeString(petId)); var path: String = "/pet/{petId}".replace(/{format}/g,"xml").replace("{" + "petId" + "}", getApiInvoker().escapeString(petId));
@ -356,7 +263,7 @@ public class PetApi extends SwaggerApi {
} }
/* /*
* Returns void * Returns ApiResponse
*/ */
public function upload_file (petId: Number, additionalMetadata: String, file: File): String { public function upload_file (petId: Number, additionalMetadata: String, file: File): String {
// create path and map variables // create path and map variables
@ -388,7 +295,7 @@ public class PetApi extends SwaggerApi {
token.requestId = requestId; token.requestId = requestId;
token.completionEventType = "upload_file"; token.completionEventType = "upload_file";
token.returnType = null ; token.returnType = ApiResponse;
return requestId; return requestId;
} }

View File

@ -7,7 +7,6 @@ import io.swagger.common.ApiUserCredentials;
import io.swagger.event.Response; import io.swagger.event.Response;
import io.swagger.common.SwaggerApi; import io.swagger.common.SwaggerApi;
import io.swagger.client.model.Order; import io.swagger.client.model.Order;
import io.swagger.client.model.Object;
import mx.rpc.AsyncToken; import mx.rpc.AsyncToken;
import mx.utils.UIDUtil; import mx.utils.UIDUtil;
@ -25,9 +24,7 @@ public class StoreApi extends SwaggerApi {
} }
public static const event_delete_order: String = "delete_order"; public static const event_delete_order: String = "delete_order";
public static const event_find_orders_by_status: String = "find_orders_by_status";
public static const event_get_inventory: String = "get_inventory"; public static const event_get_inventory: String = "get_inventory";
public static const event_get_inventory_in_object: String = "get_inventory_in_object";
public static const event_get_order_by_id: String = "get_order_by_id"; public static const event_get_order_by_id: String = "get_order_by_id";
public static const event_place_order: String = "place_order"; public static const event_place_order: String = "place_order";
@ -62,38 +59,6 @@ public class StoreApi extends SwaggerApi {
} }
/*
* Returns Array
*/
public function find_orders_by_status (status: String): String {
// create path and map variables
var path: String = "/store/findByStatus".replace(/{format}/g,"xml");
// query params
var queryParams: Dictionary = new Dictionary();
var headerParams: Dictionary = new Dictionary();
// verify required params are set
if() {
throw new ApiError(400, "missing required params");
}
if("null" != String(status))
queryParams["status"] = toPathValue(status);
var token:AsyncToken = getApiInvoker().invokeAPI(path, "GET", queryParams, null, headerParams);
var requestId: String = getUniqueId();
token.requestId = requestId;
token.completionEventType = "find_orders_by_status";
token.returnType = Array;
return requestId;
}
/* /*
* Returns Dictionary * Returns Dictionary
*/ */
@ -120,36 +85,10 @@ public class StoreApi extends SwaggerApi {
} }
/*
* Returns Object
*/
public function get_inventory_in_object (): String {
// create path and map variables
var path: String = "/store/inventory?response&#x3D;arbitrary_object".replace(/{format}/g,"xml");
// query params
var queryParams: Dictionary = new Dictionary();
var headerParams: Dictionary = new Dictionary();
var token:AsyncToken = getApiInvoker().invokeAPI(path, "GET", queryParams, null, headerParams);
var requestId: String = getUniqueId();
token.requestId = requestId;
token.completionEventType = "get_inventory_in_object";
token.returnType = Object;
return requestId;
}
/* /*
* Returns Order * Returns Order
*/ */
public function get_order_by_id (orderId: String): String { public function get_order_by_id (orderId: Number): String {
// create path and map variables // create path and map variables
var path: String = "/store/order/{orderId}".replace(/{format}/g,"xml").replace("{" + "orderId" + "}", getApiInvoker().escapeString(orderId)); var path: String = "/store/order/{orderId}".replace(/{format}/g,"xml").replace("{" + "orderId" + "}", getApiInvoker().escapeString(orderId));

View File

@ -0,0 +1,23 @@
package io.swagger.client.model {
[XmlRootNode(name="ApiResponse")]
public class ApiResponse {
[XmlElement(name="code")]
public var code: Number = 0;
[XmlElement(name="type")]
public var type: String = null;
[XmlElement(name="message")]
public var message: String = null;
public function toString(): String {
var str: String = "ApiResponse: ";
str += " (code: " + code + ")";
str += " (type: " + type + ")";
str += " (message: " + message + ")";
return str;
}
}
}

View File

@ -0,0 +1,17 @@
package io.swagger.client.model {
import io.swagger.common.ListWrapper;
public class ApiResponseList implements ListWrapper {
// This declaration below of _ApiResponse_obj_class is to force flash compiler to include this class
private var _apiResponse_obj_class: io.swagger.client.model.ApiResponse = null;
[XmlElements(name="apiResponse", type="io.swagger.client.model.ApiResponse")]
public var apiResponse: Array = new Array();
public function getList(): Array{
return apiResponse;
}
}
}

View File

@ -0,0 +1,25 @@
goog.provide('API.Client.ApiResponse');
/**
* @record
*/
API.Client.ApiResponse = function() {}
/**
* @type {!number}
* @export
*/
API.Client.ApiResponse.prototype.code;
/**
* @type {!string}
* @export
*/
API.Client.ApiResponse.prototype.type;
/**
* @type {!string}
* @export
*/
API.Client.ApiResponse.prototype.message;

View File

@ -3,9 +3,9 @@
* Do not edit this file by hand or your changes will be lost next time it is * Do not edit this file by hand or your changes will be lost next time it is
* generated. * generated.
* *
* This is a sample server Petstore server. You can find out more about Swagger at &lt;a href=\&quot;http://swagger.io\&quot;&gt;http://swagger.io&lt;/a&gt; or on irc.freenode.net, #swagger. For this sample, you can use the api key \&quot;special-key\&quot; to test the authorization filters * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key &#x60;special-key&#x60; to test the authorization filters.
* Version: 1.0.0 * Version: 1.0.0
* Generated at: 2016-02-02T00:45:38.616-07:00 * Generated at: 2016-04-16T18:02:07.029+08:00
* Generated by: class io.swagger.codegen.languages.JavascriptClosureAngularClientCodegen * Generated by: class io.swagger.codegen.languages.JavascriptClosureAngularClientCodegen
*/ */
/** /**
@ -15,6 +15,7 @@
goog.provide('API.Client.PetApi'); goog.provide('API.Client.PetApi');
goog.require('API.Client.ApiResponse');
goog.require('API.Client.Pet'); goog.require('API.Client.Pet');
/** /**
@ -44,49 +45,14 @@ API.Client.PetApi = function($http, $httpParamSerializer, $injector) {
} }
API.Client.PetApi.$inject = ['$http', '$httpParamSerializer', '$injector']; API.Client.PetApi.$inject = ['$http', '$httpParamSerializer', '$injector'];
/**
* Update an existing pet
*
* @param {!Pet=} opt_body Pet object that needs to be added to the store
* @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
* @return {!angular.$q.Promise}
*/
API.Client.PetApi.prototype.updatePet = function(opt_body, opt_extraHttpRequestParams) {
/** @const {string} */
var path = this.basePath_ + '/pet';
/** @type {!Object} */
var queryParameters = {};
/** @type {!Object} */
var headerParams = angular.extend({}, this.defaultHeaders);
/** @type {!Object} */
var httpRequestParams = {
method: 'PUT',
url: path,
json: true,
data: opt_body,
params: queryParameters,
headers: headerParams
};
if (opt_extraHttpRequestParams) {
httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams);
}
return this.http_(httpRequestParams);
}
/** /**
* Add a new pet to the store * Add a new pet to the store
* *
* @param {!Pet=} opt_body Pet object that needs to be added to the store * @param {!Pet} body Pet object that needs to be added to the store
* @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
* @return {!angular.$q.Promise} * @return {!angular.$q.Promise}
*/ */
API.Client.PetApi.prototype.addPet = function(opt_body, opt_extraHttpRequestParams) { API.Client.PetApi.prototype.addPet = function(body, opt_extraHttpRequestParams) {
/** @const {string} */ /** @const {string} */
var path = this.basePath_ + '/pet'; var path = this.basePath_ + '/pet';
@ -95,181 +61,17 @@ API.Client.PetApi.prototype.addPet = function(opt_body, opt_extraHttpRequestPara
/** @type {!Object} */ /** @type {!Object} */
var headerParams = angular.extend({}, this.defaultHeaders); var headerParams = angular.extend({}, this.defaultHeaders);
// verify required parameter 'body' is set
if (!body) {
throw new Error('Missing required parameter body when calling addPet');
}
/** @type {!Object} */ /** @type {!Object} */
var httpRequestParams = { var httpRequestParams = {
method: 'POST', method: 'POST',
url: path, url: path,
json: true, json: true,
data: opt_body, data: body,
params: queryParameters,
params: queryParameters,
headers: headerParams
};
if (opt_extraHttpRequestParams) {
httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams);
}
return this.http_(httpRequestParams);
}
/**
* Finds Pets by status
* Multiple status values can be provided with comma seperated strings
* @param {!Array<!string>=} opt_status Status values that need to be considered for filter
* @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
* @return {!angular.$q.Promise<!Array<!API.Client.Pet>>}
*/
API.Client.PetApi.prototype.findPetsByStatus = function(opt_status, opt_extraHttpRequestParams) {
/** @const {string} */
var path = this.basePath_ + '/pet/findByStatus';
/** @type {!Object} */
var queryParameters = {};
/** @type {!Object} */
var headerParams = angular.extend({}, this.defaultHeaders);
if (opt_status !== undefined) {
queryParameters['status'] = opt_status;
}
/** @type {!Object} */
var httpRequestParams = {
method: 'GET',
url: path,
json: true,
params: queryParameters,
headers: headerParams
};
if (opt_extraHttpRequestParams) {
httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams);
}
return this.http_(httpRequestParams);
}
/**
* Finds Pets by tags
* Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
* @param {!Array<!string>=} opt_tags Tags to filter by
* @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
* @return {!angular.$q.Promise<!Array<!API.Client.Pet>>}
*/
API.Client.PetApi.prototype.findPetsByTags = function(opt_tags, opt_extraHttpRequestParams) {
/** @const {string} */
var path = this.basePath_ + '/pet/findByTags';
/** @type {!Object} */
var queryParameters = {};
/** @type {!Object} */
var headerParams = angular.extend({}, this.defaultHeaders);
if (opt_tags !== undefined) {
queryParameters['tags'] = opt_tags;
}
/** @type {!Object} */
var httpRequestParams = {
method: 'GET',
url: path,
json: true,
params: queryParameters,
headers: headerParams
};
if (opt_extraHttpRequestParams) {
httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams);
}
return this.http_(httpRequestParams);
}
/**
* Find pet by ID
* Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions
* @param {!number} petId ID of pet that needs to be fetched
* @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
* @return {!angular.$q.Promise<!API.Client.Pet>}
*/
API.Client.PetApi.prototype.getPetById = function(petId, opt_extraHttpRequestParams) {
/** @const {string} */
var path = this.basePath_ + '/pet/{petId}'
.replace('{' + 'petId' + '}', String(petId));
/** @type {!Object} */
var queryParameters = {};
/** @type {!Object} */
var headerParams = angular.extend({}, this.defaultHeaders);
// verify required parameter 'petId' is set
if (!petId) {
throw new Error('Missing required parameter petId when calling getPetById');
}
/** @type {!Object} */
var httpRequestParams = {
method: 'GET',
url: path,
json: true,
params: queryParameters,
headers: headerParams
};
if (opt_extraHttpRequestParams) {
httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams);
}
return this.http_(httpRequestParams);
}
/**
* Updates a pet in the store with form data
*
* @param {!string} petId ID of pet that needs to be updated
* @param {!string=} opt_name Updated name of the pet
* @param {!string=} opt_status Updated status of the pet
* @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
* @return {!angular.$q.Promise}
*/
API.Client.PetApi.prototype.updatePetWithForm = function(petId, opt_name, opt_status, opt_extraHttpRequestParams) {
/** @const {string} */
var path = this.basePath_ + '/pet/{petId}'
.replace('{' + 'petId' + '}', String(petId));
/** @type {!Object} */
var queryParameters = {};
/** @type {!Object} */
var headerParams = angular.extend({}, this.defaultHeaders);
/** @type {!Object} */
var formParams = {};
// verify required parameter 'petId' is set
if (!petId) {
throw new Error('Missing required parameter petId when calling updatePetWithForm');
}
headerParams['Content-Type'] = 'application/x-www-form-urlencoded';
formParams['name'] = opt_name;
formParams['status'] = opt_status;
/** @type {!Object} */
var httpRequestParams = {
method: 'POST',
url: path,
json: false,
data: this.httpParamSerializer_(formParams),
params: queryParameters,
headers: headerParams headers: headerParams
}; };
@ -309,8 +111,209 @@ API.Client.PetApi.prototype.deletePet = function(petId, opt_apiKey, opt_extraHtt
method: 'DELETE', method: 'DELETE',
url: path, url: path,
json: true, json: true,
params: queryParameters,
headers: headerParams
};
if (opt_extraHttpRequestParams) {
httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams);
}
return this.http_(httpRequestParams);
}
/**
* Finds Pets by status
* Multiple status values can be provided with comma separated strings
* @param {!Array<!string>} status Status values that need to be considered for filter
* @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
* @return {!angular.$q.Promise<!Array<!API.Client.Pet>>}
*/
API.Client.PetApi.prototype.findPetsByStatus = function(status, opt_extraHttpRequestParams) {
/** @const {string} */
var path = this.basePath_ + '/pet/findByStatus';
/** @type {!Object} */
var queryParameters = {};
/** @type {!Object} */
var headerParams = angular.extend({}, this.defaultHeaders);
// verify required parameter 'status' is set
if (!status) {
throw new Error('Missing required parameter status when calling findPetsByStatus');
}
if (status !== undefined) {
queryParameters['status'] = status;
}
/** @type {!Object} */
var httpRequestParams = {
method: 'GET',
url: path,
json: true,
params: queryParameters,
headers: headerParams
};
if (opt_extraHttpRequestParams) {
httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams);
}
return this.http_(httpRequestParams);
}
/**
* Finds Pets by tags
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @param {!Array<!string>} tags Tags to filter by
* @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
* @return {!angular.$q.Promise<!Array<!API.Client.Pet>>}
*/
API.Client.PetApi.prototype.findPetsByTags = function(tags, opt_extraHttpRequestParams) {
/** @const {string} */
var path = this.basePath_ + '/pet/findByTags';
/** @type {!Object} */
var queryParameters = {};
/** @type {!Object} */
var headerParams = angular.extend({}, this.defaultHeaders);
// verify required parameter 'tags' is set
if (!tags) {
throw new Error('Missing required parameter tags when calling findPetsByTags');
}
if (tags !== undefined) {
queryParameters['tags'] = tags;
}
/** @type {!Object} */
var httpRequestParams = {
method: 'GET',
url: path,
json: true,
params: queryParameters,
headers: headerParams
};
if (opt_extraHttpRequestParams) {
httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams);
}
return this.http_(httpRequestParams);
}
/**
* Find pet by ID
* Returns a single pet
* @param {!number} petId ID of pet to return
* @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
* @return {!angular.$q.Promise<!API.Client.Pet>}
*/
API.Client.PetApi.prototype.getPetById = function(petId, opt_extraHttpRequestParams) {
/** @const {string} */
var path = this.basePath_ + '/pet/{petId}'
.replace('{' + 'petId' + '}', String(petId));
/** @type {!Object} */
var queryParameters = {};
/** @type {!Object} */
var headerParams = angular.extend({}, this.defaultHeaders);
// verify required parameter 'petId' is set
if (!petId) {
throw new Error('Missing required parameter petId when calling getPetById');
}
/** @type {!Object} */
var httpRequestParams = {
method: 'GET',
url: path,
json: true,
params: queryParameters,
headers: headerParams
};
if (opt_extraHttpRequestParams) {
httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams);
}
return this.http_(httpRequestParams);
}
/**
* Update an existing pet
*
* @param {!Pet} body Pet object that needs to be added to the store
* @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
* @return {!angular.$q.Promise}
*/
API.Client.PetApi.prototype.updatePet = function(body, opt_extraHttpRequestParams) {
/** @const {string} */
var path = this.basePath_ + '/pet';
/** @type {!Object} */
var queryParameters = {};
/** @type {!Object} */
var headerParams = angular.extend({}, this.defaultHeaders);
// verify required parameter 'body' is set
if (!body) {
throw new Error('Missing required parameter body when calling updatePet');
}
/** @type {!Object} */
var httpRequestParams = {
method: 'PUT',
url: path,
json: true,
data: body,
params: queryParameters,
headers: headerParams
};
if (opt_extraHttpRequestParams) {
httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams);
}
return this.http_(httpRequestParams);
}
/**
* Updates a pet in the store with form data
*
* @param {!number} petId ID of pet that needs to be updated
* @param {!string=} opt_name Updated name of the pet
* @param {!string=} opt_status Updated status of the pet
* @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
* @return {!angular.$q.Promise}
*/
API.Client.PetApi.prototype.updatePetWithForm = function(petId, opt_name, opt_status, opt_extraHttpRequestParams) {
/** @const {string} */
var path = this.basePath_ + '/pet/{petId}'
.replace('{' + 'petId' + '}', String(petId));
/** @type {!Object} */
var queryParameters = {};
/** @type {!Object} */
var headerParams = angular.extend({}, this.defaultHeaders);
/** @type {!Object} */
var formParams = {};
// verify required parameter 'petId' is set
if (!petId) {
throw new Error('Missing required parameter petId when calling updatePetWithForm');
}
headerParams['Content-Type'] = 'application/x-www-form-urlencoded';
formParams['name'] = opt_name;
formParams['status'] = opt_status;
/** @type {!Object} */
var httpRequestParams = {
method: 'POST',
url: path,
json: false,
data: this.httpParamSerializer_(formParams),
params: queryParameters, params: queryParameters,
headers: headerParams headers: headerParams
}; };
@ -329,7 +332,7 @@ API.Client.PetApi.prototype.deletePet = function(petId, opt_apiKey, opt_extraHtt
* @param {!string=} opt_additionalMetadata Additional data to pass to server * @param {!string=} opt_additionalMetadata Additional data to pass to server
* @param {!Object=} opt_file file to upload * @param {!Object=} opt_file file to upload
* @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
* @return {!angular.$q.Promise} * @return {!angular.$q.Promise<!API.Client.ApiResponse>}
*/ */
API.Client.PetApi.prototype.uploadFile = function(petId, opt_additionalMetadata, opt_file, opt_extraHttpRequestParams) { API.Client.PetApi.prototype.uploadFile = function(petId, opt_additionalMetadata, opt_file, opt_extraHttpRequestParams) {
/** @const {string} */ /** @const {string} */
@ -359,83 +362,7 @@ API.Client.PetApi.prototype.uploadFile = function(petId, opt_additionalMetadata,
method: 'POST', method: 'POST',
url: path, url: path,
json: false, json: false,
data: this.httpParamSerializer_(formParams),
data: this.httpParamSerializer_(formParams),
params: queryParameters,
headers: headerParams
};
if (opt_extraHttpRequestParams) {
httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams);
}
return this.http_(httpRequestParams);
}
/**
* Fake endpoint to test byte array return by &#39;Find pet by ID&#39;
* Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions
* @param {!number} petId ID of pet that needs to be fetched
* @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
* @return {!angular.$q.Promise<!string>}
*/
API.Client.PetApi.prototype.getPetByIdWithByteArray = function(petId, opt_extraHttpRequestParams) {
/** @const {string} */
var path = this.basePath_ + '/pet/{petId}?testing_byte_array=true'
.replace('{' + 'petId' + '}', String(petId));
/** @type {!Object} */
var queryParameters = {};
/** @type {!Object} */
var headerParams = angular.extend({}, this.defaultHeaders);
// verify required parameter 'petId' is set
if (!petId) {
throw new Error('Missing required parameter petId when calling getPetByIdWithByteArray');
}
/** @type {!Object} */
var httpRequestParams = {
method: 'GET',
url: path,
json: true,
params: queryParameters,
headers: headerParams
};
if (opt_extraHttpRequestParams) {
httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams);
}
return this.http_(httpRequestParams);
}
/**
* Fake endpoint to test byte array in body parameter for adding a new pet to the store
*
* @param {!string=} opt_body Pet object in the form of byte array
* @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
* @return {!angular.$q.Promise}
*/
API.Client.PetApi.prototype.addPetUsingByteArray = function(opt_body, opt_extraHttpRequestParams) {
/** @const {string} */
var path = this.basePath_ + '/pet?testing_byte_array=true';
/** @type {!Object} */
var queryParameters = {};
/** @type {!Object} */
var headerParams = angular.extend({}, this.defaultHeaders);
/** @type {!Object} */
var httpRequestParams = {
method: 'POST',
url: path,
json: true,
data: opt_body,
params: queryParameters, params: queryParameters,
headers: headerParams headers: headerParams
}; };

View File

@ -3,9 +3,9 @@
* Do not edit this file by hand or your changes will be lost next time it is * Do not edit this file by hand or your changes will be lost next time it is
* generated. * generated.
* *
* This is a sample server Petstore server. You can find out more about Swagger at &lt;a href=\&quot;http://swagger.io\&quot;&gt;http://swagger.io&lt;/a&gt; or on irc.freenode.net, #swagger. For this sample, you can use the api key \&quot;special-key\&quot; to test the authorization filters * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key &#x60;special-key&#x60; to test the authorization filters.
* Version: 1.0.0 * Version: 1.0.0
* Generated at: 2016-02-02T00:45:38.616-07:00 * Generated at: 2016-04-16T18:02:07.029+08:00
* Generated by: class io.swagger.codegen.languages.JavascriptClosureAngularClientCodegen * Generated by: class io.swagger.codegen.languages.JavascriptClosureAngularClientCodegen
*/ */
/** /**
@ -44,113 +44,6 @@ API.Client.StoreApi = function($http, $httpParamSerializer, $injector) {
} }
API.Client.StoreApi.$inject = ['$http', '$httpParamSerializer', '$injector']; API.Client.StoreApi.$inject = ['$http', '$httpParamSerializer', '$injector'];
/**
* Returns pet inventories by status
* Returns a map of status codes to quantities
* @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
* @return {!angular.$q.Promise<!Object<!string, number>>}
*/
API.Client.StoreApi.prototype.getInventory = function(opt_extraHttpRequestParams) {
/** @const {string} */
var path = this.basePath_ + '/store/inventory';
/** @type {!Object} */
var queryParameters = {};
/** @type {!Object} */
var headerParams = angular.extend({}, this.defaultHeaders);
/** @type {!Object} */
var httpRequestParams = {
method: 'GET',
url: path,
json: true,
params: queryParameters,
headers: headerParams
};
if (opt_extraHttpRequestParams) {
httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams);
}
return this.http_(httpRequestParams);
}
/**
* Place an order for a pet
*
* @param {!Order=} opt_body order placed for purchasing the pet
* @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
* @return {!angular.$q.Promise<!API.Client.Order>}
*/
API.Client.StoreApi.prototype.placeOrder = function(opt_body, opt_extraHttpRequestParams) {
/** @const {string} */
var path = this.basePath_ + '/store/order';
/** @type {!Object} */
var queryParameters = {};
/** @type {!Object} */
var headerParams = angular.extend({}, this.defaultHeaders);
/** @type {!Object} */
var httpRequestParams = {
method: 'POST',
url: path,
json: true,
data: opt_body,
params: queryParameters,
headers: headerParams
};
if (opt_extraHttpRequestParams) {
httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams);
}
return this.http_(httpRequestParams);
}
/**
* Find purchase order by ID
* For valid response try integer IDs with value &lt;= 5 or &gt; 10. Other values will generated exceptions
* @param {!string} orderId ID of pet that needs to be fetched
* @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
* @return {!angular.$q.Promise<!API.Client.Order>}
*/
API.Client.StoreApi.prototype.getOrderById = function(orderId, opt_extraHttpRequestParams) {
/** @const {string} */
var path = this.basePath_ + '/store/order/{orderId}'
.replace('{' + 'orderId' + '}', String(orderId));
/** @type {!Object} */
var queryParameters = {};
/** @type {!Object} */
var headerParams = angular.extend({}, this.defaultHeaders);
// verify required parameter 'orderId' is set
if (!orderId) {
throw new Error('Missing required parameter orderId when calling getOrderById');
}
/** @type {!Object} */
var httpRequestParams = {
method: 'GET',
url: path,
json: true,
params: queryParameters,
headers: headerParams
};
if (opt_extraHttpRequestParams) {
httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams);
}
return this.http_(httpRequestParams);
}
/** /**
* Delete purchase order by ID * Delete purchase order by ID
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors * For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
@ -177,9 +70,112 @@ API.Client.StoreApi.prototype.deleteOrder = function(orderId, opt_extraHttpReque
method: 'DELETE', method: 'DELETE',
url: path, url: path,
json: true, json: true,
params: queryParameters,
headers: headerParams
params: queryParameters, };
if (opt_extraHttpRequestParams) {
httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams);
}
return this.http_(httpRequestParams);
}
/**
* Returns pet inventories by status
* Returns a map of status codes to quantities
* @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
* @return {!angular.$q.Promise<!Object<!string, number>>}
*/
API.Client.StoreApi.prototype.getInventory = function(opt_extraHttpRequestParams) {
/** @const {string} */
var path = this.basePath_ + '/store/inventory';
/** @type {!Object} */
var queryParameters = {};
/** @type {!Object} */
var headerParams = angular.extend({}, this.defaultHeaders);
/** @type {!Object} */
var httpRequestParams = {
method: 'GET',
url: path,
json: true,
params: queryParameters,
headers: headerParams
};
if (opt_extraHttpRequestParams) {
httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams);
}
return this.http_(httpRequestParams);
}
/**
* Find purchase order by ID
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
* @param {!number} orderId ID of pet that needs to be fetched
* @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
* @return {!angular.$q.Promise<!API.Client.Order>}
*/
API.Client.StoreApi.prototype.getOrderById = function(orderId, opt_extraHttpRequestParams) {
/** @const {string} */
var path = this.basePath_ + '/store/order/{orderId}'
.replace('{' + 'orderId' + '}', String(orderId));
/** @type {!Object} */
var queryParameters = {};
/** @type {!Object} */
var headerParams = angular.extend({}, this.defaultHeaders);
// verify required parameter 'orderId' is set
if (!orderId) {
throw new Error('Missing required parameter orderId when calling getOrderById');
}
/** @type {!Object} */
var httpRequestParams = {
method: 'GET',
url: path,
json: true,
params: queryParameters,
headers: headerParams
};
if (opt_extraHttpRequestParams) {
httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams);
}
return this.http_(httpRequestParams);
}
/**
* Place an order for a pet
*
* @param {!Order} body order placed for purchasing the pet
* @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
* @return {!angular.$q.Promise<!API.Client.Order>}
*/
API.Client.StoreApi.prototype.placeOrder = function(body, opt_extraHttpRequestParams) {
/** @const {string} */
var path = this.basePath_ + '/store/order';
/** @type {!Object} */
var queryParameters = {};
/** @type {!Object} */
var headerParams = angular.extend({}, this.defaultHeaders);
// verify required parameter 'body' is set
if (!body) {
throw new Error('Missing required parameter body when calling placeOrder');
}
/** @type {!Object} */
var httpRequestParams = {
method: 'POST',
url: path,
json: true,
data: body,
params: queryParameters,
headers: headerParams headers: headerParams
}; };

View File

@ -3,9 +3,9 @@
* Do not edit this file by hand or your changes will be lost next time it is * Do not edit this file by hand or your changes will be lost next time it is
* generated. * generated.
* *
* This is a sample server Petstore server. You can find out more about Swagger at &lt;a href=\&quot;http://swagger.io\&quot;&gt;http://swagger.io&lt;/a&gt; or on irc.freenode.net, #swagger. For this sample, you can use the api key \&quot;special-key\&quot; to test the authorization filters * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key &#x60;special-key&#x60; to test the authorization filters.
* Version: 1.0.0 * Version: 1.0.0
* Generated at: 2016-02-02T00:45:38.616-07:00 * Generated at: 2016-04-16T18:02:07.029+08:00
* Generated by: class io.swagger.codegen.languages.JavascriptClosureAngularClientCodegen * Generated by: class io.swagger.codegen.languages.JavascriptClosureAngularClientCodegen
*/ */
/** /**
@ -47,11 +47,11 @@ API.Client.UserApi.$inject = ['$http', '$httpParamSerializer', '$injector'];
/** /**
* Create user * Create user
* This can only be done by the logged in user. * This can only be done by the logged in user.
* @param {!User=} opt_body Created user object * @param {!User} body Created user object
* @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
* @return {!angular.$q.Promise} * @return {!angular.$q.Promise}
*/ */
API.Client.UserApi.prototype.createUser = function(opt_body, opt_extraHttpRequestParams) { API.Client.UserApi.prototype.createUser = function(body, opt_extraHttpRequestParams) {
/** @const {string} */ /** @const {string} */
var path = this.basePath_ + '/user'; var path = this.basePath_ + '/user';
@ -60,15 +60,17 @@ API.Client.UserApi.prototype.createUser = function(opt_body, opt_extraHttpReques
/** @type {!Object} */ /** @type {!Object} */
var headerParams = angular.extend({}, this.defaultHeaders); var headerParams = angular.extend({}, this.defaultHeaders);
// verify required parameter 'body' is set
if (!body) {
throw new Error('Missing required parameter body when calling createUser');
}
/** @type {!Object} */ /** @type {!Object} */
var httpRequestParams = { var httpRequestParams = {
method: 'POST', method: 'POST',
url: path, url: path,
json: true, json: true,
data: opt_body, data: body,
params: queryParameters,
params: queryParameters,
headers: headerParams headers: headerParams
}; };
@ -82,11 +84,11 @@ API.Client.UserApi.prototype.createUser = function(opt_body, opt_extraHttpReques
/** /**
* Creates list of users with given input array * Creates list of users with given input array
* *
* @param {!Array<!API.Client.User>=} opt_body List of user object * @param {!Array<!API.Client.User>} body List of user object
* @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
* @return {!angular.$q.Promise} * @return {!angular.$q.Promise}
*/ */
API.Client.UserApi.prototype.createUsersWithArrayInput = function(opt_body, opt_extraHttpRequestParams) { API.Client.UserApi.prototype.createUsersWithArrayInput = function(body, opt_extraHttpRequestParams) {
/** @const {string} */ /** @const {string} */
var path = this.basePath_ + '/user/createWithArray'; var path = this.basePath_ + '/user/createWithArray';
@ -95,15 +97,17 @@ API.Client.UserApi.prototype.createUsersWithArrayInput = function(opt_body, opt_
/** @type {!Object} */ /** @type {!Object} */
var headerParams = angular.extend({}, this.defaultHeaders); var headerParams = angular.extend({}, this.defaultHeaders);
// verify required parameter 'body' is set
if (!body) {
throw new Error('Missing required parameter body when calling createUsersWithArrayInput');
}
/** @type {!Object} */ /** @type {!Object} */
var httpRequestParams = { var httpRequestParams = {
method: 'POST', method: 'POST',
url: path, url: path,
json: true, json: true,
data: opt_body, data: body,
params: queryParameters,
params: queryParameters,
headers: headerParams headers: headerParams
}; };
@ -117,11 +121,11 @@ API.Client.UserApi.prototype.createUsersWithArrayInput = function(opt_body, opt_
/** /**
* Creates list of users with given input array * Creates list of users with given input array
* *
* @param {!Array<!API.Client.User>=} opt_body List of user object * @param {!Array<!API.Client.User>} body List of user object
* @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
* @return {!angular.$q.Promise} * @return {!angular.$q.Promise}
*/ */
API.Client.UserApi.prototype.createUsersWithListInput = function(opt_body, opt_extraHttpRequestParams) { API.Client.UserApi.prototype.createUsersWithListInput = function(body, opt_extraHttpRequestParams) {
/** @const {string} */ /** @const {string} */
var path = this.basePath_ + '/user/createWithList'; var path = this.basePath_ + '/user/createWithList';
@ -130,171 +134,17 @@ API.Client.UserApi.prototype.createUsersWithListInput = function(opt_body, opt_e
/** @type {!Object} */ /** @type {!Object} */
var headerParams = angular.extend({}, this.defaultHeaders); var headerParams = angular.extend({}, this.defaultHeaders);
// verify required parameter 'body' is set
if (!body) {
throw new Error('Missing required parameter body when calling createUsersWithListInput');
}
/** @type {!Object} */ /** @type {!Object} */
var httpRequestParams = { var httpRequestParams = {
method: 'POST', method: 'POST',
url: path, url: path,
json: true, json: true,
data: opt_body, data: body,
params: queryParameters,
params: queryParameters,
headers: headerParams
};
if (opt_extraHttpRequestParams) {
httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams);
}
return this.http_(httpRequestParams);
}
/**
* Logs user into the system
*
* @param {!string=} opt_username The user name for login
* @param {!string=} opt_password The password for login in clear text
* @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
* @return {!angular.$q.Promise<!string>}
*/
API.Client.UserApi.prototype.loginUser = function(opt_username, opt_password, opt_extraHttpRequestParams) {
/** @const {string} */
var path = this.basePath_ + '/user/login';
/** @type {!Object} */
var queryParameters = {};
/** @type {!Object} */
var headerParams = angular.extend({}, this.defaultHeaders);
if (opt_username !== undefined) {
queryParameters['username'] = opt_username;
}
if (opt_password !== undefined) {
queryParameters['password'] = opt_password;
}
/** @type {!Object} */
var httpRequestParams = {
method: 'GET',
url: path,
json: true,
params: queryParameters,
headers: headerParams
};
if (opt_extraHttpRequestParams) {
httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams);
}
return this.http_(httpRequestParams);
}
/**
* Logs out current logged in user session
*
* @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
* @return {!angular.$q.Promise}
*/
API.Client.UserApi.prototype.logoutUser = function(opt_extraHttpRequestParams) {
/** @const {string} */
var path = this.basePath_ + '/user/logout';
/** @type {!Object} */
var queryParameters = {};
/** @type {!Object} */
var headerParams = angular.extend({}, this.defaultHeaders);
/** @type {!Object} */
var httpRequestParams = {
method: 'GET',
url: path,
json: true,
params: queryParameters,
headers: headerParams
};
if (opt_extraHttpRequestParams) {
httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams);
}
return this.http_(httpRequestParams);
}
/**
* Get user by user name
*
* @param {!string} username The name that needs to be fetched. Use user1 for testing.
* @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
* @return {!angular.$q.Promise<!API.Client.User>}
*/
API.Client.UserApi.prototype.getUserByName = function(username, opt_extraHttpRequestParams) {
/** @const {string} */
var path = this.basePath_ + '/user/{username}'
.replace('{' + 'username' + '}', String(username));
/** @type {!Object} */
var queryParameters = {};
/** @type {!Object} */
var headerParams = angular.extend({}, this.defaultHeaders);
// verify required parameter 'username' is set
if (!username) {
throw new Error('Missing required parameter username when calling getUserByName');
}
/** @type {!Object} */
var httpRequestParams = {
method: 'GET',
url: path,
json: true,
params: queryParameters,
headers: headerParams
};
if (opt_extraHttpRequestParams) {
httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams);
}
return this.http_(httpRequestParams);
}
/**
* Updated user
* This can only be done by the logged in user.
* @param {!string} username name that need to be deleted
* @param {!User=} opt_body Updated user object
* @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
* @return {!angular.$q.Promise}
*/
API.Client.UserApi.prototype.updateUser = function(username, opt_body, opt_extraHttpRequestParams) {
/** @const {string} */
var path = this.basePath_ + '/user/{username}'
.replace('{' + 'username' + '}', String(username));
/** @type {!Object} */
var queryParameters = {};
/** @type {!Object} */
var headerParams = angular.extend({}, this.defaultHeaders);
// verify required parameter 'username' is set
if (!username) {
throw new Error('Missing required parameter username when calling updateUser');
}
/** @type {!Object} */
var httpRequestParams = {
method: 'PUT',
url: path,
json: true,
data: opt_body,
params: queryParameters,
headers: headerParams headers: headerParams
}; };
@ -331,9 +181,167 @@ API.Client.UserApi.prototype.deleteUser = function(username, opt_extraHttpReques
method: 'DELETE', method: 'DELETE',
url: path, url: path,
json: true, json: true,
params: queryParameters,
headers: headerParams
params: queryParameters, };
if (opt_extraHttpRequestParams) {
httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams);
}
return this.http_(httpRequestParams);
}
/**
* Get user by user name
*
* @param {!string} username The name that needs to be fetched. Use user1 for testing.
* @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
* @return {!angular.$q.Promise<!API.Client.User>}
*/
API.Client.UserApi.prototype.getUserByName = function(username, opt_extraHttpRequestParams) {
/** @const {string} */
var path = this.basePath_ + '/user/{username}'
.replace('{' + 'username' + '}', String(username));
/** @type {!Object} */
var queryParameters = {};
/** @type {!Object} */
var headerParams = angular.extend({}, this.defaultHeaders);
// verify required parameter 'username' is set
if (!username) {
throw new Error('Missing required parameter username when calling getUserByName');
}
/** @type {!Object} */
var httpRequestParams = {
method: 'GET',
url: path,
json: true,
params: queryParameters,
headers: headerParams
};
if (opt_extraHttpRequestParams) {
httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams);
}
return this.http_(httpRequestParams);
}
/**
* Logs user into the system
*
* @param {!string} username The user name for login
* @param {!string} password The password for login in clear text
* @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
* @return {!angular.$q.Promise<!string>}
*/
API.Client.UserApi.prototype.loginUser = function(username, password, opt_extraHttpRequestParams) {
/** @const {string} */
var path = this.basePath_ + '/user/login';
/** @type {!Object} */
var queryParameters = {};
/** @type {!Object} */
var headerParams = angular.extend({}, this.defaultHeaders);
// verify required parameter 'username' is set
if (!username) {
throw new Error('Missing required parameter username when calling loginUser');
}
// verify required parameter 'password' is set
if (!password) {
throw new Error('Missing required parameter password when calling loginUser');
}
if (username !== undefined) {
queryParameters['username'] = username;
}
if (password !== undefined) {
queryParameters['password'] = password;
}
/** @type {!Object} */
var httpRequestParams = {
method: 'GET',
url: path,
json: true,
params: queryParameters,
headers: headerParams
};
if (opt_extraHttpRequestParams) {
httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams);
}
return this.http_(httpRequestParams);
}
/**
* Logs out current logged in user session
*
* @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
* @return {!angular.$q.Promise}
*/
API.Client.UserApi.prototype.logoutUser = function(opt_extraHttpRequestParams) {
/** @const {string} */
var path = this.basePath_ + '/user/logout';
/** @type {!Object} */
var queryParameters = {};
/** @type {!Object} */
var headerParams = angular.extend({}, this.defaultHeaders);
/** @type {!Object} */
var httpRequestParams = {
method: 'GET',
url: path,
json: true,
params: queryParameters,
headers: headerParams
};
if (opt_extraHttpRequestParams) {
httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams);
}
return this.http_(httpRequestParams);
}
/**
* Updated user
* This can only be done by the logged in user.
* @param {!string} username name that need to be deleted
* @param {!User} body Updated user object
* @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
* @return {!angular.$q.Promise}
*/
API.Client.UserApi.prototype.updateUser = function(username, body, opt_extraHttpRequestParams) {
/** @const {string} */
var path = this.basePath_ + '/user/{username}'
.replace('{' + 'username' + '}', String(username));
/** @type {!Object} */
var queryParameters = {};
/** @type {!Object} */
var headerParams = angular.extend({}, this.defaultHeaders);
// verify required parameter 'username' is set
if (!username) {
throw new Error('Missing required parameter username when calling updateUser');
}
// verify required parameter 'body' is set
if (!body) {
throw new Error('Missing required parameter body when calling updateUser');
}
/** @type {!Object} */
var httpRequestParams = {
method: 'PUT',
url: path,
json: true,
data: body,
params: queryParameters,
headers: headerParams headers: headerParams
}; };

View File

@ -0,0 +1,119 @@
#include "SWGApiResponse.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace Swagger {
SWGApiResponse::SWGApiResponse(QString* json) {
init();
this->fromJson(*json);
}
SWGApiResponse::SWGApiResponse() {
init();
}
SWGApiResponse::~SWGApiResponse() {
this->cleanup();
}
void
SWGApiResponse::init() {
code = 0;
type = new QString("");
message = new QString("");
}
void
SWGApiResponse::cleanup() {
if(type != NULL) {
delete type;
}
if(message != NULL) {
delete message;
}
}
SWGApiResponse*
SWGApiResponse::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGApiResponse::fromJsonObject(QJsonObject &pJson) {
setValue(&code, pJson["code"], "qint32", "");
setValue(&type, pJson["type"], "QString", "QString");
setValue(&message, pJson["message"], "QString", "QString");
}
QString
SWGApiResponse::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
return QString(bytes);
}
QJsonObject*
SWGApiResponse::asJsonObject() {
QJsonObject* obj = new QJsonObject();
obj->insert("code", QJsonValue(code));
toJsonValue(QString("type"), type, obj, QString("QString"));
toJsonValue(QString("message"), message, obj, QString("QString"));
return obj;
}
qint32
SWGApiResponse::getCode() {
return code;
}
void
SWGApiResponse::setCode(qint32 code) {
this->code = code;
}
QString*
SWGApiResponse::getType() {
return type;
}
void
SWGApiResponse::setType(QString* type) {
this->type = type;
}
QString*
SWGApiResponse::getMessage() {
return message;
}
void
SWGApiResponse::setMessage(QString* message) {
this->message = message;
}
} /* namespace Swagger */

View File

@ -0,0 +1,48 @@
/*
* SWGApiResponse.h
*
*
*/
#ifndef SWGApiResponse_H_
#define SWGApiResponse_H_
#include <QJsonObject>
#include <QString>
#include "SWGObject.h"
namespace Swagger {
class SWGApiResponse: public SWGObject {
public:
SWGApiResponse();
SWGApiResponse(QString* json);
virtual ~SWGApiResponse();
void init();
void cleanup();
QString asJson ();
QJsonObject* asJsonObject();
void fromJsonObject(QJsonObject &json);
SWGApiResponse* fromJson(QString &jsonString);
qint32 getCode();
void setCode(qint32 code);
QString* getType();
void setType(QString* type);
QString* getMessage();
void setMessage(QString* message);
private:
qint32 code;
QString* type;
QString* message;
};
} /* namespace Swagger */
#endif /* SWGApiResponse_H_ */

View File

@ -27,17 +27,15 @@ SWGCategory::~SWGCategory() {
void void
SWGCategory::init() { SWGCategory::init() {
id = 0L; id = 0L;
name = new QString(""); name = new QString("");
} }
void void
SWGCategory::cleanup() { SWGCategory::cleanup() {
if(name != NULL) { if(name != NULL) {
delete name; delete name;
} }
} }
SWGCategory* SWGCategory*
@ -52,8 +50,7 @@ SWGCategory::fromJson(QString &json) {
void void
SWGCategory::fromJsonObject(QJsonObject &pJson) { SWGCategory::fromJsonObject(QJsonObject &pJson) {
setValue(&id, pJson["id"], "qint64", ""); setValue(&id, pJson["id"], "qint64", "");
setValue(&name, pJson["name"], "QString", "QString"); setValue(&name, pJson["name"], "QString", "QString");
} }
QString QString
@ -76,8 +73,6 @@ SWGCategory::asJsonObject() {
return obj; return obj;
} }

View File

@ -32,14 +32,12 @@ public:
qint64 getId(); qint64 getId();
void setId(qint64 id); void setId(qint64 id);
QString* getName(); QString* getName();
void setName(QString* name); void setName(QString* name);
private: private:
qint64 id; qint64 id;
QString* name; QString* name;
}; };
} /* namespace Swagger */ } /* namespace Swagger */

View File

@ -2,28 +2,32 @@
#define ModelFactory_H_ #define ModelFactory_H_
#include "SWGUser.h" #include "SWGApiResponse.h"
#include "SWGCategory.h" #include "SWGCategory.h"
#include "SWGOrder.h"
#include "SWGPet.h" #include "SWGPet.h"
#include "SWGTag.h" #include "SWGTag.h"
#include "SWGOrder.h" #include "SWGUser.h"
namespace Swagger { namespace Swagger {
inline void* create(QString type) { inline void* create(QString type) {
if(QString("SWGUser").compare(type) == 0) { if(QString("SWGApiResponse").compare(type) == 0) {
return new SWGUser(); return new SWGApiResponse();
} }
if(QString("SWGCategory").compare(type) == 0) { if(QString("SWGCategory").compare(type) == 0) {
return new SWGCategory(); return new SWGCategory();
} }
if(QString("SWGOrder").compare(type) == 0) {
return new SWGOrder();
}
if(QString("SWGPet").compare(type) == 0) { if(QString("SWGPet").compare(type) == 0) {
return new SWGPet(); return new SWGPet();
} }
if(QString("SWGTag").compare(type) == 0) { if(QString("SWGTag").compare(type) == 0) {
return new SWGTag(); return new SWGTag();
} }
if(QString("SWGOrder").compare(type) == 0) { if(QString("SWGUser").compare(type) == 0) {
return new SWGOrder(); return new SWGUser();
} }
return NULL; return NULL;

View File

@ -27,12 +27,11 @@ SWGOrder::~SWGOrder() {
void void
SWGOrder::init() { SWGOrder::init() {
id = 0L; id = 0L;
petId = 0L; petId = 0L;
quantity = 0; quantity = 0;
shipDate = NULL; shipDate = NULL;
status = new QString(""); status = new QString("");
complete = false; complete = false;
} }
void void
@ -40,14 +39,13 @@ SWGOrder::cleanup() {
if(shipDate != NULL) { if(shipDate != NULL) {
delete shipDate; delete shipDate;
} }
if(status != NULL) { if(status != NULL) {
delete status; delete status;
} }
} }
SWGOrder* SWGOrder*
@ -62,12 +60,11 @@ SWGOrder::fromJson(QString &json) {
void void
SWGOrder::fromJsonObject(QJsonObject &pJson) { SWGOrder::fromJsonObject(QJsonObject &pJson) {
setValue(&id, pJson["id"], "qint64", ""); setValue(&id, pJson["id"], "qint64", "");
setValue(&petId, pJson["petId"], "qint64", ""); setValue(&petId, pJson["petId"], "qint64", "");
setValue(&quantity, pJson["quantity"], "qint32", ""); setValue(&quantity, pJson["quantity"], "qint32", "");
setValue(&shipDate, pJson["shipDate"], "QDateTime", "QDateTime"); setValue(&shipDate, pJson["shipDate"], "QDateTime", "QDateTime");
setValue(&status, pJson["status"], "QString", "QString"); setValue(&status, pJson["status"], "QString", "QString");
setValue(&complete, pJson["complete"], "bool", ""); setValue(&complete, pJson["complete"], "bool", "");
} }
QString QString
@ -84,8 +81,8 @@ QJsonObject*
SWGOrder::asJsonObject() { SWGOrder::asJsonObject() {
QJsonObject* obj = new QJsonObject(); QJsonObject* obj = new QJsonObject();
obj->insert("id", QJsonValue(id)); obj->insert("id", QJsonValue(id));
obj->insert("petId", QJsonValue(petId)); obj->insert("petId", QJsonValue(petId));
obj->insert("quantity", QJsonValue(quantity)); obj->insert("quantity", QJsonValue(quantity));
toJsonValue(QString("shipDate"), shipDate, obj, QString("QDateTime")); toJsonValue(QString("shipDate"), shipDate, obj, QString("QDateTime"));
@ -93,13 +90,10 @@ SWGOrder::asJsonObject() {
toJsonValue(QString("status"), status, obj, QString("QString")); toJsonValue(QString("status"), status, obj, QString("QString"));
obj->insert("complete", QJsonValue(complete));
obj->insert("complete", QJsonValue(complete));
return obj; return obj;
} }

View File

@ -33,26 +33,24 @@ public:
qint64 getId(); qint64 getId();
void setId(qint64 id); void setId(qint64 id);
qint64 getPetId(); qint64 getPetId();
void setPetId(qint64 petId); void setPetId(qint64 petId);
qint32 getQuantity(); qint32 getQuantity();
void setQuantity(qint32 quantity); void setQuantity(qint32 quantity);
QDateTime* getShipDate(); QDateTime* getShipDate();
void setShipDate(QDateTime* shipDate); void setShipDate(QDateTime* shipDate);
QString* getStatus(); QString* getStatus();
void setStatus(QString* status); void setStatus(QString* status);
bool getComplete(); bool getComplete();
void setComplete(bool complete); void setComplete(bool complete);
private: private:
qint64 id; qint64 id;
qint64 petId; qint64 petId;
qint32 quantity; qint32 quantity;
QDateTime* shipDate; QDateTime* shipDate;
QString* status; QString* status;
bool complete; bool complete;
}; };
} /* namespace Swagger */ } /* namespace Swagger */

View File

@ -27,41 +27,39 @@ SWGPet::~SWGPet() {
void void
SWGPet::init() { SWGPet::init() {
id = 0L; id = 0L;
category = new SWGCategory(); category = new SWGCategory();
name = new QString(""); name = new QString("");
photoUrls = new QList<QString*>(); photoUrls = new QList<QString*>();
tags = new QList<SWGTag*>(); tags = new QList<SWGTag*>();
status = new QString(""); status = new QString("");
} }
void void
SWGPet::cleanup() { SWGPet::cleanup() {
if(category != NULL) { if(category != NULL) {
delete category; delete category;
} }
if(name != NULL) { if(name != NULL) {
delete name; delete name;
} }
if(photoUrls != NULL) { if(photoUrls != NULL) {
QList<QString*>* arr = photoUrls; QList<QString*>* arr = photoUrls;
foreach(QString* o, *arr) { foreach(QString* o, *arr) {
delete o; delete o;
} }
delete photoUrls; delete photoUrls;
} }
if(tags != NULL) { if(tags != NULL) {
QList<SWGTag*>* arr = tags; QList<SWGTag*>* arr = tags;
foreach(SWGTag* o, *arr) { foreach(SWGTag* o, *arr) {
delete o; delete o;
} }
delete tags; delete tags;
} }
if(status != NULL) { if(status != NULL) {
delete status; delete status;
} }
} }
SWGPet* SWGPet*
@ -76,12 +74,11 @@ SWGPet::fromJson(QString &json) {
void void
SWGPet::fromJsonObject(QJsonObject &pJson) { SWGPet::fromJsonObject(QJsonObject &pJson) {
setValue(&id, pJson["id"], "qint64", ""); setValue(&id, pJson["id"], "qint64", "");
setValue(&category, pJson["category"], "SWGCategory", "SWGCategory"); setValue(&category, pJson["category"], "SWGCategory", "SWGCategory");
setValue(&name, pJson["name"], "QString", "QString"); setValue(&name, pJson["name"], "QString", "QString");
setValue(&photoUrls, pJson["photoUrls"], "QList", "QString"); setValue(&photoUrls, pJson["photoUrls"], "QList", "QString");
setValue(&tags, pJson["tags"], "QList", "SWGTag"); setValue(&tags, pJson["tags"], "QList", "SWGTag");
setValue(&status, pJson["status"], "QString", "QString"); setValue(&status, pJson["status"], "QString", "QString");
} }
QString QString
@ -105,13 +102,11 @@ SWGPet::asJsonObject() {
toJsonValue(QString("name"), name, obj, QString("QString")); toJsonValue(QString("name"), name, obj, QString("QString"));
QList<QString*>* photoUrlsList = photoUrls; QList<QString*>* photoUrlsList = photoUrls;
QJsonArray photoUrlsJsonArray; QJsonArray photoUrlsJsonArray;
toJsonArray((QList<void*>*)photoUrls, &photoUrlsJsonArray, "photoUrls", "QString"); toJsonArray((QList<void*>*)photoUrls, &photoUrlsJsonArray, "photoUrls", "QString");
@ -120,7 +115,6 @@ SWGPet::asJsonObject() {
QList<SWGTag*>* tagsList = tags; QList<SWGTag*>* tagsList = tags;
QJsonArray tagsJsonArray; QJsonArray tagsJsonArray;
toJsonArray((QList<void*>*)tags, &tagsJsonArray, "tags", "SWGTag"); toJsonArray((QList<void*>*)tags, &tagsJsonArray, "tags", "SWGTag");
@ -129,13 +123,10 @@ SWGPet::asJsonObject() {
toJsonValue(QString("status"), status, obj, QString("QString")); toJsonValue(QString("status"), status, obj, QString("QString"));
return obj; return obj;
} }

View File

@ -35,26 +35,24 @@ public:
qint64 getId(); qint64 getId();
void setId(qint64 id); void setId(qint64 id);
SWGCategory* getCategory(); SWGCategory* getCategory();
void setCategory(SWGCategory* category); void setCategory(SWGCategory* category);
QString* getName(); QString* getName();
void setName(QString* name); void setName(QString* name);
QList<QString*>* getPhotoUrls(); QList<QString*>* getPhotoUrls();
void setPhotoUrls(QList<QString*>* photoUrls); void setPhotoUrls(QList<QString*>* photoUrls);
QList<SWGTag*>* getTags(); QList<SWGTag*>* getTags();
void setTags(QList<SWGTag*>* tags); void setTags(QList<SWGTag*>* tags);
QString* getStatus(); QString* getStatus();
void setStatus(QString* status); void setStatus(QString* status);
private: private:
qint64 id; qint64 id;
SWGCategory* category; SWGCategory* category;
QString* name; QString* name;
QList<QString*>* photoUrls; QList<QString*>* photoUrls;
QList<SWGTag*>* tags; QList<SWGTag*>* tags;
QString* status; QString* status;
}; };
} /* namespace Swagger */ } /* namespace Swagger */

View File

@ -15,54 +15,6 @@ SWGPetApi::SWGPetApi(QString host, QString basePath) {
this->basePath = basePath; this->basePath = basePath;
} }
void
SWGPetApi::updatePet(SWGPet body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/pet");
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "PUT");
QString output = body.asJson();
input.request_body.append(output);
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGPetApi::updatePetCallback);
worker->execute(&input);
}
void
SWGPetApi::updatePetCallback(HttpRequestWorker * worker) {
QString msg;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
worker->deleteLater();
emit updatePetSignal();
}
void void
SWGPetApi::addPet(SWGPet body) { SWGPetApi::addPet(SWGPet body) {
QString fullPath; QString fullPath;
@ -70,22 +22,15 @@ SWGPetApi::addPet(SWGPet body) {
HttpRequestWorker *worker = new HttpRequestWorker(); HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "POST"); HttpRequestInput input(fullPath, "POST");
QString output = body.asJson(); QString output = body.asJson();
input.request_body.append(output); input.request_body.append(output);
connect(worker, connect(worker,
&HttpRequestWorker::on_execution_finished, &HttpRequestWorker::on_execution_finished,
this, this,
@ -112,6 +57,48 @@ SWGPetApi::addPetCallback(HttpRequestWorker * worker) {
emit addPetSignal(); emit addPetSignal();
} }
void void
SWGPetApi::deletePet(qint64 petId, QString* apiKey) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/pet/{petId}");
QString petIdPathParam("{"); petIdPathParam.append("petId").append("}");
fullPath.replace(petIdPathParam, stringValue(petId));
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "DELETE");
// TODO: add header support
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGPetApi::deletePetCallback);
worker->execute(&input);
}
void
SWGPetApi::deletePetCallback(HttpRequestWorker * worker) {
QString msg;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
worker->deleteLater();
emit deletePetSignal();
}
void
SWGPetApi::findPetsByStatus(QList<QString*>* status) { SWGPetApi::findPetsByStatus(QList<QString*>* status) {
QString fullPath; QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/pet/findByStatus"); fullPath.append(this->host).append(this->basePath).append("/pet/findByStatus");
@ -119,12 +106,8 @@ SWGPetApi::findPetsByStatus(QList<QString*>* status) {
if (status->size() > 0) { if (status->size() > 0) {
if (QString("multi").indexOf("multi") == 0) { if (QString("csv").indexOf("multi") == 0) {
foreach(QString* t, *status) { foreach(QString* t, *status) {
if (fullPath.indexOf("?") > 0) if (fullPath.indexOf("?") > 0)
fullPath.append("&"); fullPath.append("&");
@ -133,7 +116,7 @@ SWGPetApi::findPetsByStatus(QList<QString*>* status) {
fullPath.append("status=").append(stringValue(t)); fullPath.append("status=").append(stringValue(t));
} }
} }
else if (QString("multi").indexOf("ssv") == 0) { else if (QString("csv").indexOf("ssv") == 0) {
if (fullPath.indexOf("?") > 0) if (fullPath.indexOf("?") > 0)
fullPath.append("&"); fullPath.append("&");
else else
@ -147,7 +130,7 @@ SWGPetApi::findPetsByStatus(QList<QString*>* status) {
fullPath.append(stringValue(t)); fullPath.append(stringValue(t));
} }
} }
else if (QString("multi").indexOf("tsv") == 0) { else if (QString("csv").indexOf("tsv") == 0) {
if (fullPath.indexOf("?") > 0) if (fullPath.indexOf("?") > 0)
fullPath.append("&"); fullPath.append("&");
else else
@ -164,8 +147,6 @@ SWGPetApi::findPetsByStatus(QList<QString*>* status) {
} }
HttpRequestWorker *worker = new HttpRequestWorker(); HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "GET"); HttpRequestInput input(fullPath, "GET");
@ -173,8 +154,6 @@ SWGPetApi::findPetsByStatus(QList<QString*>* status) {
connect(worker, connect(worker,
&HttpRequestWorker::on_execution_finished, &HttpRequestWorker::on_execution_finished,
this, this,
@ -210,7 +189,6 @@ SWGPetApi::findPetsByStatusCallback(HttpRequestWorker * worker) {
worker->deleteLater(); worker->deleteLater();
emit findPetsByStatusSignal(output); emit findPetsByStatusSignal(output);
@ -224,12 +202,8 @@ SWGPetApi::findPetsByTags(QList<QString*>* tags) {
if (tags->size() > 0) { if (tags->size() > 0) {
if (QString("multi").indexOf("multi") == 0) { if (QString("csv").indexOf("multi") == 0) {
foreach(QString* t, *tags) { foreach(QString* t, *tags) {
if (fullPath.indexOf("?") > 0) if (fullPath.indexOf("?") > 0)
fullPath.append("&"); fullPath.append("&");
@ -238,7 +212,7 @@ SWGPetApi::findPetsByTags(QList<QString*>* tags) {
fullPath.append("tags=").append(stringValue(t)); fullPath.append("tags=").append(stringValue(t));
} }
} }
else if (QString("multi").indexOf("ssv") == 0) { else if (QString("csv").indexOf("ssv") == 0) {
if (fullPath.indexOf("?") > 0) if (fullPath.indexOf("?") > 0)
fullPath.append("&"); fullPath.append("&");
else else
@ -252,7 +226,7 @@ SWGPetApi::findPetsByTags(QList<QString*>* tags) {
fullPath.append(stringValue(t)); fullPath.append(stringValue(t));
} }
} }
else if (QString("multi").indexOf("tsv") == 0) { else if (QString("csv").indexOf("tsv") == 0) {
if (fullPath.indexOf("?") > 0) if (fullPath.indexOf("?") > 0)
fullPath.append("&"); fullPath.append("&");
else else
@ -269,8 +243,6 @@ SWGPetApi::findPetsByTags(QList<QString*>* tags) {
} }
HttpRequestWorker *worker = new HttpRequestWorker(); HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "GET"); HttpRequestInput input(fullPath, "GET");
@ -278,8 +250,6 @@ SWGPetApi::findPetsByTags(QList<QString*>* tags) {
connect(worker, connect(worker,
&HttpRequestWorker::on_execution_finished, &HttpRequestWorker::on_execution_finished,
this, this,
@ -315,7 +285,6 @@ SWGPetApi::findPetsByTagsCallback(HttpRequestWorker * worker) {
worker->deleteLater(); worker->deleteLater();
emit findPetsByTagsSignal(output); emit findPetsByTagsSignal(output);
@ -326,13 +295,10 @@ SWGPetApi::getPetById(qint64 petId) {
QString fullPath; QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/pet/{petId}"); fullPath.append(this->host).append(this->basePath).append("/pet/{petId}");
QString petIdPathParam("{"); petIdPathParam.append("petId").append("}"); QString petIdPathParam("{"); petIdPathParam.append("petId").append("}");
fullPath.replace(petIdPathParam, stringValue(petId)); fullPath.replace(petIdPathParam, stringValue(petId));
HttpRequestWorker *worker = new HttpRequestWorker(); HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "GET"); HttpRequestInput input(fullPath, "GET");
@ -340,8 +306,6 @@ SWGPetApi::getPetById(qint64 petId) {
connect(worker, connect(worker,
&HttpRequestWorker::on_execution_finished, &HttpRequestWorker::on_execution_finished,
this, this,
@ -361,48 +325,78 @@ SWGPetApi::getPetByIdCallback(HttpRequestWorker * worker) {
} }
QString json(worker->response);
QString json(worker->response);
SWGPet* output = static_cast<SWGPet*>(create(json, QString("SWGPet"))); SWGPet* output = static_cast<SWGPet*>(create(json, QString("SWGPet")));
worker->deleteLater(); worker->deleteLater();
emit getPetByIdSignal(output); emit getPetByIdSignal(output);
} }
void void
SWGPetApi::updatePetWithForm(QString* petId, QString* name, QString* status) { SWGPetApi::updatePet(SWGPet body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/pet");
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "PUT");
QString output = body.asJson();
input.request_body.append(output);
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGPetApi::updatePetCallback);
worker->execute(&input);
}
void
SWGPetApi::updatePetCallback(HttpRequestWorker * worker) {
QString msg;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
worker->deleteLater();
emit updatePetSignal();
}
void
SWGPetApi::updatePetWithForm(qint64 petId, QString* name, QString* status) {
QString fullPath; QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/pet/{petId}"); fullPath.append(this->host).append(this->basePath).append("/pet/{petId}");
QString petIdPathParam("{"); petIdPathParam.append("petId").append("}"); QString petIdPathParam("{"); petIdPathParam.append("petId").append("}");
fullPath.replace(petIdPathParam, stringValue(petId)); fullPath.replace(petIdPathParam, stringValue(petId));
HttpRequestWorker *worker = new HttpRequestWorker(); HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "POST"); HttpRequestInput input(fullPath, "POST");
if (name != NULL) { if (name != NULL) {
input.add_var("name", *name); input.add_var("name", *name);
} }
if (status != NULL) { if (status != NULL) {
input.add_var("status", *status); input.add_var("status", *status);
} }
connect(worker, connect(worker,
&HttpRequestWorker::on_execution_finished, &HttpRequestWorker::on_execution_finished,
this, this,
@ -429,80 +423,27 @@ SWGPetApi::updatePetWithFormCallback(HttpRequestWorker * worker) {
emit updatePetWithFormSignal(); emit updatePetWithFormSignal();
} }
void void
SWGPetApi::deletePet(qint64 petId, QString* apiKey) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/pet/{petId}");
QString petIdPathParam("{"); petIdPathParam.append("petId").append("}");
fullPath.replace(petIdPathParam, stringValue(petId));
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "DELETE");
// TODO: add header support
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGPetApi::deletePetCallback);
worker->execute(&input);
}
void
SWGPetApi::deletePetCallback(HttpRequestWorker * worker) {
QString msg;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
worker->deleteLater();
emit deletePetSignal();
}
void
SWGPetApi::uploadFile(qint64 petId, QString* additionalMetadata, SWGHttpRequestInputFileElement* file) { SWGPetApi::uploadFile(qint64 petId, QString* additionalMetadata, SWGHttpRequestInputFileElement* file) {
QString fullPath; QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/pet/{petId}/uploadImage"); fullPath.append(this->host).append(this->basePath).append("/pet/{petId}/uploadImage");
QString petIdPathParam("{"); petIdPathParam.append("petId").append("}"); QString petIdPathParam("{"); petIdPathParam.append("petId").append("}");
fullPath.replace(petIdPathParam, stringValue(petId)); fullPath.replace(petIdPathParam, stringValue(petId));
HttpRequestWorker *worker = new HttpRequestWorker(); HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "POST"); HttpRequestInput input(fullPath, "POST");
if (additionalMetadata != NULL) { if (additionalMetadata != NULL) {
input.add_var("additionalMetadata", *additionalMetadata); input.add_var("additionalMetadata", *additionalMetadata);
} }
if (file != NULL) { if (file != NULL) {
input.add_file("file", *file.local_filename, *file.request_filename, *file.mime_type); input.add_file("file", *file.local_filename, *file.request_filename, *file.mime_type);
} }
connect(worker, connect(worker,
&HttpRequestWorker::on_execution_finished, &HttpRequestWorker::on_execution_finished,
this, this,
@ -522,113 +463,13 @@ SWGPetApi::uploadFileCallback(HttpRequestWorker * worker) {
} }
QString json(worker->response);
worker->deleteLater(); SWGApiResponse* output = static_cast<SWGApiResponse*>(create(json, QString("SWGApiResponse")));
emit uploadFileSignal();
}
void
SWGPetApi::getPetByIdWithByteArray(qint64 petId) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/pet/{petId}?testing_byte_array=true");
QString petIdPathParam("{"); petIdPathParam.append("petId").append("}");
fullPath.replace(petIdPathParam, stringValue(petId));
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "GET");
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGPetApi::getPetByIdWithByteArrayCallback);
worker->execute(&input);
}
void
SWGPetApi::getPetByIdWithByteArrayCallback(HttpRequestWorker * worker) {
QString msg;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
QString json(worker->response);
QString* output = static_cast<QString*>(create(json, QString("QString")));
worker->deleteLater(); worker->deleteLater();
emit getPetByIdWithByteArraySignal(output); emit uploadFileSignal(output);
} }
void
SWGPetApi::addPetUsingByteArray(QString* body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/pet?testing_byte_array=true");
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "POST");
QString output = body.asJson();
input.request_body.append(output);
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGPetApi::addPetUsingByteArrayCallback);
worker->execute(&input);
}
void
SWGPetApi::addPetUsingByteArrayCallback(HttpRequestWorker * worker) {
QString msg;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
worker->deleteLater();
emit addPetUsingByteArraySignal();
}
} /* namespace Swagger */ } /* namespace Swagger */

View File

@ -5,6 +5,7 @@
#include "SWGPet.h" #include "SWGPet.h"
#include <QString> #include <QString>
#include "SWGApiResponse.h"
#include "SWGHttpRequest.h" #include "SWGHttpRequest.h"
#include <QObject> #include <QObject>
@ -22,40 +23,34 @@ public:
QString host; QString host;
QString basePath; QString basePath;
void updatePet(SWGPet body);
void addPet(SWGPet body); void addPet(SWGPet body);
void deletePet(qint64 petId, QString* apiKey);
void findPetsByStatus(QList<QString*>* status); void findPetsByStatus(QList<QString*>* status);
void findPetsByTags(QList<QString*>* tags); void findPetsByTags(QList<QString*>* tags);
void getPetById(qint64 petId); void getPetById(qint64 petId);
void updatePetWithForm(QString* petId, QString* name, QString* status); void updatePet(SWGPet body);
void deletePet(qint64 petId, QString* apiKey); void updatePetWithForm(qint64 petId, QString* name, QString* status);
void uploadFile(qint64 petId, QString* additionalMetadata, SWGHttpRequestInputFileElement* file); void uploadFile(qint64 petId, QString* additionalMetadata, SWGHttpRequestInputFileElement* file);
void getPetByIdWithByteArray(qint64 petId);
void addPetUsingByteArray(QString* body);
private: private:
void updatePetCallback (HttpRequestWorker * worker);
void addPetCallback (HttpRequestWorker * worker); void addPetCallback (HttpRequestWorker * worker);
void deletePetCallback (HttpRequestWorker * worker);
void findPetsByStatusCallback (HttpRequestWorker * worker); void findPetsByStatusCallback (HttpRequestWorker * worker);
void findPetsByTagsCallback (HttpRequestWorker * worker); void findPetsByTagsCallback (HttpRequestWorker * worker);
void getPetByIdCallback (HttpRequestWorker * worker); void getPetByIdCallback (HttpRequestWorker * worker);
void updatePetCallback (HttpRequestWorker * worker);
void updatePetWithFormCallback (HttpRequestWorker * worker); void updatePetWithFormCallback (HttpRequestWorker * worker);
void deletePetCallback (HttpRequestWorker * worker);
void uploadFileCallback (HttpRequestWorker * worker); void uploadFileCallback (HttpRequestWorker * worker);
void getPetByIdWithByteArrayCallback (HttpRequestWorker * worker);
void addPetUsingByteArrayCallback (HttpRequestWorker * worker);
signals: signals:
void updatePetSignal();
void addPetSignal(); void addPetSignal();
void deletePetSignal();
void findPetsByStatusSignal(QList<SWGPet*>* summary); void findPetsByStatusSignal(QList<SWGPet*>* summary);
void findPetsByTagsSignal(QList<SWGPet*>* summary); void findPetsByTagsSignal(QList<SWGPet*>* summary);
void getPetByIdSignal(SWGPet* summary); void getPetByIdSignal(SWGPet* summary);
void updatePetSignal();
void updatePetWithFormSignal(); void updatePetWithFormSignal();
void deletePetSignal(); void uploadFileSignal(SWGApiResponse* summary);
void uploadFileSignal();
void getPetByIdWithByteArraySignal(QString* summary);
void addPetUsingByteArraySignal();
}; };
} }

View File

@ -15,193 +15,15 @@ SWGStoreApi::SWGStoreApi(QString host, QString basePath) {
this->basePath = basePath; this->basePath = basePath;
} }
void
SWGStoreApi::getInventory() {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/store/inventory");
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "GET");
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGStoreApi::getInventoryCallback);
worker->execute(&input);
}
void
SWGStoreApi::getInventoryCallback(HttpRequestWorker * worker) {
QString msg;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
QMap<QString, qint32>* output = new QMap<QString, qint32>();
QString json(worker->response);
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject obj = doc.object();
foreach(QString key, obj.keys()) {
qint32* val;
setValue(&val, obj[key], "QMap", "");
output->insert(key, *val);
}
worker->deleteLater();
emit getInventorySignal(output);
}
void
SWGStoreApi::placeOrder(SWGOrder body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/store/order");
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "POST");
QString output = body.asJson();
input.request_body.append(output);
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGStoreApi::placeOrderCallback);
worker->execute(&input);
}
void
SWGStoreApi::placeOrderCallback(HttpRequestWorker * worker) {
QString msg;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
QString json(worker->response);
SWGOrder* output = static_cast<SWGOrder*>(create(json, QString("SWGOrder")));
worker->deleteLater();
emit placeOrderSignal(output);
}
void
SWGStoreApi::getOrderById(QString* orderId) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/store/order/{orderId}");
QString orderIdPathParam("{"); orderIdPathParam.append("orderId").append("}");
fullPath.replace(orderIdPathParam, stringValue(orderId));
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "GET");
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGStoreApi::getOrderByIdCallback);
worker->execute(&input);
}
void
SWGStoreApi::getOrderByIdCallback(HttpRequestWorker * worker) {
QString msg;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
QString json(worker->response);
SWGOrder* output = static_cast<SWGOrder*>(create(json, QString("SWGOrder")));
worker->deleteLater();
emit getOrderByIdSignal(output);
}
void void
SWGStoreApi::deleteOrder(QString* orderId) { SWGStoreApi::deleteOrder(QString* orderId) {
QString fullPath; QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/store/order/{orderId}"); fullPath.append(this->host).append(this->basePath).append("/store/order/{orderId}");
QString orderIdPathParam("{"); orderIdPathParam.append("orderId").append("}"); QString orderIdPathParam("{"); orderIdPathParam.append("orderId").append("}");
fullPath.replace(orderIdPathParam, stringValue(orderId)); fullPath.replace(orderIdPathParam, stringValue(orderId));
HttpRequestWorker *worker = new HttpRequestWorker(); HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "DELETE"); HttpRequestInput input(fullPath, "DELETE");
@ -209,8 +31,6 @@ SWGStoreApi::deleteOrder(QString* orderId) {
connect(worker, connect(worker,
&HttpRequestWorker::on_execution_finished, &HttpRequestWorker::on_execution_finished,
this, this,
@ -236,4 +56,146 @@ SWGStoreApi::deleteOrderCallback(HttpRequestWorker * worker) {
emit deleteOrderSignal(); emit deleteOrderSignal();
} }
void
SWGStoreApi::getInventory() {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/store/inventory");
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "GET");
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGStoreApi::getInventoryCallback);
worker->execute(&input);
}
void
SWGStoreApi::getInventoryCallback(HttpRequestWorker * worker) {
QString msg;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
QMap<QString, qint32>* output = new QMap<QString, qint32>();
QString json(worker->response);
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject obj = doc.object();
foreach(QString key, obj.keys()) {
qint32* val;
setValue(&val, obj[key], "QMap", "");
output->insert(key, *val);
}
worker->deleteLater();
emit getInventorySignal(output);
}
void
SWGStoreApi::getOrderById(qint64 orderId) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/store/order/{orderId}");
QString orderIdPathParam("{"); orderIdPathParam.append("orderId").append("}");
fullPath.replace(orderIdPathParam, stringValue(orderId));
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "GET");
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGStoreApi::getOrderByIdCallback);
worker->execute(&input);
}
void
SWGStoreApi::getOrderByIdCallback(HttpRequestWorker * worker) {
QString msg;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
QString json(worker->response);
SWGOrder* output = static_cast<SWGOrder*>(create(json, QString("SWGOrder")));
worker->deleteLater();
emit getOrderByIdSignal(output);
}
void
SWGStoreApi::placeOrder(SWGOrder body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/store/order");
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "POST");
QString output = body.asJson();
input.request_body.append(output);
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGStoreApi::placeOrderCallback);
worker->execute(&input);
}
void
SWGStoreApi::placeOrderCallback(HttpRequestWorker * worker) {
QString msg;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
QString json(worker->response);
SWGOrder* output = static_cast<SWGOrder*>(create(json, QString("SWGOrder")));
worker->deleteLater();
emit placeOrderSignal(output);
}
} /* namespace Swagger */ } /* namespace Swagger */

View File

@ -3,9 +3,9 @@
#include "SWGHttpRequest.h" #include "SWGHttpRequest.h"
#include <QString>
#include "QMap.h" #include "QMap.h"
#include "SWGOrder.h" #include "SWGOrder.h"
#include <QString>
#include <QObject> #include <QObject>
@ -22,22 +22,22 @@ public:
QString host; QString host;
QString basePath; QString basePath;
void getInventory();
void placeOrder(SWGOrder body);
void getOrderById(QString* orderId);
void deleteOrder(QString* orderId); void deleteOrder(QString* orderId);
void getInventory();
void getOrderById(qint64 orderId);
void placeOrder(SWGOrder body);
private: private:
void getInventoryCallback (HttpRequestWorker * worker);
void placeOrderCallback (HttpRequestWorker * worker);
void getOrderByIdCallback (HttpRequestWorker * worker);
void deleteOrderCallback (HttpRequestWorker * worker); void deleteOrderCallback (HttpRequestWorker * worker);
void getInventoryCallback (HttpRequestWorker * worker);
void getOrderByIdCallback (HttpRequestWorker * worker);
void placeOrderCallback (HttpRequestWorker * worker);
signals: signals:
void getInventorySignal(QMap<QString, qint32>* summary);
void placeOrderSignal(SWGOrder* summary);
void getOrderByIdSignal(SWGOrder* summary);
void deleteOrderSignal(); void deleteOrderSignal();
void getInventorySignal(QMap<QString, qint32>* summary);
void getOrderByIdSignal(SWGOrder* summary);
void placeOrderSignal(SWGOrder* summary);
}; };
} }

View File

@ -27,17 +27,15 @@ SWGTag::~SWGTag() {
void void
SWGTag::init() { SWGTag::init() {
id = 0L; id = 0L;
name = new QString(""); name = new QString("");
} }
void void
SWGTag::cleanup() { SWGTag::cleanup() {
if(name != NULL) { if(name != NULL) {
delete name; delete name;
} }
} }
SWGTag* SWGTag*
@ -52,8 +50,7 @@ SWGTag::fromJson(QString &json) {
void void
SWGTag::fromJsonObject(QJsonObject &pJson) { SWGTag::fromJsonObject(QJsonObject &pJson) {
setValue(&id, pJson["id"], "qint64", ""); setValue(&id, pJson["id"], "qint64", "");
setValue(&name, pJson["name"], "QString", "QString"); setValue(&name, pJson["name"], "QString", "QString");
} }
QString QString
@ -76,8 +73,6 @@ SWGTag::asJsonObject() {
return obj; return obj;
} }

View File

@ -32,14 +32,12 @@ public:
qint64 getId(); qint64 getId();
void setId(qint64 id); void setId(qint64 id);
QString* getName(); QString* getName();
void setName(QString* name); void setName(QString* name);
private: private:
qint64 id; qint64 id;
QString* name; QString* name;
}; };
} /* namespace Swagger */ } /* namespace Swagger */

View File

@ -27,39 +27,37 @@ SWGUser::~SWGUser() {
void void
SWGUser::init() { SWGUser::init() {
id = 0L; id = 0L;
username = new QString(""); username = new QString("");
firstName = new QString(""); firstName = new QString("");
lastName = new QString(""); lastName = new QString("");
email = new QString(""); email = new QString("");
password = new QString(""); password = new QString("");
phone = new QString(""); phone = new QString("");
userStatus = 0; userStatus = 0;
} }
void void
SWGUser::cleanup() { SWGUser::cleanup() {
if(username != NULL) { if(username != NULL) {
delete username; delete username;
} }
if(firstName != NULL) { if(firstName != NULL) {
delete firstName; delete firstName;
} }
if(lastName != NULL) { if(lastName != NULL) {
delete lastName; delete lastName;
} }
if(email != NULL) { if(email != NULL) {
delete email; delete email;
} }
if(password != NULL) { if(password != NULL) {
delete password; delete password;
} }
if(phone != NULL) { if(phone != NULL) {
delete phone; delete phone;
} }
} }
SWGUser* SWGUser*
@ -74,14 +72,13 @@ SWGUser::fromJson(QString &json) {
void void
SWGUser::fromJsonObject(QJsonObject &pJson) { SWGUser::fromJsonObject(QJsonObject &pJson) {
setValue(&id, pJson["id"], "qint64", ""); setValue(&id, pJson["id"], "qint64", "");
setValue(&username, pJson["username"], "QString", "QString"); setValue(&username, pJson["username"], "QString", "QString");
setValue(&firstName, pJson["firstName"], "QString", "QString"); setValue(&firstName, pJson["firstName"], "QString", "QString");
setValue(&lastName, pJson["lastName"], "QString", "QString"); setValue(&lastName, pJson["lastName"], "QString", "QString");
setValue(&email, pJson["email"], "QString", "QString"); setValue(&email, pJson["email"], "QString", "QString");
setValue(&password, pJson["password"], "QString", "QString"); setValue(&password, pJson["password"], "QString", "QString");
setValue(&phone, pJson["phone"], "QString", "QString"); setValue(&phone, pJson["phone"], "QString", "QString");
setValue(&userStatus, pJson["userStatus"], "qint32", ""); setValue(&userStatus, pJson["userStatus"], "qint32", "");
} }
QString QString
@ -105,37 +102,30 @@ SWGUser::asJsonObject() {
toJsonValue(QString("firstName"), firstName, obj, QString("QString")); toJsonValue(QString("firstName"), firstName, obj, QString("QString"));
toJsonValue(QString("lastName"), lastName, obj, QString("QString")); toJsonValue(QString("lastName"), lastName, obj, QString("QString"));
toJsonValue(QString("email"), email, obj, QString("QString")); toJsonValue(QString("email"), email, obj, QString("QString"));
toJsonValue(QString("password"), password, obj, QString("QString")); toJsonValue(QString("password"), password, obj, QString("QString"));
toJsonValue(QString("phone"), phone, obj, QString("QString")); toJsonValue(QString("phone"), phone, obj, QString("QString"));
obj->insert("userStatus", QJsonValue(userStatus));
obj->insert("userStatus", QJsonValue(userStatus));
return obj; return obj;
} }

View File

@ -32,32 +32,30 @@ public:
qint64 getId(); qint64 getId();
void setId(qint64 id); void setId(qint64 id);
QString* getUsername(); QString* getUsername();
void setUsername(QString* username); void setUsername(QString* username);
QString* getFirstName(); QString* getFirstName();
void setFirstName(QString* firstName); void setFirstName(QString* firstName);
QString* getLastName(); QString* getLastName();
void setLastName(QString* lastName); void setLastName(QString* lastName);
QString* getEmail(); QString* getEmail();
void setEmail(QString* email); void setEmail(QString* email);
QString* getPassword(); QString* getPassword();
void setPassword(QString* password); void setPassword(QString* password);
QString* getPhone(); QString* getPhone();
void setPhone(QString* phone); void setPhone(QString* phone);
qint32 getUserStatus(); qint32 getUserStatus();
void setUserStatus(qint32 userStatus); void setUserStatus(qint32 userStatus);
private: private:
qint64 id; qint64 id;
QString* username; QString* username;
QString* firstName; QString* firstName;
QString* lastName; QString* lastName;
QString* email; QString* email;
QString* password; QString* password;
QString* phone; QString* phone;
qint32 userStatus; qint32 userStatus;
}; };
} /* namespace Swagger */ } /* namespace Swagger */

View File

@ -22,22 +22,15 @@ SWGUserApi::createUser(SWGUser body) {
HttpRequestWorker *worker = new HttpRequestWorker(); HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "POST"); HttpRequestInput input(fullPath, "POST");
QString output = body.asJson(); QString output = body.asJson();
input.request_body.append(output); input.request_body.append(output);
connect(worker, connect(worker,
&HttpRequestWorker::on_execution_finished, &HttpRequestWorker::on_execution_finished,
this, this,
@ -70,15 +63,10 @@ SWGUserApi::createUsersWithArrayInput(QList<SWGUser*>* body) {
HttpRequestWorker *worker = new HttpRequestWorker(); HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "POST"); HttpRequestInput input(fullPath, "POST");
QJsonArray* bodyArray = new QJsonArray(); QJsonArray* bodyArray = new QJsonArray();
toJsonArray((QList<void*>*)body, bodyArray, QString("body"), QString("SWGUser*")); toJsonArray((QList<void*>*)body, bodyArray, QString("body"), QString("SWGUser*"));
@ -89,8 +77,6 @@ SWGUserApi::createUsersWithArrayInput(QList<SWGUser*>* body) {
connect(worker, connect(worker,
&HttpRequestWorker::on_execution_finished, &HttpRequestWorker::on_execution_finished,
this, this,
@ -123,15 +109,10 @@ SWGUserApi::createUsersWithListInput(QList<SWGUser*>* body) {
HttpRequestWorker *worker = new HttpRequestWorker(); HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "POST"); HttpRequestInput input(fullPath, "POST");
QJsonArray* bodyArray = new QJsonArray(); QJsonArray* bodyArray = new QJsonArray();
toJsonArray((QList<void*>*)body, bodyArray, QString("body"), QString("SWGUser*")); toJsonArray((QList<void*>*)body, bodyArray, QString("body"), QString("SWGUser*"));
@ -142,8 +123,6 @@ SWGUserApi::createUsersWithListInput(QList<SWGUser*>* body) {
connect(worker, connect(worker,
&HttpRequestWorker::on_execution_finished, &HttpRequestWorker::on_execution_finished,
this, this,
@ -170,14 +149,96 @@ SWGUserApi::createUsersWithListInputCallback(HttpRequestWorker * worker) {
emit createUsersWithListInputSignal(); emit createUsersWithListInputSignal();
} }
void void
SWGUserApi::deleteUser(QString* username) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/user/{username}");
QString usernamePathParam("{"); usernamePathParam.append("username").append("}");
fullPath.replace(usernamePathParam, stringValue(username));
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "DELETE");
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGUserApi::deleteUserCallback);
worker->execute(&input);
}
void
SWGUserApi::deleteUserCallback(HttpRequestWorker * worker) {
QString msg;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
worker->deleteLater();
emit deleteUserSignal();
}
void
SWGUserApi::getUserByName(QString* username) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/user/{username}");
QString usernamePathParam("{"); usernamePathParam.append("username").append("}");
fullPath.replace(usernamePathParam, stringValue(username));
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "GET");
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGUserApi::getUserByNameCallback);
worker->execute(&input);
}
void
SWGUserApi::getUserByNameCallback(HttpRequestWorker * worker) {
QString msg;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
QString json(worker->response);
SWGUser* output = static_cast<SWGUser*>(create(json, QString("SWGUser")));
worker->deleteLater();
emit getUserByNameSignal(output);
}
void
SWGUserApi::loginUser(QString* username, QString* password) { SWGUserApi::loginUser(QString* username, QString* password) {
QString fullPath; QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/user/login"); fullPath.append(this->host).append(this->basePath).append("/user/login");
if (fullPath.indexOf("?") > 0) if (fullPath.indexOf("?") > 0)
fullPath.append("&"); fullPath.append("&");
else else
@ -186,10 +247,6 @@ SWGUserApi::loginUser(QString* username, QString* password) {
.append("=") .append("=")
.append(QUrl::toPercentEncoding(stringValue(username))); .append(QUrl::toPercentEncoding(stringValue(username)));
if (fullPath.indexOf("?") > 0) if (fullPath.indexOf("?") > 0)
fullPath.append("&"); fullPath.append("&");
else else
@ -199,9 +256,6 @@ SWGUserApi::loginUser(QString* username, QString* password) {
.append(QUrl::toPercentEncoding(stringValue(password))); .append(QUrl::toPercentEncoding(stringValue(password)));
HttpRequestWorker *worker = new HttpRequestWorker(); HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "GET"); HttpRequestInput input(fullPath, "GET");
@ -209,8 +263,6 @@ SWGUserApi::loginUser(QString* username, QString* password) {
connect(worker, connect(worker,
&HttpRequestWorker::on_execution_finished, &HttpRequestWorker::on_execution_finished,
this, this,
@ -230,16 +282,10 @@ SWGUserApi::loginUserCallback(HttpRequestWorker * worker) {
} }
QString json(worker->response);
QString json(worker->response);
QString* output = static_cast<QString*>(create(json, QString("QString"))); QString* output = static_cast<QString*>(create(json, QString("QString")));
worker->deleteLater(); worker->deleteLater();
emit loginUserSignal(output); emit loginUserSignal(output);
@ -252,8 +298,6 @@ SWGUserApi::logoutUser() {
HttpRequestWorker *worker = new HttpRequestWorker(); HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "GET"); HttpRequestInput input(fullPath, "GET");
@ -261,8 +305,6 @@ SWGUserApi::logoutUser() {
connect(worker, connect(worker,
&HttpRequestWorker::on_execution_finished, &HttpRequestWorker::on_execution_finished,
this, this,
@ -289,86 +331,23 @@ SWGUserApi::logoutUserCallback(HttpRequestWorker * worker) {
emit logoutUserSignal(); emit logoutUserSignal();
} }
void void
SWGUserApi::getUserByName(QString* username) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/user/{username}");
QString usernamePathParam("{"); usernamePathParam.append("username").append("}");
fullPath.replace(usernamePathParam, stringValue(username));
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "GET");
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGUserApi::getUserByNameCallback);
worker->execute(&input);
}
void
SWGUserApi::getUserByNameCallback(HttpRequestWorker * worker) {
QString msg;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
QString json(worker->response);
SWGUser* output = static_cast<SWGUser*>(create(json, QString("SWGUser")));
worker->deleteLater();
emit getUserByNameSignal(output);
}
void
SWGUserApi::updateUser(QString* username, SWGUser body) { SWGUserApi::updateUser(QString* username, SWGUser body) {
QString fullPath; QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/user/{username}"); fullPath.append(this->host).append(this->basePath).append("/user/{username}");
QString usernamePathParam("{"); usernamePathParam.append("username").append("}"); QString usernamePathParam("{"); usernamePathParam.append("username").append("}");
fullPath.replace(usernamePathParam, stringValue(username)); fullPath.replace(usernamePathParam, stringValue(username));
HttpRequestWorker *worker = new HttpRequestWorker(); HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "PUT"); HttpRequestInput input(fullPath, "PUT");
QString output = body.asJson(); QString output = body.asJson();
input.request_body.append(output); input.request_body.append(output);
connect(worker, connect(worker,
&HttpRequestWorker::on_execution_finished, &HttpRequestWorker::on_execution_finished,
this, this,
@ -394,50 +373,4 @@ SWGUserApi::updateUserCallback(HttpRequestWorker * worker) {
emit updateUserSignal(); emit updateUserSignal();
} }
void
SWGUserApi::deleteUser(QString* username) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/user/{username}");
QString usernamePathParam("{"); usernamePathParam.append("username").append("}");
fullPath.replace(usernamePathParam, stringValue(username));
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "DELETE");
connect(worker,
&HttpRequestWorker::on_execution_finished,
this,
&SWGUserApi::deleteUserCallback);
worker->execute(&input);
}
void
SWGUserApi::deleteUserCallback(HttpRequestWorker * worker) {
QString msg;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
worker->deleteLater();
emit deleteUserSignal();
}
} /* namespace Swagger */ } /* namespace Swagger */

View File

@ -25,31 +25,31 @@ public:
void createUser(SWGUser body); void createUser(SWGUser body);
void createUsersWithArrayInput(QList<SWGUser*>* body); void createUsersWithArrayInput(QList<SWGUser*>* body);
void createUsersWithListInput(QList<SWGUser*>* body); void createUsersWithListInput(QList<SWGUser*>* body);
void deleteUser(QString* username);
void getUserByName(QString* username);
void loginUser(QString* username, QString* password); void loginUser(QString* username, QString* password);
void logoutUser(); void logoutUser();
void getUserByName(QString* username);
void updateUser(QString* username, SWGUser body); void updateUser(QString* username, SWGUser body);
void deleteUser(QString* username);
private: private:
void createUserCallback (HttpRequestWorker * worker); void createUserCallback (HttpRequestWorker * worker);
void createUsersWithArrayInputCallback (HttpRequestWorker * worker); void createUsersWithArrayInputCallback (HttpRequestWorker * worker);
void createUsersWithListInputCallback (HttpRequestWorker * worker); void createUsersWithListInputCallback (HttpRequestWorker * worker);
void deleteUserCallback (HttpRequestWorker * worker);
void getUserByNameCallback (HttpRequestWorker * worker);
void loginUserCallback (HttpRequestWorker * worker); void loginUserCallback (HttpRequestWorker * worker);
void logoutUserCallback (HttpRequestWorker * worker); void logoutUserCallback (HttpRequestWorker * worker);
void getUserByNameCallback (HttpRequestWorker * worker);
void updateUserCallback (HttpRequestWorker * worker); void updateUserCallback (HttpRequestWorker * worker);
void deleteUserCallback (HttpRequestWorker * worker);
signals: signals:
void createUserSignal(); void createUserSignal();
void createUsersWithArrayInputSignal(); void createUsersWithArrayInputSignal();
void createUsersWithListInputSignal(); void createUsersWithListInputSignal();
void deleteUserSignal();
void getUserByNameSignal(SWGUser* summary);
void loginUserSignal(QString* summary); void loginUserSignal(QString* summary);
void logoutUserSignal(); void logoutUserSignal();
void getUserByNameSignal(SWGUser* summary);
void updateUserSignal(); void updateUserSignal();
void deleteUserSignal();
}; };
} }

View File

@ -0,0 +1,203 @@
#include "SamiApiResponse.h"
#include <FLocales.h>
using namespace Tizen::Base;
using namespace Tizen::System;
using namespace Tizen::Base::Utility;
using namespace Tizen::Base::Collection;
using namespace Tizen::Web::Json;
using namespace Tizen::Locales;
namespace Swagger {
SamiApiResponse::SamiApiResponse() {
init();
}
SamiApiResponse::~SamiApiResponse() {
this->cleanup();
}
void
SamiApiResponse::init() {
pCode = null;
pType = null;
pMessage = null;
}
void
SamiApiResponse::cleanup() {
if(pCode != null) {
delete pCode;
pCode = null;
}
if(pType != null) {
delete pType;
pType = null;
}
if(pMessage != null) {
delete pMessage;
pMessage = null;
}
}
SamiApiResponse*
SamiApiResponse::fromJson(String* json) {
this->cleanup();
String str(json->GetPointer());
int length = str.GetLength();
ByteBuffer buffer;
buffer.Construct(length);
for (int i = 0; i < length; ++i) {
byte b = str[i];
buffer.SetByte(b);
}
IJsonValue* pJson = JsonParser::ParseN(buffer);
fromJsonObject(pJson);
if (pJson->GetType() == JSON_TYPE_OBJECT) {
JsonObject* pObject = static_cast< JsonObject* >(pJson);
pObject->RemoveAll(true);
}
else if (pJson->GetType() == JSON_TYPE_ARRAY) {
JsonArray* pArray = static_cast< JsonArray* >(pJson);
pArray->RemoveAll(true);
}
delete pJson;
return this;
}
void
SamiApiResponse::fromJsonObject(IJsonValue* pJson) {
JsonObject* pJsonObject = static_cast< JsonObject* >(pJson);
if(pJsonObject != null) {
JsonString* pCodeKey = new JsonString(L"code");
IJsonValue* pCodeVal = null;
pJsonObject->GetValue(pCodeKey, pCodeVal);
if(pCodeVal != null) {
pCode = new Integer();
jsonToValue(pCode, pCodeVal, L"Integer", L"Integer");
}
delete pCodeKey;
JsonString* pTypeKey = new JsonString(L"type");
IJsonValue* pTypeVal = null;
pJsonObject->GetValue(pTypeKey, pTypeVal);
if(pTypeVal != null) {
pType = new String();
jsonToValue(pType, pTypeVal, L"String", L"String");
}
delete pTypeKey;
JsonString* pMessageKey = new JsonString(L"message");
IJsonValue* pMessageVal = null;
pJsonObject->GetValue(pMessageKey, pMessageVal);
if(pMessageVal != null) {
pMessage = new String();
jsonToValue(pMessage, pMessageVal, L"String", L"String");
}
delete pMessageKey;
}
}
SamiApiResponse::SamiApiResponse(String* json) {
init();
String str(json->GetPointer());
int length = str.GetLength();
ByteBuffer buffer;
buffer.Construct(length);
for (int i = 0; i < length; ++i) {
byte b = str[i];
buffer.SetByte(b);
}
IJsonValue* pJson = JsonParser::ParseN(buffer);
fromJsonObject(pJson);
if (pJson->GetType() == JSON_TYPE_OBJECT) {
JsonObject* pObject = static_cast< JsonObject* >(pJson);
pObject->RemoveAll(true);
}
else if (pJson->GetType() == JSON_TYPE_ARRAY) {
JsonArray* pArray = static_cast< JsonArray* >(pJson);
pArray->RemoveAll(true);
}
delete pJson;
}
String
SamiApiResponse::asJson ()
{
JsonObject* pJsonObject = asJsonObject();
char *pComposeBuf = new char[256];
JsonWriter::Compose(pJsonObject, pComposeBuf, 256);
String s = String(pComposeBuf);
delete pComposeBuf;
pJsonObject->RemoveAll(true);
delete pJsonObject;
return s;
}
JsonObject*
SamiApiResponse::asJsonObject() {
JsonObject *pJsonObject = new JsonObject();
pJsonObject->Construct();
JsonString *pCodeKey = new JsonString(L"code");
pJsonObject->Add(pCodeKey, toJson(getPCode(), "Integer", ""));
JsonString *pTypeKey = new JsonString(L"type");
pJsonObject->Add(pTypeKey, toJson(getPType(), "String", ""));
JsonString *pMessageKey = new JsonString(L"message");
pJsonObject->Add(pMessageKey, toJson(getPMessage(), "String", ""));
return pJsonObject;
}
Integer*
SamiApiResponse::getPCode() {
return pCode;
}
void
SamiApiResponse::setPCode(Integer* pCode) {
this->pCode = pCode;
}
String*
SamiApiResponse::getPType() {
return pType;
}
void
SamiApiResponse::setPType(String* pType) {
this->pType = pType;
}
String*
SamiApiResponse::getPMessage() {
return pMessage;
}
void
SamiApiResponse::setPMessage(String* pMessage) {
this->pMessage = pMessage;
}
} /* namespace Swagger */

View File

@ -0,0 +1,59 @@
/*
* SamiApiResponse.h
*
*
*/
#ifndef SamiApiResponse_H_
#define SamiApiResponse_H_
#include <FApp.h>
#include <FBase.h>
#include <FSystem.h>
#include <FWebJson.h>
#include "SamiHelpers.h"
#include "SamiObject.h"
using namespace Tizen::Web::Json;
using Tizen::Base::Integer;
using Tizen::Base::String;
namespace Swagger {
class SamiApiResponse: public SamiObject {
public:
SamiApiResponse();
SamiApiResponse(String* json);
virtual ~SamiApiResponse();
void init();
void cleanup();
String asJson ();
JsonObject* asJsonObject();
void fromJsonObject(IJsonValue* json);
SamiApiResponse* fromJson(String* obj);
Integer* getPCode();
void setPCode(Integer* pCode);
String* getPType();
void setPType(String* pType);
String* getPMessage();
void setPMessage(String* pMessage);
private:
Integer* pCode;
String* pType;
String* pMessage;
};
} /* namespace Swagger */
#endif /* SamiApiResponse_H_ */

View File

@ -23,8 +23,7 @@ SamiCategory::~SamiCategory() {
void void
SamiCategory::init() { SamiCategory::init() {
pId = null; pId = null;
pName = null; pName = null;
} }
void void
@ -34,12 +33,11 @@ SamiCategory::cleanup() {
delete pId; delete pId;
pId = null; pId = null;
} }
if(pName != null) { if(pName != null) {
delete pName; delete pName;
pName = null; pName = null;
} }
} }
@ -86,7 +84,7 @@ SamiCategory::fromJsonObject(IJsonValue* pJson) {
jsonToValue(pId, pIdVal, L"Long", L"Long"); jsonToValue(pId, pIdVal, L"Long", L"Long");
} }
delete pIdKey; delete pIdKey;
JsonString* pNameKey = new JsonString(L"name"); JsonString* pNameKey = new JsonString(L"name");
IJsonValue* pNameVal = null; IJsonValue* pNameVal = null;
pJsonObject->GetValue(pNameKey, pNameVal); pJsonObject->GetValue(pNameKey, pNameVal);
if(pNameVal != null) { if(pNameVal != null) {
@ -95,7 +93,6 @@ SamiCategory::fromJsonObject(IJsonValue* pJson) {
jsonToValue(pName, pNameVal, L"String", L"String"); jsonToValue(pName, pNameVal, L"String", L"String");
} }
delete pNameKey; delete pNameKey;
} }
} }
@ -146,15 +143,12 @@ SamiCategory::asJsonObject() {
JsonObject *pJsonObject = new JsonObject(); JsonObject *pJsonObject = new JsonObject();
pJsonObject->Construct(); pJsonObject->Construct();
JsonString *pIdKey = new JsonString(L"id"); JsonString *pIdKey = new JsonString(L"id");
pJsonObject->Add(pIdKey, toJson(getPId(), "Long", "")); pJsonObject->Add(pIdKey, toJson(getPId(), "Long", ""));
JsonString *pNameKey = new JsonString(L"name"); JsonString *pNameKey = new JsonString(L"name");
pJsonObject->Add(pNameKey, toJson(getPName(), "String", "")); pJsonObject->Add(pNameKey, toJson(getPName(), "String", ""));
return pJsonObject; return pJsonObject;
} }

View File

@ -41,18 +41,14 @@ public:
SamiCategory* fromJson(String* obj); SamiCategory* fromJson(String* obj);
Long* getPId(); Long* getPId();
void setPId(Long* pId); void setPId(Long* pId);
String* getPName(); String* getPName();
void setPName(String* pName); void setPName(String* pName);
private: private:
Long* pId; Long* pId;
String* pName; String* pName;
}; };
} /* namespace Swagger */ } /* namespace Swagger */

View File

@ -3,29 +3,33 @@
#include "SamiObject.h" #include "SamiObject.h"
#include "SamiUser.h" #include "SamiApiResponse.h"
#include "SamiCategory.h" #include "SamiCategory.h"
#include "SamiOrder.h"
#include "SamiPet.h" #include "SamiPet.h"
#include "SamiTag.h" #include "SamiTag.h"
#include "SamiOrder.h" #include "SamiUser.h"
namespace Swagger { namespace Swagger {
void* void*
create(String type) { create(String type) {
if(type.Equals(L"SamiUser", true)) { if(type.Equals(L"SamiApiResponse", true)) {
return new SamiUser(); return new SamiApiResponse();
} }
if(type.Equals(L"SamiCategory", true)) { if(type.Equals(L"SamiCategory", true)) {
return new SamiCategory(); return new SamiCategory();
} }
if(type.Equals(L"SamiOrder", true)) {
return new SamiOrder();
}
if(type.Equals(L"SamiPet", true)) { if(type.Equals(L"SamiPet", true)) {
return new SamiPet(); return new SamiPet();
} }
if(type.Equals(L"SamiTag", true)) { if(type.Equals(L"SamiTag", true)) {
return new SamiTag(); return new SamiTag();
} }
if(type.Equals(L"SamiOrder", true)) { if(type.Equals(L"SamiUser", true)) {
return new SamiOrder(); return new SamiUser();
} }
if(type.Equals(L"String", true)) { if(type.Equals(L"String", true)) {

View File

@ -23,12 +23,11 @@ SamiOrder::~SamiOrder() {
void void
SamiOrder::init() { SamiOrder::init() {
pId = null; pId = null;
pPetId = null; pPetId = null;
pQuantity = null; pQuantity = null;
pShipDate = null; pShipDate = null;
pStatus = null; pStatus = null;
pComplete = null; pComplete = null;
} }
void void
@ -38,32 +37,31 @@ SamiOrder::cleanup() {
delete pId; delete pId;
pId = null; pId = null;
} }
if(pPetId != null) { if(pPetId != null) {
delete pPetId; delete pPetId;
pPetId = null; pPetId = null;
} }
if(pQuantity != null) { if(pQuantity != null) {
delete pQuantity; delete pQuantity;
pQuantity = null; pQuantity = null;
} }
if(pShipDate != null) { if(pShipDate != null) {
delete pShipDate; delete pShipDate;
pShipDate = null; pShipDate = null;
} }
if(pStatus != null) { if(pStatus != null) {
delete pStatus; delete pStatus;
pStatus = null; pStatus = null;
} }
if(pComplete != null) { if(pComplete != null) {
delete pComplete; delete pComplete;
pComplete = null; pComplete = null;
} }
} }
@ -110,7 +108,7 @@ SamiOrder::fromJsonObject(IJsonValue* pJson) {
jsonToValue(pId, pIdVal, L"Long", L"Long"); jsonToValue(pId, pIdVal, L"Long", L"Long");
} }
delete pIdKey; delete pIdKey;
JsonString* pPetIdKey = new JsonString(L"petId"); JsonString* pPetIdKey = new JsonString(L"petId");
IJsonValue* pPetIdVal = null; IJsonValue* pPetIdVal = null;
pJsonObject->GetValue(pPetIdKey, pPetIdVal); pJsonObject->GetValue(pPetIdKey, pPetIdVal);
if(pPetIdVal != null) { if(pPetIdVal != null) {
@ -119,7 +117,7 @@ SamiOrder::fromJsonObject(IJsonValue* pJson) {
jsonToValue(pPetId, pPetIdVal, L"Long", L"Long"); jsonToValue(pPetId, pPetIdVal, L"Long", L"Long");
} }
delete pPetIdKey; delete pPetIdKey;
JsonString* pQuantityKey = new JsonString(L"quantity"); JsonString* pQuantityKey = new JsonString(L"quantity");
IJsonValue* pQuantityVal = null; IJsonValue* pQuantityVal = null;
pJsonObject->GetValue(pQuantityKey, pQuantityVal); pJsonObject->GetValue(pQuantityKey, pQuantityVal);
if(pQuantityVal != null) { if(pQuantityVal != null) {
@ -128,7 +126,7 @@ SamiOrder::fromJsonObject(IJsonValue* pJson) {
jsonToValue(pQuantity, pQuantityVal, L"Integer", L"Integer"); jsonToValue(pQuantity, pQuantityVal, L"Integer", L"Integer");
} }
delete pQuantityKey; delete pQuantityKey;
JsonString* pShipDateKey = new JsonString(L"shipDate"); JsonString* pShipDateKey = new JsonString(L"shipDate");
IJsonValue* pShipDateVal = null; IJsonValue* pShipDateVal = null;
pJsonObject->GetValue(pShipDateKey, pShipDateVal); pJsonObject->GetValue(pShipDateKey, pShipDateVal);
if(pShipDateVal != null) { if(pShipDateVal != null) {
@ -137,7 +135,7 @@ SamiOrder::fromJsonObject(IJsonValue* pJson) {
jsonToValue(pShipDate, pShipDateVal, L"DateTime", L"DateTime"); jsonToValue(pShipDate, pShipDateVal, L"DateTime", L"DateTime");
} }
delete pShipDateKey; delete pShipDateKey;
JsonString* pStatusKey = new JsonString(L"status"); JsonString* pStatusKey = new JsonString(L"status");
IJsonValue* pStatusVal = null; IJsonValue* pStatusVal = null;
pJsonObject->GetValue(pStatusKey, pStatusVal); pJsonObject->GetValue(pStatusKey, pStatusVal);
if(pStatusVal != null) { if(pStatusVal != null) {
@ -146,7 +144,7 @@ SamiOrder::fromJsonObject(IJsonValue* pJson) {
jsonToValue(pStatus, pStatusVal, L"String", L"String"); jsonToValue(pStatus, pStatusVal, L"String", L"String");
} }
delete pStatusKey; delete pStatusKey;
JsonString* pCompleteKey = new JsonString(L"complete"); JsonString* pCompleteKey = new JsonString(L"complete");
IJsonValue* pCompleteVal = null; IJsonValue* pCompleteVal = null;
pJsonObject->GetValue(pCompleteKey, pCompleteVal); pJsonObject->GetValue(pCompleteKey, pCompleteVal);
if(pCompleteVal != null) { if(pCompleteVal != null) {
@ -155,7 +153,6 @@ SamiOrder::fromJsonObject(IJsonValue* pJson) {
jsonToValue(pComplete, pCompleteVal, L"Boolean", L"Boolean"); jsonToValue(pComplete, pCompleteVal, L"Boolean", L"Boolean");
} }
delete pCompleteKey; delete pCompleteKey;
} }
} }
@ -206,31 +203,24 @@ SamiOrder::asJsonObject() {
JsonObject *pJsonObject = new JsonObject(); JsonObject *pJsonObject = new JsonObject();
pJsonObject->Construct(); pJsonObject->Construct();
JsonString *pIdKey = new JsonString(L"id"); JsonString *pIdKey = new JsonString(L"id");
pJsonObject->Add(pIdKey, toJson(getPId(), "Long", "")); pJsonObject->Add(pIdKey, toJson(getPId(), "Long", ""));
JsonString *pPetIdKey = new JsonString(L"petId"); JsonString *pPetIdKey = new JsonString(L"petId");
pJsonObject->Add(pPetIdKey, toJson(getPPetId(), "Long", "")); pJsonObject->Add(pPetIdKey, toJson(getPPetId(), "Long", ""));
JsonString *pQuantityKey = new JsonString(L"quantity"); JsonString *pQuantityKey = new JsonString(L"quantity");
pJsonObject->Add(pQuantityKey, toJson(getPQuantity(), "Integer", "")); pJsonObject->Add(pQuantityKey, toJson(getPQuantity(), "Integer", ""));
JsonString *pShipDateKey = new JsonString(L"shipDate"); JsonString *pShipDateKey = new JsonString(L"shipDate");
pJsonObject->Add(pShipDateKey, toJson(getPShipDate(), "DateTime", "")); pJsonObject->Add(pShipDateKey, toJson(getPShipDate(), "DateTime", ""));
JsonString *pStatusKey = new JsonString(L"status"); JsonString *pStatusKey = new JsonString(L"status");
pJsonObject->Add(pStatusKey, toJson(getPStatus(), "String", "")); pJsonObject->Add(pStatusKey, toJson(getPStatus(), "String", ""));
JsonString *pCompleteKey = new JsonString(L"complete"); JsonString *pCompleteKey = new JsonString(L"complete");
pJsonObject->Add(pCompleteKey, toJson(getPComplete(), "Boolean", "")); pJsonObject->Add(pCompleteKey, toJson(getPComplete(), "Boolean", ""));
return pJsonObject; return pJsonObject;
} }

View File

@ -17,11 +17,11 @@
using namespace Tizen::Web::Json; using namespace Tizen::Web::Json;
using Tizen::Base::Long;
using Tizen::Base::DateTime;
using Tizen::Base::String;
using Tizen::Base::Boolean; using Tizen::Base::Boolean;
using Tizen::Base::DateTime;
using Tizen::Base::Integer; using Tizen::Base::Integer;
using Tizen::Base::Long;
using Tizen::Base::String;
namespace Swagger { namespace Swagger {
@ -44,34 +44,26 @@ public:
SamiOrder* fromJson(String* obj); SamiOrder* fromJson(String* obj);
Long* getPId(); Long* getPId();
void setPId(Long* pId); void setPId(Long* pId);
Long* getPPetId(); Long* getPPetId();
void setPPetId(Long* pPetId); void setPPetId(Long* pPetId);
Integer* getPQuantity(); Integer* getPQuantity();
void setPQuantity(Integer* pQuantity); void setPQuantity(Integer* pQuantity);
DateTime* getPShipDate(); DateTime* getPShipDate();
void setPShipDate(DateTime* pShipDate); void setPShipDate(DateTime* pShipDate);
String* getPStatus(); String* getPStatus();
void setPStatus(String* pStatus); void setPStatus(String* pStatus);
Boolean* getPComplete(); Boolean* getPComplete();
void setPComplete(Boolean* pComplete); void setPComplete(Boolean* pComplete);
private: private:
Long* pId; Long* pId;
Long* pPetId; Long* pPetId;
Integer* pQuantity; Integer* pQuantity;
DateTime* pShipDate; DateTime* pShipDate;
String* pStatus; String* pStatus;
Boolean* pComplete; Boolean* pComplete;
}; };
} /* namespace Swagger */ } /* namespace Swagger */

View File

@ -23,12 +23,11 @@ SamiPet::~SamiPet() {
void void
SamiPet::init() { SamiPet::init() {
pId = null; pId = null;
pCategory = null; pCategory = null;
pName = null; pName = null;
pPhotoUrls = null; pPhotoUrls = null;
pTags = null; pTags = null;
pStatus = null; pStatus = null;
} }
void void
@ -38,32 +37,31 @@ SamiPet::cleanup() {
delete pId; delete pId;
pId = null; pId = null;
} }
if(pCategory != null) { if(pCategory != null) {
delete pCategory; delete pCategory;
pCategory = null; pCategory = null;
} }
if(pName != null) { if(pName != null) {
delete pName; delete pName;
pName = null; pName = null;
} }
if(pPhotoUrls != null) { if(pPhotoUrls != null) {
pPhotoUrls->RemoveAll(true); pPhotoUrls->RemoveAll(true);
delete pPhotoUrls; delete pPhotoUrls;
pPhotoUrls = null; pPhotoUrls = null;
} }
if(pTags != null) { if(pTags != null) {
pTags->RemoveAll(true); pTags->RemoveAll(true);
delete pTags; delete pTags;
pTags = null; pTags = null;
} }
if(pStatus != null) { if(pStatus != null) {
delete pStatus; delete pStatus;
pStatus = null; pStatus = null;
} }
} }
@ -110,7 +108,7 @@ SamiPet::fromJsonObject(IJsonValue* pJson) {
jsonToValue(pId, pIdVal, L"Long", L"Long"); jsonToValue(pId, pIdVal, L"Long", L"Long");
} }
delete pIdKey; delete pIdKey;
JsonString* pCategoryKey = new JsonString(L"category"); JsonString* pCategoryKey = new JsonString(L"category");
IJsonValue* pCategoryVal = null; IJsonValue* pCategoryVal = null;
pJsonObject->GetValue(pCategoryKey, pCategoryVal); pJsonObject->GetValue(pCategoryKey, pCategoryVal);
if(pCategoryVal != null) { if(pCategoryVal != null) {
@ -119,7 +117,7 @@ SamiPet::fromJsonObject(IJsonValue* pJson) {
jsonToValue(pCategory, pCategoryVal, L"SamiCategory", L"SamiCategory"); jsonToValue(pCategory, pCategoryVal, L"SamiCategory", L"SamiCategory");
} }
delete pCategoryKey; delete pCategoryKey;
JsonString* pNameKey = new JsonString(L"name"); JsonString* pNameKey = new JsonString(L"name");
IJsonValue* pNameVal = null; IJsonValue* pNameVal = null;
pJsonObject->GetValue(pNameKey, pNameVal); pJsonObject->GetValue(pNameKey, pNameVal);
if(pNameVal != null) { if(pNameVal != null) {
@ -128,7 +126,7 @@ SamiPet::fromJsonObject(IJsonValue* pJson) {
jsonToValue(pName, pNameVal, L"String", L"String"); jsonToValue(pName, pNameVal, L"String", L"String");
} }
delete pNameKey; delete pNameKey;
JsonString* pPhotoUrlsKey = new JsonString(L"photoUrls"); JsonString* pPhotoUrlsKey = new JsonString(L"photoUrls");
IJsonValue* pPhotoUrlsVal = null; IJsonValue* pPhotoUrlsVal = null;
pJsonObject->GetValue(pPhotoUrlsKey, pPhotoUrlsVal); pJsonObject->GetValue(pPhotoUrlsKey, pPhotoUrlsVal);
if(pPhotoUrlsVal != null) { if(pPhotoUrlsVal != null) {
@ -137,7 +135,7 @@ SamiPet::fromJsonObject(IJsonValue* pJson) {
jsonToValue(pPhotoUrls, pPhotoUrlsVal, L"IList", L"String"); jsonToValue(pPhotoUrls, pPhotoUrlsVal, L"IList", L"String");
} }
delete pPhotoUrlsKey; delete pPhotoUrlsKey;
JsonString* pTagsKey = new JsonString(L"tags"); JsonString* pTagsKey = new JsonString(L"tags");
IJsonValue* pTagsVal = null; IJsonValue* pTagsVal = null;
pJsonObject->GetValue(pTagsKey, pTagsVal); pJsonObject->GetValue(pTagsKey, pTagsVal);
if(pTagsVal != null) { if(pTagsVal != null) {
@ -146,7 +144,7 @@ SamiPet::fromJsonObject(IJsonValue* pJson) {
jsonToValue(pTags, pTagsVal, L"IList", L"SamiTag"); jsonToValue(pTags, pTagsVal, L"IList", L"SamiTag");
} }
delete pTagsKey; delete pTagsKey;
JsonString* pStatusKey = new JsonString(L"status"); JsonString* pStatusKey = new JsonString(L"status");
IJsonValue* pStatusVal = null; IJsonValue* pStatusVal = null;
pJsonObject->GetValue(pStatusKey, pStatusVal); pJsonObject->GetValue(pStatusKey, pStatusVal);
if(pStatusVal != null) { if(pStatusVal != null) {
@ -155,7 +153,6 @@ SamiPet::fromJsonObject(IJsonValue* pJson) {
jsonToValue(pStatus, pStatusVal, L"String", L"String"); jsonToValue(pStatus, pStatusVal, L"String", L"String");
} }
delete pStatusKey; delete pStatusKey;
} }
} }
@ -206,31 +203,24 @@ SamiPet::asJsonObject() {
JsonObject *pJsonObject = new JsonObject(); JsonObject *pJsonObject = new JsonObject();
pJsonObject->Construct(); pJsonObject->Construct();
JsonString *pIdKey = new JsonString(L"id"); JsonString *pIdKey = new JsonString(L"id");
pJsonObject->Add(pIdKey, toJson(getPId(), "Long", "")); pJsonObject->Add(pIdKey, toJson(getPId(), "Long", ""));
JsonString *pCategoryKey = new JsonString(L"category"); JsonString *pCategoryKey = new JsonString(L"category");
pJsonObject->Add(pCategoryKey, toJson(getPCategory(), "SamiCategory", "")); pJsonObject->Add(pCategoryKey, toJson(getPCategory(), "SamiCategory", ""));
JsonString *pNameKey = new JsonString(L"name"); JsonString *pNameKey = new JsonString(L"name");
pJsonObject->Add(pNameKey, toJson(getPName(), "String", "")); pJsonObject->Add(pNameKey, toJson(getPName(), "String", ""));
JsonString *pPhotoUrlsKey = new JsonString(L"photoUrls"); JsonString *pPhotoUrlsKey = new JsonString(L"photoUrls");
pJsonObject->Add(pPhotoUrlsKey, toJson(getPPhotoUrls(), "String", "array")); pJsonObject->Add(pPhotoUrlsKey, toJson(getPPhotoUrls(), "String", "array"));
JsonString *pTagsKey = new JsonString(L"tags"); JsonString *pTagsKey = new JsonString(L"tags");
pJsonObject->Add(pTagsKey, toJson(getPTags(), "SamiTag", "array")); pJsonObject->Add(pTagsKey, toJson(getPTags(), "SamiTag", "array"));
JsonString *pStatusKey = new JsonString(L"status"); JsonString *pStatusKey = new JsonString(L"status");
pJsonObject->Add(pStatusKey, toJson(getPStatus(), "String", "")); pJsonObject->Add(pStatusKey, toJson(getPStatus(), "String", ""));
return pJsonObject; return pJsonObject;
} }

View File

@ -18,10 +18,10 @@ using namespace Tizen::Web::Json;
#include "SamiCategory.h" #include "SamiCategory.h"
using Tizen::Base::Long;
using Tizen::Base::String;
#include "SamiTag.h" #include "SamiTag.h"
using Tizen::Base::Collection::IList; using Tizen::Base::Collection::IList;
using Tizen::Base::Long;
using Tizen::Base::String;
namespace Swagger { namespace Swagger {
@ -44,34 +44,26 @@ public:
SamiPet* fromJson(String* obj); SamiPet* fromJson(String* obj);
Long* getPId(); Long* getPId();
void setPId(Long* pId); void setPId(Long* pId);
SamiCategory* getPCategory(); SamiCategory* getPCategory();
void setPCategory(SamiCategory* pCategory); void setPCategory(SamiCategory* pCategory);
String* getPName(); String* getPName();
void setPName(String* pName); void setPName(String* pName);
IList* getPPhotoUrls(); IList* getPPhotoUrls();
void setPPhotoUrls(IList* pPhotoUrls); void setPPhotoUrls(IList* pPhotoUrls);
IList* getPTags(); IList* getPTags();
void setPTags(IList* pTags); void setPTags(IList* pTags);
String* getPStatus(); String* getPStatus();
void setPStatus(String* pStatus); void setPStatus(String* pStatus);
private: private:
Long* pId; Long* pId;
SamiCategory* pCategory; SamiCategory* pCategory;
String* pName; String* pName;
IList* pPhotoUrls; IList* pPhotoUrls;
IList* pTags; IList* pTags;
String* pStatus; String* pStatus;
}; };
} /* namespace Swagger */ } /* namespace Swagger */

View File

@ -16,55 +16,6 @@ SamiPetApi::~SamiPetApi() {
} }
void
updatePetProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) {
int code = pHttpResponse->GetHttpStatusCode();
if(code >= 200 && code < 300) {
handler(null, null);
}
else {
SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText()));
handler(error, null);
}
}
void
SamiPetApi::updatePetWithCompletion(SamiPet* body, void(*success)(SamiError*)) {
client = new SamiApiClient();
client->success(&updatePetProcessor, (void(*)(void*, SamiError*))success);
HashMap* headerParams = new HashMap(SingleObjectDeleter);
headerParams->Construct();
HashMap* queryParams = new HashMap(SingleObjectDeleter);
queryParams->Construct();
String* mBody = null;
if(body != null) {
mBody = new String(body->asJson());
headerParams->Add(new String("Content-Type"), new String("application/json"));
}
String url(L"/pet");
client->execute(SamiPetApi::getBasePath(), url, "PUT", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json");
}
void void
addPetProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { addPetProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) {
int code = pHttpResponse->GetHttpStatusCode(); int code = pHttpResponse->GetHttpStatusCode();
@ -88,32 +39,67 @@ SamiPetApi::addPetWithCompletion(SamiPet* body, void(*success)(SamiError*)) {
headerParams->Construct(); headerParams->Construct();
HashMap* queryParams = new HashMap(SingleObjectDeleter); HashMap* queryParams = new HashMap(SingleObjectDeleter);
queryParams->Construct(); queryParams->Construct();
String* mBody = null; String* mBody = null;
if(body != null) { if(body != null) {
mBody = new String(body->asJson()); mBody = new String(body->asJson());
headerParams->Add(new String("Content-Type"), new String("application/json")); headerParams->Add(new String("Content-Type"), new String("application/json"));
} }
String url(L"/pet"); String url(L"/pet");
client->execute(SamiPetApi::getBasePath(), url, "POST", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); client->execute(SamiPetApi::getBasePath(), url, "POST", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json");
} }
void
deletePetProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) {
int code = pHttpResponse->GetHttpStatusCode();
if(code >= 200 && code < 300) {
handler(null, null);
}
else {
SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText()));
handler(error, null);
}
}
void
SamiPetApi::deletePetWithCompletion(Long* petId, String* apiKey, void(*success)(SamiError*)) {
client = new SamiApiClient();
client->success(&deletePetProcessor, (void(*)(void*, SamiError*))success);
HashMap* headerParams = new HashMap(SingleObjectDeleter);
headerParams->Construct();
headerParams->Add(new String("api_key"), apiKey);
HashMap* queryParams = new HashMap(SingleObjectDeleter);
queryParams->Construct();
String* mBody = null;
String url(L"/pet/{petId}");
String s_petId(L"{");
s_petId.Append(L"petId");
s_petId.Append(L"}");
url.Replace(s_petId, stringify(petId, L"Long*"));
client->execute(SamiPetApi::getBasePath(), url, "DELETE", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json");
}
void void
findPetsByStatusProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { findPetsByStatusProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) {
int code = pHttpResponse->GetHttpStatusCode(); int code = pHttpResponse->GetHttpStatusCode();
@ -158,7 +144,6 @@ SamiPetApi::findPetsByStatusWithCompletion(IList* status, void (* success)(IList
headerParams->Construct(); headerParams->Construct();
HashMap* queryParams = new HashMap(SingleObjectDeleter); HashMap* queryParams = new HashMap(SingleObjectDeleter);
queryParams->Construct(); queryParams->Construct();
@ -169,16 +154,12 @@ SamiPetApi::findPetsByStatusWithCompletion(IList* status, void (* success)(IList
queryParams->Add(new String("status"), new String(itemAt)); queryParams->Add(new String("status"), new String(itemAt));
} }
String* mBody = null; String* mBody = null;
String url(L"/pet/findByStatus"); String url(L"/pet/findByStatus");
client->execute(SamiPetApi::getBasePath(), url, "GET", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); client->execute(SamiPetApi::getBasePath(), url, "GET", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json");
return null; return null;
} }
@ -227,7 +208,6 @@ SamiPetApi::findPetsByTagsWithCompletion(IList* tags, void (* success)(IList*, S
headerParams->Construct(); headerParams->Construct();
HashMap* queryParams = new HashMap(SingleObjectDeleter); HashMap* queryParams = new HashMap(SingleObjectDeleter);
queryParams->Construct(); queryParams->Construct();
@ -238,16 +218,12 @@ SamiPetApi::findPetsByTagsWithCompletion(IList* tags, void (* success)(IList*, S
queryParams->Add(new String("tags"), new String(itemAt)); queryParams->Add(new String("tags"), new String(itemAt));
} }
String* mBody = null; String* mBody = null;
String url(L"/pet/findByTags"); String url(L"/pet/findByTags");
client->execute(SamiPetApi::getBasePath(), url, "GET", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); client->execute(SamiPetApi::getBasePath(), url, "GET", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json");
return null; return null;
} }
@ -296,29 +272,65 @@ SamiPetApi::getPetByIdWithCompletion(Long* petId, void (* success)(SamiPet*, Sam
headerParams->Construct(); headerParams->Construct();
HashMap* queryParams = new HashMap(SingleObjectDeleter); HashMap* queryParams = new HashMap(SingleObjectDeleter);
queryParams->Construct(); queryParams->Construct();
String* mBody = null; String* mBody = null;
String url(L"/pet/{petId}"); String url(L"/pet/{petId}");
String s_petId(L"{"); String s_petId(L"{");
s_petId.Append(L"petId"); s_petId.Append(L"petId");
s_petId.Append(L"}"); s_petId.Append(L"}");
url.Replace(s_petId, stringify(petId, L"Long*")); url.Replace(s_petId, stringify(petId, L"Long*"));
client->execute(SamiPetApi::getBasePath(), url, "GET", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); client->execute(SamiPetApi::getBasePath(), url, "GET", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json");
return null; return null;
} }
void
updatePetProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) {
int code = pHttpResponse->GetHttpStatusCode();
if(code >= 200 && code < 300) {
handler(null, null);
}
else {
SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText()));
handler(error, null);
}
}
void
SamiPetApi::updatePetWithCompletion(SamiPet* body, void(*success)(SamiError*)) {
client = new SamiApiClient();
client->success(&updatePetProcessor, (void(*)(void*, SamiError*))success);
HashMap* headerParams = new HashMap(SingleObjectDeleter);
headerParams->Construct();
HashMap* queryParams = new HashMap(SingleObjectDeleter);
queryParams->Construct();
String* mBody = null;
if(body != null) {
mBody = new String(body->asJson());
headerParams->Add(new String("Content-Type"), new String("application/json"));
}
String url(L"/pet");
client->execute(SamiPetApi::getBasePath(), url, "PUT", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json");
}
void void
updatePetWithFormProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { updatePetWithFormProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) {
int code = pHttpResponse->GetHttpStatusCode(); int code = pHttpResponse->GetHttpStatusCode();
@ -334,7 +346,7 @@ updatePetWithFormProcessor(HttpResponse* pHttpResponse, void (* handler)(void*,
} }
void void
SamiPetApi::updatePetWithFormWithCompletion(String* petId, String* name, String* status, void(*success)(SamiError*)) { SamiPetApi::updatePetWithFormWithCompletion(Long* petId, String* name, String* status, void(*success)(SamiError*)) {
client = new SamiApiClient(); client = new SamiApiClient();
client->success(&updatePetWithFormProcessor, (void(*)(void*, SamiError*))success); client->success(&updatePetWithFormProcessor, (void(*)(void*, SamiError*))success);
@ -342,75 +354,21 @@ SamiPetApi::updatePetWithFormWithCompletion(String* petId, String* name, String*
headerParams->Construct(); headerParams->Construct();
HashMap* queryParams = new HashMap(SingleObjectDeleter); HashMap* queryParams = new HashMap(SingleObjectDeleter);
queryParams->Construct(); queryParams->Construct();
String* mBody = null; String* mBody = null;
String url(L"/pet/{petId}"); String url(L"/pet/{petId}");
String s_petId(L"{");
s_petId.Append(L"petId");
s_petId.Append(L"}");
url.Replace(s_petId, stringify(petId, L"String*"));
client->execute(SamiPetApi::getBasePath(), url, "POST", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json");
}
void
deletePetProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) {
int code = pHttpResponse->GetHttpStatusCode();
if(code >= 200 && code < 300) {
handler(null, null);
}
else {
SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText()));
handler(error, null);
}
}
void
SamiPetApi::deletePetWithCompletion(Long* petId, String* apiKey, void(*success)(SamiError*)) {
client = new SamiApiClient();
client->success(&deletePetProcessor, (void(*)(void*, SamiError*))success);
HashMap* headerParams = new HashMap(SingleObjectDeleter);
headerParams->Construct();
headerParams->Add(new String("api_key"), apiKey);
HashMap* queryParams = new HashMap(SingleObjectDeleter);
queryParams->Construct();
String* mBody = null;
String url(L"/pet/{petId}");
String s_petId(L"{"); String s_petId(L"{");
s_petId.Append(L"petId"); s_petId.Append(L"petId");
s_petId.Append(L"}"); s_petId.Append(L"}");
url.Replace(s_petId, stringify(petId, L"Long*")); url.Replace(s_petId, stringify(petId, L"Long*"));
client->execute(SamiPetApi::getBasePath(), url, "POST", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json");
client->execute(SamiPetApi::getBasePath(), url, "DELETE", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json");
} }
@ -419,17 +377,38 @@ uploadFileProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiErr
int code = pHttpResponse->GetHttpStatusCode(); int code = pHttpResponse->GetHttpStatusCode();
if(code >= 200 && code < 300) { if(code >= 200 && code < 300) {
handler(null, null); ByteBuffer* pBuffer = pHttpResponse->ReadBodyN();
IJsonValue* pJson = JsonParser::ParseN(*pBuffer);
SamiApiResponse* out = new SamiApiResponse();
jsonToValue(out, pJson, L"SamiApiResponse*", L"SamiApiResponse");
if (pJson) {
if (pJson->GetType() == JSON_TYPE_OBJECT) {
JsonObject* pObject = static_cast< JsonObject* >(pJson);
pObject->RemoveAll(true);
}
else if (pJson->GetType() == JSON_TYPE_ARRAY) {
JsonArray* pArray = static_cast< JsonArray* >(pJson);
pArray->RemoveAll(true);
}
handler(out, null);
}
else {
SamiError* error = new SamiError(0, new String(L"No parsable response received"));
handler(null, error);
}
} }
else { else {
SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText()));
handler(null, error);
handler(error, null);
} }
} }
void SamiApiResponse*
SamiPetApi::uploadFileWithCompletion(Long* petId, String* additionalMetadata, SamiFile* file, void(*success)(SamiError*)) { SamiPetApi::uploadFileWithCompletion(Long* petId, String* additionalMetadata, SamiFile* file, void (* success)(SamiApiResponse*, SamiError*)) {
client = new SamiApiClient(); client = new SamiApiClient();
client->success(&uploadFileProcessor, (void(*)(void*, SamiError*))success); client->success(&uploadFileProcessor, (void(*)(void*, SamiError*))success);
@ -437,27 +416,22 @@ SamiPetApi::uploadFileWithCompletion(Long* petId, String* additionalMetadata, Sa
headerParams->Construct(); headerParams->Construct();
HashMap* queryParams = new HashMap(SingleObjectDeleter); HashMap* queryParams = new HashMap(SingleObjectDeleter);
queryParams->Construct(); queryParams->Construct();
String* mBody = null; String* mBody = null;
String url(L"/pet/{petId}/uploadImage"); String url(L"/pet/{petId}/uploadImage");
String s_petId(L"{"); String s_petId(L"{");
s_petId.Append(L"petId"); s_petId.Append(L"petId");
s_petId.Append(L"}"); s_petId.Append(L"}");
url.Replace(s_petId, stringify(petId, L"Long*")); url.Replace(s_petId, stringify(petId, L"Long*"));
client->execute(SamiPetApi::getBasePath(), url, "POST", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); client->execute(SamiPetApi::getBasePath(), url, "POST", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json");
return null;
} }

View File

@ -6,9 +6,10 @@
#include "SamiError.h" #include "SamiError.h"
#include "SamiPet.h" #include "SamiPet.h"
using Tizen::Base::String;
using Tizen::Base::Long; using Tizen::Base::Long;
using Tizen::Base::String;
#include "SamiFile.h" #include "SamiFile.h"
#include "SamiApiResponse.h"
using namespace Tizen::Net::Http; using namespace Tizen::Net::Http;
@ -19,31 +20,22 @@ public:
SamiPetApi(); SamiPetApi();
virtual ~SamiPetApi(); virtual ~SamiPetApi();
void
updatePetWithCompletion(SamiPet* body, void(* handler)(SamiError*));
void void
addPetWithCompletion(SamiPet* body, void(* handler)(SamiError*)); addPetWithCompletion(SamiPet* body, void(* handler)(SamiError*));
IList*
findPetsByStatusWithCompletion(IList* status, void (* handler)(IList*, SamiError*));
IList*
findPetsByTagsWithCompletion(IList* tags, void (* handler)(IList*, SamiError*));
SamiPet*
getPetByIdWithCompletion(Long* petId, void (* handler)(SamiPet*, SamiError*));
void
updatePetWithFormWithCompletion(String* petId, String* name, String* status, void(* handler)(SamiError*));
void void
deletePetWithCompletion(Long* petId, String* apiKey, void(* handler)(SamiError*)); deletePetWithCompletion(Long* petId, String* apiKey, void(* handler)(SamiError*));
IList*
findPetsByStatusWithCompletion(IList* status, void (* handler)(IList*, SamiError*));
IList*
findPetsByTagsWithCompletion(IList* tags, void (* handler)(IList*, SamiError*));
SamiPet*
getPetByIdWithCompletion(Long* petId, void (* handler)(SamiPet*, SamiError*));
void void
uploadFileWithCompletion(Long* petId, String* additionalMetadata, SamiFile* file, void(* handler)(SamiError*)); updatePetWithCompletion(SamiPet* body, void(* handler)(SamiError*));
void
updatePetWithFormWithCompletion(Long* petId, String* name, String* status, void(* handler)(SamiError*));
SamiApiResponse*
uploadFileWithCompletion(Long* petId, String* additionalMetadata, SamiFile* file, void (* handler)(SamiApiResponse*, SamiError*));
static String getBasePath() { static String getBasePath() {
return L"http://petstore.swagger.io/v2"; return L"http://petstore.swagger.io/v2";
} }

View File

@ -16,6 +16,47 @@ SamiStoreApi::~SamiStoreApi() {
} }
void
deleteOrderProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) {
int code = pHttpResponse->GetHttpStatusCode();
if(code >= 200 && code < 300) {
handler(null, null);
}
else {
SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText()));
handler(error, null);
}
}
void
SamiStoreApi::deleteOrderWithCompletion(String* orderId, void(*success)(SamiError*)) {
client = new SamiApiClient();
client->success(&deleteOrderProcessor, (void(*)(void*, SamiError*))success);
HashMap* headerParams = new HashMap(SingleObjectDeleter);
headerParams->Construct();
HashMap* queryParams = new HashMap(SingleObjectDeleter);
queryParams->Construct();
String* mBody = null;
String url(L"/store/order/{orderId}");
String s_orderId(L"{");
s_orderId.Append(L"orderId");
s_orderId.Append(L"}");
url.Replace(s_orderId, stringify(orderId, L"String*"));
client->execute(SamiStoreApi::getBasePath(), url, "DELETE", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json");
}
void void
getInventoryProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { getInventoryProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) {
int code = pHttpResponse->GetHttpStatusCode(); int code = pHttpResponse->GetHttpStatusCode();
@ -60,19 +101,77 @@ SamiStoreApi::getInventoryWithCompletion( void (* success)(HashMap*, SamiError*)
headerParams->Construct(); headerParams->Construct();
HashMap* queryParams = new HashMap(SingleObjectDeleter); HashMap* queryParams = new HashMap(SingleObjectDeleter);
queryParams->Construct(); queryParams->Construct();
String* mBody = null; String* mBody = null;
String url(L"/store/inventory"); String url(L"/store/inventory");
client->execute(SamiStoreApi::getBasePath(), url, "GET", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json");
return null;
}
void
getOrderByIdProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) {
int code = pHttpResponse->GetHttpStatusCode();
if(code >= 200 && code < 300) {
ByteBuffer* pBuffer = pHttpResponse->ReadBodyN();
IJsonValue* pJson = JsonParser::ParseN(*pBuffer);
SamiOrder* out = new SamiOrder();
jsonToValue(out, pJson, L"SamiOrder*", L"SamiOrder");
if (pJson) {
if (pJson->GetType() == JSON_TYPE_OBJECT) {
JsonObject* pObject = static_cast< JsonObject* >(pJson);
pObject->RemoveAll(true);
}
else if (pJson->GetType() == JSON_TYPE_ARRAY) {
JsonArray* pArray = static_cast< JsonArray* >(pJson);
pArray->RemoveAll(true);
}
handler(out, null);
}
else {
SamiError* error = new SamiError(0, new String(L"No parsable response received"));
handler(null, error);
}
}
else {
SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText()));
handler(null, error);
}
}
SamiOrder*
SamiStoreApi::getOrderByIdWithCompletion(Long* orderId, void (* success)(SamiOrder*, SamiError*)) {
client = new SamiApiClient();
client->success(&getOrderByIdProcessor, (void(*)(void*, SamiError*))success);
HashMap* headerParams = new HashMap(SingleObjectDeleter);
headerParams->Construct();
HashMap* queryParams = new HashMap(SingleObjectDeleter);
queryParams->Construct();
String* mBody = null;
String url(L"/store/order/{orderId}");
String s_orderId(L"{");
s_orderId.Append(L"orderId");
s_orderId.Append(L"}");
url.Replace(s_orderId, stringify(orderId, L"Long*"));
client->execute(SamiStoreApi::getBasePath(), url, "GET", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); client->execute(SamiStoreApi::getBasePath(), url, "GET", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json");
return null; return null;
@ -122,144 +221,23 @@ SamiStoreApi::placeOrderWithCompletion(SamiOrder* body, void (* success)(SamiOrd
headerParams->Construct(); headerParams->Construct();
HashMap* queryParams = new HashMap(SingleObjectDeleter); HashMap* queryParams = new HashMap(SingleObjectDeleter);
queryParams->Construct(); queryParams->Construct();
String* mBody = null; String* mBody = null;
if(body != null) { if(body != null) {
mBody = new String(body->asJson()); mBody = new String(body->asJson());
headerParams->Add(new String("Content-Type"), new String("application/json")); headerParams->Add(new String("Content-Type"), new String("application/json"));
} }
String url(L"/store/order"); String url(L"/store/order");
client->execute(SamiStoreApi::getBasePath(), url, "POST", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); client->execute(SamiStoreApi::getBasePath(), url, "POST", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json");
return null; return null;
} }
void
getOrderByIdProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) {
int code = pHttpResponse->GetHttpStatusCode();
if(code >= 200 && code < 300) {
ByteBuffer* pBuffer = pHttpResponse->ReadBodyN();
IJsonValue* pJson = JsonParser::ParseN(*pBuffer);
SamiOrder* out = new SamiOrder();
jsonToValue(out, pJson, L"SamiOrder*", L"SamiOrder");
if (pJson) {
if (pJson->GetType() == JSON_TYPE_OBJECT) {
JsonObject* pObject = static_cast< JsonObject* >(pJson);
pObject->RemoveAll(true);
}
else if (pJson->GetType() == JSON_TYPE_ARRAY) {
JsonArray* pArray = static_cast< JsonArray* >(pJson);
pArray->RemoveAll(true);
}
handler(out, null);
}
else {
SamiError* error = new SamiError(0, new String(L"No parsable response received"));
handler(null, error);
}
}
else {
SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText()));
handler(null, error);
}
}
SamiOrder*
SamiStoreApi::getOrderByIdWithCompletion(String* orderId, void (* success)(SamiOrder*, SamiError*)) {
client = new SamiApiClient();
client->success(&getOrderByIdProcessor, (void(*)(void*, SamiError*))success);
HashMap* headerParams = new HashMap(SingleObjectDeleter);
headerParams->Construct();
HashMap* queryParams = new HashMap(SingleObjectDeleter);
queryParams->Construct();
String* mBody = null;
String url(L"/store/order/{orderId}");
String s_orderId(L"{");
s_orderId.Append(L"orderId");
s_orderId.Append(L"}");
url.Replace(s_orderId, stringify(orderId, L"String*"));
client->execute(SamiStoreApi::getBasePath(), url, "GET", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json");
return null;
}
void
deleteOrderProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) {
int code = pHttpResponse->GetHttpStatusCode();
if(code >= 200 && code < 300) {
handler(null, null);
}
else {
SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText()));
handler(error, null);
}
}
void
SamiStoreApi::deleteOrderWithCompletion(String* orderId, void(*success)(SamiError*)) {
client = new SamiApiClient();
client->success(&deleteOrderProcessor, (void(*)(void*, SamiError*))success);
HashMap* headerParams = new HashMap(SingleObjectDeleter);
headerParams->Construct();
HashMap* queryParams = new HashMap(SingleObjectDeleter);
queryParams->Construct();
String* mBody = null;
String url(L"/store/order/{orderId}");
String s_orderId(L"{");
s_orderId.Append(L"orderId");
s_orderId.Append(L"}");
url.Replace(s_orderId, stringify(orderId, L"String*"));
client->execute(SamiStoreApi::getBasePath(), url, "DELETE", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json");
}
} /* namespace Swagger */ } /* namespace Swagger */

View File

@ -5,9 +5,10 @@
#include "SamiApiClient.h" #include "SamiApiClient.h"
#include "SamiError.h" #include "SamiError.h"
using Tizen::Base::String;
using Tizen::Base::Integer; using Tizen::Base::Integer;
#include "SamiOrder.h" #include "SamiOrder.h"
using Tizen::Base::String; using Tizen::Base::Long;
using namespace Tizen::Net::Http; using namespace Tizen::Net::Http;
@ -18,19 +19,14 @@ public:
SamiStoreApi(); SamiStoreApi();
virtual ~SamiStoreApi(); virtual ~SamiStoreApi();
HashMap*
getInventoryWithCompletion( void (* handler)(HashMap*, SamiError*));
SamiOrder*
placeOrderWithCompletion(SamiOrder* body, void (* handler)(SamiOrder*, SamiError*));
SamiOrder*
getOrderByIdWithCompletion(String* orderId, void (* handler)(SamiOrder*, SamiError*));
void void
deleteOrderWithCompletion(String* orderId, void(* handler)(SamiError*)); deleteOrderWithCompletion(String* orderId, void(* handler)(SamiError*));
HashMap*
getInventoryWithCompletion( void (* handler)(HashMap*, SamiError*));
SamiOrder*
getOrderByIdWithCompletion(Long* orderId, void (* handler)(SamiOrder*, SamiError*));
SamiOrder*
placeOrderWithCompletion(SamiOrder* body, void (* handler)(SamiOrder*, SamiError*));
static String getBasePath() { static String getBasePath() {
return L"http://petstore.swagger.io/v2"; return L"http://petstore.swagger.io/v2";
} }

View File

@ -23,8 +23,7 @@ SamiTag::~SamiTag() {
void void
SamiTag::init() { SamiTag::init() {
pId = null; pId = null;
pName = null; pName = null;
} }
void void
@ -34,12 +33,11 @@ SamiTag::cleanup() {
delete pId; delete pId;
pId = null; pId = null;
} }
if(pName != null) { if(pName != null) {
delete pName; delete pName;
pName = null; pName = null;
} }
} }
@ -86,7 +84,7 @@ SamiTag::fromJsonObject(IJsonValue* pJson) {
jsonToValue(pId, pIdVal, L"Long", L"Long"); jsonToValue(pId, pIdVal, L"Long", L"Long");
} }
delete pIdKey; delete pIdKey;
JsonString* pNameKey = new JsonString(L"name"); JsonString* pNameKey = new JsonString(L"name");
IJsonValue* pNameVal = null; IJsonValue* pNameVal = null;
pJsonObject->GetValue(pNameKey, pNameVal); pJsonObject->GetValue(pNameKey, pNameVal);
if(pNameVal != null) { if(pNameVal != null) {
@ -95,7 +93,6 @@ SamiTag::fromJsonObject(IJsonValue* pJson) {
jsonToValue(pName, pNameVal, L"String", L"String"); jsonToValue(pName, pNameVal, L"String", L"String");
} }
delete pNameKey; delete pNameKey;
} }
} }
@ -146,15 +143,12 @@ SamiTag::asJsonObject() {
JsonObject *pJsonObject = new JsonObject(); JsonObject *pJsonObject = new JsonObject();
pJsonObject->Construct(); pJsonObject->Construct();
JsonString *pIdKey = new JsonString(L"id"); JsonString *pIdKey = new JsonString(L"id");
pJsonObject->Add(pIdKey, toJson(getPId(), "Long", "")); pJsonObject->Add(pIdKey, toJson(getPId(), "Long", ""));
JsonString *pNameKey = new JsonString(L"name"); JsonString *pNameKey = new JsonString(L"name");
pJsonObject->Add(pNameKey, toJson(getPName(), "String", "")); pJsonObject->Add(pNameKey, toJson(getPName(), "String", ""));
return pJsonObject; return pJsonObject;
} }

View File

@ -41,18 +41,14 @@ public:
SamiTag* fromJson(String* obj); SamiTag* fromJson(String* obj);
Long* getPId(); Long* getPId();
void setPId(Long* pId); void setPId(Long* pId);
String* getPName(); String* getPName();
void setPName(String* pName); void setPName(String* pName);
private: private:
Long* pId; Long* pId;
String* pName; String* pName;
}; };
} /* namespace Swagger */ } /* namespace Swagger */

View File

@ -23,14 +23,13 @@ SamiUser::~SamiUser() {
void void
SamiUser::init() { SamiUser::init() {
pId = null; pId = null;
pUsername = null; pUsername = null;
pFirstName = null; pFirstName = null;
pLastName = null; pLastName = null;
pEmail = null; pEmail = null;
pPassword = null; pPassword = null;
pPhone = null; pPhone = null;
pUserStatus = null; pUserStatus = null;
} }
void void
@ -40,42 +39,41 @@ SamiUser::cleanup() {
delete pId; delete pId;
pId = null; pId = null;
} }
if(pUsername != null) { if(pUsername != null) {
delete pUsername; delete pUsername;
pUsername = null; pUsername = null;
} }
if(pFirstName != null) { if(pFirstName != null) {
delete pFirstName; delete pFirstName;
pFirstName = null; pFirstName = null;
} }
if(pLastName != null) { if(pLastName != null) {
delete pLastName; delete pLastName;
pLastName = null; pLastName = null;
} }
if(pEmail != null) { if(pEmail != null) {
delete pEmail; delete pEmail;
pEmail = null; pEmail = null;
} }
if(pPassword != null) { if(pPassword != null) {
delete pPassword; delete pPassword;
pPassword = null; pPassword = null;
} }
if(pPhone != null) { if(pPhone != null) {
delete pPhone; delete pPhone;
pPhone = null; pPhone = null;
} }
if(pUserStatus != null) { if(pUserStatus != null) {
delete pUserStatus; delete pUserStatus;
pUserStatus = null; pUserStatus = null;
} }
} }
@ -122,7 +120,7 @@ SamiUser::fromJsonObject(IJsonValue* pJson) {
jsonToValue(pId, pIdVal, L"Long", L"Long"); jsonToValue(pId, pIdVal, L"Long", L"Long");
} }
delete pIdKey; delete pIdKey;
JsonString* pUsernameKey = new JsonString(L"username"); JsonString* pUsernameKey = new JsonString(L"username");
IJsonValue* pUsernameVal = null; IJsonValue* pUsernameVal = null;
pJsonObject->GetValue(pUsernameKey, pUsernameVal); pJsonObject->GetValue(pUsernameKey, pUsernameVal);
if(pUsernameVal != null) { if(pUsernameVal != null) {
@ -131,7 +129,7 @@ SamiUser::fromJsonObject(IJsonValue* pJson) {
jsonToValue(pUsername, pUsernameVal, L"String", L"String"); jsonToValue(pUsername, pUsernameVal, L"String", L"String");
} }
delete pUsernameKey; delete pUsernameKey;
JsonString* pFirstNameKey = new JsonString(L"firstName"); JsonString* pFirstNameKey = new JsonString(L"firstName");
IJsonValue* pFirstNameVal = null; IJsonValue* pFirstNameVal = null;
pJsonObject->GetValue(pFirstNameKey, pFirstNameVal); pJsonObject->GetValue(pFirstNameKey, pFirstNameVal);
if(pFirstNameVal != null) { if(pFirstNameVal != null) {
@ -140,7 +138,7 @@ SamiUser::fromJsonObject(IJsonValue* pJson) {
jsonToValue(pFirstName, pFirstNameVal, L"String", L"String"); jsonToValue(pFirstName, pFirstNameVal, L"String", L"String");
} }
delete pFirstNameKey; delete pFirstNameKey;
JsonString* pLastNameKey = new JsonString(L"lastName"); JsonString* pLastNameKey = new JsonString(L"lastName");
IJsonValue* pLastNameVal = null; IJsonValue* pLastNameVal = null;
pJsonObject->GetValue(pLastNameKey, pLastNameVal); pJsonObject->GetValue(pLastNameKey, pLastNameVal);
if(pLastNameVal != null) { if(pLastNameVal != null) {
@ -149,7 +147,7 @@ SamiUser::fromJsonObject(IJsonValue* pJson) {
jsonToValue(pLastName, pLastNameVal, L"String", L"String"); jsonToValue(pLastName, pLastNameVal, L"String", L"String");
} }
delete pLastNameKey; delete pLastNameKey;
JsonString* pEmailKey = new JsonString(L"email"); JsonString* pEmailKey = new JsonString(L"email");
IJsonValue* pEmailVal = null; IJsonValue* pEmailVal = null;
pJsonObject->GetValue(pEmailKey, pEmailVal); pJsonObject->GetValue(pEmailKey, pEmailVal);
if(pEmailVal != null) { if(pEmailVal != null) {
@ -158,7 +156,7 @@ SamiUser::fromJsonObject(IJsonValue* pJson) {
jsonToValue(pEmail, pEmailVal, L"String", L"String"); jsonToValue(pEmail, pEmailVal, L"String", L"String");
} }
delete pEmailKey; delete pEmailKey;
JsonString* pPasswordKey = new JsonString(L"password"); JsonString* pPasswordKey = new JsonString(L"password");
IJsonValue* pPasswordVal = null; IJsonValue* pPasswordVal = null;
pJsonObject->GetValue(pPasswordKey, pPasswordVal); pJsonObject->GetValue(pPasswordKey, pPasswordVal);
if(pPasswordVal != null) { if(pPasswordVal != null) {
@ -167,7 +165,7 @@ SamiUser::fromJsonObject(IJsonValue* pJson) {
jsonToValue(pPassword, pPasswordVal, L"String", L"String"); jsonToValue(pPassword, pPasswordVal, L"String", L"String");
} }
delete pPasswordKey; delete pPasswordKey;
JsonString* pPhoneKey = new JsonString(L"phone"); JsonString* pPhoneKey = new JsonString(L"phone");
IJsonValue* pPhoneVal = null; IJsonValue* pPhoneVal = null;
pJsonObject->GetValue(pPhoneKey, pPhoneVal); pJsonObject->GetValue(pPhoneKey, pPhoneVal);
if(pPhoneVal != null) { if(pPhoneVal != null) {
@ -176,7 +174,7 @@ SamiUser::fromJsonObject(IJsonValue* pJson) {
jsonToValue(pPhone, pPhoneVal, L"String", L"String"); jsonToValue(pPhone, pPhoneVal, L"String", L"String");
} }
delete pPhoneKey; delete pPhoneKey;
JsonString* pUserStatusKey = new JsonString(L"userStatus"); JsonString* pUserStatusKey = new JsonString(L"userStatus");
IJsonValue* pUserStatusVal = null; IJsonValue* pUserStatusVal = null;
pJsonObject->GetValue(pUserStatusKey, pUserStatusVal); pJsonObject->GetValue(pUserStatusKey, pUserStatusVal);
if(pUserStatusVal != null) { if(pUserStatusVal != null) {
@ -185,7 +183,6 @@ SamiUser::fromJsonObject(IJsonValue* pJson) {
jsonToValue(pUserStatus, pUserStatusVal, L"Integer", L"Integer"); jsonToValue(pUserStatus, pUserStatusVal, L"Integer", L"Integer");
} }
delete pUserStatusKey; delete pUserStatusKey;
} }
} }
@ -236,39 +233,30 @@ SamiUser::asJsonObject() {
JsonObject *pJsonObject = new JsonObject(); JsonObject *pJsonObject = new JsonObject();
pJsonObject->Construct(); pJsonObject->Construct();
JsonString *pIdKey = new JsonString(L"id"); JsonString *pIdKey = new JsonString(L"id");
pJsonObject->Add(pIdKey, toJson(getPId(), "Long", "")); pJsonObject->Add(pIdKey, toJson(getPId(), "Long", ""));
JsonString *pUsernameKey = new JsonString(L"username"); JsonString *pUsernameKey = new JsonString(L"username");
pJsonObject->Add(pUsernameKey, toJson(getPUsername(), "String", "")); pJsonObject->Add(pUsernameKey, toJson(getPUsername(), "String", ""));
JsonString *pFirstNameKey = new JsonString(L"firstName"); JsonString *pFirstNameKey = new JsonString(L"firstName");
pJsonObject->Add(pFirstNameKey, toJson(getPFirstName(), "String", "")); pJsonObject->Add(pFirstNameKey, toJson(getPFirstName(), "String", ""));
JsonString *pLastNameKey = new JsonString(L"lastName"); JsonString *pLastNameKey = new JsonString(L"lastName");
pJsonObject->Add(pLastNameKey, toJson(getPLastName(), "String", "")); pJsonObject->Add(pLastNameKey, toJson(getPLastName(), "String", ""));
JsonString *pEmailKey = new JsonString(L"email"); JsonString *pEmailKey = new JsonString(L"email");
pJsonObject->Add(pEmailKey, toJson(getPEmail(), "String", "")); pJsonObject->Add(pEmailKey, toJson(getPEmail(), "String", ""));
JsonString *pPasswordKey = new JsonString(L"password"); JsonString *pPasswordKey = new JsonString(L"password");
pJsonObject->Add(pPasswordKey, toJson(getPPassword(), "String", "")); pJsonObject->Add(pPasswordKey, toJson(getPPassword(), "String", ""));
JsonString *pPhoneKey = new JsonString(L"phone"); JsonString *pPhoneKey = new JsonString(L"phone");
pJsonObject->Add(pPhoneKey, toJson(getPPhone(), "String", "")); pJsonObject->Add(pPhoneKey, toJson(getPPhone(), "String", ""));
JsonString *pUserStatusKey = new JsonString(L"userStatus"); JsonString *pUserStatusKey = new JsonString(L"userStatus");
pJsonObject->Add(pUserStatusKey, toJson(getPUserStatus(), "Integer", "")); pJsonObject->Add(pUserStatusKey, toJson(getPUserStatus(), "Integer", ""));
return pJsonObject; return pJsonObject;
} }

View File

@ -17,9 +17,9 @@
using namespace Tizen::Web::Json; using namespace Tizen::Web::Json;
using Tizen::Base::Integer;
using Tizen::Base::Long; using Tizen::Base::Long;
using Tizen::Base::String; using Tizen::Base::String;
using Tizen::Base::Integer;
namespace Swagger { namespace Swagger {
@ -42,42 +42,32 @@ public:
SamiUser* fromJson(String* obj); SamiUser* fromJson(String* obj);
Long* getPId(); Long* getPId();
void setPId(Long* pId); void setPId(Long* pId);
String* getPUsername(); String* getPUsername();
void setPUsername(String* pUsername); void setPUsername(String* pUsername);
String* getPFirstName(); String* getPFirstName();
void setPFirstName(String* pFirstName); void setPFirstName(String* pFirstName);
String* getPLastName(); String* getPLastName();
void setPLastName(String* pLastName); void setPLastName(String* pLastName);
String* getPEmail(); String* getPEmail();
void setPEmail(String* pEmail); void setPEmail(String* pEmail);
String* getPPassword(); String* getPPassword();
void setPPassword(String* pPassword); void setPPassword(String* pPassword);
String* getPPhone(); String* getPPhone();
void setPPhone(String* pPhone); void setPPhone(String* pPhone);
Integer* getPUserStatus(); Integer* getPUserStatus();
void setPUserStatus(Integer* pUserStatus); void setPUserStatus(Integer* pUserStatus);
private: private:
Long* pId; Long* pId;
String* pUsername; String* pUsername;
String* pFirstName; String* pFirstName;
String* pLastName; String* pLastName;
String* pEmail; String* pEmail;
String* pPassword; String* pPassword;
String* pPhone; String* pPhone;
Integer* pUserStatus; Integer* pUserStatus;
}; };
} /* namespace Swagger */ } /* namespace Swagger */

View File

@ -39,28 +39,20 @@ SamiUserApi::createUserWithCompletion(SamiUser* body, void(*success)(SamiError*)
headerParams->Construct(); headerParams->Construct();
HashMap* queryParams = new HashMap(SingleObjectDeleter); HashMap* queryParams = new HashMap(SingleObjectDeleter);
queryParams->Construct(); queryParams->Construct();
String* mBody = null; String* mBody = null;
if(body != null) { if(body != null) {
mBody = new String(body->asJson()); mBody = new String(body->asJson());
headerParams->Add(new String("Content-Type"), new String("application/json")); headerParams->Add(new String("Content-Type"), new String("application/json"));
} }
String url(L"/user"); String url(L"/user");
client->execute(SamiUserApi::getBasePath(), url, "POST", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); client->execute(SamiUserApi::getBasePath(), url, "POST", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json");
} }
@ -88,16 +80,12 @@ SamiUserApi::createUsersWithArrayInputWithCompletion(IList* body, void(*success)
headerParams->Construct(); headerParams->Construct();
HashMap* queryParams = new HashMap(SingleObjectDeleter); HashMap* queryParams = new HashMap(SingleObjectDeleter);
queryParams->Construct(); queryParams->Construct();
String* mBody = null; String* mBody = null;
if(body != null) { if(body != null) {
mBody = new String(""); mBody = new String("");
int sz = body->GetCount(); int sz = body->GetCount();
@ -112,13 +100,9 @@ SamiUserApi::createUsersWithArrayInputWithCompletion(IList* body, void(*success)
headerParams->Add(new String("Content-Type"), new String("application/json")); headerParams->Add(new String("Content-Type"), new String("application/json"));
} }
String url(L"/user/createWithArray"); String url(L"/user/createWithArray");
client->execute(SamiUserApi::getBasePath(), url, "POST", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); client->execute(SamiUserApi::getBasePath(), url, "POST", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json");
} }
@ -146,16 +130,12 @@ SamiUserApi::createUsersWithListInputWithCompletion(IList* body, void(*success)(
headerParams->Construct(); headerParams->Construct();
HashMap* queryParams = new HashMap(SingleObjectDeleter); HashMap* queryParams = new HashMap(SingleObjectDeleter);
queryParams->Construct(); queryParams->Construct();
String* mBody = null; String* mBody = null;
if(body != null) { if(body != null) {
mBody = new String(""); mBody = new String("");
int sz = body->GetCount(); int sz = body->GetCount();
@ -170,87 +150,15 @@ SamiUserApi::createUsersWithListInputWithCompletion(IList* body, void(*success)(
headerParams->Add(new String("Content-Type"), new String("application/json")); headerParams->Add(new String("Content-Type"), new String("application/json"));
} }
String url(L"/user/createWithList"); String url(L"/user/createWithList");
client->execute(SamiUserApi::getBasePath(), url, "POST", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); client->execute(SamiUserApi::getBasePath(), url, "POST", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json");
} }
void void
loginUserProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { deleteUserProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) {
int code = pHttpResponse->GetHttpStatusCode();
if(code >= 200 && code < 300) {
ByteBuffer* pBuffer = pHttpResponse->ReadBodyN();
IJsonValue* pJson = JsonParser::ParseN(*pBuffer);
String* out = new String();
jsonToValue(out, pJson, L"String*", L"String");
if (pJson) {
if (pJson->GetType() == JSON_TYPE_OBJECT) {
JsonObject* pObject = static_cast< JsonObject* >(pJson);
pObject->RemoveAll(true);
}
else if (pJson->GetType() == JSON_TYPE_ARRAY) {
JsonArray* pArray = static_cast< JsonArray* >(pJson);
pArray->RemoveAll(true);
}
handler(out, null);
}
else {
SamiError* error = new SamiError(0, new String(L"No parsable response received"));
handler(null, error);
}
}
else {
SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText()));
handler(null, error);
}
}
String*
SamiUserApi::loginUserWithCompletion(String* username, String* password, void (* success)(String*, SamiError*)) {
client = new SamiApiClient();
client->success(&loginUserProcessor, (void(*)(void*, SamiError*))success);
HashMap* headerParams = new HashMap(SingleObjectDeleter);
headerParams->Construct();
HashMap* queryParams = new HashMap(SingleObjectDeleter);
queryParams->Construct();
queryParams->Add(new String("username"), username);
queryParams->Add(new String("password"), password);
String* mBody = null;
String url(L"/user/login");
client->execute(SamiUserApi::getBasePath(), url, "GET", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json");
return null;
}
void
logoutUserProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) {
int code = pHttpResponse->GetHttpStatusCode(); int code = pHttpResponse->GetHttpStatusCode();
if(code >= 200 && code < 300) { if(code >= 200 && code < 300) {
@ -264,29 +172,29 @@ logoutUserProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiErr
} }
void void
SamiUserApi::logoutUserWithCompletion( void(*success)(SamiError*)) { SamiUserApi::deleteUserWithCompletion(String* username, void(*success)(SamiError*)) {
client = new SamiApiClient(); client = new SamiApiClient();
client->success(&logoutUserProcessor, (void(*)(void*, SamiError*))success); client->success(&deleteUserProcessor, (void(*)(void*, SamiError*))success);
HashMap* headerParams = new HashMap(SingleObjectDeleter); HashMap* headerParams = new HashMap(SingleObjectDeleter);
headerParams->Construct(); headerParams->Construct();
HashMap* queryParams = new HashMap(SingleObjectDeleter); HashMap* queryParams = new HashMap(SingleObjectDeleter);
queryParams->Construct(); queryParams->Construct();
String* mBody = null; String* mBody = null;
String url(L"/user/{username}");
String url(L"/user/logout"); String s_username(L"{");
s_username.Append(L"username");
s_username.Append(L"}");
url.Replace(s_username, stringify(username, L"String*"));
client->execute(SamiUserApi::getBasePath(), url, "DELETE", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json");
client->execute(SamiUserApi::getBasePath(), url, "GET", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json");
} }
@ -334,29 +242,123 @@ SamiUserApi::getUserByNameWithCompletion(String* username, void (* success)(Sami
headerParams->Construct(); headerParams->Construct();
HashMap* queryParams = new HashMap(SingleObjectDeleter); HashMap* queryParams = new HashMap(SingleObjectDeleter);
queryParams->Construct(); queryParams->Construct();
String* mBody = null; String* mBody = null;
String url(L"/user/{username}"); String url(L"/user/{username}");
String s_username(L"{"); String s_username(L"{");
s_username.Append(L"username"); s_username.Append(L"username");
s_username.Append(L"}"); s_username.Append(L"}");
url.Replace(s_username, stringify(username, L"String*")); url.Replace(s_username, stringify(username, L"String*"));
client->execute(SamiUserApi::getBasePath(), url, "GET", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json");
return null;
}
void
loginUserProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) {
int code = pHttpResponse->GetHttpStatusCode();
if(code >= 200 && code < 300) {
ByteBuffer* pBuffer = pHttpResponse->ReadBodyN();
IJsonValue* pJson = JsonParser::ParseN(*pBuffer);
String* out = new String();
jsonToValue(out, pJson, L"String*", L"String");
if (pJson) {
if (pJson->GetType() == JSON_TYPE_OBJECT) {
JsonObject* pObject = static_cast< JsonObject* >(pJson);
pObject->RemoveAll(true);
}
else if (pJson->GetType() == JSON_TYPE_ARRAY) {
JsonArray* pArray = static_cast< JsonArray* >(pJson);
pArray->RemoveAll(true);
}
handler(out, null);
}
else {
SamiError* error = new SamiError(0, new String(L"No parsable response received"));
handler(null, error);
}
}
else {
SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText()));
handler(null, error);
}
}
String*
SamiUserApi::loginUserWithCompletion(String* username, String* password, void (* success)(String*, SamiError*)) {
client = new SamiApiClient();
client->success(&loginUserProcessor, (void(*)(void*, SamiError*))success);
HashMap* headerParams = new HashMap(SingleObjectDeleter);
headerParams->Construct();
HashMap* queryParams = new HashMap(SingleObjectDeleter);
queryParams->Construct();
queryParams->Add(new String("username"), username);
queryParams->Add(new String("password"), password);
String* mBody = null;
String url(L"/user/login");
client->execute(SamiUserApi::getBasePath(), url, "GET", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); client->execute(SamiUserApi::getBasePath(), url, "GET", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json");
return null; return null;
} }
void
logoutUserProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) {
int code = pHttpResponse->GetHttpStatusCode();
if(code >= 200 && code < 300) {
handler(null, null);
}
else {
SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText()));
handler(error, null);
}
}
void
SamiUserApi::logoutUserWithCompletion( void(*success)(SamiError*)) {
client = new SamiApiClient();
client->success(&logoutUserProcessor, (void(*)(void*, SamiError*))success);
HashMap* headerParams = new HashMap(SingleObjectDeleter);
headerParams->Construct();
HashMap* queryParams = new HashMap(SingleObjectDeleter);
queryParams->Construct();
String* mBody = null;
String url(L"/user/logout");
client->execute(SamiUserApi::getBasePath(), url, "GET", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json");
}
void void
updateUserProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { updateUserProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) {
int code = pHttpResponse->GetHttpStatusCode(); int code = pHttpResponse->GetHttpStatusCode();
@ -380,82 +382,27 @@ SamiUserApi::updateUserWithCompletion(String* username, SamiUser* body, void(*su
headerParams->Construct(); headerParams->Construct();
HashMap* queryParams = new HashMap(SingleObjectDeleter); HashMap* queryParams = new HashMap(SingleObjectDeleter);
queryParams->Construct(); queryParams->Construct();
String* mBody = null; String* mBody = null;
if(body != null) { if(body != null) {
mBody = new String(body->asJson()); mBody = new String(body->asJson());
headerParams->Add(new String("Content-Type"), new String("application/json")); headerParams->Add(new String("Content-Type"), new String("application/json"));
} }
String url(L"/user/{username}"); String url(L"/user/{username}");
String s_username(L"{"); String s_username(L"{");
s_username.Append(L"username"); s_username.Append(L"username");
s_username.Append(L"}"); s_username.Append(L"}");
url.Replace(s_username, stringify(username, L"String*")); url.Replace(s_username, stringify(username, L"String*"));
client->execute(SamiUserApi::getBasePath(), url, "PUT", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); client->execute(SamiUserApi::getBasePath(), url, "PUT", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json");
} }
void
deleteUserProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) {
int code = pHttpResponse->GetHttpStatusCode();
if(code >= 200 && code < 300) {
handler(null, null);
}
else {
SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText()));
handler(error, null);
}
}
void
SamiUserApi::deleteUserWithCompletion(String* username, void(*success)(SamiError*)) {
client = new SamiApiClient();
client->success(&deleteUserProcessor, (void(*)(void*, SamiError*))success);
HashMap* headerParams = new HashMap(SingleObjectDeleter);
headerParams->Construct();
HashMap* queryParams = new HashMap(SingleObjectDeleter);
queryParams->Construct();
String* mBody = null;
String url(L"/user/{username}");
String s_username(L"{");
s_username.Append(L"username");
s_username.Append(L"}");
url.Replace(s_username, stringify(username, L"String*"));
client->execute(SamiUserApi::getBasePath(), url, "DELETE", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json");
}
} /* namespace Swagger */ } /* namespace Swagger */

View File

@ -18,31 +18,22 @@ public:
SamiUserApi(); SamiUserApi();
virtual ~SamiUserApi(); virtual ~SamiUserApi();
void void
createUserWithCompletion(SamiUser* body, void(* handler)(SamiError*)); createUserWithCompletion(SamiUser* body, void(* handler)(SamiError*));
void void
createUsersWithArrayInputWithCompletion(IList* body, void(* handler)(SamiError*)); createUsersWithArrayInputWithCompletion(IList* body, void(* handler)(SamiError*));
void void
createUsersWithListInputWithCompletion(IList* body, void(* handler)(SamiError*)); createUsersWithListInputWithCompletion(IList* body, void(* handler)(SamiError*));
String*
loginUserWithCompletion(String* username, String* password, void (* handler)(String*, SamiError*));
void
logoutUserWithCompletion( void(* handler)(SamiError*));
SamiUser*
getUserByNameWithCompletion(String* username, void (* handler)(SamiUser*, SamiError*));
void
updateUserWithCompletion(String* username, SamiUser* body, void(* handler)(SamiError*));
void void
deleteUserWithCompletion(String* username, void(* handler)(SamiError*)); deleteUserWithCompletion(String* username, void(* handler)(SamiError*));
SamiUser*
getUserByNameWithCompletion(String* username, void (* handler)(SamiUser*, SamiError*));
String*
loginUserWithCompletion(String* username, String* password, void (* handler)(String*, SamiError*));
void
logoutUserWithCompletion( void(* handler)(SamiError*));
void
updateUserWithCompletion(String* username, SamiUser* body, void(* handler)(SamiError*));
static String getBasePath() { static String getBasePath() {
return L"http://petstore.swagger.io/v2"; return L"http://petstore.swagger.io/v2";
} }

View File

@ -29,82 +29,47 @@
<li>Getting Started</li> <li>Getting Started</li>
</ul> </ul>
</div> </div>
<div class="section-box">
<div class="section-header">
<a href="#!/UserApi">UserApi</a>
</div>
<ul>
<li><a href="#!/UserApi#createUser">createUser</a></li>
<li><a href="#!/UserApi#createUsersWithArrayInput">createUsersWithArrayInput</a></li>
<li><a href="#!/UserApi#createUsersWithListInput">createUsersWithListInput</a></li>
<li><a href="#!/UserApi#loginUser">loginUser</a></li>
<li><a href="#!/UserApi#logoutUser">logoutUser</a></li>
<li><a href="#!/UserApi#getUserByName">getUserByName</a></li>
<li><a href="#!/UserApi#updateUser">updateUser</a></li>
<li><a href="#!/UserApi#deleteUser">deleteUser</a></li>
</ul>
</div>
<div class="section-box"> <div class="section-box">
<div class="section-header"> <div class="section-header">
<a href="#!/PetApi">PetApi</a> <a href="#!/PetApi">PetApi</a>
</div> </div>
<ul> <ul>
<li><a href="#!/PetApi#updatePet">updatePet</a></li>
<li><a href="#!/PetApi#addPet">addPet</a></li> <li><a href="#!/PetApi#addPet">addPet</a></li>
<li><a href="#!/PetApi#findPetsByStatus">findPetsByStatus</a></li>
<li><a href="#!/PetApi#findPetsByTags">findPetsByTags</a></li>
<li><a href="#!/PetApi#getPetById">getPetById</a></li>
<li><a href="#!/PetApi#updatePetWithForm">updatePetWithForm</a></li>
<li><a href="#!/PetApi#deletePet">deletePet</a></li> <li><a href="#!/PetApi#deletePet">deletePet</a></li>
<li><a href="#!/PetApi#findPetsByStatus">findPetsByStatus</a></li>
<li><a href="#!/PetApi#findPetsByTags">findPetsByTags</a></li>
<li><a href="#!/PetApi#getPetById">getPetById</a></li>
<li><a href="#!/PetApi#updatePet">updatePet</a></li>
<li><a href="#!/PetApi#updatePetWithForm">updatePetWithForm</a></li>
<li><a href="#!/PetApi#uploadFile">uploadFile</a></li> <li><a href="#!/PetApi#uploadFile">uploadFile</a></li>
</ul> </ul>
</div> </div>
<div class="section-box"> <div class="section-box">
<div class="section-header"> <div class="section-header">
<a href="#!/StoreApi">StoreApi</a> <a href="#!/StoreApi">StoreApi</a>
</div> </div>
<ul> <ul>
<li><a href="#!/StoreApi#getInventory">getInventory</a></li>
<li><a href="#!/StoreApi#placeOrder">placeOrder</a></li>
<li><a href="#!/StoreApi#getOrderById">getOrderById</a></li>
<li><a href="#!/StoreApi#deleteOrder">deleteOrder</a></li> <li><a href="#!/StoreApi#deleteOrder">deleteOrder</a></li>
<li><a href="#!/StoreApi#getInventory">getInventory</a></li>
<li><a href="#!/StoreApi#getOrderById">getOrderById</a></li>
<li><a href="#!/StoreApi#placeOrder">placeOrder</a></li>
</ul>
</div>
<div class="section-box">
<div class="section-header">
<a href="#!/UserApi">UserApi</a>
</div>
<ul>
<li><a href="#!/UserApi#createUser">createUser</a></li>
<li><a href="#!/UserApi#createUsersWithArrayInput">createUsersWithArrayInput</a></li>
<li><a href="#!/UserApi#createUsersWithListInput">createUsersWithListInput</a></li>
<li><a href="#!/UserApi#deleteUser">deleteUser</a></li>
<li><a href="#!/UserApi#getUserByName">getUserByName</a></li>
<li><a href="#!/UserApi#loginUser">loginUser</a></li>
<li><a href="#!/UserApi#logoutUser">logoutUser</a></li>
<li><a href="#!/UserApi#updateUser">updateUser</a></li>
</ul> </ul>
</div> </div>
</div> </div>
<div class="non-sidebar"> <div class="non-sidebar">
<div class="main-content"> <div class="main-content">

View File

@ -0,0 +1,17 @@
<h2>ApiResponse</h2>
<ul class="parameter">
<li class="param-required-">code : Integer
<br/>
</li>
</ul>
<ul class="parameter">
<li class="param-required-">type : String
<br/>
</li>
</ul>
<ul class="parameter">
<li class="param-required-">message : String
<br/>
</li>
</ul>

View File

@ -1,17 +1,12 @@
<h2>Category</h2> <h2>Category</h2>
<ul class="parameter"> <ul class="parameter">
<li class="param-required-">id : Long <li class="param-required-">id : Long
<br/> <br/>
</li> </li>
</ul> </ul>
<ul class="parameter"> <ul class="parameter">
<li class="param-required-">name : String <li class="param-required-">name : String
<br/> <br/>
</li> </li>
</ul> </ul>

View File

@ -1,57 +1,39 @@
<h2>Order</h2> <h2>Order</h2>
<ul class="parameter"> <ul class="parameter">
<li class="param-required-">id : Long <li class="param-required-">id : Long
<br/> <br/>
</li> </li>
</ul> </ul>
<ul class="parameter"> <ul class="parameter">
<li class="param-required-">petId : Long <li class="param-required-">petId : Long
<br/> <br/>
</li> </li>
</ul> </ul>
<ul class="parameter"> <ul class="parameter">
<li class="param-required-">quantity : Integer <li class="param-required-">quantity : Integer
<br/> <br/>
</li> </li>
</ul> </ul>
<ul class="parameter"> <ul class="parameter">
<li class="param-required-">shipDate : Date <li class="param-required-">shipDate : Date
<br/> <br/>
</li> </li>
</ul> </ul>
<ul class="parameter"> <ul class="parameter">
<li class="param-required-">status : String <li class="param-required-">status : String
<br/>Order Status <br/>Order Status
<dl class="param-enum"> <dl class="param-enum">
<dt>Enum: <dt>Enum:
<dd>placed</dd> <dd>placed</dd>
<dd>approved</dd> <dd>approved</dd>
<dd>delivered</dd> <dd>delivered</dd>
</dt> </dt>
</dl> </dl>
</li> </li>
</ul> </ul>
<ul class="parameter"> <ul class="parameter">
<li class="param-required-">complete : Boolean <li class="param-required-">complete : Boolean
<br/> <br/>
</li> </li>
</ul> </ul>

View File

@ -1,57 +1,39 @@
<h2>Pet</h2> <h2>Pet</h2>
<ul class="parameter"> <ul class="parameter">
<li class="param-required-">id : Long <li class="param-required-">id : Long
<br/> <br/>
</li> </li>
</ul> </ul>
<ul class="parameter"> <ul class="parameter">
<li class="param-required-">category : Category <li class="param-required-">category : Category
<br/> <br/>
</li> </li>
</ul> </ul>
<ul class="parameter"> <ul class="parameter">
<li class="param-required-true">name : String <li class="param-required-true">name : String
<br/> <br/>
</li> </li>
</ul> </ul>
<ul class="parameter"> <ul class="parameter">
<li class="param-required-true">photoUrls : List <li class="param-required-true">photoUrls : List
<br/> <br/>
</li> </li>
</ul> </ul>
<ul class="parameter"> <ul class="parameter">
<li class="param-required-">tags : List <li class="param-required-">tags : List
<br/> <br/>
</li> </li>
</ul> </ul>
<ul class="parameter"> <ul class="parameter">
<li class="param-required-">status : String <li class="param-required-">status : String
<br/>pet status in the store <br/>pet status in the store
<dl class="param-enum"> <dl class="param-enum">
<dt>Enum: <dt>Enum:
<dd>available</dd> <dd>available</dd>
<dd>pending</dd> <dd>pending</dd>
<dd>sold</dd> <dd>sold</dd>
</dt> </dt>
</dl> </dl>
</li> </li>
</ul> </ul>

View File

@ -1,17 +1,12 @@
<h2>Tag</h2> <h2>Tag</h2>
<ul class="parameter"> <ul class="parameter">
<li class="param-required-">id : Long <li class="param-required-">id : Long
<br/> <br/>
</li> </li>
</ul> </ul>
<ul class="parameter"> <ul class="parameter">
<li class="param-required-">name : String <li class="param-required-">name : String
<br/> <br/>
</li> </li>
</ul> </ul>

View File

@ -1,59 +1,42 @@
<h2>User</h2> <h2>User</h2>
<ul class="parameter"> <ul class="parameter">
<li class="param-required-">id : Long <li class="param-required-">id : Long
<br/> <br/>
</li> </li>
</ul> </ul>
<ul class="parameter"> <ul class="parameter">
<li class="param-required-">username : String <li class="param-required-">username : String
<br/> <br/>
</li> </li>
</ul> </ul>
<ul class="parameter"> <ul class="parameter">
<li class="param-required-">firstName : String <li class="param-required-">firstName : String
<br/> <br/>
</li> </li>
</ul> </ul>
<ul class="parameter"> <ul class="parameter">
<li class="param-required-">lastName : String <li class="param-required-">lastName : String
<br/> <br/>
</li> </li>
</ul> </ul>
<ul class="parameter"> <ul class="parameter">
<li class="param-required-">email : String <li class="param-required-">email : String
<br/> <br/>
</li> </li>
</ul> </ul>
<ul class="parameter"> <ul class="parameter">
<li class="param-required-">password : String <li class="param-required-">password : String
<br/> <br/>
</li> </li>
</ul> </ul>
<ul class="parameter"> <ul class="parameter">
<li class="param-required-">phone : String <li class="param-required-">phone : String
<br/> <br/>
</li> </li>
</ul> </ul>
<ul class="parameter"> <ul class="parameter">
<li class="param-required-">userStatus : Integer <li class="param-required-">userStatus : Integer
<br/>User Status <br/>User Status
</li> </li>
</ul> </ul>

View File

@ -2,35 +2,6 @@
<h2><a name=""></a></h2> <h2><a name=""></a></h2>
<p>This is the API</p> <p>This is the API</p>
<h2><a name="updatePet"></a>updatePet</h2>
<hr>
<p></p>
<p></p>
<h3 class="section">URL</h3>
<code>http://petstore.swagger.io/v2/pet</code>
<h3 class="section">HTTP Method</h3>
<code>PUT</code>
<h3 class="section">Response Type</h3>
<div class="model" data-model=""><a href=""></a></div>
<h3 class="section">Parameters</h3>
<ul>
<li class="parameter">
<span class="param-in">Body: </span>
<span class="param-name">body</span>
<span class="param-type">Pet</span>
<p class="param-description">Pet object that needs to be added to the store</p>
</li>
</ul>
<h2><a name="addPet"></a>addPet</h2> <h2><a name="addPet"></a>addPet</h2>
<hr> <hr>
<p></p> <p></p>
@ -43,7 +14,6 @@
<div class="model" data-model=""><a href=""></a></div> <div class="model" data-model=""><a href=""></a></div>
<h3 class="section">Parameters</h3> <h3 class="section">Parameters</h3>
<ul> <ul>
<li class="parameter"> <li class="parameter">
@ -51,145 +21,11 @@
<span class="param-in">Body: </span> <span class="param-in">Body: </span>
<span class="param-name">body</span> <span class="param-name">body</span>
<span class="param-type">Pet</span> <span class="param-type">Pet(Pet)</span>
<p class="param-description">Pet object that needs to be added to the store</p> <p class="param-description">Pet object that needs to be added to the store</p>
</li> </li>
</ul> </ul>
<h2><a name="findPetsByStatus"></a>findPetsByStatus</h2>
<hr>
<p></p>
<p>Multiple status values can be provided with comma seperated strings</p>
<h3 class="section">URL</h3>
<code>http://petstore.swagger.io/v2/pet/findByStatus</code>
<h3 class="section">HTTP Method</h3>
<code>GET</code>
<h3 class="section">Response Type</h3>
<div class="model" data-model="Pet"><a href="">List</a></div>
<h3 class="section">Parameters</h3>
<ul>
<li class="parameter">
<span class="param-in">Query: </span>
<span class="param-name">status</span>
<span class="param-type">List(String)</span>
<p class="param-description">Status values that need to be considered for filter</p>
</li>
</ul>
<h2><a name="findPetsByTags"></a>findPetsByTags</h2>
<hr>
<p></p>
<p>Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.</p>
<h3 class="section">URL</h3>
<code>http://petstore.swagger.io/v2/pet/findByTags</code>
<h3 class="section">HTTP Method</h3>
<code>GET</code>
<h3 class="section">Response Type</h3>
<div class="model" data-model="Pet"><a href="">List</a></div>
<h3 class="section">Parameters</h3>
<ul>
<li class="parameter">
<span class="param-in">Query: </span>
<span class="param-name">tags</span>
<span class="param-type">List(String)</span>
<p class="param-description">Tags to filter by</p>
</li>
</ul>
<h2><a name="getPetById"></a>getPetById</h2>
<hr>
<p></p>
<p>Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions</p>
<h3 class="section">URL</h3>
<code>http://petstore.swagger.io/v2/pet/{petId}</code>
<h3 class="section">HTTP Method</h3>
<code>GET</code>
<h3 class="section">Response Type</h3>
<div class="model" data-model="Pet"><a href="">Pet</a></div>
<h3 class="section">Parameters</h3>
<ul>
<li class="parameter">
<span class="param-in">Path: </span>
<span class="param-name">petId</span>
<span class="param-type">Long</span>
<p class="param-description">ID of pet that needs to be fetched</p>
</li>
</ul>
<h2><a name="updatePetWithForm"></a>updatePetWithForm</h2>
<hr>
<p></p>
<p></p>
<h3 class="section">URL</h3>
<code>http://petstore.swagger.io/v2/pet/{petId}</code>
<h3 class="section">HTTP Method</h3>
<code>POST</code>
<h3 class="section">Response Type</h3>
<div class="model" data-model=""><a href=""></a></div>
<h3 class="section">Parameters</h3>
<ul>
<li class="parameter">
<span class="param-in">Path: </span>
<span class="param-name">petId</span>
<span class="param-type">String</span>
<p class="param-description">ID of pet that needs to be updated</p>
</li>
<li class="parameter">
<span class="param-in">Form: </span>
<span class="param-name">name</span>
<span class="param-type">String</span>
<p class="param-description">Updated name of the pet</p>
</li>
<li class="parameter">
<span class="param-in">Form: </span>
<span class="param-name">status</span>
<span class="param-type">String</span>
<p class="param-description">Updated status of the pet</p>
</li>
</ul>
<h2><a name="deletePet"></a>deletePet</h2> <h2><a name="deletePet"></a>deletePet</h2>
<hr> <hr>
<p></p> <p></p>
@ -202,7 +38,6 @@
<div class="model" data-model=""><a href=""></a></div> <div class="model" data-model=""><a href=""></a></div>
<h3 class="section">Parameters</h3> <h3 class="section">Parameters</h3>
<ul> <ul>
<li class="parameter"> <li class="parameter">
@ -214,7 +49,6 @@
<p class="param-description">Pet id to delete</p> <p class="param-description">Pet id to delete</p>
</li> </li>
<li class="parameter"> <li class="parameter">
@ -226,9 +60,149 @@
<p class="param-description"></p> <p class="param-description"></p>
</li> </li>
</ul> </ul>
<h2><a name="findPetsByStatus"></a>findPetsByStatus</h2>
<hr>
<p></p>
<p>Multiple status values can be provided with comma separated strings</p>
<h3 class="section">URL</h3>
<code>http://petstore.swagger.io/v2/pet/findByStatus</code>
<h3 class="section">HTTP Method</h3>
<code>GET</code>
<h3 class="section">Response Type</h3>
<div class="model" data-model="Pet"><a href="">List</a></div>
<h3 class="section">Parameters</h3>
<ul>
<li class="parameter">
<span class="param-in">Query: </span>
<span class="param-name">status</span>
<span class="param-type">List(String)</span>
<p class="param-description">Status values that need to be considered for filter</p>
</li>
</ul>
<h2><a name="findPetsByTags"></a>findPetsByTags</h2>
<hr>
<p></p>
<p>Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.</p>
<h3 class="section">URL</h3>
<code>http://petstore.swagger.io/v2/pet/findByTags</code>
<h3 class="section">HTTP Method</h3>
<code>GET</code>
<h3 class="section">Response Type</h3>
<div class="model" data-model="Pet"><a href="">List</a></div>
<h3 class="section">Parameters</h3>
<ul>
<li class="parameter">
<span class="param-in">Query: </span>
<span class="param-name">tags</span>
<span class="param-type">List(String)</span>
<p class="param-description">Tags to filter by</p>
</li>
</ul>
<h2><a name="getPetById"></a>getPetById</h2>
<hr>
<p></p>
<p>Returns a single pet</p>
<h3 class="section">URL</h3>
<code>http://petstore.swagger.io/v2/pet/{petId}</code>
<h3 class="section">HTTP Method</h3>
<code>GET</code>
<h3 class="section">Response Type</h3>
<div class="model" data-model="Pet"><a href="">Pet</a></div>
<h3 class="section">Parameters</h3>
<ul>
<li class="parameter">
<span class="param-in">Path: </span>
<span class="param-name">petId</span>
<span class="param-type">Long</span>
<p class="param-description">ID of pet to return</p>
</li>
</ul>
<h2><a name="updatePet"></a>updatePet</h2>
<hr>
<p></p>
<p></p>
<h3 class="section">URL</h3>
<code>http://petstore.swagger.io/v2/pet</code>
<h3 class="section">HTTP Method</h3>
<code>PUT</code>
<h3 class="section">Response Type</h3>
<div class="model" data-model=""><a href=""></a></div>
<h3 class="section">Parameters</h3>
<ul>
<li class="parameter">
<span class="param-in">Body: </span>
<span class="param-name">body</span>
<span class="param-type">Pet(Pet)</span>
<p class="param-description">Pet object that needs to be added to the store</p>
</li>
</ul>
<h2><a name="updatePetWithForm"></a>updatePetWithForm</h2>
<hr>
<p></p>
<p></p>
<h3 class="section">URL</h3>
<code>http://petstore.swagger.io/v2/pet/{petId}</code>
<h3 class="section">HTTP Method</h3>
<code>POST</code>
<h3 class="section">Response Type</h3>
<div class="model" data-model=""><a href=""></a></div>
<h3 class="section">Parameters</h3>
<ul>
<li class="parameter">
<span class="param-in">Path: </span>
<span class="param-name">petId</span>
<span class="param-type">Long</span>
<p class="param-description">ID of pet that needs to be updated</p>
</li>
<li class="parameter">
<span class="param-in">Form: </span>
<span class="param-name">name</span>
<span class="param-type">String</span>
<p class="param-description">Updated name of the pet</p>
</li>
<li class="parameter">
<span class="param-in">Form: </span>
<span class="param-name">status</span>
<span class="param-type">String</span>
<p class="param-description">Updated status of the pet</p>
</li>
</ul>
<h2><a name="uploadFile"></a>uploadFile</h2> <h2><a name="uploadFile"></a>uploadFile</h2>
<hr> <hr>
<p></p> <p></p>
@ -238,10 +212,9 @@
<h3 class="section">HTTP Method</h3> <h3 class="section">HTTP Method</h3>
<code>POST</code> <code>POST</code>
<h3 class="section">Response Type</h3> <h3 class="section">Response Type</h3>
<div class="model" data-model=""><a href=""></a></div> <div class="model" data-model="ApiResponse"><a href="">ApiResponse</a></div>
<h3 class="section">Parameters</h3> <h3 class="section">Parameters</h3>
<ul> <ul>
<li class="parameter"> <li class="parameter">
@ -253,7 +226,6 @@
<p class="param-description">ID of pet to update</p> <p class="param-description">ID of pet to update</p>
</li> </li>
<li class="parameter"> <li class="parameter">
<span class="param-in">Form: </span> <span class="param-in">Form: </span>
@ -265,7 +237,6 @@
<p class="param-description">Additional data to pass to server</p> <p class="param-description">Additional data to pass to server</p>
</li> </li>
<li class="parameter"> <li class="parameter">
<span class="param-in">Form: </span> <span class="param-in">Form: </span>
@ -277,8 +248,5 @@
<p class="param-description">file to upload</p> <p class="param-description">file to upload</p>
</li> </li>
</ul> </ul>
</div> </div>

View File

@ -2,77 +2,6 @@
<h2><a name=""></a></h2> <h2><a name=""></a></h2>
<p>This is the API</p> <p>This is the API</p>
<h2><a name="getInventory"></a>getInventory</h2>
<hr>
<p></p>
<p>Returns a map of status codes to quantities</p>
<h3 class="section">URL</h3>
<code>http://petstore.swagger.io/v2/store/inventory</code>
<h3 class="section">HTTP Method</h3>
<code>GET</code>
<h3 class="section">Response Type</h3>
<div class="model" data-model="integer"><a href="">Map</a></div>
<h3 class="section">Parameters</h3>
<ul>
</ul>
<h2><a name="placeOrder"></a>placeOrder</h2>
<hr>
<p></p>
<p></p>
<h3 class="section">URL</h3>
<code>http://petstore.swagger.io/v2/store/order</code>
<h3 class="section">HTTP Method</h3>
<code>POST</code>
<h3 class="section">Response Type</h3>
<div class="model" data-model="Order"><a href="">Order</a></div>
<h3 class="section">Parameters</h3>
<ul>
<li class="parameter">
<span class="param-in">Body: </span>
<span class="param-name">body</span>
<span class="param-type">Order</span>
<p class="param-description">order placed for purchasing the pet</p>
</li>
</ul>
<h2><a name="getOrderById"></a>getOrderById</h2>
<hr>
<p></p>
<p>For valid response try integer IDs with value &lt;= 5 or &gt; 10. Other values will generated exceptions</p>
<h3 class="section">URL</h3>
<code>http://petstore.swagger.io/v2/store/order/{orderId}</code>
<h3 class="section">HTTP Method</h3>
<code>GET</code>
<h3 class="section">Response Type</h3>
<div class="model" data-model="Order"><a href="">Order</a></div>
<h3 class="section">Parameters</h3>
<ul>
<li class="parameter">
<span class="param-in">Path: </span>
<span class="param-name">orderId</span>
<span class="param-type">String</span>
<p class="param-description">ID of pet that needs to be fetched</p>
</li>
</ul>
<h2><a name="deleteOrder"></a>deleteOrder</h2> <h2><a name="deleteOrder"></a>deleteOrder</h2>
<hr> <hr>
<p></p> <p></p>
@ -85,7 +14,6 @@
<div class="model" data-model=""><a href=""></a></div> <div class="model" data-model=""><a href=""></a></div>
<h3 class="section">Parameters</h3> <h3 class="section">Parameters</h3>
<ul> <ul>
<li class="parameter"> <li class="parameter">
@ -97,8 +25,66 @@
<p class="param-description">ID of the order that needs to be deleted</p> <p class="param-description">ID of the order that needs to be deleted</p>
</li> </li>
</ul> </ul>
<h2><a name="getInventory"></a>getInventory</h2>
<hr>
<p></p>
<p>Returns a map of status codes to quantities</p>
<h3 class="section">URL</h3>
<code>http://petstore.swagger.io/v2/store/inventory</code>
<h3 class="section">HTTP Method</h3>
<code>GET</code>
<h3 class="section">Response Type</h3>
<div class="model" data-model="integer"><a href="">Map</a></div>
<h3 class="section">Parameters</h3>
<ul>
</ul>
<h2><a name="getOrderById"></a>getOrderById</h2>
<hr>
<p></p>
<p>For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions</p>
<h3 class="section">URL</h3>
<code>http://petstore.swagger.io/v2/store/order/{orderId}</code>
<h3 class="section">HTTP Method</h3>
<code>GET</code>
<h3 class="section">Response Type</h3>
<div class="model" data-model="Order"><a href="">Order</a></div>
<h3 class="section">Parameters</h3>
<ul>
<li class="parameter">
<span class="param-in">Path: </span>
<span class="param-name">orderId</span>
<span class="param-type">Long</span>
<p class="param-description">ID of pet that needs to be fetched</p>
</li>
</ul>
<h2><a name="placeOrder"></a>placeOrder</h2>
<hr>
<p></p>
<p></p>
<h3 class="section">URL</h3>
<code>http://petstore.swagger.io/v2/store/order</code>
<h3 class="section">HTTP Method</h3>
<code>POST</code>
<h3 class="section">Response Type</h3>
<div class="model" data-model="Order"><a href="">Order</a></div>
<h3 class="section">Parameters</h3>
<ul>
<li class="parameter">
<span class="param-in">Body: </span>
<span class="param-name">body</span>
<span class="param-type">Order(Order)</span>
<p class="param-description">order placed for purchasing the pet</p>
</li>
</ul>
</div> </div>

View File

@ -2,8 +2,6 @@
<h2><a name=""></a></h2> <h2><a name=""></a></h2>
<p>This is the API</p> <p>This is the API</p>
<h2><a name="createUser"></a>createUser</h2> <h2><a name="createUser"></a>createUser</h2>
<hr> <hr>
<p></p> <p></p>
@ -16,7 +14,6 @@
<div class="model" data-model=""><a href=""></a></div> <div class="model" data-model=""><a href=""></a></div>
<h3 class="section">Parameters</h3> <h3 class="section">Parameters</h3>
<ul> <ul>
<li class="parameter"> <li class="parameter">
@ -24,13 +21,11 @@
<span class="param-in">Body: </span> <span class="param-in">Body: </span>
<span class="param-name">body</span> <span class="param-name">body</span>
<span class="param-type">User</span> <span class="param-type">User(User)</span>
<p class="param-description">Created user object</p> <p class="param-description">Created user object</p>
</li> </li>
</ul> </ul>
<h2><a name="createUsersWithArrayInput"></a>createUsersWithArrayInput</h2> <h2><a name="createUsersWithArrayInput"></a>createUsersWithArrayInput</h2>
<hr> <hr>
<p></p> <p></p>
@ -43,7 +38,6 @@
<div class="model" data-model=""><a href=""></a></div> <div class="model" data-model=""><a href=""></a></div>
<h3 class="section">Parameters</h3> <h3 class="section">Parameters</h3>
<ul> <ul>
<li class="parameter"> <li class="parameter">
@ -51,13 +45,11 @@
<span class="param-in">Body: </span> <span class="param-in">Body: </span>
<span class="param-name">body</span> <span class="param-name">body</span>
<span class="param-type">List</span> <span class="param-type">List(User)</span>
<p class="param-description">List of user object</p> <p class="param-description">List of user object</p>
</li> </li>
</ul> </ul>
<h2><a name="createUsersWithListInput"></a>createUsersWithListInput</h2> <h2><a name="createUsersWithListInput"></a>createUsersWithListInput</h2>
<hr> <hr>
<p></p> <p></p>
@ -70,7 +62,6 @@
<div class="model" data-model=""><a href=""></a></div> <div class="model" data-model=""><a href=""></a></div>
<h3 class="section">Parameters</h3> <h3 class="section">Parameters</h3>
<ul> <ul>
<li class="parameter"> <li class="parameter">
@ -78,133 +69,11 @@
<span class="param-in">Body: </span> <span class="param-in">Body: </span>
<span class="param-name">body</span> <span class="param-name">body</span>
<span class="param-type">List</span> <span class="param-type">List(User)</span>
<p class="param-description">List of user object</p> <p class="param-description">List of user object</p>
</li> </li>
</ul> </ul>
<h2><a name="loginUser"></a>loginUser</h2>
<hr>
<p></p>
<p></p>
<h3 class="section">URL</h3>
<code>http://petstore.swagger.io/v2/user/login</code>
<h3 class="section">HTTP Method</h3>
<code>GET</code>
<h3 class="section">Response Type</h3>
<div class="model" data-model="string"><a href="">String</a></div>
<h3 class="section">Parameters</h3>
<ul>
<li class="parameter">
<span class="param-in">Query: </span>
<span class="param-name">username</span>
<span class="param-type">String</span>
<p class="param-description">The user name for login</p>
</li>
<li class="parameter">
<span class="param-in">Query: </span>
<span class="param-name">password</span>
<span class="param-type">String</span>
<p class="param-description">The password for login in clear text</p>
</li>
</ul>
<h2><a name="logoutUser"></a>logoutUser</h2>
<hr>
<p></p>
<p></p>
<h3 class="section">URL</h3>
<code>http://petstore.swagger.io/v2/user/logout</code>
<h3 class="section">HTTP Method</h3>
<code>GET</code>
<h3 class="section">Response Type</h3>
<div class="model" data-model=""><a href=""></a></div>
<h3 class="section">Parameters</h3>
<ul>
</ul>
<h2><a name="getUserByName"></a>getUserByName</h2>
<hr>
<p></p>
<p></p>
<h3 class="section">URL</h3>
<code>http://petstore.swagger.io/v2/user/{username}</code>
<h3 class="section">HTTP Method</h3>
<code>GET</code>
<h3 class="section">Response Type</h3>
<div class="model" data-model="User"><a href="">User</a></div>
<h3 class="section">Parameters</h3>
<ul>
<li class="parameter">
<span class="param-in">Path: </span>
<span class="param-name">username</span>
<span class="param-type">String</span>
<p class="param-description">The name that needs to be fetched. Use user1 for testing.</p>
</li>
</ul>
<h2><a name="updateUser"></a>updateUser</h2>
<hr>
<p></p>
<p>This can only be done by the logged in user.</p>
<h3 class="section">URL</h3>
<code>http://petstore.swagger.io/v2/user/{username}</code>
<h3 class="section">HTTP Method</h3>
<code>PUT</code>
<h3 class="section">Response Type</h3>
<div class="model" data-model=""><a href=""></a></div>
<h3 class="section">Parameters</h3>
<ul>
<li class="parameter">
<span class="param-in">Path: </span>
<span class="param-name">username</span>
<span class="param-type">String</span>
<p class="param-description">name that need to be deleted</p>
</li>
<li class="parameter">
<span class="param-in">Body: </span>
<span class="param-name">body</span>
<span class="param-type">User</span>
<p class="param-description">Updated user object</p>
</li>
</ul>
<h2><a name="deleteUser"></a>deleteUser</h2> <h2><a name="deleteUser"></a>deleteUser</h2>
<hr> <hr>
<p></p> <p></p>
@ -217,7 +86,6 @@
<div class="model" data-model=""><a href=""></a></div> <div class="model" data-model=""><a href=""></a></div>
<h3 class="section">Parameters</h3> <h3 class="section">Parameters</h3>
<ul> <ul>
<li class="parameter"> <li class="parameter">
@ -229,8 +97,112 @@
<p class="param-description">The name that needs to be deleted</p> <p class="param-description">The name that needs to be deleted</p>
</li> </li>
</ul> </ul>
<h2><a name="getUserByName"></a>getUserByName</h2>
<hr>
<p></p>
<p></p>
<h3 class="section">URL</h3>
<code>http://petstore.swagger.io/v2/user/{username}</code>
<h3 class="section">HTTP Method</h3>
<code>GET</code>
<h3 class="section">Response Type</h3>
<div class="model" data-model="User"><a href="">User</a></div>
<h3 class="section">Parameters</h3>
<ul>
<li class="parameter">
<span class="param-in">Path: </span>
<span class="param-name">username</span>
<span class="param-type">String</span>
<p class="param-description">The name that needs to be fetched. Use user1 for testing. </p>
</li>
</ul>
<h2><a name="loginUser"></a>loginUser</h2>
<hr>
<p></p>
<p></p>
<h3 class="section">URL</h3>
<code>http://petstore.swagger.io/v2/user/login</code>
<h3 class="section">HTTP Method</h3>
<code>GET</code>
<h3 class="section">Response Type</h3>
<div class="model" data-model="string"><a href="">String</a></div>
<h3 class="section">Parameters</h3>
<ul>
<li class="parameter">
<span class="param-in">Query: </span>
<span class="param-name">username</span>
<span class="param-type">String</span>
<p class="param-description">The user name for login</p>
</li>
<li class="parameter">
<span class="param-in">Query: </span>
<span class="param-name">password</span>
<span class="param-type">String</span>
<p class="param-description">The password for login in clear text</p>
</li>
</ul>
<h2><a name="logoutUser"></a>logoutUser</h2>
<hr>
<p></p>
<p></p>
<h3 class="section">URL</h3>
<code>http://petstore.swagger.io/v2/user/logout</code>
<h3 class="section">HTTP Method</h3>
<code>GET</code>
<h3 class="section">Response Type</h3>
<div class="model" data-model=""><a href=""></a></div>
<h3 class="section">Parameters</h3>
<ul>
</ul>
<h2><a name="updateUser"></a>updateUser</h2>
<hr>
<p></p>
<p>This can only be done by the logged in user.</p>
<h3 class="section">URL</h3>
<code>http://petstore.swagger.io/v2/user/{username}</code>
<h3 class="section">HTTP Method</h3>
<code>PUT</code>
<h3 class="section">Response Type</h3>
<div class="model" data-model=""><a href=""></a></div>
<h3 class="section">Parameters</h3>
<ul>
<li class="parameter">
<span class="param-in">Path: </span>
<span class="param-name">username</span>
<span class="param-type">String</span>
<p class="param-description">name that need to be deleted</p>
</li>
<li class="parameter">
<span class="param-in">Body: </span>
<span class="param-name">body</span>
<span class="param-type">User(User)</span>
<p class="param-description">Updated user object</p>
</li>
</ul>
</div> </div>

View File

@ -182,7 +182,7 @@ font-style: italic;
</head> </head>
<body> <body>
<h1>Swagger Petstore</h1> <h1>Swagger Petstore</h1>
<div class="app-desc">This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters</div> <div class="app-desc">This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.</div>
<div class="app-desc">Contact Info: <a href="apiteam@swagger.io">apiteam@swagger.io</a></div> <div class="app-desc">Contact Info: <a href="apiteam@swagger.io">apiteam@swagger.io</a></div>
<div class="app-desc">Version: 1.0.0</div> <div class="app-desc">Version: 1.0.0</div>
@ -198,20 +198,15 @@ font-style: italic;
<div class="method-summary"></div> <div class="method-summary"></div>
<ol> <ol>
<li><a href="#addPet"><code><span class="http-method">post</span> /pet</code></a></li> <li><a href="#addPet"><code><span class="http-method">post</span> /pet</code></a></li>
<li><a href="#addPetUsingByteArray"><code><span class="http-method">post</span> /pet?testing_byte_array&#x3D;true</code></a></li>
<li><a href="#deletePet"><code><span class="http-method">delete</span> /pet/{petId}</code></a></li> <li><a href="#deletePet"><code><span class="http-method">delete</span> /pet/{petId}</code></a></li>
<li><a href="#findPetsByStatus"><code><span class="http-method">get</span> /pet/findByStatus</code></a></li> <li><a href="#findPetsByStatus"><code><span class="http-method">get</span> /pet/findByStatus</code></a></li>
<li><a href="#findPetsByTags"><code><span class="http-method">get</span> /pet/findByTags</code></a></li> <li><a href="#findPetsByTags"><code><span class="http-method">get</span> /pet/findByTags</code></a></li>
<li><a href="#getPetById"><code><span class="http-method">get</span> /pet/{petId}</code></a></li> <li><a href="#getPetById"><code><span class="http-method">get</span> /pet/{petId}</code></a></li>
<li><a href="#getPetByIdInObject"><code><span class="http-method">get</span> /pet/{petId}?response&#x3D;inline_arbitrary_object</code></a></li>
<li><a href="#petPetIdtestingByteArraytrueGet"><code><span class="http-method">get</span> /pet/{petId}?testing_byte_array&#x3D;true</code></a></li>
<li><a href="#updatePet"><code><span class="http-method">put</span> /pet</code></a></li> <li><a href="#updatePet"><code><span class="http-method">put</span> /pet</code></a></li>
<li><a href="#updatePetWithForm"><code><span class="http-method">post</span> /pet/{petId}</code></a></li> <li><a href="#updatePetWithForm"><code><span class="http-method">post</span> /pet/{petId}</code></a></li>
<li><a href="#uploadFile"><code><span class="http-method">post</span> /pet/{petId}/uploadImage</code></a></li> <li><a href="#uploadFile"><code><span class="http-method">post</span> /pet/{petId}/uploadImage</code></a></li>
<li><a href="#deleteOrder"><code><span class="http-method">delete</span> /store/order/{orderId}</code></a></li> <li><a href="#deleteOrder"><code><span class="http-method">delete</span> /store/order/{orderId}</code></a></li>
<li><a href="#findOrdersByStatus"><code><span class="http-method">get</span> /store/findByStatus</code></a></li>
<li><a href="#getInventory"><code><span class="http-method">get</span> /store/inventory</code></a></li> <li><a href="#getInventory"><code><span class="http-method">get</span> /store/inventory</code></a></li>
<li><a href="#getInventoryInObject"><code><span class="http-method">get</span> /store/inventory?response&#x3D;arbitrary_object</code></a></li>
<li><a href="#getOrderById"><code><span class="http-method">get</span> /store/order/{orderId}</code></a></li> <li><a href="#getOrderById"><code><span class="http-method">get</span> /store/order/{orderId}</code></a></li>
<li><a href="#placeOrder"><code><span class="http-method">post</span> /store/order</code></a></li> <li><a href="#placeOrder"><code><span class="http-method">post</span> /store/order</code></a></li>
<li><a href="#createUser"><code><span class="http-method">post</span> /user</code></a></li> <li><a href="#createUser"><code><span class="http-method">post</span> /user</code></a></li>
@ -241,7 +236,7 @@ font-style: italic;
<h3 class="field-label">Request body</h3> <h3 class="field-label">Request body</h3>
<div class="field-items"> <div class="field-items">
<div class="param">body (optional)</div> <div class="param">body (required)</div>
<div class="param-desc"><span class="param-type">Body Parameter</span> &mdash; Pet object that needs to be added to the store </div> <div class="param-desc"><span class="param-type">Body Parameter</span> &mdash; Pet object that needs to be added to the store </div>
</div> <!-- field-items --> </div> <!-- field-items -->
@ -257,50 +252,8 @@ font-style: italic;
This API call produces the following media types according to the <span class="header">Accept</span> request header; This API call produces the following media types according to the <span class="header">Accept</span> request header;
the media type will be conveyed by the <span class="heaader">Content-Type</span> response header. the media type will be conveyed by the <span class="heaader">Content-Type</span> response header.
<ul> <ul>
<li><code>application/json</code></li>
<li><code>application/xml</code></li> <li><code>application/xml</code></li>
</ul>
<h3 class="field-label">Responses</h3>
<h4 class="field-label">405</h4>
Invalid input
</div> <!-- method -->
<hr/>
<div class="method"><a name="addPetUsingByteArray"/>
<div class="method-path">
<a class="up" href="#__Methods">Up</a>
<pre class="post"><code class="huge"><span class="http-method">post</span> /pet?testing_byte_array&#x3D;true</code></pre></div>
<div class="method-summary">Fake endpoint to test byte array in body parameter for adding a new pet to the store (<span class="nickname">addPetUsingByteArray</span>)</div>
<div class="method-notes"></div>
<h3 class="field-label">Consumes</h3>
This API call consumes the following media types via the <span class="heaader">Content-Type</span> request header:
<ul>
<li><code>application/json</code></li> <li><code>application/json</code></li>
<li><code>application/xml</code></li>
</ul>
<h3 class="field-label">Request body</h3>
<div class="field-items">
<div class="param">body (optional)</div>
<div class="param-desc"><span class="param-type">Body Parameter</span> &mdash; Pet object in the form of byte array </div>
</div> <!-- field-items -->
<!--Todo: process Response Object and its headers, schema, examples -->
<h3 class="field-label">Produces</h3>
This API call produces the following media types according to the <span class="header">Accept</span> request header;
the media type will be conveyed by the <span class="heaader">Content-Type</span> response header.
<ul>
<li><code>application/json</code></li>
<li><code>application/xml</code></li>
</ul> </ul>
<h3 class="field-label">Responses</h3> <h3 class="field-label">Responses</h3>
@ -335,8 +288,8 @@ font-style: italic;
This API call produces the following media types according to the <span class="header">Accept</span> request header; This API call produces the following media types according to the <span class="header">Accept</span> request header;
the media type will be conveyed by the <span class="heaader">Content-Type</span> response header. the media type will be conveyed by the <span class="heaader">Content-Type</span> response header.
<ul> <ul>
<li><code>application/json</code></li>
<li><code>application/xml</code></li> <li><code>application/xml</code></li>
<li><code>application/json</code></li>
</ul> </ul>
<h3 class="field-label">Responses</h3> <h3 class="field-label">Responses</h3>
@ -357,9 +310,9 @@ font-style: italic;
<h3 class="field-label">Query parameters</h3> <h3 class="field-label">Query parameters</h3>
<div class="field-items"> <div class="field-items">
<div class="param">status (optional)</div> <div class="param">status (required)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> &mdash; Status values that need to be considered for query default: available</div> <div class="param-desc"><span class="param-type">Query Parameter</span> &mdash; Status values that need to be considered for filter </div>
</div> <!-- field-items --> </div> <!-- field-items -->
@ -376,8 +329,8 @@ font-style: italic;
This API call produces the following media types according to the <span class="header">Accept</span> request header; This API call produces the following media types according to the <span class="header">Accept</span> request header;
the media type will be conveyed by the <span class="heaader">Content-Type</span> response header. the media type will be conveyed by the <span class="heaader">Content-Type</span> response header.
<ul> <ul>
<li><code>application/json</code></li>
<li><code>application/xml</code></li> <li><code>application/xml</code></li>
<li><code>application/json</code></li>
</ul> </ul>
<h3 class="field-label">Responses</h3> <h3 class="field-label">Responses</h3>
@ -392,7 +345,7 @@ font-style: italic;
<a class="up" href="#__Methods">Up</a> <a class="up" href="#__Methods">Up</a>
<pre class="get"><code class="huge"><span class="http-method">get</span> /pet/findByTags</code></pre></div> <pre class="get"><code class="huge"><span class="http-method">get</span> /pet/findByTags</code></pre></div>
<div class="method-summary">Finds Pets by tags (<span class="nickname">findPetsByTags</span>)</div> <div class="method-summary">Finds Pets by tags (<span class="nickname">findPetsByTags</span>)</div>
<div class="method-notes">Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.</div> <div class="method-notes">Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.</div>
@ -400,7 +353,7 @@ font-style: italic;
<h3 class="field-label">Query parameters</h3> <h3 class="field-label">Query parameters</h3>
<div class="field-items"> <div class="field-items">
<div class="param">tags (optional)</div> <div class="param">tags (required)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> &mdash; Tags to filter by </div> <div class="param-desc"><span class="param-type">Query Parameter</span> &mdash; Tags to filter by </div>
</div> <!-- field-items --> </div> <!-- field-items -->
@ -419,8 +372,8 @@ font-style: italic;
This API call produces the following media types according to the <span class="header">Accept</span> request header; This API call produces the following media types according to the <span class="header">Accept</span> request header;
the media type will be conveyed by the <span class="heaader">Content-Type</span> response header. the media type will be conveyed by the <span class="heaader">Content-Type</span> response header.
<ul> <ul>
<li><code>application/json</code></li>
<li><code>application/xml</code></li> <li><code>application/xml</code></li>
<li><code>application/json</code></li>
</ul> </ul>
<h3 class="field-label">Responses</h3> <h3 class="field-label">Responses</h3>
@ -435,13 +388,13 @@ font-style: italic;
<a class="up" href="#__Methods">Up</a> <a class="up" href="#__Methods">Up</a>
<pre class="get"><code class="huge"><span class="http-method">get</span> /pet/{petId}</code></pre></div> <pre class="get"><code class="huge"><span class="http-method">get</span> /pet/{petId}</code></pre></div>
<div class="method-summary">Find pet by ID (<span class="nickname">getPetById</span>)</div> <div class="method-summary">Find pet by ID (<span class="nickname">getPetById</span>)</div>
<div class="method-notes">Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions</div> <div class="method-notes">Returns a single pet</div>
<h3 class="field-label">Path parameters</h3> <h3 class="field-label">Path parameters</h3>
<div class="field-items"> <div class="field-items">
<div class="param">petId (required)</div> <div class="param">petId (required)</div>
<div class="param-desc"><span class="param-type">Path Parameter</span> &mdash; ID of pet that needs to be fetched </div> <div class="param-desc"><span class="param-type">Path Parameter</span> &mdash; ID of pet to return </div>
</div> <!-- field-items --> </div> <!-- field-items -->
@ -462,98 +415,8 @@ font-style: italic;
This API call produces the following media types according to the <span class="header">Accept</span> request header; This API call produces the following media types according to the <span class="header">Accept</span> request header;
the media type will be conveyed by the <span class="heaader">Content-Type</span> response header. the media type will be conveyed by the <span class="heaader">Content-Type</span> response header.
<ul> <ul>
<li><code>application/json</code></li>
<li><code>application/xml</code></li> <li><code>application/xml</code></li>
</ul>
<h3 class="field-label">Responses</h3>
<h4 class="field-label">200</h4>
successful operation
<h4 class="field-label">400</h4>
Invalid ID supplied
<h4 class="field-label">404</h4>
Pet not found
</div> <!-- method -->
<hr/>
<div class="method"><a name="getPetByIdInObject"/>
<div class="method-path">
<a class="up" href="#__Methods">Up</a>
<pre class="get"><code class="huge"><span class="http-method">get</span> /pet/{petId}?response&#x3D;inline_arbitrary_object</code></pre></div>
<div class="method-summary">Fake endpoint to test inline arbitrary object return by &#39;Find pet by ID&#39; (<span class="nickname">getPetByIdInObject</span>)</div>
<div class="method-notes">Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions</div>
<h3 class="field-label">Path parameters</h3>
<div class="field-items">
<div class="param">petId (required)</div>
<div class="param-desc"><span class="param-type">Path Parameter</span> &mdash; ID of pet that needs to be fetched </div>
</div> <!-- field-items -->
<h3 class="field-label">Return type</h3>
<div class="return-type">
<a href="#inline_response_200">inline_response_200</a>
</div>
<!--Todo: process Response Object and its headers, schema, examples -->
<h3 class="field-label">Produces</h3>
This API call produces the following media types according to the <span class="header">Accept</span> request header;
the media type will be conveyed by the <span class="heaader">Content-Type</span> response header.
<ul>
<li><code>application/json</code></li> <li><code>application/json</code></li>
<li><code>application/xml</code></li>
</ul>
<h3 class="field-label">Responses</h3>
<h4 class="field-label">200</h4>
successful operation
<h4 class="field-label">400</h4>
Invalid ID supplied
<h4 class="field-label">404</h4>
Pet not found
</div> <!-- method -->
<hr/>
<div class="method"><a name="petPetIdtestingByteArraytrueGet"/>
<div class="method-path">
<a class="up" href="#__Methods">Up</a>
<pre class="get"><code class="huge"><span class="http-method">get</span> /pet/{petId}?testing_byte_array&#x3D;true</code></pre></div>
<div class="method-summary">Fake endpoint to test byte array return by &#39;Find pet by ID&#39; (<span class="nickname">petPetIdtestingByteArraytrueGet</span>)</div>
<div class="method-notes">Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions</div>
<h3 class="field-label">Path parameters</h3>
<div class="field-items">
<div class="param">petId (required)</div>
<div class="param-desc"><span class="param-type">Path Parameter</span> &mdash; ID of pet that needs to be fetched </div>
</div> <!-- field-items -->
<h3 class="field-label">Return type</h3>
<div class="return-type">
byte[]
</div>
<!--Todo: process Response Object and its headers, schema, examples -->
<h3 class="field-label">Produces</h3>
This API call produces the following media types according to the <span class="header">Accept</span> request header;
the media type will be conveyed by the <span class="heaader">Content-Type</span> response header.
<ul>
<li><code>application/json</code></li>
<li><code>application/xml</code></li>
</ul> </ul>
<h3 class="field-label">Responses</h3> <h3 class="field-label">Responses</h3>
@ -582,7 +445,7 @@ font-style: italic;
<h3 class="field-label">Request body</h3> <h3 class="field-label">Request body</h3>
<div class="field-items"> <div class="field-items">
<div class="param">body (optional)</div> <div class="param">body (required)</div>
<div class="param-desc"><span class="param-type">Body Parameter</span> &mdash; Pet object that needs to be added to the store </div> <div class="param-desc"><span class="param-type">Body Parameter</span> &mdash; Pet object that needs to be added to the store </div>
</div> <!-- field-items --> </div> <!-- field-items -->
@ -598,8 +461,8 @@ font-style: italic;
This API call produces the following media types according to the <span class="header">Accept</span> request header; This API call produces the following media types according to the <span class="header">Accept</span> request header;
the media type will be conveyed by the <span class="heaader">Content-Type</span> response header. the media type will be conveyed by the <span class="heaader">Content-Type</span> response header.
<ul> <ul>
<li><code>application/json</code></li>
<li><code>application/xml</code></li> <li><code>application/xml</code></li>
<li><code>application/json</code></li>
</ul> </ul>
<h3 class="field-label">Responses</h3> <h3 class="field-label">Responses</h3>
@ -651,8 +514,8 @@ font-style: italic;
This API call produces the following media types according to the <span class="header">Accept</span> request header; This API call produces the following media types according to the <span class="header">Accept</span> request header;
the media type will be conveyed by the <span class="heaader">Content-Type</span> response header. the media type will be conveyed by the <span class="heaader">Content-Type</span> response header.
<ul> <ul>
<li><code>application/json</code></li>
<li><code>application/xml</code></li> <li><code>application/xml</code></li>
<li><code>application/json</code></li>
</ul> </ul>
<h3 class="field-label">Responses</h3> <h3 class="field-label">Responses</h3>
@ -692,6 +555,11 @@ font-style: italic;
<div class="param-desc"><span class="param-type">Form Parameter</span> &mdash; file to upload </div> <div class="param-desc"><span class="param-type">Form Parameter</span> &mdash; file to upload </div>
</div> <!-- field-items --> </div> <!-- field-items -->
<h3 class="field-label">Return type</h3>
<div class="return-type">
<a href="#ApiResponse">ApiResponse</a>
</div>
<!--Todo: process Response Object and its headers, schema, examples --> <!--Todo: process Response Object and its headers, schema, examples -->
@ -701,11 +569,10 @@ font-style: italic;
the media type will be conveyed by the <span class="heaader">Content-Type</span> response header. the media type will be conveyed by the <span class="heaader">Content-Type</span> response header.
<ul> <ul>
<li><code>application/json</code></li> <li><code>application/json</code></li>
<li><code>application/xml</code></li>
</ul> </ul>
<h3 class="field-label">Responses</h3> <h3 class="field-label">Responses</h3>
<h4 class="field-label">0</h4> <h4 class="field-label">200</h4>
successful operation successful operation
</div> <!-- method --> </div> <!-- method -->
<hr/> <hr/>
@ -736,8 +603,8 @@ font-style: italic;
This API call produces the following media types according to the <span class="header">Accept</span> request header; This API call produces the following media types according to the <span class="header">Accept</span> request header;
the media type will be conveyed by the <span class="heaader">Content-Type</span> response header. the media type will be conveyed by the <span class="heaader">Content-Type</span> response header.
<ul> <ul>
<li><code>application/json</code></li>
<li><code>application/xml</code></li> <li><code>application/xml</code></li>
<li><code>application/json</code></li>
</ul> </ul>
<h3 class="field-label">Responses</h3> <h3 class="field-label">Responses</h3>
@ -747,49 +614,6 @@ font-style: italic;
Order not found Order not found
</div> <!-- method --> </div> <!-- method -->
<hr/> <hr/>
<div class="method"><a name="findOrdersByStatus"/>
<div class="method-path">
<a class="up" href="#__Methods">Up</a>
<pre class="get"><code class="huge"><span class="http-method">get</span> /store/findByStatus</code></pre></div>
<div class="method-summary">Finds orders by status (<span class="nickname">findOrdersByStatus</span>)</div>
<div class="method-notes">A single status value can be provided as a string</div>
<h3 class="field-label">Query parameters</h3>
<div class="field-items">
<div class="param">status (optional)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> &mdash; Status value that needs to be considered for query default: placed</div>
</div> <!-- field-items -->
<h3 class="field-label">Return type</h3>
<div class="return-type">
array[<a href="#Order">Order</a>]
</div>
<!--Todo: process Response Object and its headers, schema, examples -->
<h3 class="field-label">Produces</h3>
This API call produces the following media types according to the <span class="header">Accept</span> request header;
the media type will be conveyed by the <span class="heaader">Content-Type</span> response header.
<ul>
<li><code>application/json</code></li>
<li><code>application/xml</code></li>
</ul>
<h3 class="field-label">Responses</h3>
<h4 class="field-label">200</h4>
successful operation
<h4 class="field-label">400</h4>
Invalid status value
</div> <!-- method -->
<hr/>
<div class="method"><a name="getInventory"/> <div class="method"><a name="getInventory"/>
<div class="method-path"> <div class="method-path">
<a class="up" href="#__Methods">Up</a> <a class="up" href="#__Methods">Up</a>
@ -817,42 +641,6 @@ font-style: italic;
the media type will be conveyed by the <span class="heaader">Content-Type</span> response header. the media type will be conveyed by the <span class="heaader">Content-Type</span> response header.
<ul> <ul>
<li><code>application/json</code></li> <li><code>application/json</code></li>
<li><code>application/xml</code></li>
</ul>
<h3 class="field-label">Responses</h3>
<h4 class="field-label">200</h4>
successful operation
</div> <!-- method -->
<hr/>
<div class="method"><a name="getInventoryInObject"/>
<div class="method-path">
<a class="up" href="#__Methods">Up</a>
<pre class="get"><code class="huge"><span class="http-method">get</span> /store/inventory?response&#x3D;arbitrary_object</code></pre></div>
<div class="method-summary">Fake endpoint to test arbitrary object return by &#39;Get inventory&#39; (<span class="nickname">getInventoryInObject</span>)</div>
<div class="method-notes">Returns an arbitrary object which is actually a map of status codes to quantities</div>
<h3 class="field-label">Return type</h3>
<div class="return-type">
Object
</div>
<!--Todo: process Response Object and its headers, schema, examples -->
<h3 class="field-label">Produces</h3>
This API call produces the following media types according to the <span class="header">Accept</span> request header;
the media type will be conveyed by the <span class="heaader">Content-Type</span> response header.
<ul>
<li><code>application/json</code></li>
<li><code>application/xml</code></li>
</ul> </ul>
<h3 class="field-label">Responses</h3> <h3 class="field-label">Responses</h3>
@ -892,8 +680,8 @@ font-style: italic;
This API call produces the following media types according to the <span class="header">Accept</span> request header; This API call produces the following media types according to the <span class="header">Accept</span> request header;
the media type will be conveyed by the <span class="heaader">Content-Type</span> response header. the media type will be conveyed by the <span class="heaader">Content-Type</span> response header.
<ul> <ul>
<li><code>application/json</code></li>
<li><code>application/xml</code></li> <li><code>application/xml</code></li>
<li><code>application/json</code></li>
</ul> </ul>
<h3 class="field-label">Responses</h3> <h3 class="field-label">Responses</h3>
@ -916,7 +704,7 @@ font-style: italic;
<h3 class="field-label">Request body</h3> <h3 class="field-label">Request body</h3>
<div class="field-items"> <div class="field-items">
<div class="param">body (optional)</div> <div class="param">body (required)</div>
<div class="param-desc"><span class="param-type">Body Parameter</span> &mdash; order placed for purchasing the pet </div> <div class="param-desc"><span class="param-type">Body Parameter</span> &mdash; order placed for purchasing the pet </div>
</div> <!-- field-items --> </div> <!-- field-items -->
@ -937,8 +725,8 @@ font-style: italic;
This API call produces the following media types according to the <span class="header">Accept</span> request header; This API call produces the following media types according to the <span class="header">Accept</span> request header;
the media type will be conveyed by the <span class="heaader">Content-Type</span> response header. the media type will be conveyed by the <span class="heaader">Content-Type</span> response header.
<ul> <ul>
<li><code>application/json</code></li>
<li><code>application/xml</code></li> <li><code>application/xml</code></li>
<li><code>application/json</code></li>
</ul> </ul>
<h3 class="field-label">Responses</h3> <h3 class="field-label">Responses</h3>
@ -959,7 +747,7 @@ font-style: italic;
<h3 class="field-label">Request body</h3> <h3 class="field-label">Request body</h3>
<div class="field-items"> <div class="field-items">
<div class="param">body (optional)</div> <div class="param">body (required)</div>
<div class="param-desc"><span class="param-type">Body Parameter</span> &mdash; Created user object </div> <div class="param-desc"><span class="param-type">Body Parameter</span> &mdash; Created user object </div>
</div> <!-- field-items --> </div> <!-- field-items -->
@ -975,8 +763,8 @@ font-style: italic;
This API call produces the following media types according to the <span class="header">Accept</span> request header; This API call produces the following media types according to the <span class="header">Accept</span> request header;
the media type will be conveyed by the <span class="heaader">Content-Type</span> response header. the media type will be conveyed by the <span class="heaader">Content-Type</span> response header.
<ul> <ul>
<li><code>application/json</code></li>
<li><code>application/xml</code></li> <li><code>application/xml</code></li>
<li><code>application/json</code></li>
</ul> </ul>
<h3 class="field-label">Responses</h3> <h3 class="field-label">Responses</h3>
@ -995,7 +783,7 @@ font-style: italic;
<h3 class="field-label">Request body</h3> <h3 class="field-label">Request body</h3>
<div class="field-items"> <div class="field-items">
<div class="param">body (optional)</div> <div class="param">body (required)</div>
<div class="param-desc"><span class="param-type">Body Parameter</span> &mdash; List of user object </div> <div class="param-desc"><span class="param-type">Body Parameter</span> &mdash; List of user object </div>
</div> <!-- field-items --> </div> <!-- field-items -->
@ -1011,8 +799,8 @@ font-style: italic;
This API call produces the following media types according to the <span class="header">Accept</span> request header; This API call produces the following media types according to the <span class="header">Accept</span> request header;
the media type will be conveyed by the <span class="heaader">Content-Type</span> response header. the media type will be conveyed by the <span class="heaader">Content-Type</span> response header.
<ul> <ul>
<li><code>application/json</code></li>
<li><code>application/xml</code></li> <li><code>application/xml</code></li>
<li><code>application/json</code></li>
</ul> </ul>
<h3 class="field-label">Responses</h3> <h3 class="field-label">Responses</h3>
@ -1031,7 +819,7 @@ font-style: italic;
<h3 class="field-label">Request body</h3> <h3 class="field-label">Request body</h3>
<div class="field-items"> <div class="field-items">
<div class="param">body (optional)</div> <div class="param">body (required)</div>
<div class="param-desc"><span class="param-type">Body Parameter</span> &mdash; List of user object </div> <div class="param-desc"><span class="param-type">Body Parameter</span> &mdash; List of user object </div>
</div> <!-- field-items --> </div> <!-- field-items -->
@ -1047,8 +835,8 @@ font-style: italic;
This API call produces the following media types according to the <span class="header">Accept</span> request header; This API call produces the following media types according to the <span class="header">Accept</span> request header;
the media type will be conveyed by the <span class="heaader">Content-Type</span> response header. the media type will be conveyed by the <span class="heaader">Content-Type</span> response header.
<ul> <ul>
<li><code>application/json</code></li>
<li><code>application/xml</code></li> <li><code>application/xml</code></li>
<li><code>application/json</code></li>
</ul> </ul>
<h3 class="field-label">Responses</h3> <h3 class="field-label">Responses</h3>
@ -1083,8 +871,8 @@ font-style: italic;
This API call produces the following media types according to the <span class="header">Accept</span> request header; This API call produces the following media types according to the <span class="header">Accept</span> request header;
the media type will be conveyed by the <span class="heaader">Content-Type</span> response header. the media type will be conveyed by the <span class="heaader">Content-Type</span> response header.
<ul> <ul>
<li><code>application/json</code></li>
<li><code>application/xml</code></li> <li><code>application/xml</code></li>
<li><code>application/json</code></li>
</ul> </ul>
<h3 class="field-label">Responses</h3> <h3 class="field-label">Responses</h3>
@ -1126,16 +914,13 @@ font-style: italic;
This API call produces the following media types according to the <span class="header">Accept</span> request header; This API call produces the following media types according to the <span class="header">Accept</span> request header;
the media type will be conveyed by the <span class="heaader">Content-Type</span> response header. the media type will be conveyed by the <span class="heaader">Content-Type</span> response header.
<ul> <ul>
<li><code>application/json</code></li>
<li><code>application/xml</code></li> <li><code>application/xml</code></li>
<li><code>application/json</code></li>
</ul> </ul>
<h3 class="field-label">Responses</h3> <h3 class="field-label">Responses</h3>
<h4 class="field-label">200</h4> <h4 class="field-label">200</h4>
successful operation successful operation
<h3 class="field-label">Example data</h3>
<div class="example-data-content-type">Content-Type: application/json</div>
<pre class="example"><code>{id&#x3D;1, username&#x3D;johnp, firstName&#x3D;John, lastName&#x3D;Public, email&#x3D;johnp@swagger.io, password&#x3D;-secret-, phone&#x3D;0123456789, userStatus&#x3D;0}</code></pre>
<h4 class="field-label">400</h4> <h4 class="field-label">400</h4>
Invalid username supplied Invalid username supplied
<h4 class="field-label">404</h4> <h4 class="field-label">404</h4>
@ -1155,9 +940,9 @@ font-style: italic;
<h3 class="field-label">Query parameters</h3> <h3 class="field-label">Query parameters</h3>
<div class="field-items"> <div class="field-items">
<div class="param">username (optional)</div> <div class="param">username (required)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> &mdash; The user name for login </div><div class="param">password (optional)</div> <div class="param-desc"><span class="param-type">Query Parameter</span> &mdash; The user name for login </div><div class="param">password (required)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> &mdash; The password for login in clear text </div> <div class="param-desc"><span class="param-type">Query Parameter</span> &mdash; The password for login in clear text </div>
</div> <!-- field-items --> </div> <!-- field-items -->
@ -1176,8 +961,8 @@ font-style: italic;
This API call produces the following media types according to the <span class="header">Accept</span> request header; This API call produces the following media types according to the <span class="header">Accept</span> request header;
the media type will be conveyed by the <span class="heaader">Content-Type</span> response header. the media type will be conveyed by the <span class="heaader">Content-Type</span> response header.
<ul> <ul>
<li><code>application/json</code></li>
<li><code>application/xml</code></li> <li><code>application/xml</code></li>
<li><code>application/json</code></li>
</ul> </ul>
<h3 class="field-label">Responses</h3> <h3 class="field-label">Responses</h3>
@ -1208,8 +993,8 @@ font-style: italic;
This API call produces the following media types according to the <span class="header">Accept</span> request header; This API call produces the following media types according to the <span class="header">Accept</span> request header;
the media type will be conveyed by the <span class="heaader">Content-Type</span> response header. the media type will be conveyed by the <span class="heaader">Content-Type</span> response header.
<ul> <ul>
<li><code>application/json</code></li>
<li><code>application/xml</code></li> <li><code>application/xml</code></li>
<li><code>application/json</code></li>
</ul> </ul>
<h3 class="field-label">Responses</h3> <h3 class="field-label">Responses</h3>
@ -1234,7 +1019,7 @@ font-style: italic;
<h3 class="field-label">Request body</h3> <h3 class="field-label">Request body</h3>
<div class="field-items"> <div class="field-items">
<div class="param">body (optional)</div> <div class="param">body (required)</div>
<div class="param-desc"><span class="param-type">Body Parameter</span> &mdash; Updated user object </div> <div class="param-desc"><span class="param-type">Body Parameter</span> &mdash; Updated user object </div>
</div> <!-- field-items --> </div> <!-- field-items -->
@ -1250,8 +1035,8 @@ font-style: italic;
This API call produces the following media types according to the <span class="header">Accept</span> request header; This API call produces the following media types according to the <span class="header">Accept</span> request header;
the media type will be conveyed by the <span class="heaader">Content-Type</span> response header. the media type will be conveyed by the <span class="heaader">Content-Type</span> response header.
<ul> <ul>
<li><code>application/json</code></li>
<li><code>application/xml</code></li> <li><code>application/xml</code></li>
<li><code>application/json</code></li>
</ul> </ul>
<h3 class="field-label">Responses</h3> <h3 class="field-label">Responses</h3>
@ -1268,147 +1053,73 @@ font-style: italic;
<h2>Table of Contents</h2> <h2>Table of Contents</h2>
<ol> <ol>
<li><a href="#$special[model.name]"><code>$special[model.name]</code></a></li> <li><a href="#ApiResponse"><code>ApiResponse</code></a></li>
<li><a href="#200_response"><code>200_response</code></a></li>
<li><a href="#Animal"><code>Animal</code></a></li>
<li><a href="#Cat"><code>Cat</code></a></li>
<li><a href="#Category"><code>Category</code></a></li> <li><a href="#Category"><code>Category</code></a></li>
<li><a href="#Dog"><code>Dog</code></a></li>
<li><a href="#Format_test"><code>Format_test</code></a></li>
<li><a href="#Inline_response_200"><code>Inline_response_200</code></a></li>
<li><a href="#Name"><code>Name</code></a></li>
<li><a href="#Order"><code>Order</code></a></li> <li><a href="#Order"><code>Order</code></a></li>
<li><a href="#Pet"><code>Pet</code></a></li> <li><a href="#Pet"><code>Pet</code></a></li>
<li><a href="#Return"><code>Return</code></a></li>
<li><a href="#Tag"><code>Tag</code></a></li> <li><a href="#Tag"><code>Tag</code></a></li>
<li><a href="#User"><code>User</code></a></li> <li><a href="#User"><code>User</code></a></li>
</ol> </ol>
<div class="model"> <div class="model">
<h3 class="field-label"><a name="$special[model.name]">$special[model.name]</a> <a class="up" href="#__Models">Up</a></h3> <h3 class="field-label"><a name="ApiResponse">ApiResponse</a> <a class="up" href="#__Models">Up</a></h3>
<div class="field-items"> <div class="field-items">
<div class="param">$special[property.name] </div><div class="param-desc"><span class="param-type">Long</span> </div> <div class="param">code (optional)</div><div class="param-desc"><span class="param-type">Integer</span> </div>
</div> <!-- field-items --> <div class="param">type (optional)</div><div class="param-desc"><span class="param-type">String</span> </div>
</div> <div class="param">message (optional)</div><div class="param-desc"><span class="param-type">String</span> </div>
<div class="model">
<h3 class="field-label"><a name="200_response">200_response</a> <a class="up" href="#__Models">Up</a></h3>
<div class="field-items">
<div class="param">name </div><div class="param-desc"><span class="param-type">Integer</span> </div>
</div> <!-- field-items -->
</div>
<div class="model">
<h3 class="field-label"><a name="Animal">Animal</a> <a class="up" href="#__Models">Up</a></h3>
<div class="field-items">
<div class="param">className </div><div class="param-desc"><span class="param-type">String</span> </div>
</div> <!-- field-items -->
</div>
<div class="model">
<h3 class="field-label"><a name="Cat">Cat</a> <a class="up" href="#__Models">Up</a></h3>
<div class="field-items">
<div class="param">className </div><div class="param-desc"><span class="param-type">String</span> </div>
<div class="param">declawed </div><div class="param-desc"><span class="param-type">Boolean</span> </div>
</div> <!-- field-items --> </div> <!-- field-items -->
</div> </div>
<div class="model"> <div class="model">
<h3 class="field-label"><a name="Category">Category</a> <a class="up" href="#__Models">Up</a></h3> <h3 class="field-label"><a name="Category">Category</a> <a class="up" href="#__Models">Up</a></h3>
<div class="field-items"> <div class="field-items">
<div class="param">id </div><div class="param-desc"><span class="param-type">Long</span> </div> <div class="param">id (optional)</div><div class="param-desc"><span class="param-type">Long</span> </div>
<div class="param">name </div><div class="param-desc"><span class="param-type">String</span> </div> <div class="param">name (optional)</div><div class="param-desc"><span class="param-type">String</span> </div>
</div> <!-- field-items -->
</div>
<div class="model">
<h3 class="field-label"><a name="Dog">Dog</a> <a class="up" href="#__Models">Up</a></h3>
<div class="field-items">
<div class="param">className </div><div class="param-desc"><span class="param-type">String</span> </div>
<div class="param">breed </div><div class="param-desc"><span class="param-type">String</span> </div>
</div> <!-- field-items -->
</div>
<div class="model">
<h3 class="field-label"><a name="Format_test">Format_test</a> <a class="up" href="#__Models">Up</a></h3>
<div class="field-items">
<div class="param">integer </div><div class="param-desc"><span class="param-type">Integer</span> </div>
<div class="param">int32 </div><div class="param-desc"><span class="param-type">Integer</span> </div>
<div class="param">int64 </div><div class="param-desc"><span class="param-type">Long</span> </div>
<div class="param">number </div><div class="param-desc"><span class="param-type">BigDecimal</span> </div>
<div class="param">float </div><div class="param-desc"><span class="param-type">Float</span> </div>
<div class="param">double </div><div class="param-desc"><span class="param-type">Double</span> </div>
<div class="param">string </div><div class="param-desc"><span class="param-type">String</span> </div>
<div class="param">byte </div><div class="param-desc"><span class="param-type">byte[]</span> </div>
<div class="param">binary </div><div class="param-desc"><span class="param-type">byte[]</span> </div>
<div class="param">date </div><div class="param-desc"><span class="param-type">date</span> </div>
<div class="param">dateTime </div><div class="param-desc"><span class="param-type">String</span> </div>
</div> <!-- field-items -->
</div>
<div class="model">
<h3 class="field-label"><a name="Inline_response_200">Inline_response_200</a> <a class="up" href="#__Models">Up</a></h3>
<div class="field-items">
<div class="param">tags </div><div class="param-desc"><span class="param-type">array[Tag]</span> </div>
<div class="param">id </div><div class="param-desc"><span class="param-type">Long</span> </div>
<div class="param">category </div><div class="param-desc"><span class="param-type">Object</span> </div>
<div class="param">status </div><div class="param-desc"><span class="param-type">String</span> pet status in the store</div>
<div class="param-enum-header">Enum:</div>
<div class="param-enum">available</div><div class="param-enum">pending</div><div class="param-enum">sold</div>
<div class="param">name </div><div class="param-desc"><span class="param-type">String</span> </div>
<div class="param">photoUrls </div><div class="param-desc"><span class="param-type">array[String]</span> </div>
</div> <!-- field-items -->
</div>
<div class="model">
<h3 class="field-label"><a name="Name">Name</a> <a class="up" href="#__Models">Up</a></h3>
<div class="field-items">
<div class="param">name </div><div class="param-desc"><span class="param-type">Integer</span> </div>
<div class="param">snake_case </div><div class="param-desc"><span class="param-type">Integer</span> </div>
</div> <!-- field-items --> </div> <!-- field-items -->
</div> </div>
<div class="model"> <div class="model">
<h3 class="field-label"><a name="Order">Order</a> <a class="up" href="#__Models">Up</a></h3> <h3 class="field-label"><a name="Order">Order</a> <a class="up" href="#__Models">Up</a></h3>
<div class="field-items"> <div class="field-items">
<div class="param">id </div><div class="param-desc"><span class="param-type">Long</span> </div> <div class="param">id (optional)</div><div class="param-desc"><span class="param-type">Long</span> </div>
<div class="param">petId </div><div class="param-desc"><span class="param-type">Long</span> </div> <div class="param">petId (optional)</div><div class="param-desc"><span class="param-type">Long</span> </div>
<div class="param">quantity </div><div class="param-desc"><span class="param-type">Integer</span> </div> <div class="param">quantity (optional)</div><div class="param-desc"><span class="param-type">Integer</span> </div>
<div class="param">shipDate </div><div class="param-desc"><span class="param-type">Date</span> </div> <div class="param">shipDate (optional)</div><div class="param-desc"><span class="param-type">Date</span> </div>
<div class="param">status </div><div class="param-desc"><span class="param-type">String</span> Order Status</div> <div class="param">status (optional)</div><div class="param-desc"><span class="param-type">String</span> Order Status</div>
<div class="param-enum-header">Enum:</div> <div class="param-enum-header">Enum:</div>
<div class="param-enum">placed</div><div class="param-enum">approved</div><div class="param-enum">delivered</div> <div class="param-enum">placed</div><div class="param-enum">approved</div><div class="param-enum">delivered</div>
<div class="param">complete </div><div class="param-desc"><span class="param-type">Boolean</span> </div> <div class="param">complete (optional)</div><div class="param-desc"><span class="param-type">Boolean</span> </div>
</div> <!-- field-items --> </div> <!-- field-items -->
</div> </div>
<div class="model"> <div class="model">
<h3 class="field-label"><a name="Pet">Pet</a> <a class="up" href="#__Models">Up</a></h3> <h3 class="field-label"><a name="Pet">Pet</a> <a class="up" href="#__Models">Up</a></h3>
<div class="field-items"> <div class="field-items">
<div class="param">id </div><div class="param-desc"><span class="param-type">Long</span> </div> <div class="param">id (optional)</div><div class="param-desc"><span class="param-type">Long</span> </div>
<div class="param">category </div><div class="param-desc"><span class="param-type">Category</span> </div> <div class="param">category (optional)</div><div class="param-desc"><span class="param-type">Category</span> </div>
<div class="param">name </div><div class="param-desc"><span class="param-type">String</span> </div> <div class="param">name </div><div class="param-desc"><span class="param-type">String</span> </div>
<div class="param">photoUrls </div><div class="param-desc"><span class="param-type">array[String]</span> </div> <div class="param">photoUrls </div><div class="param-desc"><span class="param-type">array[String]</span> </div>
<div class="param">tags </div><div class="param-desc"><span class="param-type">array[Tag]</span> </div> <div class="param">tags (optional)</div><div class="param-desc"><span class="param-type">array[Tag]</span> </div>
<div class="param">status </div><div class="param-desc"><span class="param-type">String</span> pet status in the store</div> <div class="param">status (optional)</div><div class="param-desc"><span class="param-type">String</span> pet status in the store</div>
<div class="param-enum-header">Enum:</div> <div class="param-enum-header">Enum:</div>
<div class="param-enum">available</div><div class="param-enum">pending</div><div class="param-enum">sold</div> <div class="param-enum">available</div><div class="param-enum">pending</div><div class="param-enum">sold</div>
</div> <!-- field-items --> </div> <!-- field-items -->
</div> </div>
<div class="model">
<h3 class="field-label"><a name="Return">Return</a> <a class="up" href="#__Models">Up</a></h3>
<div class="field-items">
<div class="param">return </div><div class="param-desc"><span class="param-type">Integer</span> </div>
</div> <!-- field-items -->
</div>
<div class="model"> <div class="model">
<h3 class="field-label"><a name="Tag">Tag</a> <a class="up" href="#__Models">Up</a></h3> <h3 class="field-label"><a name="Tag">Tag</a> <a class="up" href="#__Models">Up</a></h3>
<div class="field-items"> <div class="field-items">
<div class="param">id </div><div class="param-desc"><span class="param-type">Long</span> </div> <div class="param">id (optional)</div><div class="param-desc"><span class="param-type">Long</span> </div>
<div class="param">name </div><div class="param-desc"><span class="param-type">String</span> </div> <div class="param">name (optional)</div><div class="param-desc"><span class="param-type">String</span> </div>
</div> <!-- field-items --> </div> <!-- field-items -->
</div> </div>
<div class="model"> <div class="model">
<h3 class="field-label"><a name="User">User</a> <a class="up" href="#__Models">Up</a></h3> <h3 class="field-label"><a name="User">User</a> <a class="up" href="#__Models">Up</a></h3>
<div class="field-items"> <div class="field-items">
<div class="param">id </div><div class="param-desc"><span class="param-type">Long</span> </div> <div class="param">id (optional)</div><div class="param-desc"><span class="param-type">Long</span> </div>
<div class="param">username </div><div class="param-desc"><span class="param-type">String</span> </div> <div class="param">username (optional)</div><div class="param-desc"><span class="param-type">String</span> </div>
<div class="param">firstName </div><div class="param-desc"><span class="param-type">String</span> </div> <div class="param">firstName (optional)</div><div class="param-desc"><span class="param-type">String</span> </div>
<div class="param">lastName </div><div class="param-desc"><span class="param-type">String</span> </div> <div class="param">lastName (optional)</div><div class="param-desc"><span class="param-type">String</span> </div>
<div class="param">email </div><div class="param-desc"><span class="param-type">String</span> </div> <div class="param">email (optional)</div><div class="param-desc"><span class="param-type">String</span> </div>
<div class="param">password </div><div class="param-desc"><span class="param-type">String</span> </div> <div class="param">password (optional)</div><div class="param-desc"><span class="param-type">String</span> </div>
<div class="param">phone </div><div class="param-desc"><span class="param-type">String</span> </div> <div class="param">phone (optional)</div><div class="param-desc"><span class="param-type">String</span> </div>
<div class="param">userStatus </div><div class="param-desc"><span class="param-type">Integer</span> User Status</div> <div class="param">userStatus (optional)</div><div class="param-desc"><span class="param-type">Integer</span> User Status</div>
</div> <!-- field-items --> </div> <!-- field-items -->
</div> </div>
</body> </body>

View File

@ -0,0 +1,150 @@
using System;
using System.Linq;
using System.IO;
using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
namespace IO.Swagger.Models
{
/// <summary>
///
/// </summary>
public partial class ApiResponse : IEquatable<ApiResponse>
{
/// <summary>
/// Initializes a new instance of the <see cref="ApiResponse" /> class.
/// </summary>
/// <param name="Code">Code.</param>
/// <param name="Type">Type.</param>
/// <param name="Message">Message.</param>
public ApiResponse(int? Code = null, string Type = null, string Message = null)
{
this.Code = Code;
this.Type = Type;
this.Message = Message;
}
/// <summary>
/// Gets or Sets Code
/// </summary>
public int? Code { get; set; }
/// <summary>
/// Gets or Sets Type
/// </summary>
public string Type { get; set; }
/// <summary>
/// Gets or Sets Message
/// </summary>
public string Message { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class ApiResponse {\n");
sb.Append(" Code: ").Append(Code).Append("\n");
sb.Append(" Type: ").Append(Type).Append("\n");
sb.Append(" Message: ").Append(Message).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public string ToJson()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="obj">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != GetType()) return false;
return Equals((ApiResponse)obj);
}
/// <summary>
/// Returns true if ApiResponse instances are equal
/// </summary>
/// <param name="other">Instance of ApiResponse to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(ApiResponse other)
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) return true;
return
(
this.Code == other.Code ||
this.Code != null &&
this.Code.Equals(other.Code)
) &&
(
this.Type == other.Type ||
this.Type != null &&
this.Type.Equals(other.Type)
) &&
(
this.Message == other.Message ||
this.Message != null &&
this.Message.Equals(other.Message)
);
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
// credit: http://stackoverflow.com/a/263416/677735
unchecked // Overflow is fine, just wrap
{
int hash = 41;
// Suitable nullity checks etc, of course :)
if (this.Code != null)
hash = hash * 59 + this.Code.GetHashCode();
if (this.Type != null)
hash = hash * 59 + this.Type.GetHashCode();
if (this.Message != null)
hash = hash * 59 + this.Message.GetHashCode();
return hash;
}
}
#region Operators
public static bool operator ==(ApiResponse left, ApiResponse right)
{
return Equals(left, right);
}
public static bool operator !=(ApiResponse left, ApiResponse right)
{
return !Equals(left, right);
}
#endregion Operators
}
}

View File

@ -0,0 +1,9 @@
package com.wordnik.client.model
case class ApiResponse (
code: Option[Int],
type: Option[String],
message: Option[String]
)