/**
         * Invokes the given method specified in the API request object.
         *
         * @param request APIRequest object containing method name and parameters.
         * @return APIResponse with status code, message and JSON response or a JSON null string for void functions. Status code 200 is OK, all others are HTTP standard error conditions.
         */
        public new APIResponse Invoke(APIRequest request)
        {
            APIResponse response        = new APIResponse();
            int         responseCode    = 200;
            String      responseMessage = "OK";
            String      responseJSON    = "null";

            switch (request.GetMethodName())
            {
            case "addNetworkStatusListener":
                INetworkStatusListener listener0 = new NetworkStatusListenerImpl(request.GetAsyncId());
                this.AddNetworkStatusListener(listener0);
                break;

            case "removeNetworkStatusListener":
                INetworkStatusListener listener1 = new NetworkStatusListenerImpl(request.GetAsyncId());
                this.RemoveNetworkStatusListener(listener1);
                break;

            case "removeNetworkStatusListeners":
                this.RemoveNetworkStatusListeners();
                break;

            default:
                // 404 - response null.
                responseCode    = 404;
                responseMessage = "NetworkStatusBridge does not provide the function '" + request.GetMethodName() + "' Please check your client-side API version; should be API version >= v2.2.15.";
                break;
            }
            response.SetResponse(responseJSON);
            response.SetStatusCode(responseCode);
            response.SetStatusMessage(responseMessage);
            return(response);
        }
Exemple #2
0
        /**
         * Invokes the given method specified in the API request object.
         *
         * @param request APIRequest object containing method name and parameters.
         * @return APIResponse with status code, message and JSON response or a JSON null string for void functions. Status code 200 is OK, all others are HTTP standard error conditions.
         */
        public new APIResponse Invoke(APIRequest request)
        {
            APIResponse response        = new APIResponse();
            int         responseCode    = 200;
            String      responseMessage = "OK";
            String      responseJSON    = "null";

            switch (request.GetMethodName())
            {
            case "sendEmail":
                Email data0 = GetJSONProcessor().DeserializeObject <Email>(request.GetParameters()[0]);
                IMessagingCallback callback0 = new MessagingCallbackImpl(request.GetAsyncId());
                this.SendEmail(data0, callback0);
                break;

            default:
                // 404 - response null.
                responseCode    = 404;
                responseMessage = "MailBridge does not provide the function '" + request.GetMethodName() + "' Please check your client-side API version; should be API version >= v2.2.15.";
                break;
            }
            response.SetResponse(responseJSON);
            response.SetStatusCode(responseCode);
            response.SetStatusMessage(responseMessage);
            return(response);
        }
        /**
         * Invokes the given method specified in the API request object.
         *
         * @param request APIRequest object containing method name and parameters.
         * @return APIResponse with status code, message and JSON response or a JSON null string for void functions. Status code 200 is OK, all others are HTTP standard error conditions.
         */
        public new APIResponse Invoke(APIRequest request)
        {
            APIResponse response        = new APIResponse();
            int         responseCode    = 200;
            String      responseMessage = "OK";
            String      responseJSON    = "null";

            switch (request.GetMethodName())
            {
            case "deleteSecureKeyValuePairs":
                string[] keys0                    = GetJSONProcessor().DeserializeObject <string[]>(request.GetParameters()[0]);
                string   publicAccessName0        = GetJSONProcessor().DeserializeObject <string>(request.GetParameters()[1]);
                ISecurityResultCallback callback0 = new SecurityResultCallbackImpl(request.GetAsyncId());
                this.DeleteSecureKeyValuePairs(keys0, publicAccessName0, callback0);
                break;

            case "getSecureKeyValuePairs":
                string[] keys1                    = GetJSONProcessor().DeserializeObject <string[]>(request.GetParameters()[0]);
                string   publicAccessName1        = GetJSONProcessor().DeserializeObject <string>(request.GetParameters()[1]);
                ISecurityResultCallback callback1 = new SecurityResultCallbackImpl(request.GetAsyncId());
                this.GetSecureKeyValuePairs(keys1, publicAccessName1, callback1);
                break;

            case "isDeviceModified":
                bool response2 = this.IsDeviceModified();
                responseJSON = GetJSONProcessor().SerializeObject(response2);
                break;

            case "setSecureKeyValuePairs":
                SecureKeyPair[]         keyValues3        = GetJSONProcessor().DeserializeObject <SecureKeyPair[]>(request.GetParameters()[0]);
                string                  publicAccessName3 = GetJSONProcessor().DeserializeObject <string>(request.GetParameters()[1]);
                ISecurityResultCallback callback3         = new SecurityResultCallbackImpl(request.GetAsyncId());
                this.SetSecureKeyValuePairs(keyValues3, publicAccessName3, callback3);
                break;

            default:
                // 404 - response null.
                responseCode    = 404;
                responseMessage = "SecurityBridge does not provide the function '" + request.GetMethodName() + "' Please check your client-side API version; should be API version >= v2.2.15.";
                break;
            }
            response.SetResponse(responseJSON);
            response.SetStatusCode(responseCode);
            response.SetStatusMessage(responseMessage);
            return(response);
        }
