forked from loafle/openapi-generator-original
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:
commit
bb8db88b95
@ -26,6 +26,6 @@ fi
|
||||
|
||||
# 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"
|
||||
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
|
||||
|
@ -26,6 +26,6 @@ fi
|
||||
|
||||
# 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"
|
||||
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
|
||||
|
@ -26,6 +26,6 @@ fi
|
||||
|
||||
# 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"
|
||||
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
|
||||
|
@ -26,6 +26,6 @@ fi
|
||||
|
||||
# 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"
|
||||
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
|
||||
|
@ -26,6 +26,6 @@ fi
|
||||
|
||||
# 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"
|
||||
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
|
||||
|
@ -26,6 +26,6 @@ fi
|
||||
|
||||
# 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"
|
||||
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
|
||||
|
@ -26,6 +26,6 @@ fi
|
||||
|
||||
# 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"
|
||||
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
|
||||
|
@ -26,6 +26,6 @@ fi
|
||||
|
||||
# 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"
|
||||
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
|
||||
|
@ -168,7 +168,7 @@ public class AkkaScalaClientCodegen extends DefaultCodegen implements CodegenCon
|
||||
|
||||
@Override
|
||||
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
|
||||
|
@ -79,7 +79,7 @@ public class JavascriptClosureAngularClientCodegen extends DefaultCodegen implem
|
||||
|
||||
@Override
|
||||
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)";
|
||||
}
|
||||
|
||||
|
@ -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}}
|
||||
|
||||
{{#imports}}
|
||||
@ -29,7 +34,7 @@ object {{classname}} {
|
||||
{{/dataType}}{{^dataType}}.withDefault{{>responseState}}Response[Unit]
|
||||
{{/dataType}}{{/isWildcard}}{{/responses}}{{^responseHeaders.isEmpty}}
|
||||
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}}
|
||||
{{/operation}}
|
||||
|
@ -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}}
|
||||
|
||||
import java.io.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}}
|
||||
|
||||
sealed trait ResponseState
|
||||
|
@ -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}}
|
||||
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
@ -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}}
|
||||
|
||||
import {{modelPackage}}._
|
||||
|
@ -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}}
|
||||
|
||||
import {{invokerPackage}}.ApiModel
|
||||
@ -8,7 +14,7 @@ import org.joda.time.DateTime
|
||||
|
||||
case class {{classname}} (
|
||||
{{#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
|
||||
|
||||
{{#hasEnums}}
|
||||
|
@ -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}}
|
||||
|
||||
import java.io.File
|
||||
@ -8,6 +13,8 @@ sealed trait ApiReturnWithHeaders {
|
||||
def headers: Map[String, String]
|
||||
def header(name: String): Option[String] = headers.get(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 getLongHeader(name: String) = castedHeader(name, java.lang.Long.parseLong)
|
||||
def getFloatHeader(name: String) = castedHeader(name, java.lang.Float.parseFloat)
|
||||
|
@ -217,7 +217,7 @@
|
||||
<akka-version>2.3.9</akka-version>
|
||||
<joda-version>1.2</joda-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>
|
||||
|
||||
<junit-version>4.8.1</junit-version>
|
||||
|
@ -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
|
||||
|
||||
import io.swagger.client.model._
|
||||
@ -7,8 +12,8 @@ import scala.reflect.ClassTag
|
||||
object EnumsSerializers {
|
||||
|
||||
def all = Seq[Serializer[_]]() :+
|
||||
new EnumNameSerializer(PetEnums.Status) :+
|
||||
new EnumNameSerializer(OrderEnums.Status)
|
||||
new EnumNameSerializer(OrderEnums.Status) :+
|
||||
new EnumNameSerializer(PetEnums.Status)
|
||||
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
||||
import io.swagger.client.model.Pet
|
||||
import io.swagger.client.model.ApiResponse
|
||||
import java.io.File
|
||||
import io.swagger.client.core._
|
||||
import io.swagger.client.core.CollectionFormats._
|
||||
@ -8,22 +14,6 @@ import io.swagger.client.core.ApiKeyLocations._
|
||||
|
||||
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:
|
||||
@ -31,78 +21,10 @@ object PetApi {
|
||||
*
|
||||
* @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")
|
||||
.withBody(body)
|
||||
.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 < 10. ID > 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:
|
||||
@ -116,23 +38,99 @@ object PetApi {
|
||||
.withPathParam("petId", petId)
|
||||
.withHeaderParam("api_key", apiKey)
|
||||
.withErrorResponse[Unit](400)
|
||||
|
||||
/**
|
||||
* Multiple status values can be provided with comma separated 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, 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 0 : (successful operation)
|
||||
* 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 additionalMetadata Additional data to pass to server
|
||||
* @param file file to upload
|
||||
*/
|
||||
def uploadFile(petId: Long, additionalMetadata: Option[String] = None, file: Option[File] = None): ApiRequest[Unit] =
|
||||
ApiRequest[Unit](ApiMethods.POST, "http://petstore.swagger.io/v2", "/pet/{petId}/uploadImage", "multipart/form-data")
|
||||
def uploadFile(petId: Long, additionalMetadata: Option[String] = None, file: Option[File] = None): ApiRequest[ApiResponse] =
|
||||
ApiRequest[ApiResponse](ApiMethods.POST, "http://petstore.swagger.io/v2", "/pet/{petId}/uploadImage", "multipart/form-data")
|
||||
.withFormParam("additionalMetadata", additionalMetadata)
|
||||
.withFormParam("file", file)
|
||||
.withPathParam("petId", petId)
|
||||
.withDefaultSuccessResponse[Unit]
|
||||
|
||||
.withSuccessResponse[ApiResponse](200)
|
||||
|
||||
|
||||
}
|
||||
|
@ -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
|
||||
|
||||
import io.swagger.client.model.Order
|
||||
@ -7,51 +12,6 @@ import io.swagger.client.core.ApiKeyLocations._
|
||||
|
||||
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 <= 5 or > 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 < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
*
|
||||
@ -66,7 +26,48 @@ object StoreApi {
|
||||
.withPathParam("orderId", orderId)
|
||||
.withErrorResponse[Unit](400)
|
||||
.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 <= 5 or > 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)
|
||||
|
||||
|
||||
}
|
||||
|
@ -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
|
||||
|
||||
import io.swagger.client.model.User
|
||||
@ -15,11 +20,10 @@ object UserApi {
|
||||
*
|
||||
* @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")
|
||||
.withBody(body)
|
||||
.withDefaultSuccessResponse[Unit]
|
||||
|
||||
/**
|
||||
*
|
||||
* Expected answers:
|
||||
@ -31,7 +35,6 @@ object UserApi {
|
||||
ApiRequest[Unit](ApiMethods.POST, "http://petstore.swagger.io/v2", "/user/createWithArray", "application/json")
|
||||
.withBody(body)
|
||||
.withDefaultSuccessResponse[Unit]
|
||||
|
||||
/**
|
||||
*
|
||||
* Expected answers:
|
||||
@ -43,32 +46,20 @@ object UserApi {
|
||||
ApiRequest[Unit](ApiMethods.POST, "http://petstore.swagger.io/v2", "/user/createWithList", "application/json")
|
||||
.withBody(body)
|
||||
.withDefaultSuccessResponse[Unit]
|
||||
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
*
|
||||
* Expected answers:
|
||||
* code 200 : String (successful operation)
|
||||
* code 400 : (Invalid username/password supplied)
|
||||
* code 400 : (Invalid username supplied)
|
||||
* code 404 : (User not found)
|
||||
*
|
||||
* @param username The user name for login
|
||||
* @param password The password for login in clear text
|
||||
* @param username The name that needs to be deleted
|
||||
*/
|
||||
def loginUser(username: Option[String] = None, password: Option[String] = None): ApiRequest[String] =
|
||||
ApiRequest[String](ApiMethods.GET, "http://petstore.swagger.io/v2", "/user/login", "application/json")
|
||||
.withQueryParam("username", username)
|
||||
.withQueryParam("password", password)
|
||||
.withSuccessResponse[String](200)
|
||||
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)
|
||||
|
||||
/**
|
||||
*
|
||||
* 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]
|
||||
|
||||
.withErrorResponse[Unit](404)
|
||||
/**
|
||||
*
|
||||
* Expected answers:
|
||||
@ -84,7 +75,37 @@ object UserApi {
|
||||
.withSuccessResponse[User](200)
|
||||
.withErrorResponse[Unit](400)
|
||||
.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.
|
||||
*
|
||||
@ -95,29 +116,13 @@ object UserApi {
|
||||
* @param username name that need to be deleted
|
||||
* @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")
|
||||
.withBody(body)
|
||||
.withPathParam("username", username)
|
||||
.withErrorResponse[Unit](400)
|
||||
.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)
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
||||
import java.io.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
|
||||
|
||||
sealed trait ResponseState
|
||||
|
@ -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
|
||||
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
@ -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
|
||||
|
||||
import java.io.File
|
||||
@ -8,6 +13,8 @@ sealed trait ApiReturnWithHeaders {
|
||||
def headers: Map[String, String]
|
||||
def header(name: String): Option[String] = headers.get(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 getLongHeader(name: String) = castedHeader(name, java.lang.Long.parseLong)
|
||||
def getFloatHeader(name: String) = castedHeader(name, java.lang.Float.parseFloat)
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
import io.swagger.client.core.ApiModel
|
||||
|
@ -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
|
||||
|
||||
import io.swagger.client.core.ApiModel
|
||||
|
@ -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
|
||||
|
||||
import io.swagger.client.core.ApiModel
|
||||
|
@ -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
|
||||
|
||||
import io.swagger.client.core.ApiModel
|
||||
|
@ -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
|
||||
|
||||
import io.swagger.client.core.ApiModel
|
||||
|
@ -7,7 +7,7 @@ import io.swagger.common.ApiUserCredentials;
|
||||
import io.swagger.event.Response;
|
||||
import io.swagger.common.SwaggerApi;
|
||||
import io.swagger.client.model.Pet;
|
||||
import io.swagger.client.model.InlineResponse200;
|
||||
import io.swagger.client.model.ApiResponse;
|
||||
import flash.filesystem.File;
|
||||
|
||||
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_using_byte_array: String = "add_pet_using_byte_array";
|
||||
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_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_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_with_form: String = "update_pet_with_form";
|
||||
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=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
|
||||
*/
|
||||
@ -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=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=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
|
||||
*/
|
||||
@ -320,7 +227,7 @@ public class PetApi extends SwaggerApi {
|
||||
/*
|
||||
* 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
|
||||
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 {
|
||||
// create path and map variables
|
||||
@ -388,7 +295,7 @@ public class PetApi extends SwaggerApi {
|
||||
token.requestId = requestId;
|
||||
token.completionEventType = "upload_file";
|
||||
|
||||
token.returnType = null ;
|
||||
token.returnType = ApiResponse;
|
||||
return requestId;
|
||||
|
||||
}
|
||||
|
@ -7,7 +7,6 @@ import io.swagger.common.ApiUserCredentials;
|
||||
import io.swagger.event.Response;
|
||||
import io.swagger.common.SwaggerApi;
|
||||
import io.swagger.client.model.Order;
|
||||
import io.swagger.client.model.Object;
|
||||
|
||||
import mx.rpc.AsyncToken;
|
||||
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_find_orders_by_status: String = "find_orders_by_status";
|
||||
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_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
|
||||
*/
|
||||
@ -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=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
|
||||
*/
|
||||
public function get_order_by_id (orderId: String): String {
|
||||
public function get_order_by_id (orderId: Number): String {
|
||||
// create path and map variables
|
||||
var path: String = "/store/order/{orderId}".replace(/{format}/g,"xml").replace("{" + "orderId" + "}", getApiInvoker().escapeString(orderId));
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -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;
|
||||
|
@ -3,9 +3,9 @@
|
||||
* Do not edit this file by hand or your changes will be lost next time it is
|
||||
* generated.
|
||||
*
|
||||
* 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
|
||||
* 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.
|
||||
* 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
|
||||
*/
|
||||
/**
|
||||
@ -15,6 +15,7 @@
|
||||
|
||||
goog.provide('API.Client.PetApi');
|
||||
|
||||
goog.require('API.Client.ApiResponse');
|
||||
goog.require('API.Client.Pet');
|
||||
|
||||
/**
|
||||
@ -44,49 +45,14 @@ API.Client.PetApi = function($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
|
||||
*
|
||||
* @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.
|
||||
* @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} */
|
||||
var path = this.basePath_ + '/pet';
|
||||
|
||||
@ -95,180 +61,16 @@ API.Client.PetApi.prototype.addPet = function(opt_body, opt_extraHttpRequestPara
|
||||
|
||||
/** @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 addPet');
|
||||
}
|
||||
/** @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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 < 10. ID > 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),
|
||||
|
||||
data: body,
|
||||
params: queryParameters,
|
||||
headers: headerParams
|
||||
};
|
||||
@ -309,8 +111,209 @@ API.Client.PetApi.prototype.deletePet = function(petId, opt_apiKey, opt_extraHtt
|
||||
method: 'DELETE',
|
||||
url: path,
|
||||
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,
|
||||
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 {!Object=} opt_file file to upload
|
||||
* @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) {
|
||||
/** @const {string} */
|
||||
@ -359,83 +362,7 @@ API.Client.PetApi.prototype.uploadFile = function(petId, opt_additionalMetadata,
|
||||
method: 'POST',
|
||||
url: path,
|
||||
json: false,
|
||||
|
||||
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 'Find pet by ID'
|
||||
* Returns a pet when ID < 10. ID > 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,
|
||||
headers: headerParams
|
||||
};
|
||||
|
@ -3,9 +3,9 @@
|
||||
* Do not edit this file by hand or your changes will be lost next time it is
|
||||
* generated.
|
||||
*
|
||||
* 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
|
||||
* 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.
|
||||
* 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
|
||||
*/
|
||||
/**
|
||||
@ -44,113 +44,6 @@ API.Client.StoreApi = function($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 <= 5 or > 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
|
||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
@ -177,8 +70,111 @@ API.Client.StoreApi.prototype.deleteOrder = function(orderId, opt_extraHttpReque
|
||||
method: 'DELETE',
|
||||
url: path,
|
||||
json: true,
|
||||
|
||||
|
||||
params: queryParameters,
|
||||
headers: headerParams
|
||||
};
|
||||
|
||||
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 <= 5 or > 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
|
||||
};
|
||||
|
@ -3,9 +3,9 @@
|
||||
* Do not edit this file by hand or your changes will be lost next time it is
|
||||
* generated.
|
||||
*
|
||||
* 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
|
||||
* 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.
|
||||
* 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
|
||||
*/
|
||||
/**
|
||||
@ -47,11 +47,11 @@ API.Client.UserApi.$inject = ['$http', '$httpParamSerializer', '$injector'];
|
||||
/**
|
||||
* Create 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.
|
||||
* @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} */
|
||||
var path = this.basePath_ + '/user';
|
||||
|
||||
@ -60,14 +60,16 @@ API.Client.UserApi.prototype.createUser = function(opt_body, opt_extraHttpReques
|
||||
|
||||
/** @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 createUser');
|
||||
}
|
||||
/** @type {!Object} */
|
||||
var httpRequestParams = {
|
||||
method: 'POST',
|
||||
url: path,
|
||||
json: true,
|
||||
data: opt_body,
|
||||
|
||||
|
||||
data: body,
|
||||
params: queryParameters,
|
||||
headers: headerParams
|
||||
};
|
||||
@ -82,11 +84,11 @@ API.Client.UserApi.prototype.createUser = function(opt_body, opt_extraHttpReques
|
||||
/**
|
||||
* 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.
|
||||
* @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} */
|
||||
var path = this.basePath_ + '/user/createWithArray';
|
||||
|
||||
@ -95,14 +97,16 @@ API.Client.UserApi.prototype.createUsersWithArrayInput = function(opt_body, opt_
|
||||
|
||||
/** @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 createUsersWithArrayInput');
|
||||
}
|
||||
/** @type {!Object} */
|
||||
var httpRequestParams = {
|
||||
method: 'POST',
|
||||
url: path,
|
||||
json: true,
|
||||
data: opt_body,
|
||||
|
||||
|
||||
data: body,
|
||||
params: queryParameters,
|
||||
headers: headerParams
|
||||
};
|
||||
@ -117,11 +121,11 @@ API.Client.UserApi.prototype.createUsersWithArrayInput = function(opt_body, opt_
|
||||
/**
|
||||
* 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.
|
||||
* @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} */
|
||||
var path = this.basePath_ + '/user/createWithList';
|
||||
|
||||
@ -130,170 +134,16 @@ API.Client.UserApi.prototype.createUsersWithListInput = function(opt_body, opt_e
|
||||
|
||||
/** @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 createUsersWithListInput');
|
||||
}
|
||||
/** @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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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,
|
||||
|
||||
|
||||
data: body,
|
||||
params: queryParameters,
|
||||
headers: headerParams
|
||||
};
|
||||
@ -331,8 +181,166 @@ API.Client.UserApi.prototype.deleteUser = function(username, opt_extraHttpReques
|
||||
method: 'DELETE',
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
};
|
||||
|
119
samples/client/petstore/qt5cpp/client/SWGApiResponse.cpp
Normal file
119
samples/client/petstore/qt5cpp/client/SWGApiResponse.cpp
Normal 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 */
|
||||
|
48
samples/client/petstore/qt5cpp/client/SWGApiResponse.h
Normal file
48
samples/client/petstore/qt5cpp/client/SWGApiResponse.h
Normal 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_ */
|
@ -27,17 +27,15 @@ SWGCategory::~SWGCategory() {
|
||||
void
|
||||
SWGCategory::init() {
|
||||
id = 0L;
|
||||
name = new QString("");
|
||||
|
||||
name = new QString("");
|
||||
}
|
||||
|
||||
void
|
||||
SWGCategory::cleanup() {
|
||||
|
||||
if(name != NULL) {
|
||||
if(name != NULL) {
|
||||
delete name;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
SWGCategory*
|
||||
@ -52,8 +50,7 @@ SWGCategory::fromJson(QString &json) {
|
||||
void
|
||||
SWGCategory::fromJsonObject(QJsonObject &pJson) {
|
||||
setValue(&id, pJson["id"], "qint64", "");
|
||||
setValue(&name, pJson["name"], "QString", "QString");
|
||||
|
||||
setValue(&name, pJson["name"], "QString", "QString");
|
||||
}
|
||||
|
||||
QString
|
||||
@ -76,8 +73,6 @@ SWGCategory::asJsonObject() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
@ -32,14 +32,12 @@ public:
|
||||
|
||||
qint64 getId();
|
||||
void setId(qint64 id);
|
||||
QString* getName();
|
||||
QString* getName();
|
||||
void setName(QString* name);
|
||||
|
||||
|
||||
private:
|
||||
qint64 id;
|
||||
QString* name;
|
||||
|
||||
QString* name;
|
||||
};
|
||||
|
||||
} /* namespace Swagger */
|
||||
|
@ -2,28 +2,32 @@
|
||||
#define ModelFactory_H_
|
||||
|
||||
|
||||
#include "SWGUser.h"
|
||||
#include "SWGApiResponse.h"
|
||||
#include "SWGCategory.h"
|
||||
#include "SWGOrder.h"
|
||||
#include "SWGPet.h"
|
||||
#include "SWGTag.h"
|
||||
#include "SWGOrder.h"
|
||||
#include "SWGUser.h"
|
||||
|
||||
namespace Swagger {
|
||||
inline void* create(QString type) {
|
||||
if(QString("SWGUser").compare(type) == 0) {
|
||||
return new SWGUser();
|
||||
if(QString("SWGApiResponse").compare(type) == 0) {
|
||||
return new SWGApiResponse();
|
||||
}
|
||||
if(QString("SWGCategory").compare(type) == 0) {
|
||||
return new SWGCategory();
|
||||
}
|
||||
if(QString("SWGOrder").compare(type) == 0) {
|
||||
return new SWGOrder();
|
||||
}
|
||||
if(QString("SWGPet").compare(type) == 0) {
|
||||
return new SWGPet();
|
||||
}
|
||||
if(QString("SWGTag").compare(type) == 0) {
|
||||
return new SWGTag();
|
||||
}
|
||||
if(QString("SWGOrder").compare(type) == 0) {
|
||||
return new SWGOrder();
|
||||
if(QString("SWGUser").compare(type) == 0) {
|
||||
return new SWGUser();
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
@ -27,12 +27,11 @@ SWGOrder::~SWGOrder() {
|
||||
void
|
||||
SWGOrder::init() {
|
||||
id = 0L;
|
||||
petId = 0L;
|
||||
quantity = 0;
|
||||
shipDate = NULL;
|
||||
status = new QString("");
|
||||
complete = false;
|
||||
|
||||
petId = 0L;
|
||||
quantity = 0;
|
||||
shipDate = NULL;
|
||||
status = new QString("");
|
||||
complete = false;
|
||||
}
|
||||
|
||||
void
|
||||
@ -40,14 +39,13 @@ SWGOrder::cleanup() {
|
||||
|
||||
|
||||
|
||||
if(shipDate != NULL) {
|
||||
if(shipDate != NULL) {
|
||||
delete shipDate;
|
||||
}
|
||||
if(status != NULL) {
|
||||
if(status != NULL) {
|
||||
delete status;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
SWGOrder*
|
||||
@ -62,12 +60,11 @@ SWGOrder::fromJson(QString &json) {
|
||||
void
|
||||
SWGOrder::fromJsonObject(QJsonObject &pJson) {
|
||||
setValue(&id, pJson["id"], "qint64", "");
|
||||
setValue(&petId, pJson["petId"], "qint64", "");
|
||||
setValue(&quantity, pJson["quantity"], "qint32", "");
|
||||
setValue(&shipDate, pJson["shipDate"], "QDateTime", "QDateTime");
|
||||
setValue(&status, pJson["status"], "QString", "QString");
|
||||
setValue(&complete, pJson["complete"], "bool", "");
|
||||
|
||||
setValue(&petId, pJson["petId"], "qint64", "");
|
||||
setValue(&quantity, pJson["quantity"], "qint32", "");
|
||||
setValue(&shipDate, pJson["shipDate"], "QDateTime", "QDateTime");
|
||||
setValue(&status, pJson["status"], "QString", "QString");
|
||||
setValue(&complete, pJson["complete"], "bool", "");
|
||||
}
|
||||
|
||||
QString
|
||||
@ -84,8 +81,8 @@ QJsonObject*
|
||||
SWGOrder::asJsonObject() {
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
obj->insert("id", QJsonValue(id));
|
||||
obj->insert("petId", QJsonValue(petId));
|
||||
obj->insert("quantity", QJsonValue(quantity));
|
||||
obj->insert("petId", QJsonValue(petId));
|
||||
obj->insert("quantity", QJsonValue(quantity));
|
||||
|
||||
|
||||
toJsonValue(QString("shipDate"), shipDate, obj, QString("QDateTime"));
|
||||
@ -93,13 +90,10 @@ SWGOrder::asJsonObject() {
|
||||
|
||||
|
||||
|
||||
|
||||
toJsonValue(QString("status"), status, obj, QString("QString"));
|
||||
|
||||
|
||||
|
||||
obj->insert("complete", QJsonValue(complete));
|
||||
|
||||
obj->insert("complete", QJsonValue(complete));
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
@ -33,26 +33,24 @@ public:
|
||||
|
||||
qint64 getId();
|
||||
void setId(qint64 id);
|
||||
qint64 getPetId();
|
||||
qint64 getPetId();
|
||||
void setPetId(qint64 petId);
|
||||
qint32 getQuantity();
|
||||
qint32 getQuantity();
|
||||
void setQuantity(qint32 quantity);
|
||||
QDateTime* getShipDate();
|
||||
QDateTime* getShipDate();
|
||||
void setShipDate(QDateTime* shipDate);
|
||||
QString* getStatus();
|
||||
QString* getStatus();
|
||||
void setStatus(QString* status);
|
||||
bool getComplete();
|
||||
bool getComplete();
|
||||
void setComplete(bool complete);
|
||||
|
||||
|
||||
private:
|
||||
qint64 id;
|
||||
qint64 petId;
|
||||
qint32 quantity;
|
||||
QDateTime* shipDate;
|
||||
QString* status;
|
||||
bool complete;
|
||||
|
||||
qint64 petId;
|
||||
qint32 quantity;
|
||||
QDateTime* shipDate;
|
||||
QString* status;
|
||||
bool complete;
|
||||
};
|
||||
|
||||
} /* namespace Swagger */
|
||||
|
@ -27,41 +27,39 @@ SWGPet::~SWGPet() {
|
||||
void
|
||||
SWGPet::init() {
|
||||
id = 0L;
|
||||
category = new SWGCategory();
|
||||
name = new QString("");
|
||||
photoUrls = new QList<QString*>();
|
||||
tags = new QList<SWGTag*>();
|
||||
status = new QString("");
|
||||
|
||||
category = new SWGCategory();
|
||||
name = new QString("");
|
||||
photoUrls = new QList<QString*>();
|
||||
tags = new QList<SWGTag*>();
|
||||
status = new QString("");
|
||||
}
|
||||
|
||||
void
|
||||
SWGPet::cleanup() {
|
||||
|
||||
if(category != NULL) {
|
||||
if(category != NULL) {
|
||||
delete category;
|
||||
}
|
||||
if(name != NULL) {
|
||||
if(name != NULL) {
|
||||
delete name;
|
||||
}
|
||||
if(photoUrls != NULL) {
|
||||
if(photoUrls != NULL) {
|
||||
QList<QString*>* arr = photoUrls;
|
||||
foreach(QString* o, *arr) {
|
||||
delete o;
|
||||
}
|
||||
delete photoUrls;
|
||||
}
|
||||
if(tags != NULL) {
|
||||
if(tags != NULL) {
|
||||
QList<SWGTag*>* arr = tags;
|
||||
foreach(SWGTag* o, *arr) {
|
||||
delete o;
|
||||
}
|
||||
delete tags;
|
||||
}
|
||||
if(status != NULL) {
|
||||
if(status != NULL) {
|
||||
delete status;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
SWGPet*
|
||||
@ -76,12 +74,11 @@ SWGPet::fromJson(QString &json) {
|
||||
void
|
||||
SWGPet::fromJsonObject(QJsonObject &pJson) {
|
||||
setValue(&id, pJson["id"], "qint64", "");
|
||||
setValue(&category, pJson["category"], "SWGCategory", "SWGCategory");
|
||||
setValue(&name, pJson["name"], "QString", "QString");
|
||||
setValue(&photoUrls, pJson["photoUrls"], "QList", "QString");
|
||||
setValue(&tags, pJson["tags"], "QList", "SWGTag");
|
||||
setValue(&status, pJson["status"], "QString", "QString");
|
||||
|
||||
setValue(&category, pJson["category"], "SWGCategory", "SWGCategory");
|
||||
setValue(&name, pJson["name"], "QString", "QString");
|
||||
setValue(&photoUrls, pJson["photoUrls"], "QList", "QString");
|
||||
setValue(&tags, pJson["tags"], "QList", "SWGTag");
|
||||
setValue(&status, pJson["status"], "QString", "QString");
|
||||
}
|
||||
|
||||
QString
|
||||
@ -105,13 +102,11 @@ SWGPet::asJsonObject() {
|
||||
|
||||
|
||||
|
||||
|
||||
toJsonValue(QString("name"), name, obj, QString("QString"));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
QList<QString*>* photoUrlsList = photoUrls;
|
||||
QJsonArray photoUrlsJsonArray;
|
||||
toJsonArray((QList<void*>*)photoUrls, &photoUrlsJsonArray, "photoUrls", "QString");
|
||||
@ -120,7 +115,6 @@ SWGPet::asJsonObject() {
|
||||
|
||||
|
||||
|
||||
|
||||
QList<SWGTag*>* tagsList = tags;
|
||||
QJsonArray tagsJsonArray;
|
||||
toJsonArray((QList<void*>*)tags, &tagsJsonArray, "tags", "SWGTag");
|
||||
@ -129,13 +123,10 @@ SWGPet::asJsonObject() {
|
||||
|
||||
|
||||
|
||||
|
||||
toJsonValue(QString("status"), status, obj, QString("QString"));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
@ -35,26 +35,24 @@ public:
|
||||
|
||||
qint64 getId();
|
||||
void setId(qint64 id);
|
||||
SWGCategory* getCategory();
|
||||
SWGCategory* getCategory();
|
||||
void setCategory(SWGCategory* category);
|
||||
QString* getName();
|
||||
QString* getName();
|
||||
void setName(QString* name);
|
||||
QList<QString*>* getPhotoUrls();
|
||||
QList<QString*>* getPhotoUrls();
|
||||
void setPhotoUrls(QList<QString*>* photoUrls);
|
||||
QList<SWGTag*>* getTags();
|
||||
QList<SWGTag*>* getTags();
|
||||
void setTags(QList<SWGTag*>* tags);
|
||||
QString* getStatus();
|
||||
QString* getStatus();
|
||||
void setStatus(QString* status);
|
||||
|
||||
|
||||
private:
|
||||
qint64 id;
|
||||
SWGCategory* category;
|
||||
QString* name;
|
||||
QList<QString*>* photoUrls;
|
||||
QList<SWGTag*>* tags;
|
||||
QString* status;
|
||||
|
||||
SWGCategory* category;
|
||||
QString* name;
|
||||
QList<QString*>* photoUrls;
|
||||
QList<SWGTag*>* tags;
|
||||
QString* status;
|
||||
};
|
||||
|
||||
} /* namespace Swagger */
|
||||
|
@ -15,54 +15,6 @@ SWGPetApi::SWGPetApi(QString host, QString 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
|
||||
SWGPetApi::addPet(SWGPet body) {
|
||||
QString fullPath;
|
||||
@ -70,22 +22,15 @@ SWGPetApi::addPet(SWGPet body) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "POST");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
QString output = body.asJson();
|
||||
input.request_body.append(output);
|
||||
|
||||
|
||||
|
||||
|
||||
connect(worker,
|
||||
&HttpRequestWorker::on_execution_finished,
|
||||
this,
|
||||
@ -112,6 +57,48 @@ SWGPetApi::addPetCallback(HttpRequestWorker * worker) {
|
||||
emit addPetSignal();
|
||||
}
|
||||
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) {
|
||||
QString fullPath;
|
||||
fullPath.append(this->host).append(this->basePath).append("/pet/findByStatus");
|
||||
@ -119,12 +106,8 @@ SWGPetApi::findPetsByStatus(QList<QString*>* status) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (status->size() > 0) {
|
||||
if (QString("multi").indexOf("multi") == 0) {
|
||||
if (QString("csv").indexOf("multi") == 0) {
|
||||
foreach(QString* t, *status) {
|
||||
if (fullPath.indexOf("?") > 0)
|
||||
fullPath.append("&");
|
||||
@ -133,7 +116,7 @@ SWGPetApi::findPetsByStatus(QList<QString*>* status) {
|
||||
fullPath.append("status=").append(stringValue(t));
|
||||
}
|
||||
}
|
||||
else if (QString("multi").indexOf("ssv") == 0) {
|
||||
else if (QString("csv").indexOf("ssv") == 0) {
|
||||
if (fullPath.indexOf("?") > 0)
|
||||
fullPath.append("&");
|
||||
else
|
||||
@ -147,7 +130,7 @@ SWGPetApi::findPetsByStatus(QList<QString*>* status) {
|
||||
fullPath.append(stringValue(t));
|
||||
}
|
||||
}
|
||||
else if (QString("multi").indexOf("tsv") == 0) {
|
||||
else if (QString("csv").indexOf("tsv") == 0) {
|
||||
if (fullPath.indexOf("?") > 0)
|
||||
fullPath.append("&");
|
||||
else
|
||||
@ -164,8 +147,6 @@ SWGPetApi::findPetsByStatus(QList<QString*>* status) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "GET");
|
||||
|
||||
@ -173,8 +154,6 @@ SWGPetApi::findPetsByStatus(QList<QString*>* status) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
connect(worker,
|
||||
&HttpRequestWorker::on_execution_finished,
|
||||
this,
|
||||
@ -210,7 +189,6 @@ SWGPetApi::findPetsByStatusCallback(HttpRequestWorker * worker) {
|
||||
|
||||
|
||||
|
||||
|
||||
worker->deleteLater();
|
||||
|
||||
emit findPetsByStatusSignal(output);
|
||||
@ -224,12 +202,8 @@ SWGPetApi::findPetsByTags(QList<QString*>* tags) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (tags->size() > 0) {
|
||||
if (QString("multi").indexOf("multi") == 0) {
|
||||
if (QString("csv").indexOf("multi") == 0) {
|
||||
foreach(QString* t, *tags) {
|
||||
if (fullPath.indexOf("?") > 0)
|
||||
fullPath.append("&");
|
||||
@ -238,7 +212,7 @@ SWGPetApi::findPetsByTags(QList<QString*>* tags) {
|
||||
fullPath.append("tags=").append(stringValue(t));
|
||||
}
|
||||
}
|
||||
else if (QString("multi").indexOf("ssv") == 0) {
|
||||
else if (QString("csv").indexOf("ssv") == 0) {
|
||||
if (fullPath.indexOf("?") > 0)
|
||||
fullPath.append("&");
|
||||
else
|
||||
@ -252,7 +226,7 @@ SWGPetApi::findPetsByTags(QList<QString*>* tags) {
|
||||
fullPath.append(stringValue(t));
|
||||
}
|
||||
}
|
||||
else if (QString("multi").indexOf("tsv") == 0) {
|
||||
else if (QString("csv").indexOf("tsv") == 0) {
|
||||
if (fullPath.indexOf("?") > 0)
|
||||
fullPath.append("&");
|
||||
else
|
||||
@ -269,8 +243,6 @@ SWGPetApi::findPetsByTags(QList<QString*>* tags) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "GET");
|
||||
|
||||
@ -278,8 +250,6 @@ SWGPetApi::findPetsByTags(QList<QString*>* tags) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
connect(worker,
|
||||
&HttpRequestWorker::on_execution_finished,
|
||||
this,
|
||||
@ -315,7 +285,6 @@ SWGPetApi::findPetsByTagsCallback(HttpRequestWorker * worker) {
|
||||
|
||||
|
||||
|
||||
|
||||
worker->deleteLater();
|
||||
|
||||
emit findPetsByTagsSignal(output);
|
||||
@ -326,13 +295,10 @@ SWGPetApi::getPetById(qint64 petId) {
|
||||
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, "GET");
|
||||
|
||||
@ -340,8 +306,6 @@ SWGPetApi::getPetById(qint64 petId) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
connect(worker,
|
||||
&HttpRequestWorker::on_execution_finished,
|
||||
this,
|
||||
@ -361,48 +325,78 @@ SWGPetApi::getPetByIdCallback(HttpRequestWorker * worker) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
QString json(worker->response);
|
||||
SWGPet* output = static_cast<SWGPet*>(create(json, QString("SWGPet")));
|
||||
|
||||
|
||||
|
||||
|
||||
worker->deleteLater();
|
||||
|
||||
emit getPetByIdSignal(output);
|
||||
|
||||
}
|
||||
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;
|
||||
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, "POST");
|
||||
|
||||
if (name != NULL) {
|
||||
input.add_var("name", *name);
|
||||
}
|
||||
if (status != NULL) {
|
||||
if (status != NULL) {
|
||||
input.add_var("status", *status);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
connect(worker,
|
||||
&HttpRequestWorker::on_execution_finished,
|
||||
this,
|
||||
@ -429,80 +423,27 @@ SWGPetApi::updatePetWithFormCallback(HttpRequestWorker * worker) {
|
||||
emit updatePetWithFormSignal();
|
||||
}
|
||||
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) {
|
||||
QString fullPath;
|
||||
fullPath.append(this->host).append(this->basePath).append("/pet/{petId}/uploadImage");
|
||||
|
||||
|
||||
QString petIdPathParam("{"); petIdPathParam.append("petId").append("}");
|
||||
fullPath.replace(petIdPathParam, stringValue(petId));
|
||||
|
||||
|
||||
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "POST");
|
||||
|
||||
if (additionalMetadata != NULL) {
|
||||
input.add_var("additionalMetadata", *additionalMetadata);
|
||||
}
|
||||
if (file != NULL) {
|
||||
if (file != NULL) {
|
||||
input.add_file("file", *file.local_filename, *file.request_filename, *file.mime_type);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
connect(worker,
|
||||
&HttpRequestWorker::on_execution_finished,
|
||||
this,
|
||||
@ -522,113 +463,13 @@ SWGPetApi::uploadFileCallback(HttpRequestWorker * worker) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
worker->deleteLater();
|
||||
|
||||
|
||||
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")));
|
||||
|
||||
|
||||
SWGApiResponse* output = static_cast<SWGApiResponse*>(create(json, QString("SWGApiResponse")));
|
||||
|
||||
|
||||
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 */
|
||||
|
@ -5,6 +5,7 @@
|
||||
|
||||
#include "SWGPet.h"
|
||||
#include <QString>
|
||||
#include "SWGApiResponse.h"
|
||||
#include "SWGHttpRequest.h"
|
||||
|
||||
#include <QObject>
|
||||
@ -22,40 +23,34 @@ public:
|
||||
QString host;
|
||||
QString basePath;
|
||||
|
||||
void updatePet(SWGPet body);
|
||||
void addPet(SWGPet body);
|
||||
void deletePet(qint64 petId, QString* apiKey);
|
||||
void findPetsByStatus(QList<QString*>* status);
|
||||
void findPetsByTags(QList<QString*>* tags);
|
||||
void getPetById(qint64 petId);
|
||||
void updatePetWithForm(QString* petId, QString* name, QString* status);
|
||||
void deletePet(qint64 petId, QString* apiKey);
|
||||
void updatePet(SWGPet body);
|
||||
void updatePetWithForm(qint64 petId, QString* name, QString* status);
|
||||
void uploadFile(qint64 petId, QString* additionalMetadata, SWGHttpRequestInputFileElement* file);
|
||||
void getPetByIdWithByteArray(qint64 petId);
|
||||
void addPetUsingByteArray(QString* body);
|
||||
|
||||
private:
|
||||
void updatePetCallback (HttpRequestWorker * worker);
|
||||
void addPetCallback (HttpRequestWorker * worker);
|
||||
void deletePetCallback (HttpRequestWorker * worker);
|
||||
void findPetsByStatusCallback (HttpRequestWorker * worker);
|
||||
void findPetsByTagsCallback (HttpRequestWorker * worker);
|
||||
void getPetByIdCallback (HttpRequestWorker * worker);
|
||||
void updatePetCallback (HttpRequestWorker * worker);
|
||||
void updatePetWithFormCallback (HttpRequestWorker * worker);
|
||||
void deletePetCallback (HttpRequestWorker * worker);
|
||||
void uploadFileCallback (HttpRequestWorker * worker);
|
||||
void getPetByIdWithByteArrayCallback (HttpRequestWorker * worker);
|
||||
void addPetUsingByteArrayCallback (HttpRequestWorker * worker);
|
||||
|
||||
signals:
|
||||
void updatePetSignal();
|
||||
void addPetSignal();
|
||||
void deletePetSignal();
|
||||
void findPetsByStatusSignal(QList<SWGPet*>* summary);
|
||||
void findPetsByTagsSignal(QList<SWGPet*>* summary);
|
||||
void getPetByIdSignal(SWGPet* summary);
|
||||
void updatePetSignal();
|
||||
void updatePetWithFormSignal();
|
||||
void deletePetSignal();
|
||||
void uploadFileSignal();
|
||||
void getPetByIdWithByteArraySignal(QString* summary);
|
||||
void addPetUsingByteArraySignal();
|
||||
void uploadFileSignal(SWGApiResponse* summary);
|
||||
|
||||
};
|
||||
}
|
||||
|
@ -15,193 +15,15 @@ SWGStoreApi::SWGStoreApi(QString host, QString 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
|
||||
SWGStoreApi::deleteOrder(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, "DELETE");
|
||||
|
||||
@ -209,8 +31,6 @@ SWGStoreApi::deleteOrder(QString* orderId) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
connect(worker,
|
||||
&HttpRequestWorker::on_execution_finished,
|
||||
this,
|
||||
@ -236,4 +56,146 @@ SWGStoreApi::deleteOrderCallback(HttpRequestWorker * worker) {
|
||||
|
||||
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 */
|
||||
|
@ -3,9 +3,9 @@
|
||||
|
||||
#include "SWGHttpRequest.h"
|
||||
|
||||
#include <QString>
|
||||
#include "QMap.h"
|
||||
#include "SWGOrder.h"
|
||||
#include <QString>
|
||||
|
||||
#include <QObject>
|
||||
|
||||
@ -22,22 +22,22 @@ public:
|
||||
QString host;
|
||||
QString basePath;
|
||||
|
||||
void getInventory();
|
||||
void placeOrder(SWGOrder body);
|
||||
void getOrderById(QString* orderId);
|
||||
void deleteOrder(QString* orderId);
|
||||
void getInventory();
|
||||
void getOrderById(qint64 orderId);
|
||||
void placeOrder(SWGOrder body);
|
||||
|
||||
private:
|
||||
void getInventoryCallback (HttpRequestWorker * worker);
|
||||
void placeOrderCallback (HttpRequestWorker * worker);
|
||||
void getOrderByIdCallback (HttpRequestWorker * worker);
|
||||
void deleteOrderCallback (HttpRequestWorker * worker);
|
||||
void getInventoryCallback (HttpRequestWorker * worker);
|
||||
void getOrderByIdCallback (HttpRequestWorker * worker);
|
||||
void placeOrderCallback (HttpRequestWorker * worker);
|
||||
|
||||
signals:
|
||||
void getInventorySignal(QMap<QString, qint32>* summary);
|
||||
void placeOrderSignal(SWGOrder* summary);
|
||||
void getOrderByIdSignal(SWGOrder* summary);
|
||||
void deleteOrderSignal();
|
||||
void getInventorySignal(QMap<QString, qint32>* summary);
|
||||
void getOrderByIdSignal(SWGOrder* summary);
|
||||
void placeOrderSignal(SWGOrder* summary);
|
||||
|
||||
};
|
||||
}
|
||||
|
@ -27,17 +27,15 @@ SWGTag::~SWGTag() {
|
||||
void
|
||||
SWGTag::init() {
|
||||
id = 0L;
|
||||
name = new QString("");
|
||||
|
||||
name = new QString("");
|
||||
}
|
||||
|
||||
void
|
||||
SWGTag::cleanup() {
|
||||
|
||||
if(name != NULL) {
|
||||
if(name != NULL) {
|
||||
delete name;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
SWGTag*
|
||||
@ -52,8 +50,7 @@ SWGTag::fromJson(QString &json) {
|
||||
void
|
||||
SWGTag::fromJsonObject(QJsonObject &pJson) {
|
||||
setValue(&id, pJson["id"], "qint64", "");
|
||||
setValue(&name, pJson["name"], "QString", "QString");
|
||||
|
||||
setValue(&name, pJson["name"], "QString", "QString");
|
||||
}
|
||||
|
||||
QString
|
||||
@ -76,8 +73,6 @@ SWGTag::asJsonObject() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
@ -32,14 +32,12 @@ public:
|
||||
|
||||
qint64 getId();
|
||||
void setId(qint64 id);
|
||||
QString* getName();
|
||||
QString* getName();
|
||||
void setName(QString* name);
|
||||
|
||||
|
||||
private:
|
||||
qint64 id;
|
||||
QString* name;
|
||||
|
||||
QString* name;
|
||||
};
|
||||
|
||||
} /* namespace Swagger */
|
||||
|
@ -27,39 +27,37 @@ SWGUser::~SWGUser() {
|
||||
void
|
||||
SWGUser::init() {
|
||||
id = 0L;
|
||||
username = new QString("");
|
||||
firstName = new QString("");
|
||||
lastName = new QString("");
|
||||
email = new QString("");
|
||||
password = new QString("");
|
||||
phone = new QString("");
|
||||
userStatus = 0;
|
||||
|
||||
username = new QString("");
|
||||
firstName = new QString("");
|
||||
lastName = new QString("");
|
||||
email = new QString("");
|
||||
password = new QString("");
|
||||
phone = new QString("");
|
||||
userStatus = 0;
|
||||
}
|
||||
|
||||
void
|
||||
SWGUser::cleanup() {
|
||||
|
||||
if(username != NULL) {
|
||||
if(username != NULL) {
|
||||
delete username;
|
||||
}
|
||||
if(firstName != NULL) {
|
||||
if(firstName != NULL) {
|
||||
delete firstName;
|
||||
}
|
||||
if(lastName != NULL) {
|
||||
if(lastName != NULL) {
|
||||
delete lastName;
|
||||
}
|
||||
if(email != NULL) {
|
||||
if(email != NULL) {
|
||||
delete email;
|
||||
}
|
||||
if(password != NULL) {
|
||||
if(password != NULL) {
|
||||
delete password;
|
||||
}
|
||||
if(phone != NULL) {
|
||||
if(phone != NULL) {
|
||||
delete phone;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
SWGUser*
|
||||
@ -74,14 +72,13 @@ SWGUser::fromJson(QString &json) {
|
||||
void
|
||||
SWGUser::fromJsonObject(QJsonObject &pJson) {
|
||||
setValue(&id, pJson["id"], "qint64", "");
|
||||
setValue(&username, pJson["username"], "QString", "QString");
|
||||
setValue(&firstName, pJson["firstName"], "QString", "QString");
|
||||
setValue(&lastName, pJson["lastName"], "QString", "QString");
|
||||
setValue(&email, pJson["email"], "QString", "QString");
|
||||
setValue(&password, pJson["password"], "QString", "QString");
|
||||
setValue(&phone, pJson["phone"], "QString", "QString");
|
||||
setValue(&userStatus, pJson["userStatus"], "qint32", "");
|
||||
|
||||
setValue(&username, pJson["username"], "QString", "QString");
|
||||
setValue(&firstName, pJson["firstName"], "QString", "QString");
|
||||
setValue(&lastName, pJson["lastName"], "QString", "QString");
|
||||
setValue(&email, pJson["email"], "QString", "QString");
|
||||
setValue(&password, pJson["password"], "QString", "QString");
|
||||
setValue(&phone, pJson["phone"], "QString", "QString");
|
||||
setValue(&userStatus, pJson["userStatus"], "qint32", "");
|
||||
}
|
||||
|
||||
QString
|
||||
@ -105,37 +102,30 @@ SWGUser::asJsonObject() {
|
||||
|
||||
|
||||
|
||||
|
||||
toJsonValue(QString("firstName"), firstName, obj, QString("QString"));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
toJsonValue(QString("lastName"), lastName, obj, QString("QString"));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
toJsonValue(QString("email"), email, obj, QString("QString"));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
toJsonValue(QString("password"), password, obj, QString("QString"));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
toJsonValue(QString("phone"), phone, obj, QString("QString"));
|
||||
|
||||
|
||||
|
||||
obj->insert("userStatus", QJsonValue(userStatus));
|
||||
|
||||
obj->insert("userStatus", QJsonValue(userStatus));
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
@ -32,32 +32,30 @@ public:
|
||||
|
||||
qint64 getId();
|
||||
void setId(qint64 id);
|
||||
QString* getUsername();
|
||||
QString* getUsername();
|
||||
void setUsername(QString* username);
|
||||
QString* getFirstName();
|
||||
QString* getFirstName();
|
||||
void setFirstName(QString* firstName);
|
||||
QString* getLastName();
|
||||
QString* getLastName();
|
||||
void setLastName(QString* lastName);
|
||||
QString* getEmail();
|
||||
QString* getEmail();
|
||||
void setEmail(QString* email);
|
||||
QString* getPassword();
|
||||
QString* getPassword();
|
||||
void setPassword(QString* password);
|
||||
QString* getPhone();
|
||||
QString* getPhone();
|
||||
void setPhone(QString* phone);
|
||||
qint32 getUserStatus();
|
||||
qint32 getUserStatus();
|
||||
void setUserStatus(qint32 userStatus);
|
||||
|
||||
|
||||
private:
|
||||
qint64 id;
|
||||
QString* username;
|
||||
QString* firstName;
|
||||
QString* lastName;
|
||||
QString* email;
|
||||
QString* password;
|
||||
QString* phone;
|
||||
qint32 userStatus;
|
||||
|
||||
QString* username;
|
||||
QString* firstName;
|
||||
QString* lastName;
|
||||
QString* email;
|
||||
QString* password;
|
||||
QString* phone;
|
||||
qint32 userStatus;
|
||||
};
|
||||
|
||||
} /* namespace Swagger */
|
||||
|
@ -22,22 +22,15 @@ SWGUserApi::createUser(SWGUser body) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "POST");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
QString output = body.asJson();
|
||||
input.request_body.append(output);
|
||||
|
||||
|
||||
|
||||
|
||||
connect(worker,
|
||||
&HttpRequestWorker::on_execution_finished,
|
||||
this,
|
||||
@ -70,15 +63,10 @@ SWGUserApi::createUsersWithArrayInput(QList<SWGUser*>* body) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "POST");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
QJsonArray* bodyArray = new QJsonArray();
|
||||
toJsonArray((QList<void*>*)body, bodyArray, QString("body"), QString("SWGUser*"));
|
||||
|
||||
@ -89,8 +77,6 @@ SWGUserApi::createUsersWithArrayInput(QList<SWGUser*>* body) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
connect(worker,
|
||||
&HttpRequestWorker::on_execution_finished,
|
||||
this,
|
||||
@ -123,15 +109,10 @@ SWGUserApi::createUsersWithListInput(QList<SWGUser*>* body) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "POST");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
QJsonArray* bodyArray = new QJsonArray();
|
||||
toJsonArray((QList<void*>*)body, bodyArray, QString("body"), QString("SWGUser*"));
|
||||
|
||||
@ -142,8 +123,6 @@ SWGUserApi::createUsersWithListInput(QList<SWGUser*>* body) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
connect(worker,
|
||||
&HttpRequestWorker::on_execution_finished,
|
||||
this,
|
||||
@ -170,14 +149,96 @@ SWGUserApi::createUsersWithListInputCallback(HttpRequestWorker * worker) {
|
||||
emit createUsersWithListInputSignal();
|
||||
}
|
||||
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) {
|
||||
QString fullPath;
|
||||
fullPath.append(this->host).append(this->basePath).append("/user/login");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (fullPath.indexOf("?") > 0)
|
||||
fullPath.append("&");
|
||||
else
|
||||
@ -186,10 +247,6 @@ SWGUserApi::loginUser(QString* username, QString* password) {
|
||||
.append("=")
|
||||
.append(QUrl::toPercentEncoding(stringValue(username)));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (fullPath.indexOf("?") > 0)
|
||||
fullPath.append("&");
|
||||
else
|
||||
@ -199,9 +256,6 @@ SWGUserApi::loginUser(QString* username, QString* password) {
|
||||
.append(QUrl::toPercentEncoding(stringValue(password)));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "GET");
|
||||
|
||||
@ -209,8 +263,6 @@ SWGUserApi::loginUser(QString* username, QString* password) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
connect(worker,
|
||||
&HttpRequestWorker::on_execution_finished,
|
||||
this,
|
||||
@ -230,16 +282,10 @@ SWGUserApi::loginUserCallback(HttpRequestWorker * worker) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
QString json(worker->response);
|
||||
QString* output = static_cast<QString*>(create(json, QString("QString")));
|
||||
|
||||
|
||||
|
||||
|
||||
worker->deleteLater();
|
||||
|
||||
emit loginUserSignal(output);
|
||||
@ -252,8 +298,6 @@ SWGUserApi::logoutUser() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "GET");
|
||||
|
||||
@ -261,8 +305,6 @@ SWGUserApi::logoutUser() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
connect(worker,
|
||||
&HttpRequestWorker::on_execution_finished,
|
||||
this,
|
||||
@ -289,86 +331,23 @@ SWGUserApi::logoutUserCallback(HttpRequestWorker * worker) {
|
||||
emit logoutUserSignal();
|
||||
}
|
||||
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) {
|
||||
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, "PUT");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
QString output = body.asJson();
|
||||
input.request_body.append(output);
|
||||
|
||||
|
||||
|
||||
|
||||
connect(worker,
|
||||
&HttpRequestWorker::on_execution_finished,
|
||||
this,
|
||||
@ -394,50 +373,4 @@ SWGUserApi::updateUserCallback(HttpRequestWorker * worker) {
|
||||
|
||||
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 */
|
||||
|
@ -25,31 +25,31 @@ public:
|
||||
void createUser(SWGUser body);
|
||||
void createUsersWithArrayInput(QList<SWGUser*>* body);
|
||||
void createUsersWithListInput(QList<SWGUser*>* body);
|
||||
void deleteUser(QString* username);
|
||||
void getUserByName(QString* username);
|
||||
void loginUser(QString* username, QString* password);
|
||||
void logoutUser();
|
||||
void getUserByName(QString* username);
|
||||
void updateUser(QString* username, SWGUser body);
|
||||
void deleteUser(QString* username);
|
||||
|
||||
private:
|
||||
void createUserCallback (HttpRequestWorker * worker);
|
||||
void createUsersWithArrayInputCallback (HttpRequestWorker * worker);
|
||||
void createUsersWithListInputCallback (HttpRequestWorker * worker);
|
||||
void deleteUserCallback (HttpRequestWorker * worker);
|
||||
void getUserByNameCallback (HttpRequestWorker * worker);
|
||||
void loginUserCallback (HttpRequestWorker * worker);
|
||||
void logoutUserCallback (HttpRequestWorker * worker);
|
||||
void getUserByNameCallback (HttpRequestWorker * worker);
|
||||
void updateUserCallback (HttpRequestWorker * worker);
|
||||
void deleteUserCallback (HttpRequestWorker * worker);
|
||||
|
||||
signals:
|
||||
void createUserSignal();
|
||||
void createUsersWithArrayInputSignal();
|
||||
void createUsersWithListInputSignal();
|
||||
void deleteUserSignal();
|
||||
void getUserByNameSignal(SWGUser* summary);
|
||||
void loginUserSignal(QString* summary);
|
||||
void logoutUserSignal();
|
||||
void getUserByNameSignal(SWGUser* summary);
|
||||
void updateUserSignal();
|
||||
void deleteUserSignal();
|
||||
|
||||
};
|
||||
}
|
||||
|
203
samples/client/petstore/tizen/client/SamiApiResponse.cpp
Normal file
203
samples/client/petstore/tizen/client/SamiApiResponse.cpp
Normal 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 */
|
||||
|
59
samples/client/petstore/tizen/client/SamiApiResponse.h
Normal file
59
samples/client/petstore/tizen/client/SamiApiResponse.h
Normal 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_ */
|
@ -23,8 +23,7 @@ SamiCategory::~SamiCategory() {
|
||||
void
|
||||
SamiCategory::init() {
|
||||
pId = null;
|
||||
pName = null;
|
||||
|
||||
pName = null;
|
||||
}
|
||||
|
||||
void
|
||||
@ -34,12 +33,11 @@ SamiCategory::cleanup() {
|
||||
delete pId;
|
||||
pId = null;
|
||||
}
|
||||
if(pName != null) {
|
||||
if(pName != null) {
|
||||
|
||||
delete pName;
|
||||
pName = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -86,7 +84,7 @@ SamiCategory::fromJsonObject(IJsonValue* pJson) {
|
||||
jsonToValue(pId, pIdVal, L"Long", L"Long");
|
||||
}
|
||||
delete pIdKey;
|
||||
JsonString* pNameKey = new JsonString(L"name");
|
||||
JsonString* pNameKey = new JsonString(L"name");
|
||||
IJsonValue* pNameVal = null;
|
||||
pJsonObject->GetValue(pNameKey, pNameVal);
|
||||
if(pNameVal != null) {
|
||||
@ -95,7 +93,6 @@ SamiCategory::fromJsonObject(IJsonValue* pJson) {
|
||||
jsonToValue(pName, pNameVal, L"String", L"String");
|
||||
}
|
||||
delete pNameKey;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -146,15 +143,12 @@ SamiCategory::asJsonObject() {
|
||||
JsonObject *pJsonObject = new JsonObject();
|
||||
pJsonObject->Construct();
|
||||
|
||||
|
||||
JsonString *pIdKey = new JsonString(L"id");
|
||||
pJsonObject->Add(pIdKey, toJson(getPId(), "Long", ""));
|
||||
|
||||
|
||||
JsonString *pNameKey = new JsonString(L"name");
|
||||
pJsonObject->Add(pNameKey, toJson(getPName(), "String", ""));
|
||||
|
||||
|
||||
return pJsonObject;
|
||||
}
|
||||
|
||||
|
@ -41,18 +41,14 @@ public:
|
||||
|
||||
SamiCategory* fromJson(String* obj);
|
||||
|
||||
|
||||
Long* getPId();
|
||||
void setPId(Long* pId);
|
||||
|
||||
String* getPName();
|
||||
void setPName(String* pName);
|
||||
|
||||
|
||||
private:
|
||||
Long* pId;
|
||||
String* pName;
|
||||
|
||||
String* pName;
|
||||
};
|
||||
|
||||
} /* namespace Swagger */
|
||||
|
@ -3,29 +3,33 @@
|
||||
|
||||
#include "SamiObject.h"
|
||||
|
||||
#include "SamiUser.h"
|
||||
#include "SamiApiResponse.h"
|
||||
#include "SamiCategory.h"
|
||||
#include "SamiOrder.h"
|
||||
#include "SamiPet.h"
|
||||
#include "SamiTag.h"
|
||||
#include "SamiOrder.h"
|
||||
#include "SamiUser.h"
|
||||
|
||||
namespace Swagger {
|
||||
void*
|
||||
create(String type) {
|
||||
if(type.Equals(L"SamiUser", true)) {
|
||||
return new SamiUser();
|
||||
if(type.Equals(L"SamiApiResponse", true)) {
|
||||
return new SamiApiResponse();
|
||||
}
|
||||
if(type.Equals(L"SamiCategory", true)) {
|
||||
return new SamiCategory();
|
||||
}
|
||||
if(type.Equals(L"SamiOrder", true)) {
|
||||
return new SamiOrder();
|
||||
}
|
||||
if(type.Equals(L"SamiPet", true)) {
|
||||
return new SamiPet();
|
||||
}
|
||||
if(type.Equals(L"SamiTag", true)) {
|
||||
return new SamiTag();
|
||||
}
|
||||
if(type.Equals(L"SamiOrder", true)) {
|
||||
return new SamiOrder();
|
||||
if(type.Equals(L"SamiUser", true)) {
|
||||
return new SamiUser();
|
||||
}
|
||||
|
||||
if(type.Equals(L"String", true)) {
|
||||
|
@ -23,12 +23,11 @@ SamiOrder::~SamiOrder() {
|
||||
void
|
||||
SamiOrder::init() {
|
||||
pId = null;
|
||||
pPetId = null;
|
||||
pQuantity = null;
|
||||
pShipDate = null;
|
||||
pStatus = null;
|
||||
pComplete = null;
|
||||
|
||||
pPetId = null;
|
||||
pQuantity = null;
|
||||
pShipDate = null;
|
||||
pStatus = null;
|
||||
pComplete = null;
|
||||
}
|
||||
|
||||
void
|
||||
@ -38,32 +37,31 @@ SamiOrder::cleanup() {
|
||||
delete pId;
|
||||
pId = null;
|
||||
}
|
||||
if(pPetId != null) {
|
||||
if(pPetId != null) {
|
||||
|
||||
delete pPetId;
|
||||
pPetId = null;
|
||||
}
|
||||
if(pQuantity != null) {
|
||||
if(pQuantity != null) {
|
||||
|
||||
delete pQuantity;
|
||||
pQuantity = null;
|
||||
}
|
||||
if(pShipDate != null) {
|
||||
if(pShipDate != null) {
|
||||
|
||||
delete pShipDate;
|
||||
pShipDate = null;
|
||||
}
|
||||
if(pStatus != null) {
|
||||
if(pStatus != null) {
|
||||
|
||||
delete pStatus;
|
||||
pStatus = null;
|
||||
}
|
||||
if(pComplete != null) {
|
||||
if(pComplete != null) {
|
||||
|
||||
delete pComplete;
|
||||
pComplete = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -110,7 +108,7 @@ SamiOrder::fromJsonObject(IJsonValue* pJson) {
|
||||
jsonToValue(pId, pIdVal, L"Long", L"Long");
|
||||
}
|
||||
delete pIdKey;
|
||||
JsonString* pPetIdKey = new JsonString(L"petId");
|
||||
JsonString* pPetIdKey = new JsonString(L"petId");
|
||||
IJsonValue* pPetIdVal = null;
|
||||
pJsonObject->GetValue(pPetIdKey, pPetIdVal);
|
||||
if(pPetIdVal != null) {
|
||||
@ -119,7 +117,7 @@ SamiOrder::fromJsonObject(IJsonValue* pJson) {
|
||||
jsonToValue(pPetId, pPetIdVal, L"Long", L"Long");
|
||||
}
|
||||
delete pPetIdKey;
|
||||
JsonString* pQuantityKey = new JsonString(L"quantity");
|
||||
JsonString* pQuantityKey = new JsonString(L"quantity");
|
||||
IJsonValue* pQuantityVal = null;
|
||||
pJsonObject->GetValue(pQuantityKey, pQuantityVal);
|
||||
if(pQuantityVal != null) {
|
||||
@ -128,7 +126,7 @@ SamiOrder::fromJsonObject(IJsonValue* pJson) {
|
||||
jsonToValue(pQuantity, pQuantityVal, L"Integer", L"Integer");
|
||||
}
|
||||
delete pQuantityKey;
|
||||
JsonString* pShipDateKey = new JsonString(L"shipDate");
|
||||
JsonString* pShipDateKey = new JsonString(L"shipDate");
|
||||
IJsonValue* pShipDateVal = null;
|
||||
pJsonObject->GetValue(pShipDateKey, pShipDateVal);
|
||||
if(pShipDateVal != null) {
|
||||
@ -137,7 +135,7 @@ SamiOrder::fromJsonObject(IJsonValue* pJson) {
|
||||
jsonToValue(pShipDate, pShipDateVal, L"DateTime", L"DateTime");
|
||||
}
|
||||
delete pShipDateKey;
|
||||
JsonString* pStatusKey = new JsonString(L"status");
|
||||
JsonString* pStatusKey = new JsonString(L"status");
|
||||
IJsonValue* pStatusVal = null;
|
||||
pJsonObject->GetValue(pStatusKey, pStatusVal);
|
||||
if(pStatusVal != null) {
|
||||
@ -146,7 +144,7 @@ SamiOrder::fromJsonObject(IJsonValue* pJson) {
|
||||
jsonToValue(pStatus, pStatusVal, L"String", L"String");
|
||||
}
|
||||
delete pStatusKey;
|
||||
JsonString* pCompleteKey = new JsonString(L"complete");
|
||||
JsonString* pCompleteKey = new JsonString(L"complete");
|
||||
IJsonValue* pCompleteVal = null;
|
||||
pJsonObject->GetValue(pCompleteKey, pCompleteVal);
|
||||
if(pCompleteVal != null) {
|
||||
@ -155,7 +153,6 @@ SamiOrder::fromJsonObject(IJsonValue* pJson) {
|
||||
jsonToValue(pComplete, pCompleteVal, L"Boolean", L"Boolean");
|
||||
}
|
||||
delete pCompleteKey;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -206,31 +203,24 @@ SamiOrder::asJsonObject() {
|
||||
JsonObject *pJsonObject = new JsonObject();
|
||||
pJsonObject->Construct();
|
||||
|
||||
|
||||
JsonString *pIdKey = new JsonString(L"id");
|
||||
pJsonObject->Add(pIdKey, toJson(getPId(), "Long", ""));
|
||||
|
||||
|
||||
JsonString *pPetIdKey = new JsonString(L"petId");
|
||||
pJsonObject->Add(pPetIdKey, toJson(getPPetId(), "Long", ""));
|
||||
|
||||
|
||||
JsonString *pQuantityKey = new JsonString(L"quantity");
|
||||
pJsonObject->Add(pQuantityKey, toJson(getPQuantity(), "Integer", ""));
|
||||
|
||||
|
||||
JsonString *pShipDateKey = new JsonString(L"shipDate");
|
||||
pJsonObject->Add(pShipDateKey, toJson(getPShipDate(), "DateTime", ""));
|
||||
|
||||
|
||||
JsonString *pStatusKey = new JsonString(L"status");
|
||||
pJsonObject->Add(pStatusKey, toJson(getPStatus(), "String", ""));
|
||||
|
||||
|
||||
JsonString *pCompleteKey = new JsonString(L"complete");
|
||||
pJsonObject->Add(pCompleteKey, toJson(getPComplete(), "Boolean", ""));
|
||||
|
||||
|
||||
return pJsonObject;
|
||||
}
|
||||
|
||||
|
@ -17,11 +17,11 @@
|
||||
using namespace Tizen::Web::Json;
|
||||
|
||||
|
||||
using Tizen::Base::Long;
|
||||
using Tizen::Base::DateTime;
|
||||
using Tizen::Base::String;
|
||||
using Tizen::Base::Boolean;
|
||||
using Tizen::Base::DateTime;
|
||||
using Tizen::Base::Integer;
|
||||
using Tizen::Base::Long;
|
||||
using Tizen::Base::String;
|
||||
|
||||
|
||||
namespace Swagger {
|
||||
@ -44,34 +44,26 @@ public:
|
||||
|
||||
SamiOrder* fromJson(String* obj);
|
||||
|
||||
|
||||
Long* getPId();
|
||||
void setPId(Long* pId);
|
||||
|
||||
Long* getPPetId();
|
||||
void setPPetId(Long* pPetId);
|
||||
|
||||
Integer* getPQuantity();
|
||||
void setPQuantity(Integer* pQuantity);
|
||||
|
||||
DateTime* getPShipDate();
|
||||
void setPShipDate(DateTime* pShipDate);
|
||||
|
||||
String* getPStatus();
|
||||
void setPStatus(String* pStatus);
|
||||
|
||||
Boolean* getPComplete();
|
||||
void setPComplete(Boolean* pComplete);
|
||||
|
||||
|
||||
private:
|
||||
Long* pId;
|
||||
Long* pPetId;
|
||||
Integer* pQuantity;
|
||||
DateTime* pShipDate;
|
||||
String* pStatus;
|
||||
Boolean* pComplete;
|
||||
|
||||
Long* pPetId;
|
||||
Integer* pQuantity;
|
||||
DateTime* pShipDate;
|
||||
String* pStatus;
|
||||
Boolean* pComplete;
|
||||
};
|
||||
|
||||
} /* namespace Swagger */
|
||||
|
@ -23,12 +23,11 @@ SamiPet::~SamiPet() {
|
||||
void
|
||||
SamiPet::init() {
|
||||
pId = null;
|
||||
pCategory = null;
|
||||
pName = null;
|
||||
pPhotoUrls = null;
|
||||
pTags = null;
|
||||
pStatus = null;
|
||||
|
||||
pCategory = null;
|
||||
pName = null;
|
||||
pPhotoUrls = null;
|
||||
pTags = null;
|
||||
pStatus = null;
|
||||
}
|
||||
|
||||
void
|
||||
@ -38,32 +37,31 @@ SamiPet::cleanup() {
|
||||
delete pId;
|
||||
pId = null;
|
||||
}
|
||||
if(pCategory != null) {
|
||||
if(pCategory != null) {
|
||||
|
||||
delete pCategory;
|
||||
pCategory = null;
|
||||
}
|
||||
if(pName != null) {
|
||||
if(pName != null) {
|
||||
|
||||
delete pName;
|
||||
pName = null;
|
||||
}
|
||||
if(pPhotoUrls != null) {
|
||||
if(pPhotoUrls != null) {
|
||||
pPhotoUrls->RemoveAll(true);
|
||||
delete pPhotoUrls;
|
||||
pPhotoUrls = null;
|
||||
}
|
||||
if(pTags != null) {
|
||||
if(pTags != null) {
|
||||
pTags->RemoveAll(true);
|
||||
delete pTags;
|
||||
pTags = null;
|
||||
}
|
||||
if(pStatus != null) {
|
||||
if(pStatus != null) {
|
||||
|
||||
delete pStatus;
|
||||
pStatus = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -110,7 +108,7 @@ SamiPet::fromJsonObject(IJsonValue* pJson) {
|
||||
jsonToValue(pId, pIdVal, L"Long", L"Long");
|
||||
}
|
||||
delete pIdKey;
|
||||
JsonString* pCategoryKey = new JsonString(L"category");
|
||||
JsonString* pCategoryKey = new JsonString(L"category");
|
||||
IJsonValue* pCategoryVal = null;
|
||||
pJsonObject->GetValue(pCategoryKey, pCategoryVal);
|
||||
if(pCategoryVal != null) {
|
||||
@ -119,7 +117,7 @@ SamiPet::fromJsonObject(IJsonValue* pJson) {
|
||||
jsonToValue(pCategory, pCategoryVal, L"SamiCategory", L"SamiCategory");
|
||||
}
|
||||
delete pCategoryKey;
|
||||
JsonString* pNameKey = new JsonString(L"name");
|
||||
JsonString* pNameKey = new JsonString(L"name");
|
||||
IJsonValue* pNameVal = null;
|
||||
pJsonObject->GetValue(pNameKey, pNameVal);
|
||||
if(pNameVal != null) {
|
||||
@ -128,7 +126,7 @@ SamiPet::fromJsonObject(IJsonValue* pJson) {
|
||||
jsonToValue(pName, pNameVal, L"String", L"String");
|
||||
}
|
||||
delete pNameKey;
|
||||
JsonString* pPhotoUrlsKey = new JsonString(L"photoUrls");
|
||||
JsonString* pPhotoUrlsKey = new JsonString(L"photoUrls");
|
||||
IJsonValue* pPhotoUrlsVal = null;
|
||||
pJsonObject->GetValue(pPhotoUrlsKey, pPhotoUrlsVal);
|
||||
if(pPhotoUrlsVal != null) {
|
||||
@ -137,7 +135,7 @@ SamiPet::fromJsonObject(IJsonValue* pJson) {
|
||||
jsonToValue(pPhotoUrls, pPhotoUrlsVal, L"IList", L"String");
|
||||
}
|
||||
delete pPhotoUrlsKey;
|
||||
JsonString* pTagsKey = new JsonString(L"tags");
|
||||
JsonString* pTagsKey = new JsonString(L"tags");
|
||||
IJsonValue* pTagsVal = null;
|
||||
pJsonObject->GetValue(pTagsKey, pTagsVal);
|
||||
if(pTagsVal != null) {
|
||||
@ -146,7 +144,7 @@ SamiPet::fromJsonObject(IJsonValue* pJson) {
|
||||
jsonToValue(pTags, pTagsVal, L"IList", L"SamiTag");
|
||||
}
|
||||
delete pTagsKey;
|
||||
JsonString* pStatusKey = new JsonString(L"status");
|
||||
JsonString* pStatusKey = new JsonString(L"status");
|
||||
IJsonValue* pStatusVal = null;
|
||||
pJsonObject->GetValue(pStatusKey, pStatusVal);
|
||||
if(pStatusVal != null) {
|
||||
@ -155,7 +153,6 @@ SamiPet::fromJsonObject(IJsonValue* pJson) {
|
||||
jsonToValue(pStatus, pStatusVal, L"String", L"String");
|
||||
}
|
||||
delete pStatusKey;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -206,31 +203,24 @@ SamiPet::asJsonObject() {
|
||||
JsonObject *pJsonObject = new JsonObject();
|
||||
pJsonObject->Construct();
|
||||
|
||||
|
||||
JsonString *pIdKey = new JsonString(L"id");
|
||||
pJsonObject->Add(pIdKey, toJson(getPId(), "Long", ""));
|
||||
|
||||
|
||||
JsonString *pCategoryKey = new JsonString(L"category");
|
||||
pJsonObject->Add(pCategoryKey, toJson(getPCategory(), "SamiCategory", ""));
|
||||
|
||||
|
||||
JsonString *pNameKey = new JsonString(L"name");
|
||||
pJsonObject->Add(pNameKey, toJson(getPName(), "String", ""));
|
||||
|
||||
|
||||
JsonString *pPhotoUrlsKey = new JsonString(L"photoUrls");
|
||||
pJsonObject->Add(pPhotoUrlsKey, toJson(getPPhotoUrls(), "String", "array"));
|
||||
|
||||
|
||||
JsonString *pTagsKey = new JsonString(L"tags");
|
||||
pJsonObject->Add(pTagsKey, toJson(getPTags(), "SamiTag", "array"));
|
||||
|
||||
|
||||
JsonString *pStatusKey = new JsonString(L"status");
|
||||
pJsonObject->Add(pStatusKey, toJson(getPStatus(), "String", ""));
|
||||
|
||||
|
||||
return pJsonObject;
|
||||
}
|
||||
|
||||
|
@ -18,10 +18,10 @@ using namespace Tizen::Web::Json;
|
||||
|
||||
|
||||
#include "SamiCategory.h"
|
||||
using Tizen::Base::Long;
|
||||
using Tizen::Base::String;
|
||||
#include "SamiTag.h"
|
||||
using Tizen::Base::Collection::IList;
|
||||
using Tizen::Base::Long;
|
||||
using Tizen::Base::String;
|
||||
|
||||
|
||||
namespace Swagger {
|
||||
@ -44,34 +44,26 @@ public:
|
||||
|
||||
SamiPet* fromJson(String* obj);
|
||||
|
||||
|
||||
Long* getPId();
|
||||
void setPId(Long* pId);
|
||||
|
||||
SamiCategory* getPCategory();
|
||||
void setPCategory(SamiCategory* pCategory);
|
||||
|
||||
String* getPName();
|
||||
void setPName(String* pName);
|
||||
|
||||
IList* getPPhotoUrls();
|
||||
void setPPhotoUrls(IList* pPhotoUrls);
|
||||
|
||||
IList* getPTags();
|
||||
void setPTags(IList* pTags);
|
||||
|
||||
String* getPStatus();
|
||||
void setPStatus(String* pStatus);
|
||||
|
||||
|
||||
private:
|
||||
Long* pId;
|
||||
SamiCategory* pCategory;
|
||||
String* pName;
|
||||
IList* pPhotoUrls;
|
||||
IList* pTags;
|
||||
String* pStatus;
|
||||
|
||||
SamiCategory* pCategory;
|
||||
String* pName;
|
||||
IList* pPhotoUrls;
|
||||
IList* pTags;
|
||||
String* pStatus;
|
||||
};
|
||||
|
||||
} /* namespace Swagger */
|
||||
|
@ -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
|
||||
addPetProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) {
|
||||
int code = pHttpResponse->GetHttpStatusCode();
|
||||
@ -88,32 +39,67 @@ SamiPetApi::addPetWithCompletion(SamiPet* body, void(*success)(SamiError*)) {
|
||||
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, "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
|
||||
findPetsByStatusProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) {
|
||||
int code = pHttpResponse->GetHttpStatusCode();
|
||||
@ -158,7 +144,6 @@ SamiPetApi::findPetsByStatusWithCompletion(IList* status, void (* success)(IList
|
||||
headerParams->Construct();
|
||||
|
||||
|
||||
|
||||
HashMap* queryParams = new HashMap(SingleObjectDeleter);
|
||||
queryParams->Construct();
|
||||
|
||||
@ -169,16 +154,12 @@ SamiPetApi::findPetsByStatusWithCompletion(IList* status, void (* success)(IList
|
||||
queryParams->Add(new String("status"), new String(itemAt));
|
||||
}
|
||||
|
||||
|
||||
|
||||
String* mBody = null;
|
||||
|
||||
|
||||
|
||||
String url(L"/pet/findByStatus");
|
||||
|
||||
|
||||
|
||||
client->execute(SamiPetApi::getBasePath(), url, "GET", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json");
|
||||
return null;
|
||||
}
|
||||
@ -227,7 +208,6 @@ SamiPetApi::findPetsByTagsWithCompletion(IList* tags, void (* success)(IList*, S
|
||||
headerParams->Construct();
|
||||
|
||||
|
||||
|
||||
HashMap* queryParams = new HashMap(SingleObjectDeleter);
|
||||
queryParams->Construct();
|
||||
|
||||
@ -238,16 +218,12 @@ SamiPetApi::findPetsByTagsWithCompletion(IList* tags, void (* success)(IList*, S
|
||||
queryParams->Add(new String("tags"), new String(itemAt));
|
||||
}
|
||||
|
||||
|
||||
|
||||
String* mBody = null;
|
||||
|
||||
|
||||
|
||||
String url(L"/pet/findByTags");
|
||||
|
||||
|
||||
|
||||
client->execute(SamiPetApi::getBasePath(), url, "GET", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json");
|
||||
return null;
|
||||
}
|
||||
@ -296,29 +272,65 @@ SamiPetApi::getPetByIdWithCompletion(Long* petId, void (* success)(SamiPet*, Sam
|
||||
headerParams->Construct();
|
||||
|
||||
|
||||
|
||||
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, "GET", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json");
|
||||
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
|
||||
updatePetWithFormProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) {
|
||||
int code = pHttpResponse->GetHttpStatusCode();
|
||||
@ -334,7 +346,7 @@ updatePetWithFormProcessor(HttpResponse* pHttpResponse, void (* handler)(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->success(&updatePetWithFormProcessor, (void(*)(void*, SamiError*))success);
|
||||
@ -342,75 +354,21 @@ SamiPetApi::updatePetWithFormWithCompletion(String* petId, String* name, String*
|
||||
headerParams->Construct();
|
||||
|
||||
|
||||
|
||||
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"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"{");
|
||||
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");
|
||||
client->execute(SamiPetApi::getBasePath(), url, "POST", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json");
|
||||
|
||||
}
|
||||
|
||||
@ -419,17 +377,38 @@ uploadFileProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiErr
|
||||
int code = pHttpResponse->GetHttpStatusCode();
|
||||
|
||||
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 {
|
||||
SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText()));
|
||||
handler(null, error);
|
||||
|
||||
handler(error, null);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
SamiPetApi::uploadFileWithCompletion(Long* petId, String* additionalMetadata, SamiFile* file, void(*success)(SamiError*)) {
|
||||
SamiApiResponse*
|
||||
SamiPetApi::uploadFileWithCompletion(Long* petId, String* additionalMetadata, SamiFile* file, void (* success)(SamiApiResponse*, SamiError*)) {
|
||||
client = new SamiApiClient();
|
||||
|
||||
client->success(&uploadFileProcessor, (void(*)(void*, SamiError*))success);
|
||||
@ -437,27 +416,22 @@ SamiPetApi::uploadFileWithCompletion(Long* petId, String* additionalMetadata, Sa
|
||||
headerParams->Construct();
|
||||
|
||||
|
||||
|
||||
HashMap* queryParams = new HashMap(SingleObjectDeleter);
|
||||
queryParams->Construct();
|
||||
|
||||
|
||||
|
||||
String* mBody = null;
|
||||
|
||||
|
||||
|
||||
String url(L"/pet/{petId}/uploadImage");
|
||||
|
||||
|
||||
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, "POST", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json");
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,9 +6,10 @@
|
||||
#include "SamiError.h"
|
||||
|
||||
#include "SamiPet.h"
|
||||
using Tizen::Base::String;
|
||||
using Tizen::Base::Long;
|
||||
using Tizen::Base::String;
|
||||
#include "SamiFile.h"
|
||||
#include "SamiApiResponse.h"
|
||||
|
||||
using namespace Tizen::Net::Http;
|
||||
|
||||
@ -19,31 +20,22 @@ public:
|
||||
SamiPetApi();
|
||||
virtual ~SamiPetApi();
|
||||
|
||||
|
||||
void
|
||||
updatePetWithCompletion(SamiPet* body, void(* handler)(SamiError*));
|
||||
|
||||
void
|
||||
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
|
||||
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
|
||||
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() {
|
||||
return L"http://petstore.swagger.io/v2";
|
||||
}
|
||||
|
@ -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
|
||||
getInventoryProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) {
|
||||
int code = pHttpResponse->GetHttpStatusCode();
|
||||
@ -60,19 +101,77 @@ SamiStoreApi::getInventoryWithCompletion( void (* success)(HashMap*, SamiError*)
|
||||
headerParams->Construct();
|
||||
|
||||
|
||||
|
||||
HashMap* queryParams = new HashMap(SingleObjectDeleter);
|
||||
queryParams->Construct();
|
||||
|
||||
|
||||
|
||||
String* mBody = null;
|
||||
|
||||
|
||||
|
||||
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");
|
||||
return null;
|
||||
@ -122,144 +221,23 @@ SamiStoreApi::placeOrderWithCompletion(SamiOrder* body, void (* success)(SamiOrd
|
||||
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"/store/order");
|
||||
|
||||
|
||||
|
||||
client->execute(SamiStoreApi::getBasePath(), url, "POST", (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(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 */
|
||||
|
@ -5,9 +5,10 @@
|
||||
#include "SamiApiClient.h"
|
||||
#include "SamiError.h"
|
||||
|
||||
using Tizen::Base::String;
|
||||
using Tizen::Base::Integer;
|
||||
#include "SamiOrder.h"
|
||||
using Tizen::Base::String;
|
||||
using Tizen::Base::Long;
|
||||
|
||||
using namespace Tizen::Net::Http;
|
||||
|
||||
@ -18,19 +19,14 @@ public:
|
||||
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
|
||||
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() {
|
||||
return L"http://petstore.swagger.io/v2";
|
||||
}
|
||||
|
@ -23,8 +23,7 @@ SamiTag::~SamiTag() {
|
||||
void
|
||||
SamiTag::init() {
|
||||
pId = null;
|
||||
pName = null;
|
||||
|
||||
pName = null;
|
||||
}
|
||||
|
||||
void
|
||||
@ -34,12 +33,11 @@ SamiTag::cleanup() {
|
||||
delete pId;
|
||||
pId = null;
|
||||
}
|
||||
if(pName != null) {
|
||||
if(pName != null) {
|
||||
|
||||
delete pName;
|
||||
pName = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -86,7 +84,7 @@ SamiTag::fromJsonObject(IJsonValue* pJson) {
|
||||
jsonToValue(pId, pIdVal, L"Long", L"Long");
|
||||
}
|
||||
delete pIdKey;
|
||||
JsonString* pNameKey = new JsonString(L"name");
|
||||
JsonString* pNameKey = new JsonString(L"name");
|
||||
IJsonValue* pNameVal = null;
|
||||
pJsonObject->GetValue(pNameKey, pNameVal);
|
||||
if(pNameVal != null) {
|
||||
@ -95,7 +93,6 @@ SamiTag::fromJsonObject(IJsonValue* pJson) {
|
||||
jsonToValue(pName, pNameVal, L"String", L"String");
|
||||
}
|
||||
delete pNameKey;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -146,15 +143,12 @@ SamiTag::asJsonObject() {
|
||||
JsonObject *pJsonObject = new JsonObject();
|
||||
pJsonObject->Construct();
|
||||
|
||||
|
||||
JsonString *pIdKey = new JsonString(L"id");
|
||||
pJsonObject->Add(pIdKey, toJson(getPId(), "Long", ""));
|
||||
|
||||
|
||||
JsonString *pNameKey = new JsonString(L"name");
|
||||
pJsonObject->Add(pNameKey, toJson(getPName(), "String", ""));
|
||||
|
||||
|
||||
return pJsonObject;
|
||||
}
|
||||
|
||||
|
@ -41,18 +41,14 @@ public:
|
||||
|
||||
SamiTag* fromJson(String* obj);
|
||||
|
||||
|
||||
Long* getPId();
|
||||
void setPId(Long* pId);
|
||||
|
||||
String* getPName();
|
||||
void setPName(String* pName);
|
||||
|
||||
|
||||
private:
|
||||
Long* pId;
|
||||
String* pName;
|
||||
|
||||
String* pName;
|
||||
};
|
||||
|
||||
} /* namespace Swagger */
|
||||
|
@ -23,14 +23,13 @@ SamiUser::~SamiUser() {
|
||||
void
|
||||
SamiUser::init() {
|
||||
pId = null;
|
||||
pUsername = null;
|
||||
pFirstName = null;
|
||||
pLastName = null;
|
||||
pEmail = null;
|
||||
pPassword = null;
|
||||
pPhone = null;
|
||||
pUserStatus = null;
|
||||
|
||||
pUsername = null;
|
||||
pFirstName = null;
|
||||
pLastName = null;
|
||||
pEmail = null;
|
||||
pPassword = null;
|
||||
pPhone = null;
|
||||
pUserStatus = null;
|
||||
}
|
||||
|
||||
void
|
||||
@ -40,42 +39,41 @@ SamiUser::cleanup() {
|
||||
delete pId;
|
||||
pId = null;
|
||||
}
|
||||
if(pUsername != null) {
|
||||
if(pUsername != null) {
|
||||
|
||||
delete pUsername;
|
||||
pUsername = null;
|
||||
}
|
||||
if(pFirstName != null) {
|
||||
if(pFirstName != null) {
|
||||
|
||||
delete pFirstName;
|
||||
pFirstName = null;
|
||||
}
|
||||
if(pLastName != null) {
|
||||
if(pLastName != null) {
|
||||
|
||||
delete pLastName;
|
||||
pLastName = null;
|
||||
}
|
||||
if(pEmail != null) {
|
||||
if(pEmail != null) {
|
||||
|
||||
delete pEmail;
|
||||
pEmail = null;
|
||||
}
|
||||
if(pPassword != null) {
|
||||
if(pPassword != null) {
|
||||
|
||||
delete pPassword;
|
||||
pPassword = null;
|
||||
}
|
||||
if(pPhone != null) {
|
||||
if(pPhone != null) {
|
||||
|
||||
delete pPhone;
|
||||
pPhone = null;
|
||||
}
|
||||
if(pUserStatus != null) {
|
||||
if(pUserStatus != null) {
|
||||
|
||||
delete pUserStatus;
|
||||
pUserStatus = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -122,7 +120,7 @@ SamiUser::fromJsonObject(IJsonValue* pJson) {
|
||||
jsonToValue(pId, pIdVal, L"Long", L"Long");
|
||||
}
|
||||
delete pIdKey;
|
||||
JsonString* pUsernameKey = new JsonString(L"username");
|
||||
JsonString* pUsernameKey = new JsonString(L"username");
|
||||
IJsonValue* pUsernameVal = null;
|
||||
pJsonObject->GetValue(pUsernameKey, pUsernameVal);
|
||||
if(pUsernameVal != null) {
|
||||
@ -131,7 +129,7 @@ SamiUser::fromJsonObject(IJsonValue* pJson) {
|
||||
jsonToValue(pUsername, pUsernameVal, L"String", L"String");
|
||||
}
|
||||
delete pUsernameKey;
|
||||
JsonString* pFirstNameKey = new JsonString(L"firstName");
|
||||
JsonString* pFirstNameKey = new JsonString(L"firstName");
|
||||
IJsonValue* pFirstNameVal = null;
|
||||
pJsonObject->GetValue(pFirstNameKey, pFirstNameVal);
|
||||
if(pFirstNameVal != null) {
|
||||
@ -140,7 +138,7 @@ SamiUser::fromJsonObject(IJsonValue* pJson) {
|
||||
jsonToValue(pFirstName, pFirstNameVal, L"String", L"String");
|
||||
}
|
||||
delete pFirstNameKey;
|
||||
JsonString* pLastNameKey = new JsonString(L"lastName");
|
||||
JsonString* pLastNameKey = new JsonString(L"lastName");
|
||||
IJsonValue* pLastNameVal = null;
|
||||
pJsonObject->GetValue(pLastNameKey, pLastNameVal);
|
||||
if(pLastNameVal != null) {
|
||||
@ -149,7 +147,7 @@ SamiUser::fromJsonObject(IJsonValue* pJson) {
|
||||
jsonToValue(pLastName, pLastNameVal, L"String", L"String");
|
||||
}
|
||||
delete pLastNameKey;
|
||||
JsonString* pEmailKey = new JsonString(L"email");
|
||||
JsonString* pEmailKey = new JsonString(L"email");
|
||||
IJsonValue* pEmailVal = null;
|
||||
pJsonObject->GetValue(pEmailKey, pEmailVal);
|
||||
if(pEmailVal != null) {
|
||||
@ -158,7 +156,7 @@ SamiUser::fromJsonObject(IJsonValue* pJson) {
|
||||
jsonToValue(pEmail, pEmailVal, L"String", L"String");
|
||||
}
|
||||
delete pEmailKey;
|
||||
JsonString* pPasswordKey = new JsonString(L"password");
|
||||
JsonString* pPasswordKey = new JsonString(L"password");
|
||||
IJsonValue* pPasswordVal = null;
|
||||
pJsonObject->GetValue(pPasswordKey, pPasswordVal);
|
||||
if(pPasswordVal != null) {
|
||||
@ -167,7 +165,7 @@ SamiUser::fromJsonObject(IJsonValue* pJson) {
|
||||
jsonToValue(pPassword, pPasswordVal, L"String", L"String");
|
||||
}
|
||||
delete pPasswordKey;
|
||||
JsonString* pPhoneKey = new JsonString(L"phone");
|
||||
JsonString* pPhoneKey = new JsonString(L"phone");
|
||||
IJsonValue* pPhoneVal = null;
|
||||
pJsonObject->GetValue(pPhoneKey, pPhoneVal);
|
||||
if(pPhoneVal != null) {
|
||||
@ -176,7 +174,7 @@ SamiUser::fromJsonObject(IJsonValue* pJson) {
|
||||
jsonToValue(pPhone, pPhoneVal, L"String", L"String");
|
||||
}
|
||||
delete pPhoneKey;
|
||||
JsonString* pUserStatusKey = new JsonString(L"userStatus");
|
||||
JsonString* pUserStatusKey = new JsonString(L"userStatus");
|
||||
IJsonValue* pUserStatusVal = null;
|
||||
pJsonObject->GetValue(pUserStatusKey, pUserStatusVal);
|
||||
if(pUserStatusVal != null) {
|
||||
@ -185,7 +183,6 @@ SamiUser::fromJsonObject(IJsonValue* pJson) {
|
||||
jsonToValue(pUserStatus, pUserStatusVal, L"Integer", L"Integer");
|
||||
}
|
||||
delete pUserStatusKey;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -236,39 +233,30 @@ SamiUser::asJsonObject() {
|
||||
JsonObject *pJsonObject = new JsonObject();
|
||||
pJsonObject->Construct();
|
||||
|
||||
|
||||
JsonString *pIdKey = new JsonString(L"id");
|
||||
pJsonObject->Add(pIdKey, toJson(getPId(), "Long", ""));
|
||||
|
||||
|
||||
JsonString *pUsernameKey = new JsonString(L"username");
|
||||
pJsonObject->Add(pUsernameKey, toJson(getPUsername(), "String", ""));
|
||||
|
||||
|
||||
JsonString *pFirstNameKey = new JsonString(L"firstName");
|
||||
pJsonObject->Add(pFirstNameKey, toJson(getPFirstName(), "String", ""));
|
||||
|
||||
|
||||
JsonString *pLastNameKey = new JsonString(L"lastName");
|
||||
pJsonObject->Add(pLastNameKey, toJson(getPLastName(), "String", ""));
|
||||
|
||||
|
||||
JsonString *pEmailKey = new JsonString(L"email");
|
||||
pJsonObject->Add(pEmailKey, toJson(getPEmail(), "String", ""));
|
||||
|
||||
|
||||
JsonString *pPasswordKey = new JsonString(L"password");
|
||||
pJsonObject->Add(pPasswordKey, toJson(getPPassword(), "String", ""));
|
||||
|
||||
|
||||
JsonString *pPhoneKey = new JsonString(L"phone");
|
||||
pJsonObject->Add(pPhoneKey, toJson(getPPhone(), "String", ""));
|
||||
|
||||
|
||||
JsonString *pUserStatusKey = new JsonString(L"userStatus");
|
||||
pJsonObject->Add(pUserStatusKey, toJson(getPUserStatus(), "Integer", ""));
|
||||
|
||||
|
||||
return pJsonObject;
|
||||
}
|
||||
|
||||
|
@ -17,9 +17,9 @@
|
||||
using namespace Tizen::Web::Json;
|
||||
|
||||
|
||||
using Tizen::Base::Integer;
|
||||
using Tizen::Base::Long;
|
||||
using Tizen::Base::String;
|
||||
using Tizen::Base::Integer;
|
||||
|
||||
|
||||
namespace Swagger {
|
||||
@ -42,42 +42,32 @@ public:
|
||||
|
||||
SamiUser* fromJson(String* obj);
|
||||
|
||||
|
||||
Long* getPId();
|
||||
void setPId(Long* pId);
|
||||
|
||||
String* getPUsername();
|
||||
void setPUsername(String* pUsername);
|
||||
|
||||
String* getPFirstName();
|
||||
void setPFirstName(String* pFirstName);
|
||||
|
||||
String* getPLastName();
|
||||
void setPLastName(String* pLastName);
|
||||
|
||||
String* getPEmail();
|
||||
void setPEmail(String* pEmail);
|
||||
|
||||
String* getPPassword();
|
||||
void setPPassword(String* pPassword);
|
||||
|
||||
String* getPPhone();
|
||||
void setPPhone(String* pPhone);
|
||||
|
||||
Integer* getPUserStatus();
|
||||
void setPUserStatus(Integer* pUserStatus);
|
||||
|
||||
|
||||
private:
|
||||
Long* pId;
|
||||
String* pUsername;
|
||||
String* pFirstName;
|
||||
String* pLastName;
|
||||
String* pEmail;
|
||||
String* pPassword;
|
||||
String* pPhone;
|
||||
Integer* pUserStatus;
|
||||
|
||||
String* pUsername;
|
||||
String* pFirstName;
|
||||
String* pLastName;
|
||||
String* pEmail;
|
||||
String* pPassword;
|
||||
String* pPhone;
|
||||
Integer* pUserStatus;
|
||||
};
|
||||
|
||||
} /* namespace Swagger */
|
||||
|
@ -39,28 +39,20 @@ SamiUserApi::createUserWithCompletion(SamiUser* body, void(*success)(SamiError*)
|
||||
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"/user");
|
||||
|
||||
|
||||
|
||||
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();
|
||||
|
||||
|
||||
|
||||
HashMap* queryParams = new HashMap(SingleObjectDeleter);
|
||||
queryParams->Construct();
|
||||
|
||||
|
||||
|
||||
String* mBody = null;
|
||||
|
||||
|
||||
|
||||
if(body != null) {
|
||||
mBody = new String("");
|
||||
int sz = body->GetCount();
|
||||
@ -112,13 +100,9 @@ SamiUserApi::createUsersWithArrayInputWithCompletion(IList* body, void(*success)
|
||||
headerParams->Add(new String("Content-Type"), new String("application/json"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
String url(L"/user/createWithArray");
|
||||
|
||||
|
||||
|
||||
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();
|
||||
|
||||
|
||||
|
||||
HashMap* queryParams = new HashMap(SingleObjectDeleter);
|
||||
queryParams->Construct();
|
||||
|
||||
|
||||
|
||||
String* mBody = null;
|
||||
|
||||
|
||||
|
||||
if(body != null) {
|
||||
mBody = new String("");
|
||||
int sz = body->GetCount();
|
||||
@ -170,87 +150,15 @@ SamiUserApi::createUsersWithListInputWithCompletion(IList* body, void(*success)(
|
||||
headerParams->Add(new String("Content-Type"), new String("application/json"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
String url(L"/user/createWithList");
|
||||
|
||||
|
||||
|
||||
client->execute(SamiUserApi::getBasePath(), url, "POST", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json");
|
||||
|
||||
}
|
||||
|
||||
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");
|
||||
return null;
|
||||
}
|
||||
|
||||
void
|
||||
logoutUserProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) {
|
||||
deleteUserProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) {
|
||||
int code = pHttpResponse->GetHttpStatusCode();
|
||||
|
||||
if(code >= 200 && code < 300) {
|
||||
@ -264,29 +172,29 @@ logoutUserProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiErr
|
||||
}
|
||||
|
||||
void
|
||||
SamiUserApi::logoutUserWithCompletion( void(*success)(SamiError*)) {
|
||||
SamiUserApi::deleteUserWithCompletion(String* username, void(*success)(SamiError*)) {
|
||||
client = new SamiApiClient();
|
||||
|
||||
client->success(&logoutUserProcessor, (void(*)(void*, SamiError*))success);
|
||||
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 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, "GET", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json");
|
||||
client->execute(SamiUserApi::getBasePath(), url, "DELETE", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json");
|
||||
|
||||
}
|
||||
|
||||
@ -334,29 +242,123 @@ SamiUserApi::getUserByNameWithCompletion(String* username, void (* success)(Sami
|
||||
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, "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");
|
||||
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
|
||||
updateUserProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) {
|
||||
int code = pHttpResponse->GetHttpStatusCode();
|
||||
@ -380,82 +382,27 @@ SamiUserApi::updateUserWithCompletion(String* username, SamiUser* body, void(*su
|
||||
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"/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, "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 */
|
||||
|
@ -18,31 +18,22 @@ public:
|
||||
SamiUserApi();
|
||||
virtual ~SamiUserApi();
|
||||
|
||||
|
||||
void
|
||||
createUserWithCompletion(SamiUser* body, void(* handler)(SamiError*));
|
||||
|
||||
void
|
||||
createUsersWithArrayInputWithCompletion(IList* body, void(* handler)(SamiError*));
|
||||
|
||||
void
|
||||
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
|
||||
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() {
|
||||
return L"http://petstore.swagger.io/v2";
|
||||
}
|
||||
|
@ -29,82 +29,47 @@
|
||||
<li>Getting Started</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#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-header">
|
||||
<a href="#!/PetApi">PetApi</a>
|
||||
</div>
|
||||
<ul>
|
||||
|
||||
|
||||
<li><a href="#!/PetApi#updatePet">updatePet</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#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>
|
||||
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="section-box">
|
||||
<div class="section-header">
|
||||
<a href="#!/StoreApi">StoreApi</a>
|
||||
</div>
|
||||
<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#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>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="non-sidebar">
|
||||
<div class="main-content">
|
||||
|
17
samples/dynamic-html/docs/models/ApiResponse.html
Normal file
17
samples/dynamic-html/docs/models/ApiResponse.html
Normal 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>
|
@ -1,17 +1,12 @@
|
||||
|
||||
<h2>Category</h2>
|
||||
|
||||
<ul class="parameter">
|
||||
<li class="param-required-">id : Long
|
||||
<br/>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="parameter">
|
||||
<li class="param-required-">name : String
|
||||
<br/>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
@ -1,57 +1,39 @@
|
||||
|
||||
<h2>Order</h2>
|
||||
|
||||
<ul class="parameter">
|
||||
<li class="param-required-">id : Long
|
||||
<br/>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="parameter">
|
||||
<li class="param-required-">petId : Long
|
||||
<br/>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="parameter">
|
||||
<li class="param-required-">quantity : Integer
|
||||
<br/>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="parameter">
|
||||
<li class="param-required-">shipDate : Date
|
||||
<br/>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="parameter">
|
||||
<li class="param-required-">status : String
|
||||
<br/>Order Status
|
||||
|
||||
<dl class="param-enum">
|
||||
<dt>Enum:
|
||||
|
||||
<dd>placed</dd>
|
||||
|
||||
<dd>approved</dd>
|
||||
|
||||
<dd>delivered</dd>
|
||||
|
||||
</dt>
|
||||
</dl>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="parameter">
|
||||
<li class="param-required-">complete : Boolean
|
||||
<br/>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
@ -1,57 +1,39 @@
|
||||
|
||||
<h2>Pet</h2>
|
||||
|
||||
<ul class="parameter">
|
||||
<li class="param-required-">id : Long
|
||||
<br/>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="parameter">
|
||||
<li class="param-required-">category : Category
|
||||
<br/>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="parameter">
|
||||
<li class="param-required-true">name : String
|
||||
<br/>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="parameter">
|
||||
<li class="param-required-true">photoUrls : List
|
||||
<br/>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="parameter">
|
||||
<li class="param-required-">tags : List
|
||||
<br/>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="parameter">
|
||||
<li class="param-required-">status : String
|
||||
<br/>pet status in the store
|
||||
|
||||
<dl class="param-enum">
|
||||
<dt>Enum:
|
||||
|
||||
<dd>available</dd>
|
||||
|
||||
<dd>pending</dd>
|
||||
|
||||
<dd>sold</dd>
|
||||
|
||||
</dt>
|
||||
</dl>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
@ -1,17 +1,12 @@
|
||||
|
||||
<h2>Tag</h2>
|
||||
|
||||
<ul class="parameter">
|
||||
<li class="param-required-">id : Long
|
||||
<br/>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="parameter">
|
||||
<li class="param-required-">name : String
|
||||
<br/>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
@ -1,59 +1,42 @@
|
||||
|
||||
<h2>User</h2>
|
||||
|
||||
<ul class="parameter">
|
||||
<li class="param-required-">id : Long
|
||||
<br/>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="parameter">
|
||||
<li class="param-required-">username : String
|
||||
<br/>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="parameter">
|
||||
<li class="param-required-">firstName : String
|
||||
<br/>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="parameter">
|
||||
<li class="param-required-">lastName : String
|
||||
<br/>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="parameter">
|
||||
<li class="param-required-">email : String
|
||||
<br/>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="parameter">
|
||||
<li class="param-required-">password : String
|
||||
<br/>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="parameter">
|
||||
<li class="param-required-">phone : String
|
||||
<br/>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="parameter">
|
||||
<li class="param-required-">userStatus : Integer
|
||||
<br/>User Status
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
@ -2,35 +2,6 @@
|
||||
<h2><a name=""></a></h2>
|
||||
<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>
|
||||
<hr>
|
||||
<p></p>
|
||||
@ -43,7 +14,6 @@
|
||||
<div class="model" data-model=""><a href=""></a></div>
|
||||
<h3 class="section">Parameters</h3>
|
||||
<ul>
|
||||
|
||||
<li class="parameter">
|
||||
|
||||
|
||||
@ -51,145 +21,11 @@
|
||||
|
||||
<span class="param-in">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>
|
||||
</li>
|
||||
|
||||
</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 < 10. ID > 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>
|
||||
<hr>
|
||||
<p></p>
|
||||
@ -202,7 +38,6 @@
|
||||
<div class="model" data-model=""><a href=""></a></div>
|
||||
<h3 class="section">Parameters</h3>
|
||||
<ul>
|
||||
|
||||
<li class="parameter">
|
||||
|
||||
|
||||
@ -214,7 +49,6 @@
|
||||
|
||||
<p class="param-description">Pet id to delete</p>
|
||||
</li>
|
||||
|
||||
<li class="parameter">
|
||||
|
||||
|
||||
@ -226,9 +60,149 @@
|
||||
|
||||
<p class="param-description"></p>
|
||||
</li>
|
||||
|
||||
</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>
|
||||
<hr>
|
||||
<p></p>
|
||||
@ -238,10 +212,9 @@
|
||||
<h3 class="section">HTTP Method</h3>
|
||||
<code>POST</code>
|
||||
<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>
|
||||
<ul>
|
||||
|
||||
<li class="parameter">
|
||||
|
||||
|
||||
@ -253,7 +226,6 @@
|
||||
|
||||
<p class="param-description">ID of pet to update</p>
|
||||
</li>
|
||||
|
||||
<li class="parameter">
|
||||
<span class="param-in">Form: </span>
|
||||
|
||||
@ -265,7 +237,6 @@
|
||||
|
||||
<p class="param-description">Additional data to pass to server</p>
|
||||
</li>
|
||||
|
||||
<li class="parameter">
|
||||
<span class="param-in">Form: </span>
|
||||
|
||||
@ -277,8 +248,5 @@
|
||||
|
||||
<p class="param-description">file to upload</p>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
|
@ -2,77 +2,6 @@
|
||||
<h2><a name=""></a></h2>
|
||||
<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 <= 5 or > 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>
|
||||
<hr>
|
||||
<p></p>
|
||||
@ -85,7 +14,6 @@
|
||||
<div class="model" data-model=""><a href=""></a></div>
|
||||
<h3 class="section">Parameters</h3>
|
||||
<ul>
|
||||
|
||||
<li class="parameter">
|
||||
|
||||
|
||||
@ -97,8 +25,66 @@
|
||||
|
||||
<p class="param-description">ID of the order that needs to be deleted</p>
|
||||
</li>
|
||||
|
||||
</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 <= 5 or > 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>
|
||||
|
@ -2,8 +2,6 @@
|
||||
<h2><a name=""></a></h2>
|
||||
<p>This is the API</p>
|
||||
|
||||
|
||||
|
||||
<h2><a name="createUser"></a>createUser</h2>
|
||||
<hr>
|
||||
<p></p>
|
||||
@ -16,7 +14,6 @@
|
||||
<div class="model" data-model=""><a href=""></a></div>
|
||||
<h3 class="section">Parameters</h3>
|
||||
<ul>
|
||||
|
||||
<li class="parameter">
|
||||
|
||||
|
||||
@ -24,13 +21,11 @@
|
||||
|
||||
<span class="param-in">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>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<h2><a name="createUsersWithArrayInput"></a>createUsersWithArrayInput</h2>
|
||||
<hr>
|
||||
<p></p>
|
||||
@ -43,7 +38,6 @@
|
||||
<div class="model" data-model=""><a href=""></a></div>
|
||||
<h3 class="section">Parameters</h3>
|
||||
<ul>
|
||||
|
||||
<li class="parameter">
|
||||
|
||||
|
||||
@ -51,13 +45,11 @@
|
||||
|
||||
<span class="param-in">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>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<h2><a name="createUsersWithListInput"></a>createUsersWithListInput</h2>
|
||||
<hr>
|
||||
<p></p>
|
||||
@ -70,7 +62,6 @@
|
||||
<div class="model" data-model=""><a href=""></a></div>
|
||||
<h3 class="section">Parameters</h3>
|
||||
<ul>
|
||||
|
||||
<li class="parameter">
|
||||
|
||||
|
||||
@ -78,133 +69,11 @@
|
||||
|
||||
<span class="param-in">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>
|
||||
</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="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>
|
||||
<hr>
|
||||
<p></p>
|
||||
@ -217,7 +86,6 @@
|
||||
<div class="model" data-model=""><a href=""></a></div>
|
||||
<h3 class="section">Parameters</h3>
|
||||
<ul>
|
||||
|
||||
<li class="parameter">
|
||||
|
||||
|
||||
@ -229,8 +97,112 @@
|
||||
|
||||
<p class="param-description">The name that needs to be deleted</p>
|
||||
</li>
|
||||
|
||||
</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>
|
||||
|
@ -182,7 +182,7 @@ font-style: italic;
|
||||
</head>
|
||||
<body>
|
||||
<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">Version: 1.0.0</div>
|
||||
@ -198,20 +198,15 @@ font-style: italic;
|
||||
<div class="method-summary"></div>
|
||||
<ol>
|
||||
<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=true</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="#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="#getPetByIdInObject"><code><span class="http-method">get</span> /pet/{petId}?response=inline_arbitrary_object</code></a></li>
|
||||
<li><a href="#petPetIdtestingByteArraytrueGet"><code><span class="http-method">get</span> /pet/{petId}?testing_byte_array=true</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="#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="#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="#getInventoryInObject"><code><span class="http-method">get</span> /store/inventory?response=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="#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>
|
||||
@ -241,7 +236,7 @@ font-style: italic;
|
||||
|
||||
<h3 class="field-label">Request body</h3>
|
||||
<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> — Pet object that needs to be added to the store </div>
|
||||
</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;
|
||||
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">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=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/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> — 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>
|
||||
|
||||
<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;
|
||||
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>
|
||||
<li><code>application/json</code></li>
|
||||
</ul>
|
||||
|
||||
<h3 class="field-label">Responses</h3>
|
||||
@ -357,9 +310,9 @@ font-style: italic;
|
||||
|
||||
<h3 class="field-label">Query parameters</h3>
|
||||
<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> — Status values that need to be considered for query default: available</div>
|
||||
<div class="param-desc"><span class="param-type">Query Parameter</span> — Status values that need to be considered for filter </div>
|
||||
</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;
|
||||
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>
|
||||
<li><code>application/json</code></li>
|
||||
</ul>
|
||||
|
||||
<h3 class="field-label">Responses</h3>
|
||||
@ -392,7 +345,7 @@ font-style: italic;
|
||||
<a class="up" href="#__Methods">Up</a>
|
||||
<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-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>
|
||||
<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> — Tags to filter by </div>
|
||||
</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;
|
||||
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>
|
||||
<li><code>application/json</code></li>
|
||||
</ul>
|
||||
|
||||
<h3 class="field-label">Responses</h3>
|
||||
@ -435,13 +388,13 @@ font-style: italic;
|
||||
<a class="up" href="#__Methods">Up</a>
|
||||
<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-notes">Returns a pet when ID < 10. ID > 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>
|
||||
<div class="field-items">
|
||||
<div class="param">petId (required)</div>
|
||||
|
||||
<div class="param-desc"><span class="param-type">Path Parameter</span> — ID of pet that needs to be fetched </div>
|
||||
<div class="param-desc"><span class="param-type">Path Parameter</span> — ID of pet to return </div>
|
||||
</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;
|
||||
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 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=inline_arbitrary_object</code></pre></div>
|
||||
<div class="method-summary">Fake endpoint to test inline arbitrary object return by 'Find pet by ID' (<span class="nickname">getPetByIdInObject</span>)</div>
|
||||
<div class="method-notes">Returns a pet when ID < 10. ID > 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> — 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/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=true</code></pre></div>
|
||||
<div class="method-summary">Fake endpoint to test byte array return by 'Find pet by ID' (<span class="nickname">petPetIdtestingByteArraytrueGet</span>)</div>
|
||||
<div class="method-notes">Returns a pet when ID < 10. ID > 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> — 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>
|
||||
|
||||
<h3 class="field-label">Responses</h3>
|
||||
@ -582,7 +445,7 @@ font-style: italic;
|
||||
|
||||
<h3 class="field-label">Request body</h3>
|
||||
<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> — Pet object that needs to be added to the store </div>
|
||||
</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;
|
||||
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>
|
||||
<li><code>application/json</code></li>
|
||||
</ul>
|
||||
|
||||
<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;
|
||||
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>
|
||||
<li><code>application/json</code></li>
|
||||
</ul>
|
||||
|
||||
<h3 class="field-label">Responses</h3>
|
||||
@ -692,6 +555,11 @@ font-style: italic;
|
||||
<div class="param-desc"><span class="param-type">Form Parameter</span> — file to upload </div>
|
||||
</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 -->
|
||||
|
||||
@ -701,11 +569,10 @@ font-style: italic;
|
||||
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">0</h4>
|
||||
<h4 class="field-label">200</h4>
|
||||
successful operation
|
||||
</div> <!-- method -->
|
||||
<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;
|
||||
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>
|
||||
<li><code>application/json</code></li>
|
||||
</ul>
|
||||
|
||||
<h3 class="field-label">Responses</h3>
|
||||
@ -747,49 +614,6 @@ font-style: italic;
|
||||
Order not found
|
||||
</div> <!-- method -->
|
||||
<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> — 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-path">
|
||||
<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.
|
||||
<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
|
||||
</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=arbitrary_object</code></pre></div>
|
||||
<div class="method-summary">Fake endpoint to test arbitrary object return by 'Get inventory' (<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>
|
||||
|
||||
<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;
|
||||
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>
|
||||
<li><code>application/json</code></li>
|
||||
</ul>
|
||||
|
||||
<h3 class="field-label">Responses</h3>
|
||||
@ -916,7 +704,7 @@ font-style: italic;
|
||||
|
||||
<h3 class="field-label">Request body</h3>
|
||||
<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> — order placed for purchasing the pet </div>
|
||||
</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;
|
||||
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>
|
||||
<li><code>application/json</code></li>
|
||||
</ul>
|
||||
|
||||
<h3 class="field-label">Responses</h3>
|
||||
@ -959,7 +747,7 @@ font-style: italic;
|
||||
|
||||
<h3 class="field-label">Request body</h3>
|
||||
<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> — Created user object </div>
|
||||
</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;
|
||||
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>
|
||||
<li><code>application/json</code></li>
|
||||
</ul>
|
||||
|
||||
<h3 class="field-label">Responses</h3>
|
||||
@ -995,7 +783,7 @@ font-style: italic;
|
||||
|
||||
<h3 class="field-label">Request body</h3>
|
||||
<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> — List of user object </div>
|
||||
</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;
|
||||
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>
|
||||
<li><code>application/json</code></li>
|
||||
</ul>
|
||||
|
||||
<h3 class="field-label">Responses</h3>
|
||||
@ -1031,7 +819,7 @@ font-style: italic;
|
||||
|
||||
<h3 class="field-label">Request body</h3>
|
||||
<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> — List of user object </div>
|
||||
</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;
|
||||
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>
|
||||
<li><code>application/json</code></li>
|
||||
</ul>
|
||||
|
||||
<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;
|
||||
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>
|
||||
<li><code>application/json</code></li>
|
||||
</ul>
|
||||
|
||||
<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;
|
||||
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>
|
||||
<li><code>application/json</code></li>
|
||||
</ul>
|
||||
|
||||
<h3 class="field-label">Responses</h3>
|
||||
<h4 class="field-label">200</h4>
|
||||
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=1, username=johnp, firstName=John, lastName=Public, email=johnp@swagger.io, password=-secret-, phone=0123456789, userStatus=0}</code></pre>
|
||||
<h4 class="field-label">400</h4>
|
||||
Invalid username supplied
|
||||
<h4 class="field-label">404</h4>
|
||||
@ -1155,9 +940,9 @@ font-style: italic;
|
||||
|
||||
<h3 class="field-label">Query parameters</h3>
|
||||
<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> — The user name for login </div><div class="param">password (optional)</div>
|
||||
<div class="param-desc"><span class="param-type">Query Parameter</span> — The user name for login </div><div class="param">password (required)</div>
|
||||
|
||||
<div class="param-desc"><span class="param-type">Query Parameter</span> — The password for login in clear text </div>
|
||||
</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;
|
||||
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>
|
||||
<li><code>application/json</code></li>
|
||||
</ul>
|
||||
|
||||
<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;
|
||||
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>
|
||||
<li><code>application/json</code></li>
|
||||
</ul>
|
||||
|
||||
<h3 class="field-label">Responses</h3>
|
||||
@ -1234,7 +1019,7 @@ font-style: italic;
|
||||
|
||||
<h3 class="field-label">Request body</h3>
|
||||
<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> — Updated user object </div>
|
||||
</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;
|
||||
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>
|
||||
<li><code>application/json</code></li>
|
||||
</ul>
|
||||
|
||||
<h3 class="field-label">Responses</h3>
|
||||
@ -1268,147 +1053,73 @@ font-style: italic;
|
||||
|
||||
<h2>Table of Contents</h2>
|
||||
<ol>
|
||||
<li><a href="#$special[model.name]"><code>$special[model.name]</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="#ApiResponse"><code>ApiResponse</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="#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="#User"><code>User</code></a></li>
|
||||
</ol>
|
||||
|
||||
<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="param">$special[property.name] </div><div class="param-desc"><span class="param-type">Long</span> </div>
|
||||
</div> <!-- field-items -->
|
||||
</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 class="param">code (optional)</div><div class="param-desc"><span class="param-type">Integer</span> </div>
|
||||
<div class="param">type (optional)</div><div class="param-desc"><span class="param-type">String</span> </div>
|
||||
<div class="param">message (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="Category">Category</a> <a class="up" href="#__Models">Up</a></h3>
|
||||
<div class="field-items">
|
||||
<div class="param">id </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> <!-- 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 class="param">id (optional)</div><div class="param-desc"><span class="param-type">Long</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="Order">Order</a> <a class="up" href="#__Models">Up</a></h3>
|
||||
<div class="field-items">
|
||||
<div class="param">id </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">quantity </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">status </div><div class="param-desc"><span class="param-type">String</span> Order Status</div>
|
||||
<div class="param">id (optional)</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 (optional)</div><div class="param-desc"><span class="param-type">Integer</span> </div>
|
||||
<div class="param">shipDate (optional)</div><div class="param-desc"><span class="param-type">Date</span> </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">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>
|
||||
<div class="model">
|
||||
<h3 class="field-label"><a name="Pet">Pet</a> <a class="up" href="#__Models">Up</a></h3>
|
||||
<div class="field-items">
|
||||
<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">Category</span> </div>
|
||||
<div class="param">id (optional)</div><div class="param-desc"><span class="param-type">Long</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">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">status </div><div class="param-desc"><span class="param-type">String</span> pet status in the store</div>
|
||||
<div class="param">tags (optional)</div><div class="param-desc"><span class="param-type">array[Tag]</span> </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">available</div><div class="param-enum">pending</div><div class="param-enum">sold</div>
|
||||
</div> <!-- field-items -->
|
||||
</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">
|
||||
<h3 class="field-label"><a name="Tag">Tag</a> <a class="up" href="#__Models">Up</a></h3>
|
||||
<div class="field-items">
|
||||
<div class="param">id </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">id (optional)</div><div class="param-desc"><span class="param-type">Long</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="User">User</a> <a class="up" href="#__Models">Up</a></h3>
|
||||
<div class="field-items">
|
||||
<div class="param">id </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">firstName </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">email </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">phone </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">id (optional)</div><div class="param-desc"><span class="param-type">Long</span> </div>
|
||||
<div class="param">username (optional)</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 (optional)</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 (optional)</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 (optional)</div><div class="param-desc"><span class="param-type">Integer</span> User Status</div>
|
||||
</div> <!-- field-items -->
|
||||
</div>
|
||||
</body>
|
||||
|
@ -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
|
||||
|
||||
}
|
||||
}
|
0
samples/server/petstore/flaskConnexion/__init__.py
Normal file
0
samples/server/petstore/flaskConnexion/__init__.py
Normal file
0
samples/server/petstore/flaskConnexion/init.py
Normal file
0
samples/server/petstore/flaskConnexion/init.py
Normal file
@ -0,0 +1,9 @@
|
||||
package com.wordnik.client.model
|
||||
|
||||
|
||||
|
||||
case class ApiResponse (
|
||||
code: Option[Int],
|
||||
type: Option[String],
|
||||
message: Option[String]
|
||||
)
|
Loading…
x
Reference in New Issue
Block a user