diff --git a/bin/flash-petstore.json b/bin/flash-petstore.json index c13ef7f06e7..8b52733fcf4 100644 --- a/bin/flash-petstore.json +++ b/bin/flash-petstore.json @@ -1,4 +1,4 @@ { - "packageName": "io.swagger", - "invokerPackage": "io.swagger" + "packageName": "org.openapitools", + "invokerPackage": "org.openapitools" } diff --git a/bin/windows/flash-petstore.bat b/bin/windows/flash-petstore.bat index b8fae9b1300..1bbcf5f5a55 100755 --- a/bin/windows/flash-petstore.bat +++ b/bin/windows/flash-petstore.bat @@ -5,6 +5,6 @@ If Not Exist %executable% ( ) REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -l flash -o samples\client\petstore\flash +set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -l flash -o samples\client\petstore\flash -c bin\flash-petstore.json java %JAVA_OPTS% -jar %executable% %ags% diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FlashClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FlashClientCodegen.java index 55a5984ab05..a47220284e3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FlashClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FlashClientCodegen.java @@ -75,9 +75,7 @@ public class FlashClientCodegen extends DefaultCodegen implements CodegenConfig typeMapping.put("object", "Object"); typeMapping.put("file", "File"); typeMapping.put("UUID", "String"); - //TODO binary should be mapped to byte array - // mapped to String as a workaround - typeMapping.put("binary", "String"); + typeMapping.put("binary", "File"); importMapping = new HashMap(); importMapping.put("File", "flash.filesystem.File"); @@ -140,7 +138,7 @@ public class FlashClientCodegen extends DefaultCodegen implements CodegenConfig supportingFiles.add(new SupportingFile("ApiUrlHelper.as", invokerFolder + "common", "ApiUrlHelper.as")); supportingFiles.add(new SupportingFile("ApiUserCredentials.as", invokerFolder + "common", "ApiUserCredentials.as")); supportingFiles.add(new SupportingFile("ListWrapper.as", invokerFolder + "common", "ListWrapper.as")); - supportingFiles.add(new SupportingFile("SwaggerApi.as", invokerFolder + "common", "SwaggerApi.as")); + supportingFiles.add(new SupportingFile("OpenApi.as", invokerFolder + "common", "OpenApi.as")); supportingFiles.add(new SupportingFile("XMLWriter.as", invokerFolder + "common", "XMLWriter.as")); supportingFiles.add(new SupportingFile("ApiError.as", invokerFolder + "exception", "ApiError.as")); supportingFiles.add(new SupportingFile("ApiErrorCodes.as", invokerFolder + "exception", "ApiErrorCodes.as")); diff --git a/modules/openapi-generator/src/main/resources/flash/ApiClientEvent.as b/modules/openapi-generator/src/main/resources/flash/ApiClientEvent.as index d64cd304d49..964dbc26d69 100644 --- a/modules/openapi-generator/src/main/resources/flash/ApiClientEvent.as +++ b/modules/openapi-generator/src/main/resources/flash/ApiClientEvent.as @@ -1,5 +1,5 @@ -package io.swagger.event { -import io.swagger.event.Response; +package org.openapitools.event { +import org.openapitools.event.Response; import flash.events.Event; diff --git a/modules/openapi-generator/src/main/resources/flash/ApiError.as b/modules/openapi-generator/src/main/resources/flash/ApiError.as index c8ac95a5c59..0e8e09b484a 100644 --- a/modules/openapi-generator/src/main/resources/flash/ApiError.as +++ b/modules/openapi-generator/src/main/resources/flash/ApiError.as @@ -1,4 +1,4 @@ -package io.swagger.exception +package org.openapitools.exception { public class ApiError extends Error { diff --git a/modules/openapi-generator/src/main/resources/flash/ApiErrorCodes.as b/modules/openapi-generator/src/main/resources/flash/ApiErrorCodes.as index e5ea46480aa..4bc6b36cedf 100644 --- a/modules/openapi-generator/src/main/resources/flash/ApiErrorCodes.as +++ b/modules/openapi-generator/src/main/resources/flash/ApiErrorCodes.as @@ -1,4 +1,4 @@ -package io.swagger.exception +package org.openapitools.exception { public class ApiErrorCodes { diff --git a/modules/openapi-generator/src/main/resources/flash/ApiInvoker.as b/modules/openapi-generator/src/main/resources/flash/ApiInvoker.as index 6d8466390a6..cdf23b64276 100644 --- a/modules/openapi-generator/src/main/resources/flash/ApiInvoker.as +++ b/modules/openapi-generator/src/main/resources/flash/ApiInvoker.as @@ -1,6 +1,6 @@ -package io.swagger.common { -import io.swagger.event.ApiClientEvent; -import io.swagger.event.Response; +package org.openapitools.common { +import org.openapitools.event.ApiClientEvent; +import org.openapitools.event.Response; import flash.events.EventDispatcher; import flash.utils.*; diff --git a/modules/openapi-generator/src/main/resources/flash/ApiUrlHelper.as b/modules/openapi-generator/src/main/resources/flash/ApiUrlHelper.as index 8779610cd48..f07e8e6dfeb 100644 --- a/modules/openapi-generator/src/main/resources/flash/ApiUrlHelper.as +++ b/modules/openapi-generator/src/main/resources/flash/ApiUrlHelper.as @@ -1,5 +1,5 @@ -package io.swagger.common { -import io.swagger.common.ApiUserCredentials; +package org.openapitools.common { +import org.openapitools.common.ApiUserCredentials; /** * @private diff --git a/modules/openapi-generator/src/main/resources/flash/ApiUserCredentials.as b/modules/openapi-generator/src/main/resources/flash/ApiUserCredentials.as index 118d917a247..2a955438a26 100644 --- a/modules/openapi-generator/src/main/resources/flash/ApiUserCredentials.as +++ b/modules/openapi-generator/src/main/resources/flash/ApiUserCredentials.as @@ -1,4 +1,4 @@ -package io.swagger.common { +package org.openapitools.common { /** * Api account credentials. diff --git a/modules/openapi-generator/src/main/resources/flash/ListWrapper.as b/modules/openapi-generator/src/main/resources/flash/ListWrapper.as index b22890ad1d1..e6d79d5625a 100644 --- a/modules/openapi-generator/src/main/resources/flash/ListWrapper.as +++ b/modules/openapi-generator/src/main/resources/flash/ListWrapper.as @@ -1,4 +1,4 @@ -package io.swagger.common +package org.openapitools.common { public interface ListWrapper { diff --git a/modules/openapi-generator/src/main/resources/flash/SwaggerApi.as b/modules/openapi-generator/src/main/resources/flash/OpenApi.as similarity index 88% rename from modules/openapi-generator/src/main/resources/flash/SwaggerApi.as rename to modules/openapi-generator/src/main/resources/flash/OpenApi.as index 059de642a74..e632efa5335 100644 --- a/modules/openapi-generator/src/main/resources/flash/SwaggerApi.as +++ b/modules/openapi-generator/src/main/resources/flash/OpenApi.as @@ -1,13 +1,13 @@ -package io.swagger.common +package org.openapitools.common { - import io.swagger.common.ApiUserCredentials; + import org.openapitools.common.ApiUserCredentials; import flash.events.EventDispatcher; import flash.events.IEventDispatcher; import mx.utils.UIDUtil; - public class SwaggerApi extends EventDispatcher + public class OpenApi extends EventDispatcher { protected var _apiUsageCredentials:ApiUserCredentials; @@ -22,7 +22,7 @@ package io.swagger.common * @param apiCredentials Wrapper object for tokens and hostName required towards authentication * @param eventDispatcher Optional event dispatcher that when provided is used by the SDK to dispatch any Response */ - public function SwaggerApi(apiCredentials: ApiUserCredentials, eventDispatcher: EventDispatcher = null) { + public function OpenApi(apiCredentials: ApiUserCredentials, eventDispatcher: EventDispatcher = null) { super(); _apiUsageCredentials = apiCredentials; _apiEventNotifier = eventDispatcher; diff --git a/modules/openapi-generator/src/main/resources/flash/README.txt b/modules/openapi-generator/src/main/resources/flash/README.txt index c9a2a38d6a6..3d60608475d 100644 --- a/modules/openapi-generator/src/main/resources/flash/README.txt +++ b/modules/openapi-generator/src/main/resources/flash/README.txt @@ -26,10 +26,10 @@ After creating an application in java, you will have a mxml file. In this mxml f // Import the different libraries you need // ... - // Import the io.swagger libraries - import io.swagger.common.ApiUserCredentials; - import io.swagger.event.ApiClientEvent; - import io.swagger.client.api.[[API]]; // Put your Api here. + // Import the org.openapitools libraries + import org.openapitools.common.ApiUserCredentials; + import org.openapitools.event.ApiClientEvent; + import org.openapitools.client.api.[[API]]; // Put your Api here. // Variables private var cred:ApiUserCredentials; @@ -52,7 +52,7 @@ After creating an application in java, you will have a mxml file. In this mxml f // To create the API, you need the ApiUserCredentials and the dispatcher. cred = new ApiUserCredentials([[host]], [[basePath]] , [[apiToken]]); - // You can add more parameters. Go see the function in ApiUserCredential.as in io/swagger/common + // You can add more parameters. Go see the function in ApiUserCredential.as in org/openapitools/common // Create the API myAPI = new [[API]](cred, dispatcher); // change [[API]] to be the real name diff --git a/modules/openapi-generator/src/main/resources/flash/Response.as b/modules/openapi-generator/src/main/resources/flash/Response.as index d19dd0ae358..333fca9874c 100644 --- a/modules/openapi-generator/src/main/resources/flash/Response.as +++ b/modules/openapi-generator/src/main/resources/flash/Response.as @@ -1,4 +1,4 @@ -package io.swagger.event { +package org.openapitools.event { /** * Response contains info on the result of an API invocation. diff --git a/modules/openapi-generator/src/main/resources/flash/XMLWriter.as b/modules/openapi-generator/src/main/resources/flash/XMLWriter.as index 0b08066775b..8f87484841c 100644 --- a/modules/openapi-generator/src/main/resources/flash/XMLWriter.as +++ b/modules/openapi-generator/src/main/resources/flash/XMLWriter.as @@ -1,11 +1,10 @@ -package io.swagger.common +package org.openapitools.common { public class XMLWriter { public var xml:XML; - public function XMLWriter() - { + public function XMLWriter() { xml=; } diff --git a/modules/openapi-generator/src/main/resources/flash/api.mustache b/modules/openapi-generator/src/main/resources/flash/api.mustache index 50861591c40..2c51d2e12e1 100644 --- a/modules/openapi-generator/src/main/resources/flash/api.mustache +++ b/modules/openapi-generator/src/main/resources/flash/api.mustache @@ -1,11 +1,11 @@ package {{package}} { -import io.swagger.common.ApiInvoker; -import io.swagger.exception.ApiErrorCodes; -import io.swagger.exception.ApiError; -import io.swagger.common.ApiUserCredentials; -import io.swagger.event.Response; -import io.swagger.common.SwaggerApi; +import org.openapitools.common.ApiInvoker; +import org.openapitools.exception.ApiErrorCodes; +import org.openapitools.exception.ApiError; +import org.openapitools.common.ApiUserCredentials; +import org.openapitools.event.Response; +import org.openapitools.common.OpenApi; {{#imports}}import {{import}}; {{/imports}} @@ -15,7 +15,7 @@ import flash.utils.Dictionary; import flash.events.EventDispatcher; {{#operations}} -public class {{classname}} extends SwaggerApi { +public class {{classname}} extends OpenApi { /** * Constructor for the {{classname}} api client * @param apiCredentials Wrapper object for tokens and hostName required towards authentication diff --git a/modules/openapi-generator/src/main/resources/flash/build.xml b/modules/openapi-generator/src/main/resources/flash/build.xml index 5f4922470c0..da3c67f8344 100644 --- a/modules/openapi-generator/src/main/resources/flash/build.xml +++ b/modules/openapi-generator/src/main/resources/flash/build.xml @@ -62,11 +62,11 @@ - + - - - + + + diff --git a/modules/openapi-generator/src/main/resources/flash/facetValue.as b/modules/openapi-generator/src/main/resources/flash/facetValue.as index c6bfa1f27d1..428f63c0ee1 100644 --- a/modules/openapi-generator/src/main/resources/flash/facetValue.as +++ b/modules/openapi-generator/src/main/resources/flash/facetValue.as @@ -1,4 +1,4 @@ -package com.wordnik.client.model { +package org.openapitools.client.model { public class FacetValue { public var value: String = null; diff --git a/modules/openapi-generator/src/main/resources/flash/modelList.mustache b/modules/openapi-generator/src/main/resources/flash/modelList.mustache index 7741902bcaa..becb7dde2de 100644 --- a/modules/openapi-generator/src/main/resources/flash/modelList.mustache +++ b/modules/openapi-generator/src/main/resources/flash/modelList.mustache @@ -1,6 +1,6 @@ package {{package}} { -import io.swagger.common.ListWrapper; +import org.openapitools.common.ListWrapper; {{#imports}}import {{import}}; {{/imports}} diff --git a/samples/client/petstore/flash/.openapi-generator-ignore b/samples/client/petstore/flash/.openapi-generator-ignore index c5fa491b4c5..7484ee590a3 100644 --- a/samples/client/petstore/flash/.openapi-generator-ignore +++ b/samples/client/petstore/flash/.openapi-generator-ignore @@ -1,11 +1,11 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator # Use this file to prevent files from being overwritten by the generator. # The patterns follow closely to .gitignore or .dockerignore. # As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: #ApiClient.cs # You can match any string of characters against a directory, file or extension with a single asterisk (*): diff --git a/samples/client/petstore/flash/flash/README.txt b/samples/client/petstore/flash/flash/README.txt index c9a2a38d6a6..3d60608475d 100644 --- a/samples/client/petstore/flash/flash/README.txt +++ b/samples/client/petstore/flash/flash/README.txt @@ -26,10 +26,10 @@ After creating an application in java, you will have a mxml file. In this mxml f // Import the different libraries you need // ... - // Import the io.swagger libraries - import io.swagger.common.ApiUserCredentials; - import io.swagger.event.ApiClientEvent; - import io.swagger.client.api.[[API]]; // Put your Api here. + // Import the org.openapitools libraries + import org.openapitools.common.ApiUserCredentials; + import org.openapitools.event.ApiClientEvent; + import org.openapitools.client.api.[[API]]; // Put your Api here. // Variables private var cred:ApiUserCredentials; @@ -52,7 +52,7 @@ After creating an application in java, you will have a mxml file. In this mxml f // To create the API, you need the ApiUserCredentials and the dispatcher. cred = new ApiUserCredentials([[host]], [[basePath]] , [[apiToken]]); - // You can add more parameters. Go see the function in ApiUserCredential.as in io/swagger/common + // You can add more parameters. Go see the function in ApiUserCredential.as in org/openapitools/common // Create the API myAPI = new [[API]](cred, dispatcher); // change [[API]] to be the real name diff --git a/samples/client/petstore/flash/flash/build.xml b/samples/client/petstore/flash/flash/build.xml index 5f4922470c0..da3c67f8344 100644 --- a/samples/client/petstore/flash/flash/build.xml +++ b/samples/client/petstore/flash/flash/build.xml @@ -62,11 +62,11 @@ - + - - - + + + diff --git a/samples/client/petstore/flash/flash/src/io/swagger/client/model/200Response.as b/samples/client/petstore/flash/flash/src/io/swagger/client/model/200Response.as deleted file mode 100644 index d5319011e3a..00000000000 --- a/samples/client/petstore/flash/flash/src/io/swagger/client/model/200Response.as +++ /dev/null @@ -1,17 +0,0 @@ -package io.swagger.client.model { - - - [XmlRootNode(name="200Response")] - public class 200Response { - [XmlElement(name="name")] - public var name: Number = 0; - - public function toString(): String { - var str: String = "200Response: "; - str += " (name: " + name + ")"; - return str; - } - -} - -} diff --git a/samples/client/petstore/flash/flash/src/io/swagger/client/model/200ResponseList.as b/samples/client/petstore/flash/flash/src/io/swagger/client/model/200ResponseList.as deleted file mode 100644 index 006345f09e6..00000000000 --- a/samples/client/petstore/flash/flash/src/io/swagger/client/model/200ResponseList.as +++ /dev/null @@ -1,17 +0,0 @@ -package io.swagger.client.model { - -import io.swagger.common.ListWrapper; - - public class 200ResponseList implements ListWrapper { - // This declaration below of _200_response_obj_class is to force flash compiler to include this class - private var _200Response__obj_class: io.swagger.client.model.200Response = null; - [XmlElements(name="200Response_", type="io.swagger.client.model.200Response")] - public var 200Response_: Array = new Array(); - - public function getList(): Array{ - return 200Response_; - } - -} - -} diff --git a/samples/client/petstore/flash/flash/src/io/swagger/client/model/Animal.as b/samples/client/petstore/flash/flash/src/io/swagger/client/model/Animal.as deleted file mode 100644 index 2f3faea88c0..00000000000 --- a/samples/client/petstore/flash/flash/src/io/swagger/client/model/Animal.as +++ /dev/null @@ -1,17 +0,0 @@ -package io.swagger.client.model { - - - [XmlRootNode(name="Animal")] - public class Animal { - [XmlElement(name="className")] - public var className: String = null; - - public function toString(): String { - var str: String = "Animal: "; - str += " (className: " + className + ")"; - return str; - } - -} - -} diff --git a/samples/client/petstore/flash/flash/src/io/swagger/client/model/AnimalList.as b/samples/client/petstore/flash/flash/src/io/swagger/client/model/AnimalList.as deleted file mode 100644 index 11abdb96952..00000000000 --- a/samples/client/petstore/flash/flash/src/io/swagger/client/model/AnimalList.as +++ /dev/null @@ -1,17 +0,0 @@ -package io.swagger.client.model { - -import io.swagger.common.ListWrapper; - - public class AnimalList implements ListWrapper { - // This declaration below of _Animal_obj_class is to force flash compiler to include this class - private var _animal_obj_class: io.swagger.client.model.Animal = null; - [XmlElements(name="animal", type="io.swagger.client.model.Animal")] - public var animal: Array = new Array(); - - public function getList(): Array{ - return animal; - } - -} - -} diff --git a/samples/client/petstore/flash/flash/src/io/swagger/client/model/Cat.as b/samples/client/petstore/flash/flash/src/io/swagger/client/model/Cat.as deleted file mode 100644 index b479c53aae2..00000000000 --- a/samples/client/petstore/flash/flash/src/io/swagger/client/model/Cat.as +++ /dev/null @@ -1,21 +0,0 @@ -package io.swagger.client.model { - -import io.swagger.client.model.Animal; - - [XmlRootNode(name="Cat")] - public class Cat { - [XmlElement(name="className")] - public var className: String = null; - [XmlElement(name="declawed")] - public var declawed: Boolean = false; - - public function toString(): String { - var str: String = "Cat: "; - str += " (className: " + className + ")"; - str += " (declawed: " + declawed + ")"; - return str; - } - -} - -} diff --git a/samples/client/petstore/flash/flash/src/io/swagger/client/model/CatList.as b/samples/client/petstore/flash/flash/src/io/swagger/client/model/CatList.as deleted file mode 100644 index ed78fc168d2..00000000000 --- a/samples/client/petstore/flash/flash/src/io/swagger/client/model/CatList.as +++ /dev/null @@ -1,18 +0,0 @@ -package io.swagger.client.model { - -import io.swagger.common.ListWrapper; -import io.swagger.client.model.Animal; - - public class CatList implements ListWrapper { - // This declaration below of _Cat_obj_class is to force flash compiler to include this class - private var _cat_obj_class: io.swagger.client.model.Cat = null; - [XmlElements(name="cat", type="io.swagger.client.model.Cat")] - public var cat: Array = new Array(); - - public function getList(): Array{ - return cat; - } - -} - -} diff --git a/samples/client/petstore/flash/flash/src/io/swagger/client/model/CategoryList.as b/samples/client/petstore/flash/flash/src/io/swagger/client/model/CategoryList.as deleted file mode 100644 index 4bf21454d29..00000000000 --- a/samples/client/petstore/flash/flash/src/io/swagger/client/model/CategoryList.as +++ /dev/null @@ -1,17 +0,0 @@ -package io.swagger.client.model { - -import io.swagger.common.ListWrapper; - - public class CategoryList implements ListWrapper { - // This declaration below of _Category_obj_class is to force flash compiler to include this class - private var _category_obj_class: io.swagger.client.model.Category = null; - [XmlElements(name="category", type="io.swagger.client.model.Category")] - public var category: Array = new Array(); - - public function getList(): Array{ - return category; - } - -} - -} diff --git a/samples/client/petstore/flash/flash/src/io/swagger/client/model/Dog.as b/samples/client/petstore/flash/flash/src/io/swagger/client/model/Dog.as deleted file mode 100644 index 521ed241a1a..00000000000 --- a/samples/client/petstore/flash/flash/src/io/swagger/client/model/Dog.as +++ /dev/null @@ -1,21 +0,0 @@ -package io.swagger.client.model { - -import io.swagger.client.model.Animal; - - [XmlRootNode(name="Dog")] - public class Dog { - [XmlElement(name="className")] - public var className: String = null; - [XmlElement(name="breed")] - public var breed: String = null; - - public function toString(): String { - var str: String = "Dog: "; - str += " (className: " + className + ")"; - str += " (breed: " + breed + ")"; - return str; - } - -} - -} diff --git a/samples/client/petstore/flash/flash/src/io/swagger/client/model/DogList.as b/samples/client/petstore/flash/flash/src/io/swagger/client/model/DogList.as deleted file mode 100644 index 76cc41fa703..00000000000 --- a/samples/client/petstore/flash/flash/src/io/swagger/client/model/DogList.as +++ /dev/null @@ -1,18 +0,0 @@ -package io.swagger.client.model { - -import io.swagger.common.ListWrapper; -import io.swagger.client.model.Animal; - - public class DogList implements ListWrapper { - // This declaration below of _Dog_obj_class is to force flash compiler to include this class - private var _dog_obj_class: io.swagger.client.model.Dog = null; - [XmlElements(name="dog", type="io.swagger.client.model.Dog")] - public var dog: Array = new Array(); - - public function getList(): Array{ - return dog; - } - -} - -} diff --git a/samples/client/petstore/flash/flash/src/io/swagger/client/model/FormatTest.as b/samples/client/petstore/flash/flash/src/io/swagger/client/model/FormatTest.as deleted file mode 100644 index d053a7dde1c..00000000000 --- a/samples/client/petstore/flash/flash/src/io/swagger/client/model/FormatTest.as +++ /dev/null @@ -1,51 +0,0 @@ -package io.swagger.client.model { - -import io.swagger.client.model.ByteArray; - - [XmlRootNode(name="FormatTest")] - public class FormatTest { - [XmlElement(name="integer")] - public var integer: Number = NaN; - [XmlElement(name="int32")] - public var int32: Number = 0; - [XmlElement(name="int64")] - public var int64: Number = 0; - [XmlElement(name="number")] - public var number: Number = NaN; - [XmlElement(name="float")] - public var float: Number = 0.0; - [XmlElement(name="double")] - public var double: Number = 0.0; - [XmlElement(name="string")] - public var string: String = null; - [XmlElement(name="byte")] - public var byte: ByteArray = NaN; - [XmlElement(name="binary")] - public var binary: String = NaN; - [XmlElement(name="date")] - public var date: Date = null; - [XmlElement(name="dateTime")] - public var dateTime: Date = null; - [XmlElement(name="password")] - public var password: String = null; - - public function toString(): String { - var str: String = "FormatTest: "; - str += " (integer: " + integer + ")"; - str += " (int32: " + int32 + ")"; - str += " (int64: " + int64 + ")"; - str += " (number: " + number + ")"; - str += " (float: " + float + ")"; - str += " (double: " + double + ")"; - str += " (string: " + string + ")"; - str += " (byte: " + byte + ")"; - str += " (binary: " + binary + ")"; - str += " (date: " + date + ")"; - str += " (dateTime: " + dateTime + ")"; - str += " (password: " + password + ")"; - return str; - } - -} - -} diff --git a/samples/client/petstore/flash/flash/src/io/swagger/client/model/FormatTestList.as b/samples/client/petstore/flash/flash/src/io/swagger/client/model/FormatTestList.as deleted file mode 100644 index 1f30a511dfc..00000000000 --- a/samples/client/petstore/flash/flash/src/io/swagger/client/model/FormatTestList.as +++ /dev/null @@ -1,18 +0,0 @@ -package io.swagger.client.model { - -import io.swagger.common.ListWrapper; -import io.swagger.client.model.ByteArray; - - public class FormatTestList implements ListWrapper { - // This declaration below of _format_test_obj_class is to force flash compiler to include this class - private var _formatTest_obj_class: io.swagger.client.model.FormatTest = null; - [XmlElements(name="formatTest", type="io.swagger.client.model.FormatTest")] - public var formatTest: Array = new Array(); - - public function getList(): Array{ - return formatTest; - } - -} - -} diff --git a/samples/client/petstore/flash/flash/src/io/swagger/client/model/InlineResponse200.as b/samples/client/petstore/flash/flash/src/io/swagger/client/model/InlineResponse200.as deleted file mode 100644 index bb9a2848260..00000000000 --- a/samples/client/petstore/flash/flash/src/io/swagger/client/model/InlineResponse200.as +++ /dev/null @@ -1,41 +0,0 @@ -package io.swagger.client.model { - -import io.swagger.client.model.Object; -import io.swagger.client.model.Tag; - - [XmlRootNode(name="InlineResponse200")] - public class InlineResponse200 { - // This declaration below of _tags_obj_class is to force flash compiler to include this class - private var _tags_obj_class: Array = null; - [XmlElementWrapper(name="tags")] - [XmlElements(name="tags", type="Array")] - public var tags: Array = new Array(); - [XmlElement(name="id")] - public var id: Number = 0; - [XmlElement(name="category")] - public var category: Object = NaN; - /* pet status in the store */ - [XmlElement(name="status")] - public var status: String = null; - [XmlElement(name="name")] - public var name: String = null; - // This declaration below of _photoUrls_obj_class is to force flash compiler to include this class - private var _photoUrls_obj_class: Array = null; - [XmlElementWrapper(name="photoUrls")] - [XmlElements(name="photoUrls", type="Array")] - public var photoUrls: Array = new Array(); - - public function toString(): String { - var str: String = "InlineResponse200: "; - str += " (tags: " + tags + ")"; - str += " (id: " + id + ")"; - str += " (category: " + category + ")"; - str += " (status: " + status + ")"; - str += " (name: " + name + ")"; - str += " (photoUrls: " + photoUrls + ")"; - return str; - } - -} - -} diff --git a/samples/client/petstore/flash/flash/src/io/swagger/client/model/InlineResponse200List.as b/samples/client/petstore/flash/flash/src/io/swagger/client/model/InlineResponse200List.as deleted file mode 100644 index 3ffb8bf7a6b..00000000000 --- a/samples/client/petstore/flash/flash/src/io/swagger/client/model/InlineResponse200List.as +++ /dev/null @@ -1,19 +0,0 @@ -package io.swagger.client.model { - -import io.swagger.common.ListWrapper; -import io.swagger.client.model.Object; -import io.swagger.client.model.Tag; - - public class InlineResponse200List implements ListWrapper { - // This declaration below of _inline_response_200_obj_class is to force flash compiler to include this class - private var _inlineResponse200_obj_class: io.swagger.client.model.InlineResponse200 = null; - [XmlElements(name="inlineResponse200", type="io.swagger.client.model.InlineResponse200")] - public var inlineResponse200: Array = new Array(); - - public function getList(): Array{ - return inlineResponse200; - } - -} - -} diff --git a/samples/client/petstore/flash/flash/src/io/swagger/client/model/ModelReturn.as b/samples/client/petstore/flash/flash/src/io/swagger/client/model/ModelReturn.as deleted file mode 100644 index d87ae886145..00000000000 --- a/samples/client/petstore/flash/flash/src/io/swagger/client/model/ModelReturn.as +++ /dev/null @@ -1,17 +0,0 @@ -package io.swagger.client.model { - - - [XmlRootNode(name="ModelReturn")] - public class ModelReturn { - [XmlElement(name="return")] - public var return_: Number = 0; - - public function toString(): String { - var str: String = "ModelReturn: "; - str += " (return_: " + return_ + ")"; - return str; - } - -} - -} diff --git a/samples/client/petstore/flash/flash/src/io/swagger/client/model/ModelReturnList.as b/samples/client/petstore/flash/flash/src/io/swagger/client/model/ModelReturnList.as deleted file mode 100644 index 7d73597b08f..00000000000 --- a/samples/client/petstore/flash/flash/src/io/swagger/client/model/ModelReturnList.as +++ /dev/null @@ -1,17 +0,0 @@ -package io.swagger.client.model { - -import io.swagger.common.ListWrapper; - - public class ModelReturnList implements ListWrapper { - // This declaration below of _Return_obj_class is to force flash compiler to include this class - private var _return__obj_class: io.swagger.client.model.ModelReturn = null; - [XmlElements(name="return_", type="io.swagger.client.model.ModelReturn")] - public var return_: Array = new Array(); - - public function getList(): Array{ - return return_; - } - -} - -} diff --git a/samples/client/petstore/flash/flash/src/io/swagger/client/model/Name.as b/samples/client/petstore/flash/flash/src/io/swagger/client/model/Name.as deleted file mode 100644 index 4dcbc6a68f2..00000000000 --- a/samples/client/petstore/flash/flash/src/io/swagger/client/model/Name.as +++ /dev/null @@ -1,20 +0,0 @@ -package io.swagger.client.model { - - - [XmlRootNode(name="Name")] - public class Name { - [XmlElement(name="name")] - public var name: Number = 0; - [XmlElement(name="snake_case")] - public var snakeCase: Number = 0; - - public function toString(): String { - var str: String = "Name: "; - str += " (name: " + name + ")"; - str += " (snakeCase: " + snakeCase + ")"; - return str; - } - -} - -} diff --git a/samples/client/petstore/flash/flash/src/io/swagger/client/model/NameList.as b/samples/client/petstore/flash/flash/src/io/swagger/client/model/NameList.as deleted file mode 100644 index e327f3eff8d..00000000000 --- a/samples/client/petstore/flash/flash/src/io/swagger/client/model/NameList.as +++ /dev/null @@ -1,17 +0,0 @@ -package io.swagger.client.model { - -import io.swagger.common.ListWrapper; - - public class NameList implements ListWrapper { - // This declaration below of _Name_obj_class is to force flash compiler to include this class - private var _name_obj_class: io.swagger.client.model.Name = null; - [XmlElements(name="name", type="io.swagger.client.model.Name")] - public var name: Array = new Array(); - - public function getList(): Array{ - return name; - } - -} - -} diff --git a/samples/client/petstore/flash/flash/src/io/swagger/client/model/PetList.as b/samples/client/petstore/flash/flash/src/io/swagger/client/model/PetList.as deleted file mode 100644 index c1dcc0cfb6c..00000000000 --- a/samples/client/petstore/flash/flash/src/io/swagger/client/model/PetList.as +++ /dev/null @@ -1,19 +0,0 @@ -package io.swagger.client.model { - -import io.swagger.common.ListWrapper; -import io.swagger.client.model.Category; -import io.swagger.client.model.Tag; - - public class PetList implements ListWrapper { - // This declaration below of _Pet_obj_class is to force flash compiler to include this class - private var _pet_obj_class: io.swagger.client.model.Pet = null; - [XmlElements(name="pet", type="io.swagger.client.model.Pet")] - public var pet: Array = new Array(); - - public function getList(): Array{ - return pet; - } - -} - -} diff --git a/samples/client/petstore/flash/flash/src/io/swagger/client/model/SpecialModelName.as b/samples/client/petstore/flash/flash/src/io/swagger/client/model/SpecialModelName.as deleted file mode 100644 index 5834473e027..00000000000 --- a/samples/client/petstore/flash/flash/src/io/swagger/client/model/SpecialModelName.as +++ /dev/null @@ -1,17 +0,0 @@ -package io.swagger.client.model { - - - [XmlRootNode(name="SpecialModelName")] - public class SpecialModelName { - [XmlElement(name="$special[property.name]")] - public var $Special[propertyName]: Number = 0; - - public function toString(): String { - var str: String = "SpecialModelName: "; - str += " ($Special[propertyName]: " + $Special[propertyName] + ")"; - return str; - } - -} - -} diff --git a/samples/client/petstore/flash/flash/src/io/swagger/client/model/SpecialModelNameList.as b/samples/client/petstore/flash/flash/src/io/swagger/client/model/SpecialModelNameList.as deleted file mode 100644 index bdbb15aa74a..00000000000 --- a/samples/client/petstore/flash/flash/src/io/swagger/client/model/SpecialModelNameList.as +++ /dev/null @@ -1,17 +0,0 @@ -package io.swagger.client.model { - -import io.swagger.common.ListWrapper; - - public class SpecialModelNameList implements ListWrapper { - // This declaration below of _$special[model.name]_obj_class is to force flash compiler to include this class - private var _$Special[modelName]_obj_class: io.swagger.client.model.SpecialModelName = null; - [XmlElements(name="$Special[modelName]", type="io.swagger.client.model.SpecialModelName")] - public var $Special[modelName]: Array = new Array(); - - public function getList(): Array{ - return $Special[modelName]; - } - -} - -} diff --git a/samples/client/petstore/flash/flash/src/io/swagger/client/model/TagList.as b/samples/client/petstore/flash/flash/src/io/swagger/client/model/TagList.as deleted file mode 100644 index b958cae23b3..00000000000 --- a/samples/client/petstore/flash/flash/src/io/swagger/client/model/TagList.as +++ /dev/null @@ -1,17 +0,0 @@ -package io.swagger.client.model { - -import io.swagger.common.ListWrapper; - - public class TagList implements ListWrapper { - // This declaration below of _Tag_obj_class is to force flash compiler to include this class - private var _tag_obj_class: io.swagger.client.model.Tag = null; - [XmlElements(name="tag", type="io.swagger.client.model.Tag")] - public var tag: Array = new Array(); - - public function getList(): Array{ - return tag; - } - -} - -} diff --git a/samples/client/petstore/flash/flash/src/io/swagger/common/ApiUserCredentials.as b/samples/client/petstore/flash/flash/src/io/swagger/common/ApiUserCredentials.as deleted file mode 100644 index 118d917a247..00000000000 --- a/samples/client/petstore/flash/flash/src/io/swagger/common/ApiUserCredentials.as +++ /dev/null @@ -1,63 +0,0 @@ -package io.swagger.common { - -/** - * Api account credentials. - * - */ -public class ApiUserCredentials { - /** - * An apitoken that is passed along with the requests - */ - public var apiToken:String; - /** - * A valid auth_token which could be necessary for certain operations - */ - public var authToken:String; - /** - * The userId which could be required for certain operations - */ - public var userId:Number; - /** - * The host name for the Rest API eg. api.companyName.com - */ - public var hostName:String; - - /** - * The base path to the api resources - used along with the hostname - * eg. /v4 - */ - public var apiPath: String; - - /** - * The base path to the blazeds proxy - * eg. /v4/messagebroker/restproxy - */ - public var proxyPath: String; - - /** - * If a proxy server has been set up for the services specify the URL here. This value is used when the Api is invoked with - * the value useProxy as true - */ - public var apiProxyServerUrl: String; - - /** - * Constructor of ApiUserCredentials - * @param apiToken An apitoken that is passed along with the requests - * @param authToken A valid auth_token which could necessary for certain operations - * @param hostName The host name for the Rest API eg. api.companyName.com - * @param userId The userId which is required for certain operations - currently, get user lists - */ - public function ApiUserCredentials(hostName: String, apiPath: String, apiToken: String, - authToken: String = null, userId: Number = -1, apiProxyServerUrl: String="", - proxyPath: String = null) { - this.hostName = hostName; - this.apiToken = apiToken; - this.authToken = authToken; - this.userId = userId; - this.apiPath = apiPath; - this.apiProxyServerUrl = apiProxyServerUrl; - this.proxyPath = proxyPath; - } - -} -} \ No newline at end of file diff --git a/samples/client/petstore/flash/flash/src/io/swagger/common/SwaggerApi.as b/samples/client/petstore/flash/flash/src/io/swagger/common/SwaggerApi.as deleted file mode 100644 index 059de642a74..00000000000 --- a/samples/client/petstore/flash/flash/src/io/swagger/common/SwaggerApi.as +++ /dev/null @@ -1,75 +0,0 @@ -package io.swagger.common -{ - import io.swagger.common.ApiUserCredentials; - - import flash.events.EventDispatcher; - import flash.events.IEventDispatcher; - - import mx.utils.UIDUtil; - - public class SwaggerApi extends EventDispatcher - { - - protected var _apiUsageCredentials:ApiUserCredentials; - protected var _apiEventNotifier:EventDispatcher; - protected var _apiInvoker: ApiInvoker; - - protected var _useProxyServer: Boolean = false; - - - /** - * Constructor for the api client - * @param apiCredentials Wrapper object for tokens and hostName required towards authentication - * @param eventDispatcher Optional event dispatcher that when provided is used by the SDK to dispatch any Response - */ - public function SwaggerApi(apiCredentials: ApiUserCredentials, eventDispatcher: EventDispatcher = null) { - super(); - _apiUsageCredentials = apiCredentials; - _apiEventNotifier = eventDispatcher; - } - - public function useProxyServer(value:Boolean, proxyServerUrl: String = null):void { - _useProxyServer = value; - } - - protected function getApiInvoker():ApiInvoker { - if(_apiInvoker == null){ - if(_apiEventNotifier == null){ - _apiEventNotifier = this; - } - _apiInvoker = new ApiInvoker(_apiUsageCredentials, _apiEventNotifier, _useProxyServer); - } - return _apiInvoker; - } - - protected function getUniqueId():String { - return UIDUtil.createUID(); - } - - /** - * Method for returning the path value - * For a string value an empty value is returned if the value is null - * @param value - * @return - */ - protected static function toPathValue(value: Object): String { - if(value is Array){ - return arrayToPathValue(value as Array); - } - return value == null ? "" : value.toString(); - } - - /** - * Method for returning a path value - * For a list of objects a comma separated string is returned - * @param objects - * @return - */ - protected static function arrayToPathValue(objects: Array): String { - var out: String = ""; - - return objects.join(","); - } - - } -} \ No newline at end of file diff --git a/samples/client/petstore/flash/flash/src/io/swagger/exception/ApiErrorCodes.as b/samples/client/petstore/flash/flash/src/io/swagger/exception/ApiErrorCodes.as deleted file mode 100644 index e5ea46480aa..00000000000 --- a/samples/client/petstore/flash/flash/src/io/swagger/exception/ApiErrorCodes.as +++ /dev/null @@ -1,34 +0,0 @@ -package io.swagger.exception -{ - public class ApiErrorCodes - { - /** - * System exception. - */ - public static const SYSTEM_EXCEPTION: Number = 0; - - /** - * With Arguments as current key. - */ - public static const API_KEY_NOT_VALID: Number = 1000; - /** - * With arguments as current token value - */ - public static const AUTH_TOKEN_NOT_VALID: Number = 1001; - /** - * With arguments as input JSON and output class anme - */ - public static const ERROR_CONVERTING_JSON_TO_JAVA: Number = 1002; - /** - * With arguments as JAVA class name - */ - public static const ERROR_CONVERTING_JAVA_TO_JSON: Number = 1003; - - public static const ERROR_FROM_WEBSERVICE_CALL: Number = 1004; - /** - * With arguments as current API server name - */ - public static const API_SERVER_NOT_VALID: Number = 1005; - - } -} \ No newline at end of file diff --git a/samples/client/petstore/flash/flash/src/io/swagger/client/api/PetApi.as b/samples/client/petstore/flash/flash/src/org/openapitools/client/api/PetApi.as similarity index 95% rename from samples/client/petstore/flash/flash/src/io/swagger/client/api/PetApi.as rename to samples/client/petstore/flash/flash/src/org/openapitools/client/api/PetApi.as index 2479900173e..3ad9c7c96dc 100644 --- a/samples/client/petstore/flash/flash/src/io/swagger/client/api/PetApi.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/client/api/PetApi.as @@ -1,21 +1,21 @@ -package io.swagger.client.api { +package org.openapitools.client.api { -import io.swagger.common.ApiInvoker; -import io.swagger.exception.ApiErrorCodes; -import io.swagger.exception.ApiError; -import io.swagger.common.ApiUserCredentials; -import io.swagger.event.Response; -import io.swagger.common.SwaggerApi; -import io.swagger.client.model.ApiResponse; +import org.openapitools.common.ApiInvoker; +import org.openapitools.exception.ApiErrorCodes; +import org.openapitools.exception.ApiError; +import org.openapitools.common.ApiUserCredentials; +import org.openapitools.event.Response; +import org.openapitools.common.OpenApi; +import org.openapitools.client.model.ApiResponse; import flash.filesystem.File; -import io.swagger.client.model.Pet; +import org.openapitools.client.model.Pet; import mx.rpc.AsyncToken; import mx.utils.UIDUtil; import flash.utils.Dictionary; import flash.events.EventDispatcher; -public class PetApi extends SwaggerApi { +public class PetApi extends OpenApi { /** * Constructor for the PetApi api client * @param apiCredentials Wrapper object for tokens and hostName required towards authentication diff --git a/samples/client/petstore/flash/flash/src/io/swagger/client/api/StoreApi.as b/samples/client/petstore/flash/flash/src/org/openapitools/client/api/StoreApi.as similarity index 91% rename from samples/client/petstore/flash/flash/src/io/swagger/client/api/StoreApi.as rename to samples/client/petstore/flash/flash/src/org/openapitools/client/api/StoreApi.as index c8a3dd55f02..d013f1a82d1 100644 --- a/samples/client/petstore/flash/flash/src/io/swagger/client/api/StoreApi.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/client/api/StoreApi.as @@ -1,19 +1,19 @@ -package io.swagger.client.api { +package org.openapitools.client.api { -import io.swagger.common.ApiInvoker; -import io.swagger.exception.ApiErrorCodes; -import io.swagger.exception.ApiError; -import io.swagger.common.ApiUserCredentials; -import io.swagger.event.Response; -import io.swagger.common.SwaggerApi; -import io.swagger.client.model.Order; +import org.openapitools.common.ApiInvoker; +import org.openapitools.exception.ApiErrorCodes; +import org.openapitools.exception.ApiError; +import org.openapitools.common.ApiUserCredentials; +import org.openapitools.event.Response; +import org.openapitools.common.OpenApi; +import org.openapitools.client.model.Order; import mx.rpc.AsyncToken; import mx.utils.UIDUtil; import flash.utils.Dictionary; import flash.events.EventDispatcher; -public class StoreApi extends SwaggerApi { +public class StoreApi extends OpenApi { /** * Constructor for the StoreApi api client * @param apiCredentials Wrapper object for tokens and hostName required towards authentication diff --git a/samples/client/petstore/flash/flash/src/io/swagger/client/api/UserApi.as b/samples/client/petstore/flash/flash/src/org/openapitools/client/api/UserApi.as similarity index 95% rename from samples/client/petstore/flash/flash/src/io/swagger/client/api/UserApi.as rename to samples/client/petstore/flash/flash/src/org/openapitools/client/api/UserApi.as index 1949c01468f..3f11ff6e7bd 100644 --- a/samples/client/petstore/flash/flash/src/io/swagger/client/api/UserApi.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/client/api/UserApi.as @@ -1,19 +1,19 @@ -package io.swagger.client.api { +package org.openapitools.client.api { -import io.swagger.common.ApiInvoker; -import io.swagger.exception.ApiErrorCodes; -import io.swagger.exception.ApiError; -import io.swagger.common.ApiUserCredentials; -import io.swagger.event.Response; -import io.swagger.common.SwaggerApi; -import io.swagger.client.model.User; +import org.openapitools.common.ApiInvoker; +import org.openapitools.exception.ApiErrorCodes; +import org.openapitools.exception.ApiError; +import org.openapitools.common.ApiUserCredentials; +import org.openapitools.event.Response; +import org.openapitools.common.OpenApi; +import org.openapitools.client.model.User; import mx.rpc.AsyncToken; import mx.utils.UIDUtil; import flash.utils.Dictionary; import flash.events.EventDispatcher; -public class UserApi extends SwaggerApi { +public class UserApi extends OpenApi { /** * Constructor for the UserApi api client * @param apiCredentials Wrapper object for tokens and hostName required towards authentication diff --git a/samples/client/petstore/flash/flash/src/io/swagger/client/model/ApiResponse.as b/samples/client/petstore/flash/flash/src/org/openapitools/client/model/ApiResponse.as similarity index 93% rename from samples/client/petstore/flash/flash/src/io/swagger/client/model/ApiResponse.as rename to samples/client/petstore/flash/flash/src/org/openapitools/client/model/ApiResponse.as index 6f038dcf55f..e4aa8d46279 100644 --- a/samples/client/petstore/flash/flash/src/io/swagger/client/model/ApiResponse.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/client/model/ApiResponse.as @@ -1,4 +1,4 @@ -package io.swagger.client.model { +package org.openapitools.client.model { [XmlRootNode(name="ApiResponse")] diff --git a/samples/client/petstore/flash/flash/src/io/swagger/client/model/ApiResponseList.as b/samples/client/petstore/flash/flash/src/org/openapitools/client/model/ApiResponseList.as similarity index 53% rename from samples/client/petstore/flash/flash/src/io/swagger/client/model/ApiResponseList.as rename to samples/client/petstore/flash/flash/src/org/openapitools/client/model/ApiResponseList.as index 64b315a162c..5d91929d5d1 100644 --- a/samples/client/petstore/flash/flash/src/io/swagger/client/model/ApiResponseList.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/client/model/ApiResponseList.as @@ -1,11 +1,11 @@ -package io.swagger.client.model { +package org.openapitools.client.model { -import io.swagger.common.ListWrapper; +import org.openapitools.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")] + private var _apiResponse_obj_class: org.openapitools.client.model.ApiResponse = null; + [XmlElements(name="apiResponse", type="org.openapitools.client.model.ApiResponse")] public var apiResponse: Array = new Array(); public function getList(): Array{ diff --git a/samples/client/petstore/flash/flash/src/io/swagger/client/model/Category.as b/samples/client/petstore/flash/flash/src/org/openapitools/client/model/Category.as similarity index 91% rename from samples/client/petstore/flash/flash/src/io/swagger/client/model/Category.as rename to samples/client/petstore/flash/flash/src/org/openapitools/client/model/Category.as index 76916ee0b9e..b97d2f2fde7 100644 --- a/samples/client/petstore/flash/flash/src/io/swagger/client/model/Category.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/client/model/Category.as @@ -1,4 +1,4 @@ -package io.swagger.client.model { +package org.openapitools.client.model { [XmlRootNode(name="Category")] diff --git a/samples/client/petstore/flash/src/main/flex/io/swagger/client/model/CategoryList.as b/samples/client/petstore/flash/flash/src/org/openapitools/client/model/CategoryList.as similarity index 53% rename from samples/client/petstore/flash/src/main/flex/io/swagger/client/model/CategoryList.as rename to samples/client/petstore/flash/flash/src/org/openapitools/client/model/CategoryList.as index 342cd70c001..66b5dd2401f 100644 --- a/samples/client/petstore/flash/src/main/flex/io/swagger/client/model/CategoryList.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/client/model/CategoryList.as @@ -1,11 +1,11 @@ -package io.swagger.client.model { +package org.openapitools.client.model { -import io.swagger.common.ListWrapper; +import org.openapitools.common.ListWrapper; public class CategoryList implements ListWrapper { // This declaration below of _Category_obj_class is to force flash compiler to include this class - private var _category_obj_class: io.swagger.client.model.Category = null; - [XmlElements(name="category", type="io.swagger.client.model.Category")] + private var _category_obj_class: org.openapitools.client.model.Category = null; + [XmlElements(name="category", type="org.openapitools.client.model.Category")] public var category: Array = new Array(); public function getList(): Array{ @@ -13,6 +13,5 @@ import io.swagger.common.ListWrapper; } } - } diff --git a/samples/client/petstore/flash/flash/src/io/swagger/client/model/Order.as b/samples/client/petstore/flash/flash/src/org/openapitools/client/model/Order.as similarity index 96% rename from samples/client/petstore/flash/flash/src/io/swagger/client/model/Order.as rename to samples/client/petstore/flash/flash/src/org/openapitools/client/model/Order.as index bcb3855496c..ae4b33dd850 100644 --- a/samples/client/petstore/flash/flash/src/io/swagger/client/model/Order.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/client/model/Order.as @@ -1,4 +1,4 @@ -package io.swagger.client.model { +package org.openapitools.client.model { [XmlRootNode(name="Order")] diff --git a/samples/client/petstore/flash/flash/src/io/swagger/client/model/OrderList.as b/samples/client/petstore/flash/flash/src/org/openapitools/client/model/OrderList.as similarity index 54% rename from samples/client/petstore/flash/flash/src/io/swagger/client/model/OrderList.as rename to samples/client/petstore/flash/flash/src/org/openapitools/client/model/OrderList.as index 3573a1b4863..b60cbdc67b1 100644 --- a/samples/client/petstore/flash/flash/src/io/swagger/client/model/OrderList.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/client/model/OrderList.as @@ -1,11 +1,11 @@ -package io.swagger.client.model { +package org.openapitools.client.model { -import io.swagger.common.ListWrapper; +import org.openapitools.common.ListWrapper; public class OrderList implements ListWrapper { // This declaration below of _Order_obj_class is to force flash compiler to include this class - private var _order_obj_class: io.swagger.client.model.Order = null; - [XmlElements(name="order", type="io.swagger.client.model.Order")] + private var _order_obj_class: org.openapitools.client.model.Order = null; + [XmlElements(name="order", type="org.openapitools.client.model.Order")] public var order: Array = new Array(); public function getList(): Array{ diff --git a/samples/client/petstore/flash/flash/src/io/swagger/client/model/Pet.as b/samples/client/petstore/flash/flash/src/org/openapitools/client/model/Pet.as similarity index 91% rename from samples/client/petstore/flash/flash/src/io/swagger/client/model/Pet.as rename to samples/client/petstore/flash/flash/src/org/openapitools/client/model/Pet.as index 6c14f3f83e4..8eaff2b9e30 100644 --- a/samples/client/petstore/flash/flash/src/io/swagger/client/model/Pet.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/client/model/Pet.as @@ -1,7 +1,7 @@ -package io.swagger.client.model { +package org.openapitools.client.model { -import io.swagger.client.model.Category; -import io.swagger.client.model.Tag; +import org.openapitools.client.model.Category; +import org.openapitools.client.model.Tag; [XmlRootNode(name="Pet")] public class Pet { diff --git a/samples/client/petstore/flash/flash/src/org/openapitools/client/model/PetList.as b/samples/client/petstore/flash/flash/src/org/openapitools/client/model/PetList.as new file mode 100644 index 00000000000..1ae0a344ae4 --- /dev/null +++ b/samples/client/petstore/flash/flash/src/org/openapitools/client/model/PetList.as @@ -0,0 +1,19 @@ +package org.openapitools.client.model { + +import org.openapitools.common.ListWrapper; +import org.openapitools.client.model.Category; +import org.openapitools.client.model.Tag; + + public class PetList implements ListWrapper { + // This declaration below of _Pet_obj_class is to force flash compiler to include this class + private var _pet_obj_class: org.openapitools.client.model.Pet = null; + [XmlElements(name="pet", type="org.openapitools.client.model.Pet")] + public var pet: Array = new Array(); + + public function getList(): Array{ + return pet; + } + +} + +} diff --git a/samples/client/petstore/flash/flash/src/io/swagger/client/model/Tag.as b/samples/client/petstore/flash/flash/src/org/openapitools/client/model/Tag.as similarity index 90% rename from samples/client/petstore/flash/flash/src/io/swagger/client/model/Tag.as rename to samples/client/petstore/flash/flash/src/org/openapitools/client/model/Tag.as index 3c8c4cae466..7a4c4d35db8 100644 --- a/samples/client/petstore/flash/flash/src/io/swagger/client/model/Tag.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/client/model/Tag.as @@ -1,4 +1,4 @@ -package io.swagger.client.model { +package org.openapitools.client.model { [XmlRootNode(name="Tag")] diff --git a/samples/client/petstore/flash/src/main/flex/io/swagger/client/model/TagList.as b/samples/client/petstore/flash/flash/src/org/openapitools/client/model/TagList.as similarity index 54% rename from samples/client/petstore/flash/src/main/flex/io/swagger/client/model/TagList.as rename to samples/client/petstore/flash/flash/src/org/openapitools/client/model/TagList.as index 25ebadb27fb..45feeb7c9e7 100644 --- a/samples/client/petstore/flash/src/main/flex/io/swagger/client/model/TagList.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/client/model/TagList.as @@ -1,11 +1,11 @@ -package io.swagger.client.model { +package org.openapitools.client.model { -import io.swagger.common.ListWrapper; +import org.openapitools.common.ListWrapper; public class TagList implements ListWrapper { // This declaration below of _Tag_obj_class is to force flash compiler to include this class - private var _tag_obj_class: io.swagger.client.model.Tag = null; - [XmlElements(name="tag", type="io.swagger.client.model.Tag")] + private var _tag_obj_class: org.openapitools.client.model.Tag = null; + [XmlElements(name="tag", type="org.openapitools.client.model.Tag")] public var tag: Array = new Array(); public function getList(): Array{ @@ -13,6 +13,5 @@ import io.swagger.common.ListWrapper; } } - } diff --git a/samples/client/petstore/flash/flash/src/io/swagger/client/model/User.as b/samples/client/petstore/flash/flash/src/org/openapitools/client/model/User.as similarity index 96% rename from samples/client/petstore/flash/flash/src/io/swagger/client/model/User.as rename to samples/client/petstore/flash/flash/src/org/openapitools/client/model/User.as index fadf5f4e7a3..60d4f543b29 100644 --- a/samples/client/petstore/flash/flash/src/io/swagger/client/model/User.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/client/model/User.as @@ -1,4 +1,4 @@ -package io.swagger.client.model { +package org.openapitools.client.model { [XmlRootNode(name="User")] diff --git a/samples/client/petstore/flash/flash/src/io/swagger/client/model/UserList.as b/samples/client/petstore/flash/flash/src/org/openapitools/client/model/UserList.as similarity index 54% rename from samples/client/petstore/flash/flash/src/io/swagger/client/model/UserList.as rename to samples/client/petstore/flash/flash/src/org/openapitools/client/model/UserList.as index a8404427adf..615a2c457f9 100644 --- a/samples/client/petstore/flash/flash/src/io/swagger/client/model/UserList.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/client/model/UserList.as @@ -1,11 +1,11 @@ -package io.swagger.client.model { +package org.openapitools.client.model { -import io.swagger.common.ListWrapper; +import org.openapitools.common.ListWrapper; public class UserList implements ListWrapper { // This declaration below of _User_obj_class is to force flash compiler to include this class - private var _user_obj_class: io.swagger.client.model.User = null; - [XmlElements(name="user", type="io.swagger.client.model.User")] + private var _user_obj_class: org.openapitools.client.model.User = null; + [XmlElements(name="user", type="org.openapitools.client.model.User")] public var user: Array = new Array(); public function getList(): Array{ diff --git a/samples/client/petstore/flash/flash/src/io/swagger/common/ApiInvoker.as b/samples/client/petstore/flash/flash/src/org/openapitools/common/ApiInvoker.as similarity index 98% rename from samples/client/petstore/flash/flash/src/io/swagger/common/ApiInvoker.as rename to samples/client/petstore/flash/flash/src/org/openapitools/common/ApiInvoker.as index 6d8466390a6..cdf23b64276 100644 --- a/samples/client/petstore/flash/flash/src/io/swagger/common/ApiInvoker.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/common/ApiInvoker.as @@ -1,6 +1,6 @@ -package io.swagger.common { -import io.swagger.event.ApiClientEvent; -import io.swagger.event.Response; +package org.openapitools.common { +import org.openapitools.event.ApiClientEvent; +import org.openapitools.event.Response; import flash.events.EventDispatcher; import flash.utils.*; diff --git a/samples/client/petstore/flash/flash/src/io/swagger/common/ApiUrlHelper.as b/samples/client/petstore/flash/flash/src/org/openapitools/common/ApiUrlHelper.as similarity index 94% rename from samples/client/petstore/flash/flash/src/io/swagger/common/ApiUrlHelper.as rename to samples/client/petstore/flash/flash/src/org/openapitools/common/ApiUrlHelper.as index 8779610cd48..f07e8e6dfeb 100644 --- a/samples/client/petstore/flash/flash/src/io/swagger/common/ApiUrlHelper.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/common/ApiUrlHelper.as @@ -1,5 +1,5 @@ -package io.swagger.common { -import io.swagger.common.ApiUserCredentials; +package org.openapitools.common { +import org.openapitools.common.ApiUserCredentials; /** * @private diff --git a/samples/client/petstore/flash/src/main/flex/io/swagger/swagger/common/ApiUserCredentials.as b/samples/client/petstore/flash/flash/src/org/openapitools/common/ApiUserCredentials.as similarity index 98% rename from samples/client/petstore/flash/src/main/flex/io/swagger/swagger/common/ApiUserCredentials.as rename to samples/client/petstore/flash/flash/src/org/openapitools/common/ApiUserCredentials.as index 118d917a247..2a955438a26 100644 --- a/samples/client/petstore/flash/src/main/flex/io/swagger/swagger/common/ApiUserCredentials.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/common/ApiUserCredentials.as @@ -1,4 +1,4 @@ -package io.swagger.common { +package org.openapitools.common { /** * Api account credentials. diff --git a/samples/client/petstore/flash/flash/src/io/swagger/common/ListWrapper.as b/samples/client/petstore/flash/flash/src/org/openapitools/common/ListWrapper.as similarity index 69% rename from samples/client/petstore/flash/flash/src/io/swagger/common/ListWrapper.as rename to samples/client/petstore/flash/flash/src/org/openapitools/common/ListWrapper.as index b22890ad1d1..e6d79d5625a 100644 --- a/samples/client/petstore/flash/flash/src/io/swagger/common/ListWrapper.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/common/ListWrapper.as @@ -1,4 +1,4 @@ -package io.swagger.common +package org.openapitools.common { public interface ListWrapper { diff --git a/samples/client/petstore/flash/src/main/flex/io/swagger/swagger/common/SwaggerApi.as b/samples/client/petstore/flash/flash/src/org/openapitools/common/OpenApi.as similarity index 88% rename from samples/client/petstore/flash/src/main/flex/io/swagger/swagger/common/SwaggerApi.as rename to samples/client/petstore/flash/flash/src/org/openapitools/common/OpenApi.as index 059de642a74..e632efa5335 100644 --- a/samples/client/petstore/flash/src/main/flex/io/swagger/swagger/common/SwaggerApi.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/common/OpenApi.as @@ -1,13 +1,13 @@ -package io.swagger.common +package org.openapitools.common { - import io.swagger.common.ApiUserCredentials; + import org.openapitools.common.ApiUserCredentials; import flash.events.EventDispatcher; import flash.events.IEventDispatcher; import mx.utils.UIDUtil; - public class SwaggerApi extends EventDispatcher + public class OpenApi extends EventDispatcher { protected var _apiUsageCredentials:ApiUserCredentials; @@ -22,7 +22,7 @@ package io.swagger.common * @param apiCredentials Wrapper object for tokens and hostName required towards authentication * @param eventDispatcher Optional event dispatcher that when provided is used by the SDK to dispatch any Response */ - public function SwaggerApi(apiCredentials: ApiUserCredentials, eventDispatcher: EventDispatcher = null) { + public function OpenApi(apiCredentials: ApiUserCredentials, eventDispatcher: EventDispatcher = null) { super(); _apiUsageCredentials = apiCredentials; _apiEventNotifier = eventDispatcher; diff --git a/samples/client/petstore/flash/flash/src/io/swagger/common/XMLWriter.as b/samples/client/petstore/flash/flash/src/org/openapitools/common/XMLWriter.as similarity index 89% rename from samples/client/petstore/flash/flash/src/io/swagger/common/XMLWriter.as rename to samples/client/petstore/flash/flash/src/org/openapitools/common/XMLWriter.as index 0b08066775b..8f87484841c 100644 --- a/samples/client/petstore/flash/flash/src/io/swagger/common/XMLWriter.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/common/XMLWriter.as @@ -1,11 +1,10 @@ -package io.swagger.common +package org.openapitools.common { public class XMLWriter { public var xml:XML; - public function XMLWriter() - { + public function XMLWriter() { xml=; } diff --git a/samples/client/petstore/flash/flash/src/io/swagger/event/ApiClientEvent.as b/samples/client/petstore/flash/flash/src/org/openapitools/event/ApiClientEvent.as similarity index 93% rename from samples/client/petstore/flash/flash/src/io/swagger/event/ApiClientEvent.as rename to samples/client/petstore/flash/flash/src/org/openapitools/event/ApiClientEvent.as index d64cd304d49..964dbc26d69 100644 --- a/samples/client/petstore/flash/flash/src/io/swagger/event/ApiClientEvent.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/event/ApiClientEvent.as @@ -1,5 +1,5 @@ -package io.swagger.event { -import io.swagger.event.Response; +package org.openapitools.event { +import org.openapitools.event.Response; import flash.events.Event; diff --git a/samples/client/petstore/flash/flash/src/io/swagger/event/Response.as b/samples/client/petstore/flash/flash/src/org/openapitools/event/Response.as similarity index 98% rename from samples/client/petstore/flash/flash/src/io/swagger/event/Response.as rename to samples/client/petstore/flash/flash/src/org/openapitools/event/Response.as index d19dd0ae358..333fca9874c 100644 --- a/samples/client/petstore/flash/flash/src/io/swagger/event/Response.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/event/Response.as @@ -1,4 +1,4 @@ -package io.swagger.event { +package org.openapitools.event { /** * Response contains info on the result of an API invocation. diff --git a/samples/client/petstore/flash/flash/src/io/swagger/exception/ApiError.as b/samples/client/petstore/flash/flash/src/org/openapitools/exception/ApiError.as similarity index 78% rename from samples/client/petstore/flash/flash/src/io/swagger/exception/ApiError.as rename to samples/client/petstore/flash/flash/src/org/openapitools/exception/ApiError.as index c8ac95a5c59..0e8e09b484a 100644 --- a/samples/client/petstore/flash/flash/src/io/swagger/exception/ApiError.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/exception/ApiError.as @@ -1,4 +1,4 @@ -package io.swagger.exception +package org.openapitools.exception { public class ApiError extends Error { diff --git a/samples/client/petstore/flash/src/main/flex/io/swagger/swagger/exception/ApiErrorCodes.as b/samples/client/petstore/flash/flash/src/org/openapitools/exception/ApiErrorCodes.as similarity index 95% rename from samples/client/petstore/flash/src/main/flex/io/swagger/swagger/exception/ApiErrorCodes.as rename to samples/client/petstore/flash/flash/src/org/openapitools/exception/ApiErrorCodes.as index e5ea46480aa..4bc6b36cedf 100644 --- a/samples/client/petstore/flash/src/main/flex/io/swagger/swagger/exception/ApiErrorCodes.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/exception/ApiErrorCodes.as @@ -1,4 +1,4 @@ -package io.swagger.exception +package org.openapitools.exception { public class ApiErrorCodes { diff --git a/samples/client/petstore/flash/git_push.sh b/samples/client/petstore/flash/git_push.sh index ae01b182ae9..8442b80bb44 100644 --- a/samples/client/petstore/flash/git_push.sh +++ b/samples/client/petstore/flash/git_push.sh @@ -1,7 +1,7 @@ #!/bin/sh # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ # -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" git_user_id=$1 git_repo_id=$2 diff --git a/samples/client/petstore/flash/src/main/flex/bin/AirExecutorApp-app.xml b/samples/client/petstore/flash/src/main/flex/bin/AirExecutorApp-app.xml deleted file mode 100644 index 1dbaf98e644..00000000000 --- a/samples/client/petstore/flash/src/main/flex/bin/AirExecutorApp-app.xml +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - - AirExecutorApp - - - AirExecutorApp - - - AirExecutorApp - - - v1 - - - - - - - - - - - - - - - AirExecutorApp.swf - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/flash/src/main/flex/build.properties b/samples/client/petstore/flash/src/main/flex/build.properties deleted file mode 100644 index 356f112b144..00000000000 --- a/samples/client/petstore/flash/src/main/flex/build.properties +++ /dev/null @@ -1,29 +0,0 @@ -# Window and document title for the documentation -title=Sample app AS3 SDK API Documentation - -#Path to the source folder where the .as files are located -sourcepath = ./src/main/flex - -# Class-folders you want to search for classes to be included in the docs, separated by spaces (for example ../com/ ../net/ ) -# to include every .as and .mxml file within your project, just state ../ -domainextensions = ./src/main/flex - -# The Location of deployment library on your Computer (PC/Mac) for compiled SWC file -liboutputfolder = bin -liboutputfile = as3-sample-sdk.swc -libpath = lib - -# The Location of the output folder for your generated documents -docsoutputfolder = asdoc - -# The location of the test sources -testsourcepath = ./src/test/flex - -# Home directory for flex sdk, change this to build for Mac or PC using # as comment -FLEX4_SDK_HOME = /usr/local/flex_sdk_4.1.0/ -#FLEX4_SDK_HOME = /Applications/Adobe Flash Builder 4/sdks/4.1.0/ - -# The location of your asdoc.exe, change this to build for Mac or PC using # as comment -#asdoc.exe = C:/Program Files/Adobe/Flash Builder 4/sdks/3.5.0/bin/asdoc.exe -#asdoc.exe = /Applications/Adobe Flash Builder 4/sdks/3.5.0/bin/asdoc - diff --git a/samples/client/petstore/flash/src/main/flex/build.xml b/samples/client/petstore/flash/src/main/flex/build.xml deleted file mode 100644 index 9b84a466b76..00000000000 --- a/samples/client/petstore/flash/src/main/flex/build.xml +++ /dev/null @@ -1,192 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - docs created - - - - - - - - - - - - - - - - - - - - - - - - SWC created - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - - - - - - - - - - \ No newline at end of file diff --git a/samples/client/petstore/flash/src/main/flex/io/swagger/client/api/PetApi.as b/samples/client/petstore/flash/src/main/flex/io/swagger/client/api/PetApi.as deleted file mode 100644 index edd1298600f..00000000000 --- a/samples/client/petstore/flash/src/main/flex/io/swagger/client/api/PetApi.as +++ /dev/null @@ -1,276 +0,0 @@ -package io.swagger.client.api { - -import io.swagger.common.ApiInvoker; -import io.swagger.exception.ApiErrorCodes; -import io.swagger.exception.ApiError; -import io.swagger.common.ApiUserCredentials; -import io.swagger.event.Response; -import io.swagger.common.SwaggerApi; -import io.swagger.client.model.Pet; -import flash.filesystem.File; - -import mx.rpc.AsyncToken; -import mx.utils.UIDUtil; -import flash.utils.Dictionary; -import flash.events.EventDispatcher; - -public class PetApi extends SwaggerApi { - /** - * Constructor for the PetApi api client - * @param apiCredentials Wrapper object for tokens and hostName required towards authentication - * @param eventDispatcher Optional event dispatcher that when provided is used by the SDK to dispatch any Response - */ - public function PetApi(apiCredentials: ApiUserCredentials, eventDispatcher: EventDispatcher = null) { - super(apiCredentials, eventDispatcher); - } - - public static const event_update_pet: String = "update_pet"; - public static const event_add_pet: String = "add_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_update_pet_with_form: String = "update_pet_with_form"; - public static const event_delete_pet: String = "delete_pet"; - public static const event_upload_file: String = "upload_file"; - - - /* - * Returns void - */ - public function update_pet (body: Pet): String { - // create path and map variables - var path: String = "/pet".replace(/{format}/g,"xml"); - - // query params - var queryParams: Dictionary = new Dictionary(); - var headerParams: Dictionary = new Dictionary(); - - - - - - - - var token:AsyncToken = getApiInvoker().invokeAPI(path, "PUT", queryParams, body, headerParams); - - var requestId: String = getUniqueId(); - - token.requestId = requestId; - token.completionEventType = "update_pet"; - - token.returnType = null ; - return requestId; - - } - - /* - * Returns void - */ - public function add_pet (body: Pet): String { - // create path and map variables - var path: String = "/pet".replace(/{format}/g,"xml"); - - // query params - var queryParams: Dictionary = new Dictionary(); - var headerParams: Dictionary = new Dictionary(); - - - - - - - - var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, body, headerParams); - - var requestId: String = getUniqueId(); - - token.requestId = requestId; - token.completionEventType = "add_pet"; - - token.returnType = null ; - return requestId; - - } - - /* - * Returns Array - */ - public function find_pets_by_status (status: Array = available): String { - // create path and map variables - var path: String = "/pet/findByStatus".replace(/{format}/g,"xml"); - - // query params - var queryParams: Dictionary = new Dictionary(); - var headerParams: Dictionary = new Dictionary(); - - - - 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_pets_by_status"; - - token.returnType = Array; - return requestId; - - } - - /* - * Returns Array - */ - public function find_pets_by_tags (tags: Array): String { - // create path and map variables - var path: String = "/pet/findByTags".replace(/{format}/g,"xml"); - - // query params - var queryParams: Dictionary = new Dictionary(); - var headerParams: Dictionary = new Dictionary(); - - - - if("null" != String(tags)) - queryParams["tags"] = toPathValue(tags); - - - - - var token:AsyncToken = getApiInvoker().invokeAPI(path, "GET", queryParams, null, headerParams); - - var requestId: String = getUniqueId(); - - token.requestId = requestId; - token.completionEventType = "find_pets_by_tags"; - - token.returnType = Array; - return requestId; - - } - - /* - * Returns Pet - */ - public function get_pet_by_id (petId: Number): String { - // create path and map variables - var path: String = "/pet/{petId}".replace(/{format}/g,"xml").replace("{" + "petId" + "}", getApiInvoker().escapeString(petId)); - - // 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_pet_by_id"; - - token.returnType = Pet; - return requestId; - - } - - /* - * Returns void - */ - public function update_pet_with_form (petId: String, name: String, status: String): String { - // create path and map variables - var path: String = "/pet/{petId}".replace(/{format}/g,"xml").replace("{" + "petId" + "}", getApiInvoker().escapeString(petId)); - - // query params - var queryParams: Dictionary = new Dictionary(); - var headerParams: Dictionary = new Dictionary(); - - - - - - - - var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, null, headerParams); - - var requestId: String = getUniqueId(); - - token.requestId = requestId; - token.completionEventType = "update_pet_with_form"; - - token.returnType = null ; - return requestId; - - } - - /* - * Returns void - */ - public function delete_pet (petId: Number, apiKey: String): String { - // create path and map variables - var path: String = "/pet/{petId}".replace(/{format}/g,"xml").replace("{" + "petId" + "}", getApiInvoker().escapeString(petId)); - - // query params - var queryParams: Dictionary = new Dictionary(); - var headerParams: Dictionary = new Dictionary(); - - - - - - headerParams["apiKey"] = toPathValue(apiKey); - - - var token:AsyncToken = getApiInvoker().invokeAPI(path, "DELETE", queryParams, null, headerParams); - - var requestId: String = getUniqueId(); - - token.requestId = requestId; - token.completionEventType = "delete_pet"; - - token.returnType = null ; - return requestId; - - } - - /* - * Returns void - */ - public function upload_file (petId: Number, additionalMetadata: String, file: File): String { - // create path and map variables - var path: String = "/pet/{petId}/uploadImage".replace(/{format}/g,"xml").replace("{" + "petId" + "}", getApiInvoker().escapeString(petId)); - - // query params - var queryParams: Dictionary = new Dictionary(); - var headerParams: Dictionary = new Dictionary(); - - - - - - - - var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, null, headerParams); - - var requestId: String = getUniqueId(); - - token.requestId = requestId; - token.completionEventType = "upload_file"; - - token.returnType = null ; - return requestId; - - } - -} - -} diff --git a/samples/client/petstore/flash/src/main/flex/io/swagger/client/api/StoreApi.as b/samples/client/petstore/flash/src/main/flex/io/swagger/client/api/StoreApi.as deleted file mode 100644 index 061878ad257..00000000000 --- a/samples/client/petstore/flash/src/main/flex/io/swagger/client/api/StoreApi.as +++ /dev/null @@ -1,150 +0,0 @@ -package io.swagger.client.api { - -import io.swagger.common.ApiInvoker; -import io.swagger.exception.ApiErrorCodes; -import io.swagger.exception.ApiError; -import io.swagger.common.ApiUserCredentials; -import io.swagger.event.Response; -import io.swagger.common.SwaggerApi; -import io.swagger.client.model.Order; - -import mx.rpc.AsyncToken; -import mx.utils.UIDUtil; -import flash.utils.Dictionary; -import flash.events.EventDispatcher; - -public class StoreApi extends SwaggerApi { - /** - * Constructor for the StoreApi api client - * @param apiCredentials Wrapper object for tokens and hostName required towards authentication - * @param eventDispatcher Optional event dispatcher that when provided is used by the SDK to dispatch any Response - */ - public function StoreApi(apiCredentials: ApiUserCredentials, eventDispatcher: EventDispatcher = null) { - super(apiCredentials, eventDispatcher); - } - - public static const event_get_inventory: String = "get_inventory"; - public static const event_place_order: String = "place_order"; - public static const event_get_order_by_id: String = "get_order_by_id"; - public static const event_delete_order: String = "delete_order"; - - - /* - * Returns Dictionary - */ - public function get_inventory (): String { - // create path and map variables - var path: String = "/store/inventory".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"; - - token.returnType = Dictionary; - return requestId; - - } - - /* - * Returns Order - */ - public function place_order (body: Order): String { - // create path and map variables - var path: String = "/store/order".replace(/{format}/g,"xml"); - - // query params - var queryParams: Dictionary = new Dictionary(); - var headerParams: Dictionary = new Dictionary(); - - - - - - - - var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, body, headerParams); - - var requestId: String = getUniqueId(); - - token.requestId = requestId; - token.completionEventType = "place_order"; - - token.returnType = Order; - return requestId; - - } - - /* - * Returns Order - */ - public function get_order_by_id (orderId: String): String { - // create path and map variables - var path: String = "/store/order/{orderId}".replace(/{format}/g,"xml").replace("{" + "orderId" + "}", getApiInvoker().escapeString(orderId)); - - // 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_order_by_id"; - - token.returnType = Order; - return requestId; - - } - - /* - * Returns void - */ - public function delete_order (orderId: String): String { - // create path and map variables - var path: String = "/store/order/{orderId}".replace(/{format}/g,"xml").replace("{" + "orderId" + "}", getApiInvoker().escapeString(orderId)); - - // query params - var queryParams: Dictionary = new Dictionary(); - var headerParams: Dictionary = new Dictionary(); - - - - - - - - var token:AsyncToken = getApiInvoker().invokeAPI(path, "DELETE", queryParams, null, headerParams); - - var requestId: String = getUniqueId(); - - token.requestId = requestId; - token.completionEventType = "delete_order"; - - token.returnType = null ; - return requestId; - - } - -} - -} diff --git a/samples/client/petstore/flash/src/main/flex/io/swagger/client/api/UserApi.as b/samples/client/petstore/flash/src/main/flex/io/swagger/client/api/UserApi.as deleted file mode 100644 index 06b0d079799..00000000000 --- a/samples/client/petstore/flash/src/main/flex/io/swagger/client/api/UserApi.as +++ /dev/null @@ -1,274 +0,0 @@ -package io.swagger.client.api { - -import io.swagger.common.ApiInvoker; -import io.swagger.exception.ApiErrorCodes; -import io.swagger.exception.ApiError; -import io.swagger.common.ApiUserCredentials; -import io.swagger.event.Response; -import io.swagger.common.SwaggerApi; -import io.swagger.client.model.User; - -import mx.rpc.AsyncToken; -import mx.utils.UIDUtil; -import flash.utils.Dictionary; -import flash.events.EventDispatcher; - -public class UserApi extends SwaggerApi { - /** - * Constructor for the UserApi api client - * @param apiCredentials Wrapper object for tokens and hostName required towards authentication - * @param eventDispatcher Optional event dispatcher that when provided is used by the SDK to dispatch any Response - */ - public function UserApi(apiCredentials: ApiUserCredentials, eventDispatcher: EventDispatcher = null) { - super(apiCredentials, eventDispatcher); - } - - public static const event_create_user: String = "create_user"; - public static const event_create_users_with_array_input: String = "create_users_with_array_input"; - public static const event_create_users_with_list_input: String = "create_users_with_list_input"; - public static const event_login_user: String = "login_user"; - public static const event_logout_user: String = "logout_user"; - public static const event_get_user_by_name: String = "get_user_by_name"; - public static const event_update_user: String = "update_user"; - public static const event_delete_user: String = "delete_user"; - - - /* - * Returns void - */ - public function create_user (body: User): String { - // create path and map variables - var path: String = "/user".replace(/{format}/g,"xml"); - - // query params - var queryParams: Dictionary = new Dictionary(); - var headerParams: Dictionary = new Dictionary(); - - - - - - - - var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, body, headerParams); - - var requestId: String = getUniqueId(); - - token.requestId = requestId; - token.completionEventType = "create_user"; - - token.returnType = null ; - return requestId; - - } - - /* - * Returns void - */ - public function create_users_with_array_input (body: Array): String { - // create path and map variables - var path: String = "/user/createWithArray".replace(/{format}/g,"xml"); - - // query params - var queryParams: Dictionary = new Dictionary(); - var headerParams: Dictionary = new Dictionary(); - - - - - - - - var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, body, headerParams); - - var requestId: String = getUniqueId(); - - token.requestId = requestId; - token.completionEventType = "create_users_with_array_input"; - - token.returnType = null ; - return requestId; - - } - - /* - * Returns void - */ - public function create_users_with_list_input (body: Array): String { - // create path and map variables - var path: String = "/user/createWithList".replace(/{format}/g,"xml"); - - // query params - var queryParams: Dictionary = new Dictionary(); - var headerParams: Dictionary = new Dictionary(); - - - - - - - - var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, body, headerParams); - - var requestId: String = getUniqueId(); - - token.requestId = requestId; - token.completionEventType = "create_users_with_list_input"; - - token.returnType = null ; - return requestId; - - } - - /* - * Returns String - */ - public function login_user (username: String, password: String): String { - // create path and map variables - var path: String = "/user/login".replace(/{format}/g,"xml"); - - // query params - var queryParams: Dictionary = new Dictionary(); - var headerParams: Dictionary = new Dictionary(); - - - - if("null" != String(username)) - queryParams["username"] = toPathValue(username); - if("null" != String(password)) - queryParams["password"] = toPathValue(password); - - - - - var token:AsyncToken = getApiInvoker().invokeAPI(path, "GET", queryParams, null, headerParams); - - var requestId: String = getUniqueId(); - - token.requestId = requestId; - token.completionEventType = "login_user"; - - token.returnType = String; - return requestId; - - } - - /* - * Returns void - */ - public function logout_user (): String { - // create path and map variables - var path: String = "/user/logout".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 = "logout_user"; - - token.returnType = null ; - return requestId; - - } - - /* - * Returns User - */ - public function get_user_by_name (username: String): String { - // create path and map variables - var path: String = "/user/{username}".replace(/{format}/g,"xml").replace("{" + "username" + "}", getApiInvoker().escapeString(username)); - - // 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_user_by_name"; - - token.returnType = User; - return requestId; - - } - - /* - * Returns void - */ - public function update_user (username: String, body: User): String { - // create path and map variables - var path: String = "/user/{username}".replace(/{format}/g,"xml").replace("{" + "username" + "}", getApiInvoker().escapeString(username)); - - // query params - var queryParams: Dictionary = new Dictionary(); - var headerParams: Dictionary = new Dictionary(); - - - - - - - - var token:AsyncToken = getApiInvoker().invokeAPI(path, "PUT", queryParams, body, headerParams); - - var requestId: String = getUniqueId(); - - token.requestId = requestId; - token.completionEventType = "update_user"; - - token.returnType = null ; - return requestId; - - } - - /* - * Returns void - */ - public function delete_user (username: String): String { - // create path and map variables - var path: String = "/user/{username}".replace(/{format}/g,"xml").replace("{" + "username" + "}", getApiInvoker().escapeString(username)); - - // query params - var queryParams: Dictionary = new Dictionary(); - var headerParams: Dictionary = new Dictionary(); - - - - - - - - var token:AsyncToken = getApiInvoker().invokeAPI(path, "DELETE", queryParams, null, headerParams); - - var requestId: String = getUniqueId(); - - token.requestId = requestId; - token.completionEventType = "delete_user"; - - token.returnType = null ; - return requestId; - - } - -} - -} diff --git a/samples/client/petstore/flash/src/main/flex/io/swagger/client/model/Category.as b/samples/client/petstore/flash/src/main/flex/io/swagger/client/model/Category.as deleted file mode 100644 index 6aa73414387..00000000000 --- a/samples/client/petstore/flash/src/main/flex/io/swagger/client/model/Category.as +++ /dev/null @@ -1,32 +0,0 @@ -package io.swagger.client.model { - - - [XmlRootNode(name="Category")] - public class Category { - - - - [XmlElement(name="id")] - - public var id: Number = 0; - - - - [XmlElement(name="name")] - - public var name: String = null; - - - public function toString(): String { - var str: String = "Category: "; - - str += " (id: " + id + ")"; - - str += " (name: " + name + ")"; - - return str; - } - -} - -} diff --git a/samples/client/petstore/flash/src/main/flex/io/swagger/client/model/Order.as b/samples/client/petstore/flash/src/main/flex/io/swagger/client/model/Order.as deleted file mode 100644 index d6e4e6dc4d7..00000000000 --- a/samples/client/petstore/flash/src/main/flex/io/swagger/client/model/Order.as +++ /dev/null @@ -1,65 +0,0 @@ -package io.swagger.client.model { - - - [XmlRootNode(name="Order")] - public class Order { - - - - [XmlElement(name="id")] - - public var id: Number = 0; - - - - [XmlElement(name="petId")] - - public var petId: Number = 0; - - - - [XmlElement(name="quantity")] - - public var quantity: Number = 0; - - - - [XmlElement(name="shipDate")] - - public var shipDate: Date = null; - - /* Order Status */ - - - [XmlElement(name="status")] - - public var status: String = null; - - - - [XmlElement(name="complete")] - - public var complete: Boolean = false; - - - public function toString(): String { - var str: String = "Order: "; - - str += " (id: " + id + ")"; - - str += " (petId: " + petId + ")"; - - str += " (quantity: " + quantity + ")"; - - str += " (shipDate: " + shipDate + ")"; - - str += " (status: " + status + ")"; - - str += " (complete: " + complete + ")"; - - return str; - } - -} - -} diff --git a/samples/client/petstore/flash/src/main/flex/io/swagger/client/model/OrderList.as b/samples/client/petstore/flash/src/main/flex/io/swagger/client/model/OrderList.as deleted file mode 100644 index bba3d8a4724..00000000000 --- a/samples/client/petstore/flash/src/main/flex/io/swagger/client/model/OrderList.as +++ /dev/null @@ -1,18 +0,0 @@ -package io.swagger.client.model { - -import io.swagger.common.ListWrapper; - - public class OrderList implements ListWrapper { - // This declaration below of _Order_obj_class is to force flash compiler to include this class - private var _order_obj_class: io.swagger.client.model.Order = null; - [XmlElements(name="order", type="io.swagger.client.model.Order")] - public var order: Array = new Array(); - - public function getList(): Array{ - return order; - } - -} - - -} diff --git a/samples/client/petstore/flash/src/main/flex/io/swagger/client/model/Pet.as b/samples/client/petstore/flash/src/main/flex/io/swagger/client/model/Pet.as deleted file mode 100644 index 81b29d91e4c..00000000000 --- a/samples/client/petstore/flash/src/main/flex/io/swagger/client/model/Pet.as +++ /dev/null @@ -1,75 +0,0 @@ -package io.swagger.client.model { - -import io.swagger.client.model.Category; -import io.swagger.client.model.Tag; - - [XmlRootNode(name="Pet")] - public class Pet { - - - - [XmlElement(name="id")] - - public var id: Number = 0; - - - - [XmlElement(name="category")] - - public var category: Category = null; - - - - [XmlElement(name="name")] - - public var name: String = null; - - - - // This declaration below of _photoUrls_obj_class is to force flash compiler to include this class - private var _photoUrls_obj_class: Array = null; - [XmlElementWrapper(name="photoUrls")] - [XmlElements(name="photoUrls", type="Array")] - - - public var photoUrls: Array = new Array(); - - - - // This declaration below of _tags_obj_class is to force flash compiler to include this class - private var _tags_obj_class: Array = null; - [XmlElementWrapper(name="tags")] - [XmlElements(name="tags", type="Array")] - - - public var tags: Array = new Array(); - - /* pet status in the store */ - - - [XmlElement(name="status")] - - public var status: String = null; - - - public function toString(): String { - var str: String = "Pet: "; - - str += " (id: " + id + ")"; - - str += " (category: " + category + ")"; - - str += " (name: " + name + ")"; - - str += " (photoUrls: " + photoUrls + ")"; - - str += " (tags: " + tags + ")"; - - str += " (status: " + status + ")"; - - return str; - } - -} - -} diff --git a/samples/client/petstore/flash/src/main/flex/io/swagger/client/model/PetList.as b/samples/client/petstore/flash/src/main/flex/io/swagger/client/model/PetList.as deleted file mode 100644 index ada0846c5ea..00000000000 --- a/samples/client/petstore/flash/src/main/flex/io/swagger/client/model/PetList.as +++ /dev/null @@ -1,20 +0,0 @@ -package io.swagger.client.model { - -import io.swagger.common.ListWrapper; -import io.swagger.client.model.Category; -import io.swagger.client.model.Tag; - - public class PetList implements ListWrapper { - // This declaration below of _Pet_obj_class is to force flash compiler to include this class - private var _pet_obj_class: io.swagger.client.model.Pet = null; - [XmlElements(name="pet", type="io.swagger.client.model.Pet")] - public var pet: Array = new Array(); - - public function getList(): Array{ - return pet; - } - -} - - -} diff --git a/samples/client/petstore/flash/src/main/flex/io/swagger/client/model/Tag.as b/samples/client/petstore/flash/src/main/flex/io/swagger/client/model/Tag.as deleted file mode 100644 index 7387e2e2745..00000000000 --- a/samples/client/petstore/flash/src/main/flex/io/swagger/client/model/Tag.as +++ /dev/null @@ -1,32 +0,0 @@ -package io.swagger.client.model { - - - [XmlRootNode(name="Tag")] - public class Tag { - - - - [XmlElement(name="id")] - - public var id: Number = 0; - - - - [XmlElement(name="name")] - - public var name: String = null; - - - public function toString(): String { - var str: String = "Tag: "; - - str += " (id: " + id + ")"; - - str += " (name: " + name + ")"; - - return str; - } - -} - -} diff --git a/samples/client/petstore/flash/src/main/flex/io/swagger/client/model/User.as b/samples/client/petstore/flash/src/main/flex/io/swagger/client/model/User.as deleted file mode 100644 index 2b6474de90c..00000000000 --- a/samples/client/petstore/flash/src/main/flex/io/swagger/client/model/User.as +++ /dev/null @@ -1,81 +0,0 @@ -package io.swagger.client.model { - - - [XmlRootNode(name="User")] - public class User { - - - - [XmlElement(name="id")] - - public var id: Number = 0; - - - - [XmlElement(name="username")] - - public var username: String = null; - - - - [XmlElement(name="firstName")] - - public var firstName: String = null; - - - - [XmlElement(name="lastName")] - - public var lastName: String = null; - - - - [XmlElement(name="email")] - - public var email: String = null; - - - - [XmlElement(name="password")] - - public var password: String = null; - - - - [XmlElement(name="phone")] - - public var phone: String = null; - - /* User Status */ - - - [XmlElement(name="userStatus")] - - public var userStatus: Number = 0; - - - public function toString(): String { - var str: String = "User: "; - - str += " (id: " + id + ")"; - - str += " (username: " + username + ")"; - - str += " (firstName: " + firstName + ")"; - - str += " (lastName: " + lastName + ")"; - - str += " (email: " + email + ")"; - - str += " (password: " + password + ")"; - - str += " (phone: " + phone + ")"; - - str += " (userStatus: " + userStatus + ")"; - - return str; - } - -} - -} diff --git a/samples/client/petstore/flash/src/main/flex/io/swagger/client/model/UserList.as b/samples/client/petstore/flash/src/main/flex/io/swagger/client/model/UserList.as deleted file mode 100644 index e8a1fdb27f6..00000000000 --- a/samples/client/petstore/flash/src/main/flex/io/swagger/client/model/UserList.as +++ /dev/null @@ -1,18 +0,0 @@ -package io.swagger.client.model { - -import io.swagger.common.ListWrapper; - - public class UserList implements ListWrapper { - // This declaration below of _User_obj_class is to force flash compiler to include this class - private var _user_obj_class: io.swagger.client.model.User = null; - [XmlElements(name="user", type="io.swagger.client.model.User")] - public var user: Array = new Array(); - - public function getList(): Array{ - return user; - } - -} - - -} diff --git a/samples/client/petstore/flash/src/main/flex/io/swagger/swagger/common/ApiInvoker.as b/samples/client/petstore/flash/src/main/flex/io/swagger/swagger/common/ApiInvoker.as deleted file mode 100644 index 98d94052ec4..00000000000 --- a/samples/client/petstore/flash/src/main/flex/io/swagger/swagger/common/ApiInvoker.as +++ /dev/null @@ -1,255 +0,0 @@ -package io.swagger.common { -import io.swagger.event.ApiClientEvent; -import io.swagger.event.Response; - -public class ApiInvoker extends EventDispatcher { - - private static const DELETE_DATA_DUMMY:String = "dummyDataRequiredForDeleteOverride"; - private static const X_HTTP_OVERRIDE_KEY:String = "X-HTTP-Method-Override"; - private static const CONTENT_TYPE_HEADER_KEY:String = "Content-Type"; - - public function ApiInvoker(apiUsageCredentials:ApiUserCredentials, eventNotifier:EventDispatcher, useProxy:Boolean = true) { - _apiUsageCredentials = apiUsageCredentials; - _useProxyServer = useProxy; - if (_apiUsageCredentials.hostName != null) { - _proxyHostName = _apiUsageCredentials.hostName; - } - _apiPath = _apiUsageCredentials.apiPath; - _proxyPath = _apiUsageCredentials.proxyPath; - _apiProxyServerUrl = _apiUsageCredentials.apiProxyServerUrl; - _apiEventNotifier = eventNotifier; - } - public var _apiEventNotifier:EventDispatcher; - internal var _apiProxyServerUrl:String = ""; - internal var _useProxyServer:Boolean = true; - private var _apiUsageCredentials:ApiUserCredentials; - private var _baseUrl:String = ""; - private var _proxyHostName:String = ""; - private var _apiPath:String = ""; - private var _proxyPath:String = ""; - - public function invokeAPI(resourceURL:String, method:String, queryParams:Dictionary, postObject:Object, headerParams:Dictionary):AsyncToken { - //make the communication - if (_useProxyServer) { - resourceURL = _apiProxyServerUrl + resourceURL; - } - else { - resourceURL = "http://" + _proxyHostName + _apiPath + resourceURL; - } - - var counter:int = 0; - var symbol:String = "&"; - var paramValue:Object; - for (var paramName:String in queryParams) { - paramValue = queryParams[paramName]; - //var key:String = paramName; - // do stuff - symbol = "&"; - if (counter == 0) { - symbol = "?"; - } - resourceURL = resourceURL + symbol + paramName + "=" + paramValue.toString(); - counter++; - - } -// trace(resourceURL); - //create a httpservice and invoke the rest url waiting for response - var requestHeader:Object = new Object(); - if (headerParams != null) { - for (var key:String in headerParams) { - requestHeader[key] = headerParams[key]; - } - } - - resourceURL = ApiUrlHelper.appendTokenInfo(resourceURL, requestHeader, _apiUsageCredentials); - - var bodyData:String = marshal(postObject).toString();//restRequest.postData; - - return doRestCall(resourceURL, onApiRequestResult, onApiRequestFault, method, bodyData, requestHeader, "application/xml"); - - - } - - public function marshal(source:Object):Object { -// trace("marshal got - " + source) - if (source is String) { - return source; - } else if (source is Array && source.length > 0) { - var writer:XMLWriter = new XMLWriter(); - var sourceArray:Array = source as Array; - var arrayEnclosure:String = getArrayEnclosure(sourceArray); - writer.xml.setName(arrayEnclosure); - - for (var i:int = 0; i < sourceArray.length; i++) { - var o:Object = sourceArray[i]; - writer.xml.appendChild(marshal(o)); - } - return writer.xml; - } else - return marshalObject(source); - } - - public function marshalObject(source:Object):XML { - var writer:XMLWriter = new XMLWriter(); - var objDescriptor:XML = describeType(source); - var property:XML; - var propertyType:String; - var propertyValue:Object; - - var qualifiedClassName:String = objDescriptor.@name; - qualifiedClassName = qualifiedClassName.replace("::", "."); - var className:String = qualifiedClassName.substring(qualifiedClassName.lastIndexOf(".") + 1); - className = className().toLowerCase() + className.substring(1); - writer.xml.setName(className); - - for each(property in objDescriptor.elements("variable")) { - propertyValue = source[property.@name]; - if (propertyValue != null) { - if (ObjectUtil.isSimple(propertyValue)) { - writer.addProperty(property.@name, propertyValue.toString()); - } - else { - writer.addProperty(property.@name, marshal(propertyValue).toXMLString()); - } - } - } - for each(property in objDescriptor.elements("accessor")) { - if (property.@access == "readonly") { - continue; - } - propertyValue = source[property.@name]; - if (source[property.@name] != null) { - if (ObjectUtil.isSimple(propertyValue)) { - writer.addProperty(property.@name, propertyValue.toString()); - } - else { - writer.addProperty(property.@name, marshal(propertyValue).toXMLString()); - } - } - } - return writer.xml; - } - - public function escapeString(str:String):String { - return str; - } - - private function doRestCall(url:String, resultFunction:Function, faultFunction:Function = null, - restMethod:String = "GET", - bodyData:Object = null, headers:Object = null, contentType:String = "application/xml"):AsyncToken { - var httpService:HTTPService = new HTTPService(); - - if (headers == null) { - headers = new Object(); - } - httpService.method = restMethod; - - if (restMethod.toUpperCase() != HTTPRequestMessage.GET_METHOD) { - //httpService.method = HTTPRequestMessage.POST_METHOD; - not required as we're using the proxy - if (bodyData == null) { - bodyData = new Object(); - } - - if (restMethod == HTTPRequestMessage.DELETE_METHOD) { - headers[X_HTTP_OVERRIDE_KEY] = HTTPRequestMessage.DELETE_METHOD; - bodyData = DELETE_DATA_DUMMY; - } - else if (restMethod == HTTPRequestMessage.PUT_METHOD) { - headers[X_HTTP_OVERRIDE_KEY] = HTTPRequestMessage.PUT_METHOD; - } - else { - headers[CONTENT_TYPE_HEADER_KEY] = contentType; - } - } - else { - //if the request type is GET and content type is xml then the Flex HTTPService converts it to a POST ... yeah - contentType = null; - } - - httpService.url = url; - httpService.contentType = contentType; - httpService.resultFormat = "e4x"; - httpService.headers = headers; - httpService.addEventListener(ResultEvent.RESULT, resultFunction); - if (faultFunction != null) { - httpService.addEventListener(FaultEvent.FAULT, faultFunction); - } - if (_useProxyServer) { - httpService.useProxy = true; - - var channelSet:ChannelSet = new ChannelSet(); - var httpChannel:HTTPChannel = new HTTPChannel(); - httpChannel.uri = ApiUrlHelper.getProxyUrl(_proxyHostName, _proxyPath); - channelSet.addChannel(httpChannel); - httpService.channelSet = channelSet; - } - - return httpService.send(bodyData); - } - - private function onApiRequestResult(event:ResultEvent):void { - var completionListener:Function = event.token.completionListener; - var result:Object = event.result; - var resultType:Class = event.token.returnType; - var resultObject:Object; - if (resultType != null) { - var context:ASAXBContext = ASAXBContext.newInstance(resultType); - var unmarshaller:Unmarshaller = context.createUnmarshaller(); - var resultXML:XML = new XML(event.result); - try { - resultObject = unmarshaller.unmarshal(resultXML); - } - catch (error:TypeError) { - var errorResponse:Response = new Response(false, null, "Could not unmarshall response"); - if (_apiEventNotifier != null) { //dispatch event via assigned dispatcher - var failureEvent:ApiClientEvent = new ApiClientEvent(event.token.completionEventType); - failureEvent.response = errorResponse; - _apiEventNotifier.dispatchEvent(failureEvent); - } - } - - if (resultObject is ListWrapper) { - resultObject = ListWrapper(resultObject).getList(); - } - } - - var response:Response = new Response(true, resultObject); - response.requestId = event.token.requestId; - var successEventType:String = event.token.completionEventType != null ? event.token.completionEventType : ApiClientEvent.SUCCESS_EVENT; - - if (_apiEventNotifier != null) { //dispatch event via assigned dispatcher - var successEvent:ApiClientEvent = new ApiClientEvent(successEventType); - successEvent.response = response; - _apiEventNotifier.dispatchEvent(successEvent); - } - } - - private function onApiRequestFault(event:FaultEvent):void { - var completionListener:Function = event.token.completionListener; - if (completionListener != null) { - completionListener.call(null, new Response(false, null, event.fault.faultString)); - } - - var failureEventType:String = event.token.completionEventType != null ? event.token.completionEventType : ApiClientEvent.FAILURE_EVENT; - - if (_apiEventNotifier != null) { //dispatch event via assigned dispatcher - var failureEvent:ApiClientEvent = new ApiClientEvent(failureEventType); - failureEvent.response = new Response(false, null, event.fault.faultString); - _apiEventNotifier.dispatchEvent(failureEvent); - } - } - - private function getArrayEnclosure(arr:Array):String { - if (arr != null && arr.length > 0) { - var className:String = flash.utils.getQualifiedClassName(arr[0]) - if (className.indexOf("::") > 0) - className = className.substr(className.indexOf("::") + 2, className.length) - - return className.substring(0, 1).toLowerCase() + className.substring(1, className.length) + "s"; - } else - return ""; - } - - -} -} \ No newline at end of file diff --git a/samples/client/petstore/flash/src/main/flex/io/swagger/swagger/common/ApiUrlHelper.as b/samples/client/petstore/flash/src/main/flex/io/swagger/swagger/common/ApiUrlHelper.as deleted file mode 100644 index 4333c6c7e4c..00000000000 --- a/samples/client/petstore/flash/src/main/flex/io/swagger/swagger/common/ApiUrlHelper.as +++ /dev/null @@ -1,41 +0,0 @@ -package io.swagger.common { -import io.swagger.common.ApiUserCredentials; - -/** - * @private - * Internal class for the Rest client - */ -internal class ApiUrlHelper { - - private static const API_URL_KEY:String = "api_key"; - private static const AUTH_TOKEN_URL_KEY:String = "auth_token"; - - private static const HTTP_URL_PREFIX:String = "http://"; - - internal static function appendTokenInfo(restUrl:String, requestHeader: Object, credentials: ApiUserCredentials): String { - //checks for the presence api credentials on client initialization and not repeated here - if(restUrl.indexOf("?") == -1){ - restUrl += ( "?" + API_URL_KEY + "=" + credentials.apiToken ); - } - else{ - restUrl += ( "&" + API_URL_KEY + "=" + credentials.apiToken ); - } - requestHeader.api_key = credentials.apiToken; - - if(credentials.authToken != null && credentials.authToken != ""){ - restUrl += ( "&" + AUTH_TOKEN_URL_KEY + "=" + credentials.authToken ); - requestHeader.auth_token = credentials.authToken; - } - - return restUrl; - } - - internal static function getProxyUrl(hostName: String, proxyPath: String): String{ - if (hostName(hostName.length - 1) == "/") //remove trailing slash - { - hostName = hostName.substring(0, hostName.length - 1); - } - return HTTP_URL_PREFIX + hostName + proxyPath; - } -} -} diff --git a/samples/client/petstore/flash/src/main/flex/io/swagger/swagger/common/ListWrapper.as b/samples/client/petstore/flash/src/main/flex/io/swagger/swagger/common/ListWrapper.as deleted file mode 100644 index b22890ad1d1..00000000000 --- a/samples/client/petstore/flash/src/main/flex/io/swagger/swagger/common/ListWrapper.as +++ /dev/null @@ -1,9 +0,0 @@ -package io.swagger.common -{ - public interface ListWrapper - { - - function getList(): Array; - - } -} \ No newline at end of file diff --git a/samples/client/petstore/flash/src/main/flex/io/swagger/swagger/common/XMLWriter.as b/samples/client/petstore/flash/src/main/flex/io/swagger/swagger/common/XMLWriter.as deleted file mode 100644 index 0b08066775b..00000000000 --- a/samples/client/petstore/flash/src/main/flex/io/swagger/swagger/common/XMLWriter.as +++ /dev/null @@ -1,28 +0,0 @@ -package io.swagger.common -{ - public class XMLWriter - { - public var xml:XML; - - public function XMLWriter() - { - xml=; - } - - public function reset():void { - xml=new XML(); - } - - public function addProperty(propertyName:String, propertyValue:String):XML { - var xmlProperty:XML= - xmlProperty.setName(propertyName); - xmlProperty.appendChild(propertyValue); - xml.appendChild(xmlProperty); - return xmlProperty; - } - - public function addAttribute(propertyName:String, attribute:String, attributeValue:String):void { - xml.elements(propertyName)[0].@[attribute]=attributeValue; - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/flash/src/main/flex/io/swagger/swagger/event/ApiClientEvent.as b/samples/client/petstore/flash/src/main/flex/io/swagger/swagger/event/ApiClientEvent.as deleted file mode 100644 index d64cd304d49..00000000000 --- a/samples/client/petstore/flash/src/main/flex/io/swagger/swagger/event/ApiClientEvent.as +++ /dev/null @@ -1,36 +0,0 @@ -package io.swagger.event { -import io.swagger.event.Response; - -import flash.events.Event; - -/** - * Event dispatched by the SDK to communicate success events and failure events. - * If a custom dispatcher has been assigned by the consumer on the generated client then the dispatcher dispatches - * the ApiClientEvent to indicate success or failure of the invocation using the Response - */ -public class ApiClientEvent extends Event{ - - /** - * Event type to indicate a unsuccessful invocation - */ - public static const FAILURE_EVENT:String = "unsuccesfulInvocation"; - - /** - * Event type to indicate a successful invocation - */ - public static const SUCCESS_EVENT:String = "successfulInvocation"; - - /** - * The Response object which contains response info - */ - public var response: Response; - /** - * Any additional info - */ - public var message:String; - - public function ApiClientEvent(type:String,bubbles:Boolean = false,cancelable:Boolean = false) { - super(type, bubbles, cancelable); - } -} -} \ No newline at end of file diff --git a/samples/client/petstore/flash/src/main/flex/io/swagger/swagger/event/Response.as b/samples/client/petstore/flash/src/main/flex/io/swagger/swagger/event/Response.as deleted file mode 100644 index d19dd0ae358..00000000000 --- a/samples/client/petstore/flash/src/main/flex/io/swagger/swagger/event/Response.as +++ /dev/null @@ -1,56 +0,0 @@ -package io.swagger.event { - -/** - * Response contains info on the result of an API invocation. - * A completion listener will expect this Response object. - */ -public class Response { - - /** - * Indicates whether the invoked operation failed or succeeded - */ - public var isSuccess:Boolean; - - /** - * The payload of the successful operation eg. a Word in a WordRequest - */ - public var payload:Object; - - /** - * Error message in case of failure - */ - public var errorMessage:String; - - /** - * A request Id that was passed in by the user as a param when invoking the operation - */ - public var requestId:String; - private static const API_ERROR_MSG:String = "Api error response: "; - - public function Response(isSuccessful: Boolean, payload: Object = null, errorMessage: String = null, requestId: String = null) { - this.isSuccess = isSuccessful; - this.payload = payload; - this.errorMessage = getFriendlyMessage(errorMessage); - } - - private static function getFriendlyMessage(errorMessage: String): String{ - var result: String = errorMessage; - if(errorMessage == null) - return null; - var errorCode: String; - var errorCodeArray: Array = errorMessage.match(/(?<=HTTP\/1.1 )[0-9][0-9][0-9]/); - if(errorCodeArray != null && errorCodeArray.length == 1){ - errorCode = String(errorCodeArray[0]); - } - var msgArray: Array = errorMessage.match(/(?<=HTTP\/1.1 [0-9][0-9][0-9] )[^]*/); - if(msgArray != null && msgArray.length == 1){ - result = API_ERROR_MSG + String(msgArray[0]); - } - return result; - } - - public function toString(): String { - return "Response (requestId:" + requestId + "; isSuccess:" + isSuccess + "; errorMessage:" + errorMessage + "; payload:" + payload + ")"; - } -} -} \ No newline at end of file diff --git a/samples/client/petstore/flash/src/main/flex/io/swagger/swagger/exception/ApiErrors.as b/samples/client/petstore/flash/src/main/flex/io/swagger/swagger/exception/ApiErrors.as deleted file mode 100644 index c8ac95a5c59..00000000000 --- a/samples/client/petstore/flash/src/main/flex/io/swagger/swagger/exception/ApiErrors.as +++ /dev/null @@ -1,10 +0,0 @@ -package io.swagger.exception -{ - public class ApiError extends Error - { - public function ApiError(id:*=0, message:*="") - { - super(message,id); - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/flash/src/main/flex/lib/ASAXB-0.1.1.swc b/samples/client/petstore/flash/src/main/flex/lib/ASAXB-0.1.1.swc deleted file mode 100644 index c9359026784..00000000000 Binary files a/samples/client/petstore/flash/src/main/flex/lib/ASAXB-0.1.1.swc and /dev/null differ diff --git a/samples/client/petstore/flash/src/main/flex/lib/as3corelib.swc b/samples/client/petstore/flash/src/main/flex/lib/as3corelib.swc deleted file mode 100644 index 12dd6b3b0a6..00000000000 Binary files a/samples/client/petstore/flash/src/main/flex/lib/as3corelib.swc and /dev/null differ diff --git a/samples/client/petstore/flash/src/main/flex/lib/ext/flexunit-4.1.0_RC2-28-flex_3.5.0.12683.swc b/samples/client/petstore/flash/src/main/flex/lib/ext/flexunit-4.1.0_RC2-28-flex_3.5.0.12683.swc deleted file mode 100644 index e41bc68abd9..00000000000 Binary files a/samples/client/petstore/flash/src/main/flex/lib/ext/flexunit-4.1.0_RC2-28-flex_3.5.0.12683.swc and /dev/null differ diff --git a/samples/client/petstore/flash/src/main/flex/lib/ext/flexunit-aircilistener-4.1.0_RC2-28-3.5.0.12683.swc b/samples/client/petstore/flash/src/main/flex/lib/ext/flexunit-aircilistener-4.1.0_RC2-28-3.5.0.12683.swc deleted file mode 100644 index 8bbdf8b86a0..00000000000 Binary files a/samples/client/petstore/flash/src/main/flex/lib/ext/flexunit-aircilistener-4.1.0_RC2-28-3.5.0.12683.swc and /dev/null differ diff --git a/samples/client/petstore/flash/src/main/flex/lib/ext/flexunit-cilistener-4.1.0_RC2-28-3.5.0.12683.swc b/samples/client/petstore/flash/src/main/flex/lib/ext/flexunit-cilistener-4.1.0_RC2-28-3.5.0.12683.swc deleted file mode 100644 index b69064ac765..00000000000 Binary files a/samples/client/petstore/flash/src/main/flex/lib/ext/flexunit-cilistener-4.1.0_RC2-28-3.5.0.12683.swc and /dev/null differ diff --git a/samples/client/petstore/flash/src/main/flex/lib/ext/flexunit-core-flex-4.0.0.2-sdk3.5.0.12683.swc b/samples/client/petstore/flash/src/main/flex/lib/ext/flexunit-core-flex-4.0.0.2-sdk3.5.0.12683.swc deleted file mode 100644 index a90af750bb5..00000000000 Binary files a/samples/client/petstore/flash/src/main/flex/lib/ext/flexunit-core-flex-4.0.0.2-sdk3.5.0.12683.swc and /dev/null differ