Exemple #4
0
        /**
         * Invokes the given method specified in the API request object.
         *
         * @param request APIRequest object containing method name and parameters.
         * @return APIResponse with status code, message and JSON response or a JSON null string for void functions. Status code 200 is OK, all others are HTTP standard error conditions.
         */
        public new APIResponse Invoke(APIRequest request)
        {
            APIResponse response        = new APIResponse();
            int         responseCode    = 200;
            String      responseMessage = "OK";
            String      responseJSON    = "null";

            switch (request.GetMethodName())
            {
            case "addLifecycleListener":
                ILifecycleListener listener0 = new LifecycleListenerImpl(request.GetAsyncId());
                this.AddLifecycleListener(listener0);
                break;

            case "isBackground":
                bool response1 = this.IsBackground();
                responseJSON = GetJSONProcessor().SerializeObject(response1);
                break;

            case "removeLifecycleListener":
                ILifecycleListener listener2 = new LifecycleListenerImpl(request.GetAsyncId());
                this.RemoveLifecycleListener(listener2);
                break;

            case "removeLifecycleListeners":
                this.RemoveLifecycleListeners();
                break;

            default:
                // 404 - response null.
                responseCode    = 404;
                responseMessage = "LifecycleBridge does not provide the function '" + request.GetMethodName() + "' Please check your client-side API version; should be API version >= v2.2.15.";
                break;
            }
            response.SetResponse(responseJSON);
            response.SetStatusCode(responseCode);
            response.SetStatusMessage(responseMessage);
            return(response);
        }
