diff --git a/modules/openapi-generator/src/main/resources/flash/.gitignore b/modules/openapi-generator/src/main/resources/flash/.gitignore deleted file mode 100644 index f112f7fb78f..00000000000 --- a/modules/openapi-generator/src/main/resources/flash/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -# Build and Release Folders -bin/ -bin-debug/ -bin-release/ - -# Other files and folders -.settings/ - -# Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties` -# should NOT be excluded as they contain compiler settings and other important -# information for Eclipse / Flash Builder. diff --git a/modules/openapi-generator/src/main/resources/flash/ASAXB-0.1.1.swc b/modules/openapi-generator/src/main/resources/flash/ASAXB-0.1.1.swc deleted file mode 100644 index c9359026784..00000000000 Binary files a/modules/openapi-generator/src/main/resources/flash/ASAXB-0.1.1.swc and /dev/null differ diff --git a/modules/openapi-generator/src/main/resources/flash/AirExecutorApp-app.xml b/modules/openapi-generator/src/main/resources/flash/AirExecutorApp-app.xml deleted file mode 100644 index 1dbaf98e644..00000000000 --- a/modules/openapi-generator/src/main/resources/flash/AirExecutorApp-app.xml +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - - AirExecutorApp - - - AirExecutorApp - - - AirExecutorApp - - - v1 - - - - - - - - - - - - - - - AirExecutorApp.swf - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/modules/openapi-generator/src/main/resources/flash/ApiClientEvent.as b/modules/openapi-generator/src/main/resources/flash/ApiClientEvent.as deleted file mode 100644 index abb0fe121fb..00000000000 --- a/modules/openapi-generator/src/main/resources/flash/ApiClientEvent.as +++ /dev/null @@ -1,36 +0,0 @@ -package org.openapitools.event { -import org.openapitools.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 an 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); - } -} -} diff --git a/modules/openapi-generator/src/main/resources/flash/ApiError.as b/modules/openapi-generator/src/main/resources/flash/ApiError.as deleted file mode 100644 index 0e8e09b484a..00000000000 --- a/modules/openapi-generator/src/main/resources/flash/ApiError.as +++ /dev/null @@ -1,10 +0,0 @@ -package org.openapitools.exception -{ - public class ApiError extends Error - { - public function ApiError(id:*=0, message:*="") - { - super(message,id); - } - } -} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/flash/ApiErrorCodes.as b/modules/openapi-generator/src/main/resources/flash/ApiErrorCodes.as deleted file mode 100644 index 4bc6b36cedf..00000000000 --- a/modules/openapi-generator/src/main/resources/flash/ApiErrorCodes.as +++ /dev/null @@ -1,34 +0,0 @@ -package org.openapitools.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/modules/openapi-generator/src/main/resources/flash/ApiInvoker.as b/modules/openapi-generator/src/main/resources/flash/ApiInvoker.as deleted file mode 100644 index cdf23b64276..00000000000 --- a/modules/openapi-generator/src/main/resources/flash/ApiInvoker.as +++ /dev/null @@ -1,276 +0,0 @@ -package org.openapitools.common { -import org.openapitools.event.ApiClientEvent; -import org.openapitools.event.Response; - -import flash.events.EventDispatcher; -import flash.utils.*; -import mx.rpc.AsyncToken; -import mx.rpc.events.ResultEvent; -import mx.rpc.events.FaultEvent; -import mx.utils.ObjectUtil; -import mx.rpc.http.HTTPService; -import mx.messaging.messages.HTTPRequestMessage; -import mx.messaging.ChannelSet; -import mx.messaging.channels.DirectHTTPChannel; -import asaxb.xml.bind.ASAXBContext; -import asaxb.xml.bind.Unmarshaller; - -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:DirectHTTPChannel = new DirectHTTPChannel(""); - httpChannel.uri = ApiUrlHelper.getProxyUrl(_proxyHostName, _proxyPath); - channelSet.addChannel(httpChannel); - httpService.channelSet = channelSet; - } - - return httpService.send(bodyData); - } - - private function onApiRequestResult(event:ResultEvent):void { - - // I put this in comments. Here, it's trying to parse XML and it fails if it's not XML. - // Therefore, it's better to have the raw result that we can parse as we want. - // TODO: Create different parser (JSON, XML, etc.) - /* - 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); - */ - - var response:Response = new Response(true, event.result); - 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 ""; - } - - -} -} diff --git a/modules/openapi-generator/src/main/resources/flash/ApiUrlHelper.as b/modules/openapi-generator/src/main/resources/flash/ApiUrlHelper.as deleted file mode 100644 index f07e8e6dfeb..00000000000 --- a/modules/openapi-generator/src/main/resources/flash/ApiUrlHelper.as +++ /dev/null @@ -1,41 +0,0 @@ -package org.openapitools.common { -import org.openapitools.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..charAt(hostName.length) == "/") //remove trailing slash - { - hostName = hostName.substring(0, hostName.length - 1); - } - return HTTP_URL_PREFIX + hostName + proxyPath; - } -} -} diff --git a/modules/openapi-generator/src/main/resources/flash/ApiUserCredentials.as b/modules/openapi-generator/src/main/resources/flash/ApiUserCredentials.as deleted file mode 100644 index 2a955438a26..00000000000 --- a/modules/openapi-generator/src/main/resources/flash/ApiUserCredentials.as +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapitools.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/modules/openapi-generator/src/main/resources/flash/ListWrapper.as b/modules/openapi-generator/src/main/resources/flash/ListWrapper.as deleted file mode 100644 index e6d79d5625a..00000000000 --- a/modules/openapi-generator/src/main/resources/flash/ListWrapper.as +++ /dev/null @@ -1,9 +0,0 @@ -package org.openapitools.common -{ - public interface ListWrapper - { - - function getList(): Array; - - } -} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/flash/OpenApi.as b/modules/openapi-generator/src/main/resources/flash/OpenApi.as deleted file mode 100644 index e632efa5335..00000000000 --- a/modules/openapi-generator/src/main/resources/flash/OpenApi.as +++ /dev/null @@ -1,75 +0,0 @@ -package org.openapitools.common -{ - import org.openapitools.common.ApiUserCredentials; - - import flash.events.EventDispatcher; - import flash.events.IEventDispatcher; - - import mx.utils.UIDUtil; - - public class OpenApi 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 OpenApi(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/modules/openapi-generator/src/main/resources/flash/README.txt b/modules/openapi-generator/src/main/resources/flash/README.txt deleted file mode 100644 index 3d60608475d..00000000000 --- a/modules/openapi-generator/src/main/resources/flash/README.txt +++ /dev/null @@ -1,65 +0,0 @@ -README for the Flash application. - -These instructions are given using the version 4.7 of Flash Builder. - -How to use the Flash client library: - -The code which is given to you is to be considered as a Library. Therefore, in Flash Builder, you have to: -1. Create an ActionScript Library Project. (Warning: If you are dealing with Files as parameter, you need to include the Adobe AIR libraries) -2. Copy the src folder from the flash library to the project. -3. Copy the lib folder. -4. Copy the build.properties and build.xml. (You can update the paths in build.properties) -5. Right+Click on the project folder and go to Properties. Then go to the tab 'ActionScript Library Build Path' and add these two SWC: 'as3corelib.swc' and 'ASAXB-0.1.1.swc'. (They are located in the folder lib) -6. Create the Flash Application - -How to use the Flash client library in an application: - -Using the Flash client library (especially getting the response message from the server) is a bit tricky. - -The response message is given through an EventDispatcher. Therefore, you have to create an EventDispatcher and listen to the endpoints that you're calling. Below, you will find a pseudo-code explaining how to do this. - -After creating an application in java, you will have a mxml file. In this mxml file, you need to declare a Script (given below) after the Declarations. - - - - diff --git a/modules/openapi-generator/src/main/resources/flash/Response.as b/modules/openapi-generator/src/main/resources/flash/Response.as deleted file mode 100644 index 333fca9874c..00000000000 --- a/modules/openapi-generator/src/main/resources/flash/Response.as +++ /dev/null @@ -1,56 +0,0 @@ -package org.openapitools.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/modules/openapi-generator/src/main/resources/flash/XMLWriter.as b/modules/openapi-generator/src/main/resources/flash/XMLWriter.as deleted file mode 100644 index 8f87484841c..00000000000 --- a/modules/openapi-generator/src/main/resources/flash/XMLWriter.as +++ /dev/null @@ -1,27 +0,0 @@ -package org.openapitools.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/modules/openapi-generator/src/main/resources/flash/api.mustache b/modules/openapi-generator/src/main/resources/flash/api.mustache deleted file mode 100644 index 9bce67a5595..00000000000 --- a/modules/openapi-generator/src/main/resources/flash/api.mustache +++ /dev/null @@ -1,73 +0,0 @@ -package {{package}} { - -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}} - -import mx.rpc.AsyncToken; -import mx.utils.UIDUtil; -import flash.utils.Dictionary; -import flash.events.EventDispatcher; - -{{#operations}} -public class {{classname}} extends OpenApi { - /** - * Constructor for the {{classname}} 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 {{classname}}(apiCredentials: ApiUserCredentials, eventDispatcher: EventDispatcher = null) { - super(apiCredentials, eventDispatcher); - } - -{{#operation}} - public static const event_{{nickname}}: String = "{{nickname}}"; -{{/operation}} - -{{#operation}} - - /* - * Returns {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}} - */ - public function {{nickname}} ({{#allParams}}{{paramName}}: {{{dataType}}}{{^-last}}, {{/-last}}{{/allParams}}): String { - // create path and map variables - var path: String = "{{{path}}}".replace(/{format}/g,"xml"){{#pathParams}}.replace("{" + "{{baseName}}" + "}", getApiInvoker().escapeString({{{paramName}}})){{/pathParams}}; - - // query params - var queryParams: Dictionary = new Dictionary(); - var headerParams: Dictionary = new Dictionary(); - - {{#allParams}} - // verify required params are set - if({{/allParams}}{{#required}} {{paramName}} == null {{^-last}}|| {{/-last}}{{/required}}{{#allParams}}) { - throw new ApiError(400, "missing required params"); - } - {{/allParams}} - - {{#queryParams}}if("null" != String({{paramName}})) - queryParams["{{baseName}}"] = toPathValue({{paramName}}); - {{/queryParams}} - - {{#headerParams}}headerParams["{{baseName}}"] = toPathValue({{paramName}}); - {{/headerParams}} - - var token:AsyncToken = getApiInvoker().invokeAPI(path, "{{httpMethod}}", queryParams, {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}, headerParams); - - var requestId: String = getUniqueId(); - - token.requestId = requestId; - token.completionEventType = "{{nickname}}"; - - token.returnType = {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}null {{/returnType}}; - return requestId; - - } - {{/operation}} -} - {{/operations}} -} diff --git a/modules/openapi-generator/src/main/resources/flash/as3corelib.swc b/modules/openapi-generator/src/main/resources/flash/as3corelib.swc deleted file mode 100644 index 12dd6b3b0a6..00000000000 Binary files a/modules/openapi-generator/src/main/resources/flash/as3corelib.swc and /dev/null differ diff --git a/modules/openapi-generator/src/main/resources/flash/build.properties b/modules/openapi-generator/src/main/resources/flash/build.properties deleted file mode 100644 index 356f112b144..00000000000 --- a/modules/openapi-generator/src/main/resources/flash/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/modules/openapi-generator/src/main/resources/flash/build.xml b/modules/openapi-generator/src/main/resources/flash/build.xml deleted file mode 100644 index dedf7e03008..00000000000 --- a/modules/openapi-generator/src/main/resources/flash/build.xml +++ /dev/null @@ -1,192 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - docs created - - - - - - - - - - - - - - - - - - - - - - - - SWC created - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - - - - - - - - - - diff --git a/modules/openapi-generator/src/main/resources/flash/facetValue.as b/modules/openapi-generator/src/main/resources/flash/facetValue.as deleted file mode 100644 index 428f63c0ee1..00000000000 --- a/modules/openapi-generator/src/main/resources/flash/facetValue.as +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.client.model { - - public class FacetValue { - public var value: String = null; - public var count: Number = 0; - } - -} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/flash/flexunit-4.1.0_RC2-28-flex_3.5.0.12683.swc b/modules/openapi-generator/src/main/resources/flash/flexunit-4.1.0_RC2-28-flex_3.5.0.12683.swc deleted file mode 100644 index e41bc68abd9..00000000000 Binary files a/modules/openapi-generator/src/main/resources/flash/flexunit-4.1.0_RC2-28-flex_3.5.0.12683.swc and /dev/null differ diff --git a/modules/openapi-generator/src/main/resources/flash/flexunit-aircilistener-4.1.0_RC2-28-3.5.0.12683.swc b/modules/openapi-generator/src/main/resources/flash/flexunit-aircilistener-4.1.0_RC2-28-3.5.0.12683.swc deleted file mode 100644 index 8bbdf8b86a0..00000000000 Binary files a/modules/openapi-generator/src/main/resources/flash/flexunit-aircilistener-4.1.0_RC2-28-3.5.0.12683.swc and /dev/null differ diff --git a/modules/openapi-generator/src/main/resources/flash/flexunit-cilistener-4.1.0_RC2-28-3.5.0.12683.swc b/modules/openapi-generator/src/main/resources/flash/flexunit-cilistener-4.1.0_RC2-28-3.5.0.12683.swc deleted file mode 100644 index b69064ac765..00000000000 Binary files a/modules/openapi-generator/src/main/resources/flash/flexunit-cilistener-4.1.0_RC2-28-3.5.0.12683.swc and /dev/null differ diff --git a/modules/openapi-generator/src/main/resources/flash/flexunit-core-flex-4.0.0.2-sdk3.5.0.12683.swc b/modules/openapi-generator/src/main/resources/flash/flexunit-core-flex-4.0.0.2-sdk3.5.0.12683.swc deleted file mode 100644 index a90af750bb5..00000000000 Binary files a/modules/openapi-generator/src/main/resources/flash/flexunit-core-flex-4.0.0.2-sdk3.5.0.12683.swc and /dev/null differ diff --git a/modules/openapi-generator/src/main/resources/flash/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/flash/git_push.sh.mustache deleted file mode 100755 index 8b3f689c912..00000000000 --- a/modules/openapi-generator/src/main/resources/flash/git_push.sh.mustache +++ /dev/null @@ -1,58 +0,0 @@ -#!/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 openapi-pestore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="{{{gitHost}}}" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="{{{gitUserId}}}" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="{{{gitRepoId}}}" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="{{{releaseNote}}}" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/flash/gitignore.mustache b/modules/openapi-generator/src/main/resources/flash/gitignore.mustache deleted file mode 100644 index f112f7fb78f..00000000000 --- a/modules/openapi-generator/src/main/resources/flash/gitignore.mustache +++ /dev/null @@ -1,11 +0,0 @@ -# Build and Release Folders -bin/ -bin-debug/ -bin-release/ - -# Other files and folders -.settings/ - -# Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties` -# should NOT be excluded as they contain compiler settings and other important -# information for Eclipse / Flash Builder. diff --git a/modules/openapi-generator/src/main/resources/flash/model.mustache b/modules/openapi-generator/src/main/resources/flash/model.mustache deleted file mode 100644 index 337418cfaac..00000000000 --- a/modules/openapi-generator/src/main/resources/flash/model.mustache +++ /dev/null @@ -1,36 +0,0 @@ -package {{package}} { - -{{#imports}}import {{import}}; -{{/imports}} - -{{#models}} -{{#model}} - [XmlRootNode(name="{{classname}}")] - public class {{classname}} { - {{#vars}} - {{#description}}/* {{description}} */ - {{/description}} - {{#isContainer}} - // This declaration below of _{{name}}_obj_class is to force flash compiler to include this class - private var _{{name}}_obj_class: {{baseType}} = null; - [XmlElementWrapper(name="{{baseName}}")] - [XmlElements(name="{{name}}", type="{{baseType}}")] - {{/isContainer}} - {{^isContainer}}[XmlElement(name="{{baseName}}")] - {{/isContainer}} - public var {{name}}: {{{dataType}}} = {{{defaultValue}}}; - {{/vars}} - - public function toString(): String { - var str: String = "{{classname}}: "; - {{#vars}} - str += " ({{name}}: " + {{name}} + ")"; - {{/vars}} - return str; - } - -} -{{/model}} -{{/models}} - -} diff --git a/modules/openapi-generator/src/main/resources/flash/modelList.mustache b/modules/openapi-generator/src/main/resources/flash/modelList.mustache deleted file mode 100644 index becb7dde2de..00000000000 --- a/modules/openapi-generator/src/main/resources/flash/modelList.mustache +++ /dev/null @@ -1,23 +0,0 @@ -package {{package}} { - -import org.openapitools.common.ListWrapper; -{{#imports}}import {{import}}; -{{/imports}} - -{{#models}} -{{#model}} - public class {{classname}}List implements ListWrapper { - // This declaration below of _{{name}}_obj_class is to force flash compiler to include this class - private var _{{classVarName}}_obj_class: {{package}}.{{classname}} = null; - [XmlElements(name="{{classVarName}}", type="{{package}}.{{classname}}")] - public var {{classVarName}}: Array = new Array(); - - public function getList(): Array{ - return {{classVarName}}; - } - -} -{{/model}} - {{/models}} - -}