Exemple #5
0
        /**
         * Invokes the given method specified in the API request object.
         *
         * @param request APIRequest object containing method name and parameters.
         * @return APIResponse with status code, message and JSON response or a JSON null string for void functions. Status code 200 is OK, all others are HTTP standard error conditions.
         */
        public new APIResponse Invoke(APIRequest request)
        {
            APIResponse response        = new APIResponse();
            int         responseCode    = 200;
            String      responseMessage = "OK";
            String      responseJSON    = "null";

            switch (request.GetMethodName())
            {
            case "addButtonListener":
                IButtonListener listener0 = new ButtonListenerImpl(request.GetAsyncId());
                this.AddButtonListener(listener0);
                break;

            case "addDeviceOrientationListener":
                IDeviceOrientationListener listener1 = new DeviceOrientationListenerImpl(request.GetAsyncId());
                this.AddDeviceOrientationListener(listener1);
                break;

            case "getDeviceInfo":
                DeviceInfo response2 = this.GetDeviceInfo();
                if (response2 != null)
                {
                    responseJSON = GetJSONProcessor().SerializeObject(response2);
                }
                break;

            case "getLocaleCurrent":
                Locale response3 = this.GetLocaleCurrent();
                if (response3 != null)
                {
                    responseJSON = GetJSONProcessor().SerializeObject(response3);
                }
                break;

            case "getOrientationCurrent":
                ICapabilitiesOrientation response4 = this.GetOrientationCurrent();
                responseJSON = GetJSONProcessor().SerializeObject(response4);
                break;

            case "removeButtonListener":
                IButtonListener listener5 = new ButtonListenerImpl(request.GetAsyncId());
                this.RemoveButtonListener(listener5);
                break;

            case "removeButtonListeners":
                this.RemoveButtonListeners();
                break;

            case "removeDeviceOrientationListener":
                IDeviceOrientationListener listener7 = new DeviceOrientationListenerImpl(request.GetAsyncId());
                this.RemoveDeviceOrientationListener(listener7);
                break;

            case "removeDeviceOrientationListeners":
                this.RemoveDeviceOrientationListeners();
                break;

            default:
                // 404 - response null.
                responseCode    = 404;
                responseMessage = "DeviceBridge does not provide the function '" + request.GetMethodName() + "' Please check your client-side API version; should be API version >= v2.2.15.";
                break;
            }
            response.SetResponse(responseJSON);
            response.SetStatusCode(responseCode);
            response.SetStatusMessage(responseMessage);
            return(response);
        }
        /**
         * Invokes the given method specified in the API request object.
         *
         * @param request APIRequest object containing method name and parameters.
         * @return APIResponse with status code, message and JSON response or a JSON null string for void functions. Status code 200 is OK, all others are HTTP standard error conditions.
         */
        public new APIResponse Invoke(APIRequest request)
        {
            APIResponse response        = new APIResponse();
            int         responseCode    = 200;
            String      responseMessage = "OK";
            String      responseJSON    = "null";

            switch (request.GetMethodName())
            {
            case "isNetworkReachable":
                string host0 = GetJSONProcessor().DeserializeObject <string>(request.GetParameters()[0]);
                INetworkReachabilityCallback callback0 = new NetworkReachabilityCallbackImpl(request.GetAsyncId());
                this.IsNetworkReachable(host0, callback0);
                break;

            case "isNetworkServiceReachable":
                string url1 = GetJSONProcessor().DeserializeObject <string>(request.GetParameters()[0]);
                INetworkReachabilityCallback callback1 = new NetworkReachabilityCallbackImpl(request.GetAsyncId());
                this.IsNetworkServiceReachable(url1, callback1);
                break;

            default:
                // 404 - response null.
                responseCode    = 404;
                responseMessage = "NetworkReachabilityBridge does not provide the function '" + request.GetMethodName() + "' Please check your client-side API version; should be API version >= v2.2.15.";
                break;
            }
            response.SetResponse(responseJSON);
            response.SetStatusCode(responseCode);
            response.SetStatusMessage(responseMessage);
            return(response);
        }
        /**
         * Invokes the given method specified in the API request object.
         *
         * @param request APIRequest object containing method name and parameters.
         * @return APIResponse with status code, message and JSON response or a JSON null string for void functions. Status code 200 is OK, all others are HTTP standard error conditions.
         */
        public new APIResponse Invoke(APIRequest request)
        {
            APIResponse response        = new APIResponse();
            int         responseCode    = 200;
            String      responseMessage = "OK";
            String      responseJSON    = "null";

            switch (request.GetMethodName())
            {
            case "canRead":
                FileDescriptor descriptor0 = GetJSONProcessor().DeserializeObject <FileDescriptor>(request.GetParameters()[0]);
                bool           response0   = this.CanRead(descriptor0);
                responseJSON = GetJSONProcessor().SerializeObject(response0);
                break;

            case "canWrite":
                FileDescriptor descriptor1 = GetJSONProcessor().DeserializeObject <FileDescriptor>(request.GetParameters()[0]);
                bool           response1   = this.CanWrite(descriptor1);
                responseJSON = GetJSONProcessor().SerializeObject(response1);
                break;

            case "create":
                FileDescriptor      descriptor2 = GetJSONProcessor().DeserializeObject <FileDescriptor>(request.GetParameters()[0]);
                IFileResultCallback callback2   = new FileResultCallbackImpl(request.GetAsyncId());
                this.Create(descriptor2, callback2);
                break;

            case "delete":
                FileDescriptor descriptor3 = GetJSONProcessor().DeserializeObject <FileDescriptor>(request.GetParameters()[0]);
                bool           cascade3    = GetJSONProcessor().DeserializeObject <bool>(request.GetParameters()[1]);
                bool           response3   = this.Delete(descriptor3, cascade3);
                responseJSON = GetJSONProcessor().SerializeObject(response3);
                break;

            case "exists":
                FileDescriptor descriptor4 = GetJSONProcessor().DeserializeObject <FileDescriptor>(request.GetParameters()[0]);
                bool           response4   = this.Exists(descriptor4);
                responseJSON = GetJSONProcessor().SerializeObject(response4);
                break;

            case "getContent":
                FileDescriptor descriptor5            = GetJSONProcessor().DeserializeObject <FileDescriptor>(request.GetParameters()[0]);
                IFileDataLoadResultCallback callback5 = new FileDataLoadResultCallbackImpl(request.GetAsyncId());
                this.GetContent(descriptor5, callback5);
                break;

            case "getFileStorageType":
                FileDescriptor         descriptor6 = GetJSONProcessor().DeserializeObject <FileDescriptor>(request.GetParameters()[0]);
                IFileSystemStorageType response6   = this.GetFileStorageType(descriptor6);
                responseJSON = GetJSONProcessor().SerializeObject(response6);
                break;

            case "getFileType":
                FileDescriptor  descriptor7 = GetJSONProcessor().DeserializeObject <FileDescriptor>(request.GetParameters()[0]);
                IFileSystemType response7   = this.GetFileType(descriptor7);
                responseJSON = GetJSONProcessor().SerializeObject(response7);
                break;

            case "getSecurityType":
                FileDescriptor      descriptor8 = GetJSONProcessor().DeserializeObject <FileDescriptor>(request.GetParameters()[0]);
                IFileSystemSecurity response8   = this.GetSecurityType(descriptor8);
                responseJSON = GetJSONProcessor().SerializeObject(response8);
                break;

            case "isDirectory":
                FileDescriptor descriptor9 = GetJSONProcessor().DeserializeObject <FileDescriptor>(request.GetParameters()[0]);
                bool           response9   = this.IsDirectory(descriptor9);
                responseJSON = GetJSONProcessor().SerializeObject(response9);
                break;

            case "listFiles":
                FileDescriptor          descriptor10 = GetJSONProcessor().DeserializeObject <FileDescriptor>(request.GetParameters()[0]);
                IFileListResultCallback callback10   = new FileListResultCallbackImpl(request.GetAsyncId());
                this.ListFiles(descriptor10, callback10);
                break;

            case "listFilesForRegex":
                FileDescriptor          descriptor11 = GetJSONProcessor().DeserializeObject <FileDescriptor>(request.GetParameters()[0]);
                string                  regex11      = GetJSONProcessor().DeserializeObject <string>(request.GetParameters()[1]);
                IFileListResultCallback callback11   = new FileListResultCallbackImpl(request.GetAsyncId());
                this.ListFilesForRegex(descriptor11, regex11, callback11);
                break;

            case "mkDir":
                FileDescriptor descriptor12 = GetJSONProcessor().DeserializeObject <FileDescriptor>(request.GetParameters()[0]);
                bool           recursive12  = GetJSONProcessor().DeserializeObject <bool>(request.GetParameters()[1]);
                bool           response12   = this.MkDir(descriptor12, recursive12);
                responseJSON = GetJSONProcessor().SerializeObject(response12);
                break;

            case "move":
                FileDescriptor      source13      = GetJSONProcessor().DeserializeObject <FileDescriptor>(request.GetParameters()[0]);
                FileDescriptor      destination13 = GetJSONProcessor().DeserializeObject <FileDescriptor>(request.GetParameters()[1]);
                bool                createPath13  = GetJSONProcessor().DeserializeObject <bool>(request.GetParameters()[2]);
                bool                overwrite13   = GetJSONProcessor().DeserializeObject <bool>(request.GetParameters()[3]);
                IFileResultCallback callback13    = new FileResultCallbackImpl(request.GetAsyncId());
                this.Move(source13, destination13, createPath13, overwrite13, callback13);
                break;

            case "setContent":
                FileDescriptor descriptor14             = GetJSONProcessor().DeserializeObject <FileDescriptor>(request.GetParameters()[0]);
                byte[]         content14                = GetJSONProcessor().DeserializeObject <byte[]>(request.GetParameters()[1]);
                IFileDataStoreResultCallback callback14 = new FileDataStoreResultCallbackImpl(request.GetAsyncId());
                this.SetContent(descriptor14, content14, callback14);
                break;

            default:
                // 404 - response null.
                responseCode    = 404;
                responseMessage = "FileBridge does not provide the function '" + request.GetMethodName() + "' Please check your client-side API version; should be API version >= v2.2.15.";
                break;
            }
            response.SetResponse(responseJSON);
            response.SetStatusCode(responseCode);
            response.SetStatusMessage(responseMessage);
            return(response);
        }
        /**
         * Invokes the given method specified in the API request object.
         *
         * @param request APIRequest object containing method name and parameters.
         * @return APIResponse with status code, message and JSON response or a JSON null string for void functions. Status code 200 is OK, all others are HTTP standard error conditions.
         */
        public new APIResponse Invoke(APIRequest request)
        {
            APIResponse response        = new APIResponse();
            int         responseCode    = 200;
            String      responseMessage = "OK";
            String      responseJSON    = "null";

            switch (request.GetMethodName())
            {
            case "getServiceRequest":
                ServiceToken   serviceToken0 = GetJSONProcessor().DeserializeObject <ServiceToken>(request.GetParameters()[0]);
                ServiceRequest response0     = this.GetServiceRequest(serviceToken0);
                if (response0 != null)
                {
                    responseJSON = GetJSONProcessor().SerializeObject(response0);
                }
                break;

            case "getServiceToken":
                string         serviceName1  = GetJSONProcessor().DeserializeObject <string>(request.GetParameters()[0]);
                string         endpointName1 = GetJSONProcessor().DeserializeObject <string>(request.GetParameters()[1]);
                string         functionName1 = GetJSONProcessor().DeserializeObject <string>(request.GetParameters()[2]);
                IServiceMethod method1       = GetJSONProcessor().DeserializeObject <IServiceMethod>(request.GetParameters()[3]);
                ServiceToken   response1     = this.GetServiceToken(serviceName1, endpointName1, functionName1, method1);
                if (response1 != null)
                {
                    responseJSON = GetJSONProcessor().SerializeObject(response1);
                }
                break;

            case "getServiceTokenByUri":
                string       uri2      = GetJSONProcessor().DeserializeObject <string>(request.GetParameters()[0]);
                ServiceToken response2 = this.GetServiceTokenByUri(uri2);
                if (response2 != null)
                {
                    responseJSON = GetJSONProcessor().SerializeObject(response2);
                }
                break;

            case "getServicesRegistered":
                ServiceToken[] response3 = this.GetServicesRegistered();
                if (response3 != null)
                {
                    responseJSON = GetJSONProcessor().SerializeObject(response3);
                }
                break;

            case "invokeService":
                ServiceRequest         serviceRequest4 = GetJSONProcessor().DeserializeObject <ServiceRequest>(request.GetParameters()[0]);
                IServiceResultCallback callback4       = new ServiceResultCallbackImpl(request.GetAsyncId());
                this.InvokeService(serviceRequest4, callback4);
                break;

            case "isServiceRegistered":
                string         serviceName5  = GetJSONProcessor().DeserializeObject <string>(request.GetParameters()[0]);
                string         endpointName5 = GetJSONProcessor().DeserializeObject <string>(request.GetParameters()[1]);
                string         functionName5 = GetJSONProcessor().DeserializeObject <string>(request.GetParameters()[2]);
                IServiceMethod method5       = GetJSONProcessor().DeserializeObject <IServiceMethod>(request.GetParameters()[3]);
                bool           response5     = this.IsServiceRegistered(serviceName5, endpointName5, functionName5, method5);
                responseJSON = GetJSONProcessor().SerializeObject(response5);
                break;

            default:
                // 404 - response null.
                responseCode    = 404;
                responseMessage = "ServiceBridge does not provide the function '" + request.GetMethodName() + "' Please check your client-side API version; should be API version >= v2.2.15.";
                break;
            }
            response.SetResponse(responseJSON);
            response.SetStatusCode(responseCode);
            response.SetStatusMessage(responseMessage);
            return(response);
        }
Exemple #9
0
        /**
         * Invokes the given method specified in the API request object.
         *
         * @param request APIRequest object containing method name and parameters.
         * @return APIResponse with status code, message and JSON response or a JSON null string for void functions. Status code 200 is OK, all others are HTTP standard error conditions.
         */
        public new APIResponse Invoke(APIRequest request)
        {
            APIResponse response        = new APIResponse();
            int         responseCode    = 200;
            String      responseMessage = "OK";
            String      responseJSON    = "null";

            switch (request.GetMethodName())
            {
            case "addDisplayOrientationListener":
                IDisplayOrientationListener listener0 = new DisplayOrientationListenerImpl(request.GetAsyncId());
                this.AddDisplayOrientationListener(listener0);
                break;

            case "getOrientationCurrent":
                ICapabilitiesOrientation response1 = this.GetOrientationCurrent();
                responseJSON = GetJSONProcessor().SerializeObject(response1);
                break;

            case "removeDisplayOrientationListener":
                IDisplayOrientationListener listener2 = new DisplayOrientationListenerImpl(request.GetAsyncId());
                this.RemoveDisplayOrientationListener(listener2);
                break;

            case "removeDisplayOrientationListeners":
                this.RemoveDisplayOrientationListeners();
                break;

            default:
                // 404 - response null.
                responseCode    = 404;
                responseMessage = "DisplayBridge does not provide the function '" + request.GetMethodName() + "' Please check your client-side API version; should be API version >= v2.2.15.";
                break;
            }
            response.SetResponse(responseJSON);
            response.SetStatusCode(responseCode);
            response.SetStatusMessage(responseMessage);
            return(response);
        }
        /**
         * Invokes the given method specified in the API request object.
         *
         * @param request APIRequest object containing method name and parameters.
         * @return APIResponse with status code, message and JSON response or a JSON null string for void functions. Status code 200 is OK, all others are HTTP standard error conditions.
         */
        public new APIResponse Invoke(APIRequest request)
        {
            APIResponse response        = new APIResponse();
            int         responseCode    = 200;
            String      responseMessage = "OK";
            String      responseJSON    = "null";

            switch (request.GetMethodName())
            {
            case "createDatabase":
                Database database0 = GetJSONProcessor().DeserializeObject <Database>(request.GetParameters()[0]);
                IDatabaseResultCallback callback0 = new DatabaseResultCallbackImpl(request.GetAsyncId());
                this.CreateDatabase(database0, callback0);
                break;

            case "createTable":
                Database      database1                = GetJSONProcessor().DeserializeObject <Database>(request.GetParameters()[0]);
                DatabaseTable databaseTable1           = GetJSONProcessor().DeserializeObject <DatabaseTable>(request.GetParameters()[1]);
                IDatabaseTableResultCallback callback1 = new DatabaseTableResultCallbackImpl(request.GetAsyncId());
                this.CreateTable(database1, databaseTable1, callback1);
                break;

            case "deleteDatabase":
                Database database2 = GetJSONProcessor().DeserializeObject <Database>(request.GetParameters()[0]);
                IDatabaseResultCallback callback2 = new DatabaseResultCallbackImpl(request.GetAsyncId());
                this.DeleteDatabase(database2, callback2);
                break;

            case "deleteTable":
                Database      database3                = GetJSONProcessor().DeserializeObject <Database>(request.GetParameters()[0]);
                DatabaseTable databaseTable3           = GetJSONProcessor().DeserializeObject <DatabaseTable>(request.GetParameters()[1]);
                IDatabaseTableResultCallback callback3 = new DatabaseTableResultCallbackImpl(request.GetAsyncId());
                this.DeleteTable(database3, databaseTable3, callback3);
                break;

            case "executeSqlStatement":
                Database database4     = GetJSONProcessor().DeserializeObject <Database>(request.GetParameters()[0]);
                string   statement4    = GetJSONProcessor().DeserializeObject <string>(request.GetParameters()[1]);
                string[] replacements4 = GetJSONProcessor().DeserializeObject <string[]>(request.GetParameters()[2]);
                IDatabaseTableResultCallback callback4 = new DatabaseTableResultCallbackImpl(request.GetAsyncId());
                this.ExecuteSqlStatement(database4, statement4, replacements4, callback4);
                break;

            case "executeSqlTransactions":
                Database database5     = GetJSONProcessor().DeserializeObject <Database>(request.GetParameters()[0]);
                string[] statements5   = GetJSONProcessor().DeserializeObject <string[]>(request.GetParameters()[1]);
                bool     rollbackFlag5 = GetJSONProcessor().DeserializeObject <bool>(request.GetParameters()[2]);
                IDatabaseTableResultCallback callback5 = new DatabaseTableResultCallbackImpl(request.GetAsyncId());
                this.ExecuteSqlTransactions(database5, statements5, rollbackFlag5, callback5);
                break;

            case "existsDatabase":
                Database database6 = GetJSONProcessor().DeserializeObject <Database>(request.GetParameters()[0]);
                bool     response6 = this.ExistsDatabase(database6);
                responseJSON = GetJSONProcessor().SerializeObject(response6);
                break;

            case "existsTable":
                Database      database7      = GetJSONProcessor().DeserializeObject <Database>(request.GetParameters()[0]);
                DatabaseTable databaseTable7 = GetJSONProcessor().DeserializeObject <DatabaseTable>(request.GetParameters()[1]);
                bool          response7      = this.ExistsTable(database7, databaseTable7);
                responseJSON = GetJSONProcessor().SerializeObject(response7);
                break;

            default:
                // 404 - response null.
                responseCode    = 404;
                responseMessage = "DatabaseBridge does not provide the function '" + request.GetMethodName() + "' Please check your client-side API version; should be API version >= v2.2.15.";
                break;
            }
            response.SetResponse(responseJSON);
            response.SetStatusCode(responseCode);
            response.SetStatusMessage(responseMessage);
            return(response);
        }
        /**
         * Invokes the given method specified in the API request object.
         *
         * @param request APIRequest object containing method name and parameters.
         * @return APIResponse with status code, message and JSON response or a JSON null string for void functions. Status code 200 is OK, all others are HTTP standard error conditions.
         */
        public new APIResponse Invoke(APIRequest request)
        {
            APIResponse response        = new APIResponse();
            int         responseCode    = 200;
            String      responseMessage = "OK";
            String      responseJSON    = "null";

            switch (request.GetMethodName())
            {
            case "getContact":
                ContactUid             contact0  = GetJSONProcessor().DeserializeObject <ContactUid>(request.GetParameters()[0]);
                IContactResultCallback callback0 = new ContactResultCallbackImpl(request.GetAsyncId());
                this.GetContact(contact0, callback0);
                break;

            case "getContactPhoto":
                ContactUid contact1 = GetJSONProcessor().DeserializeObject <ContactUid>(request.GetParameters()[0]);
                IContactPhotoResultCallback callback1 = new ContactPhotoResultCallbackImpl(request.GetAsyncId());
                this.GetContactPhoto(contact1, callback1);
                break;

            case "getContacts":
                IContactResultCallback callback2 = new ContactResultCallbackImpl(request.GetAsyncId());
                this.GetContacts(callback2);
                break;

            case "getContactsForFields":
                IContactResultCallback callback3 = new ContactResultCallbackImpl(request.GetAsyncId());
                IContactFieldGroup[]   fields3   = GetJSONProcessor().DeserializeObject <IContactFieldGroup[]>(request.GetParameters()[1]);
                this.GetContactsForFields(callback3, fields3);
                break;

            case "getContactsWithFilter":
                IContactResultCallback callback4 = new ContactResultCallbackImpl(request.GetAsyncId());
                IContactFieldGroup[]   fields4   = GetJSONProcessor().DeserializeObject <IContactFieldGroup[]>(request.GetParameters()[1]);
                IContactFilter[]       filter4   = GetJSONProcessor().DeserializeObject <IContactFilter[]>(request.GetParameters()[2]);
                this.GetContactsWithFilter(callback4, fields4, filter4);
                break;

            case "searchContacts":
                string term5 = GetJSONProcessor().DeserializeObject <string>(request.GetParameters()[0]);
                IContactResultCallback callback5 = new ContactResultCallbackImpl(request.GetAsyncId());
                this.SearchContacts(term5, callback5);
                break;

            case "searchContactsWithFilter":
                string term6 = GetJSONProcessor().DeserializeObject <string>(request.GetParameters()[0]);
                IContactResultCallback callback6 = new ContactResultCallbackImpl(request.GetAsyncId());
                IContactFilter[]       filter6   = GetJSONProcessor().DeserializeObject <IContactFilter[]>(request.GetParameters()[2]);
                this.SearchContactsWithFilter(term6, callback6, filter6);
                break;

            case "setContactPhoto":
                ContactUid contact7  = GetJSONProcessor().DeserializeObject <ContactUid>(request.GetParameters()[0]);
                byte[]     pngImage7 = GetJSONProcessor().DeserializeObject <byte[]>(request.GetParameters()[1]);
                bool       response7 = this.SetContactPhoto(contact7, pngImage7);
                responseJSON = GetJSONProcessor().SerializeObject(response7);
                break;

            default:
                // 404 - response null.
                responseCode    = 404;
                responseMessage = "ContactBridge does not provide the function '" + request.GetMethodName() + "' Please check your client-side API version; should be API version >= v2.2.15.";
                break;
            }
            response.SetResponse(responseJSON);
            response.SetStatusCode(responseCode);
            response.SetStatusMessage(responseMessage);
            return(response);
        }