Пример #1
0
        /// <summary>
        /// Create a new API Key. API Keys can also be created via&lt;a href=&quot;https://github.com/BitMEX/market-maker/blob/master/generate-api-key.py&quot;&gt;this Python script&lt;/a&gt;.
        /// </summary>
        /// <param name="name">Key name. This name is for reference only.</param>
        /// <param name="cidr">CIDR block to restrict this key to. To restrict to a single address, append &quot;/32&quot;, e.g. 207.39.29.22/32. Leave blank or set to 0.0.0.0/0 to allow all IPs. Only one block may be set. &lt;a href=&quot;http://software77.net/cidr-101.html&quot;&gt;More on CIDR blocks&lt;/a&gt;</param>
        /// <param name="enabled">Set to true to enable this key on creation. Otherwise, it must be explicitly enabled via /apiKey/enable.</param>
        /// <returns></returns>
        public ApiKey createKey(string name, string cidr, bool?enabled)
        {
            // create path and map variables
            var path = "/apiKey".Replace("{format}", "json");

            // query params
            var queryParams  = new Dictionary <String, String>();
            var headerParams = new Dictionary <String, String>();
            var formParams   = new Dictionary <String, object>();

            if (name != null)
            {
                if (name is byte[])
                {
                    formParams.Add("name", name);
                }
                else
                {
                    string paramStr = (name is DateTime) ? ((DateTime)(object)name).ToString("u") : Convert.ToString(name);
                    formParams.Add("name", paramStr);
                }
            }
            if (cidr != null)
            {
                if (cidr is byte[])
                {
                    formParams.Add("cidr", cidr);
                }
                else
                {
                    string paramStr = (cidr is DateTime) ? ((DateTime)(object)cidr).ToString("u") : Convert.ToString(cidr);
                    formParams.Add("cidr", paramStr);
                }
            }
            if (enabled != null)
            {
                if (enabled is byte[])
                {
                    formParams.Add("enabled", enabled);
                }
                else
                {
                    string paramStr = (enabled is DateTime) ? ((DateTime)(object)enabled).ToString("u") : Convert.ToString(enabled);
                    formParams.Add("enabled", paramStr);
                }
            }
            try {
                if (typeof(ApiKey) == typeof(byte[]))
                {
                    var response = apiInvoker.invokeBinaryAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
                    return(((object)response) as ApiKey);
                }
                else
                {
                    var response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, null, headerParams, formParams);
                    if (response != null)
                    {
                        return((ApiKey)ApiInvoker.deserialize(response, typeof(ApiKey)));
                    }
                    else
                    {
                        return(null);
                    }
                }
            } catch (ApiException ex) {
                if (ex.ErrorCode == 404)
                {
                    return(null);
                }
                else
                {
                    throw ex;
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Update account The 'password' query parameter is only required when changing the account password
        /// </summary>
        /// <param name="ticket">Session ticket</param>
        /// <param name="password">Current password</param>
        /// <param name="body">Account object</param>
        /// <returns></returns>
        public void putAccount(string ticket, string password, Account body)
        {
            // create path and map variables
            var path = "/v1/accounts/me".Replace("{format}", "json");

            // query params
            var queryParams  = new Dictionary <String, String>();
            var headerParams = new Dictionary <String, String>();
            var formParams   = new Dictionary <String, object>();

            // verify required params are set
            if (body == null)
            {
                throw new ApiException(400, "missing required params");
            }
            if (ticket != null)
            {
                string paramStr = (ticket is DateTime) ? ((DateTime)(object)ticket).ToString("u") : Convert.ToString(ticket);
                queryParams.Add("ticket", paramStr);
            }
            if (password != null)
            {
                string paramStr = (password is DateTime) ? ((DateTime)(object)password).ToString("u") : Convert.ToString(password);
                queryParams.Add("password", paramStr);
            }
            try {
                if (typeof(void) == typeof(byte[]))
                {
                    var response = apiInvoker.invokeBinaryAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
                    return;
                }
                else
                {
                    var response = apiInvoker.invokeAPI(basePath, path, "PUT", queryParams, body, headerParams, formParams);
                    if (response != null)
                    {
                        return;
                    }
                    else
                    {
                        return;
                    }
                }
            } catch (ApiException ex) {
                if (ex.ErrorCode == 404)
                {
                    return;
                }
                else
                {
                    throw ex;
                }
            }
        }
Пример #3
0
        /// <summary>
        /// Generate barcode. Generate barcode.
        /// </summary>
        /// <param name="text"></param>
        /// <param name="type"></param>
        /// <param name="format"></param>
        /// <param name="resolutionX"></param>
        /// <param name="resolutionY"></param>
        /// <param name="dimensionX"></param>
        /// <param name="dimensionY"></param>
        /// <param name="enableChecksum"></param>
        /// <returns></returns>
        public ResponseMessage GetBarcodeGenerate(string text, string type, string format, float?resolutionX, float?resolutionY, float?dimensionX, float?dimensionY, string enableChecksum)
        {
            // create path and map variables
            var ResourcePath = "/barcode/generate/?appSid={appSid}&amp;text={text}&amp;type={type}&amp;toFormat={toFormat}&amp;resolutionX={resolutionX}&amp;resolutionY={resolutionY}&amp;dimensionX={dimensionX}&amp;dimensionY={dimensionY}&amp;enableChecksum={enableChecksum}".Replace("{format}", "json");

            ResourcePath = Regex.Replace(ResourcePath, "\\*", "").Replace("&amp;", "&").Replace("/?", "?").Replace("toFormat={toFormat}", "format={format}");

            // query params
            var queryParams  = new Dictionary <String, String>();
            var headerParams = new Dictionary <String, String>();
            var formParams   = new Dictionary <String, object>();

            if (text == null)
            {
                ResourcePath = Regex.Replace(ResourcePath, @"([&?])text=", "");
            }
            else
            {
                ResourcePath = ResourcePath.Replace("{" + "text" + "}", apiInvoker.ToPathValue(text));
            }
            if (type == null)
            {
                ResourcePath = Regex.Replace(ResourcePath, @"([&?])type=", "");
            }
            else
            {
                ResourcePath = ResourcePath.Replace("{" + "type" + "}", apiInvoker.ToPathValue(type));
            }
            if (format == null)
            {
                ResourcePath = Regex.Replace(ResourcePath, @"([&?])format=", "");
            }
            else
            {
                ResourcePath = ResourcePath.Replace("{" + "format" + "}", apiInvoker.ToPathValue(format));
            }
            if (resolutionX == null)
            {
                ResourcePath = Regex.Replace(ResourcePath, @"([&?])resolutionX=", "");
            }
            else
            {
                ResourcePath = ResourcePath.Replace("{" + "resolutionX" + "}", apiInvoker.ToPathValue(resolutionX));
            }
            if (resolutionY == null)
            {
                ResourcePath = Regex.Replace(ResourcePath, @"([&?])resolutionY=", "");
            }
            else
            {
                ResourcePath = ResourcePath.Replace("{" + "resolutionY" + "}", apiInvoker.ToPathValue(resolutionY));
            }
            if (dimensionX == null)
            {
                ResourcePath = Regex.Replace(ResourcePath, @"([&?])dimensionX=", "");
            }
            else
            {
                ResourcePath = ResourcePath.Replace("{" + "dimensionX" + "}", apiInvoker.ToPathValue(dimensionX));
            }
            if (dimensionY == null)
            {
                ResourcePath = Regex.Replace(ResourcePath, @"([&?])dimensionY=", "");
            }
            else
            {
                ResourcePath = ResourcePath.Replace("{" + "dimensionY" + "}", apiInvoker.ToPathValue(dimensionY));
            }
            if (enableChecksum == null)
            {
                ResourcePath = Regex.Replace(ResourcePath, @"([&?])enableChecksum=", "");
            }
            else
            {
                ResourcePath = ResourcePath.Replace("{" + "enableChecksum" + "}", apiInvoker.ToPathValue(enableChecksum));
            }
            try {
                if (typeof(ResponseMessage) == typeof(ResponseMessage))
                {
                    var response = apiInvoker.invokeBinaryAPI(basePath, ResourcePath, "GET", queryParams, null, headerParams, formParams);
                    return((ResponseMessage)ApiInvoker.deserialize(response, typeof(ResponseMessage)));
                }
                else
                {
                    var response = apiInvoker.invokeAPI(basePath, ResourcePath, "GET", queryParams, null, headerParams, formParams);
                    if (response != null)
                    {
                        return((ResponseMessage)ApiInvoker.deserialize(response, typeof(ResponseMessage)));
                    }
                    else
                    {
                        return(null);
                    }
                }
            } catch (ApiException ex) {
                if (ex.ErrorCode == 404)
                {
                    return(null);
                }
                else
                {
                    throw ex;
                }
            }
        }
Пример #4
0
        /// <summary>
        /// Remove a specific file. Parameters: path - file path e.g. /file.ext, versionID - file's version, storage - user's storage name. Remove a specific file. Parameters: path - file path e.g. /file.ext, versionID - file's version, storage - user's storage name.
        /// </summary>
        /// <param name="Path"></param>
        /// <param name="versionId"></param>
        /// <param name="storage"></param>
        /// <returns></returns>
        public RemoveFileResponse DeleteFile(string Path, string versionId, string storage)
        {
            // create path and map variables
            var ResourcePath = "/storage/file/{Path}/?appSid={appSid}&amp;versionId={versionId}&amp;storage={storage}".Replace("{format}", "json");

            ResourcePath = Regex.Replace(ResourcePath, "\\*", "").Replace("&amp;", "&").Replace("/?", "?").Replace("toFormat={toFormat}", "format={format}");

            // query params
            var queryParams  = new Dictionary <String, String>();
            var headerParams = new Dictionary <String, String>();
            var formParams   = new Dictionary <String, object>();

            // verify required params are set
            if (Path == null)
            {
                throw new ApiException(400, "missing required params");
            }
            if (Path == null)
            {
                ResourcePath = Regex.Replace(ResourcePath, @"([&?])Path=", "");
            }
            else
            {
                ResourcePath = ResourcePath.Replace("{" + "Path" + "}", apiInvoker.ToPathValue(Path));
            }
            if (versionId == null)
            {
                ResourcePath = Regex.Replace(ResourcePath, @"([&?])versionId=", "");
            }
            else
            {
                ResourcePath = ResourcePath.Replace("{" + "versionId" + "}", apiInvoker.ToPathValue(versionId));
            }
            if (storage == null)
            {
                ResourcePath = Regex.Replace(ResourcePath, @"([&?])storage=", "");
            }
            else
            {
                ResourcePath = ResourcePath.Replace("{" + "storage" + "}", apiInvoker.ToPathValue(storage));
            }
            try {
                if (typeof(RemoveFileResponse) == typeof(ResponseMessage))
                {
                    var response = apiInvoker.invokeBinaryAPI(basePath, ResourcePath, "GET", queryParams, null, headerParams, formParams);
                    return((RemoveFileResponse)ApiInvoker.deserialize(response, typeof(RemoveFileResponse)));
                }
                else
                {
                    var response = apiInvoker.invokeAPI(basePath, ResourcePath, "DELETE", queryParams, null, headerParams, formParams);
                    if (response != null)
                    {
                        return((RemoveFileResponse)ApiInvoker.deserialize(response, typeof(RemoveFileResponse)));
                    }
                    else
                    {
                        return(null);
                    }
                }
            } catch (ApiException ex) {
                if (ex.ErrorCode == 404)
                {
                    return(null);
                }
                else
                {
                    throw ex;
                }
            }
        }
Пример #5
0
        /// <summary>
        /// PostRunOmrTask
        /// </summary>
        /// <param name="name"></param>
        /// <param name="actionName"></param>
        /// <param name="functionParams"></param>
        /// <param name="additionalParams"></param>
        /// <param name="storage"></param>
        /// <param name="folder"></param>
        /// <returns></returns>
        public OMRResponse PostRunOmrTask(string name, string actionName, OMRFunctionParam functionParam,
                                          string storage, string folder)
        {
            // create path and map variables
            string ResourcePath =
                "/omr/{name}/runOmrTask/?appSid={appSid}&amp;actionName={actionName}&amp;storage={storage}&amp;folder={folder}"
                .Replace("{format}", "json");

            ResourcePath = Regex.Replace(ResourcePath, "\\*", "")
                           .Replace("&amp;", "&")
                           .Replace("/?", "?")
                           .Replace("toFormat={toFormat}", "format={format}");

            // query params
            Dictionary <string, string> queryParams  = new Dictionary <String, String>();
            Dictionary <string, string> headerParams = new Dictionary <String, String>();
            Dictionary <string, object> formParams   = new Dictionary <String, object>();

            // verify required params are set
            if (name == null)
            {
                throw new ApiException(400, "missing required params");
            }
            if (name == null)
            {
                ResourcePath = Regex.Replace(ResourcePath, @"([&?])name=", "");
            }
            else
            {
                ResourcePath = ResourcePath.Replace("{" + "name" + "}", apiInvoker.ToPathValue(name));
            }
            if (actionName == null)
            {
                ResourcePath = Regex.Replace(ResourcePath, @"([&?])actionName=", "");
            }
            else
            {
                ResourcePath = ResourcePath.Replace("{" + "actionName" + "}", apiInvoker.ToPathValue(actionName));
            }
            if (storage == null)
            {
                ResourcePath = Regex.Replace(ResourcePath, @"([&?])storage=", "");
            }
            else
            {
                ResourcePath = ResourcePath.Replace("{" + "storage" + "}", apiInvoker.ToPathValue(storage));
            }
            if (folder == null)
            {
                ResourcePath = Regex.Replace(ResourcePath, @"([&?])folder=", "");
            }
            else
            {
                ResourcePath = ResourcePath.Replace("{" + "folder" + "}", apiInvoker.ToPathValue(folder));
            }
            try
            {
                if (typeof(OMRResponse) == typeof(ResponseMessage))
                {
                    byte[] response = apiInvoker.invokeBinaryAPI(basePath, ResourcePath, "POST", queryParams,
                                                                 functionParam, headerParams, formParams);
                    return((OMRResponse)ApiInvoker.deserialize(response, typeof(OMRResponse)));
                }
                else
                {
                    string response = apiInvoker.invokeAPI(basePath, ResourcePath, "POST", queryParams, functionParam,
                                                           headerParams, formParams);
                    if (response != null)
                    {
                        return((OMRResponse)ApiInvoker.deserialize(response, typeof(OMRResponse)));
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
            catch (ApiException ex)
            {
                if (ex.ErrorCode == 404)
                {
                    return(null);
                }
                else
                {
                    throw ex;
                }
            }
        }
Пример #6
0
        /// <summary>
        /// Recognize image text, language and text region can be selected, default dictionaries can be used for correction. Recognize image text, language and text region can be selected, default dictionaries can be used for correction.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="language"></param>
        /// <param name="rectX"></param>
        /// <param name="rectY"></param>
        /// <param name="rectWidth"></param>
        /// <param name="rectHeight"></param>
        /// <param name="useDefaultDictionaries"></param>
        /// <param name="storage"></param>
        /// <param name="folder"></param>
        /// <returns></returns>
        public OCRResponse GetRecognizeDocument(string name, string language, int?rectX, int?rectY, int?rectWidth, int?rectHeight, bool?useDefaultDictionaries, string storage, string folder)
        {
            // create path and map variables
            var ResourcePath = "/ocr/{name}/recognize/?appSid={appSid}&amp;language={language}&amp;rectX={rectX}&amp;rectY={rectY}&amp;rectWidth={rectWidth}&amp;rectHeight={rectHeight}&amp;useDefaultDictionaries={useDefaultDictionaries}&amp;storage={storage}&amp;folder={folder}".Replace("{format}", "json");

            ResourcePath = Regex.Replace(ResourcePath, "\\*", "").Replace("&amp;", "&").Replace("/?", "?").Replace("toFormat={toFormat}", "format={format}");

            // query params
            var queryParams  = new Dictionary <String, String>();
            var headerParams = new Dictionary <String, String>();
            var formParams   = new Dictionary <String, object>();

            // verify required params are set
            if (name == null)
            {
                throw new ApiException(400, "missing required params");
            }
            if (name == null)
            {
                ResourcePath = Regex.Replace(ResourcePath, @"([&?])name=", "");
            }
            else
            {
                ResourcePath = ResourcePath.Replace("{" + "name" + "}", apiInvoker.ToPathValue(name));
            }
            if (language == null)
            {
                ResourcePath = Regex.Replace(ResourcePath, @"([&?])language=", "");
            }
            else
            {
                ResourcePath = ResourcePath.Replace("{" + "language" + "}", apiInvoker.ToPathValue(language));
            }
            if (rectX == null)
            {
                ResourcePath = Regex.Replace(ResourcePath, @"([&?])rectX=", "");
            }
            else
            {
                ResourcePath = ResourcePath.Replace("{" + "rectX" + "}", apiInvoker.ToPathValue(rectX));
            }
            if (rectY == null)
            {
                ResourcePath = Regex.Replace(ResourcePath, @"([&?])rectY=", "");
            }
            else
            {
                ResourcePath = ResourcePath.Replace("{" + "rectY" + "}", apiInvoker.ToPathValue(rectY));
            }
            if (rectWidth == null)
            {
                ResourcePath = Regex.Replace(ResourcePath, @"([&?])rectWidth=", "");
            }
            else
            {
                ResourcePath = ResourcePath.Replace("{" + "rectWidth" + "}", apiInvoker.ToPathValue(rectWidth));
            }
            if (rectHeight == null)
            {
                ResourcePath = Regex.Replace(ResourcePath, @"([&?])rectHeight=", "");
            }
            else
            {
                ResourcePath = ResourcePath.Replace("{" + "rectHeight" + "}", apiInvoker.ToPathValue(rectHeight));
            }
            if (useDefaultDictionaries == null)
            {
                ResourcePath = Regex.Replace(ResourcePath, @"([&?])useDefaultDictionaries=", "");
            }
            else
            {
                ResourcePath = ResourcePath.Replace("{" + "useDefaultDictionaries" + "}", apiInvoker.ToPathValue(useDefaultDictionaries));
            }
            if (storage == null)
            {
                ResourcePath = Regex.Replace(ResourcePath, @"([&?])storage=", "");
            }
            else
            {
                ResourcePath = ResourcePath.Replace("{" + "storage" + "}", apiInvoker.ToPathValue(storage));
            }
            if (folder == null)
            {
                ResourcePath = Regex.Replace(ResourcePath, @"([&?])folder=", "");
            }
            else
            {
                ResourcePath = ResourcePath.Replace("{" + "folder" + "}", apiInvoker.ToPathValue(folder));
            }
            try {
                if (typeof(OCRResponse) == typeof(ResponseMessage))
                {
                    var response = apiInvoker.invokeBinaryAPI(basePath, ResourcePath, "GET", queryParams, null, headerParams, formParams);
                    return((OCRResponse)ApiInvoker.deserialize(response, typeof(OCRResponse)));
                }
                else
                {
                    var response = apiInvoker.invokeAPI(basePath, ResourcePath, "GET", queryParams, null, headerParams, formParams);
                    if (response != null)
                    {
                        return((OCRResponse)ApiInvoker.deserialize(response, typeof(OCRResponse)));
                    }
                    else
                    {
                        return(null);
                    }
                }
            } catch (ApiException ex) {
                if (ex.ErrorCode == 404)
                {
                    return(null);
                }
                else
                {
                    throw ex;
                }
            }
        }
Пример #7
0
        /// <summary>
        /// Get your orders. To get open orders only, send {&quot;open&quot;: true} in the filter param.
        /// </summary>
        /// <param name="symbol">Instrument symbol. Send a series (e.g. XBT) to get data for the nearest contract in that series.</param>
        /// <param name="filter">Generic table filter. Send JSON key/value pairs, such as {&quot;key&quot;: &quot;value&quot;}.</param>
        /// <param name="columns">Array of column names to fetch. If omitted, will return all columns. Note that this method will always return item keys, even when not specified, so you may receive more columns that you expect.</param>
        /// <param name="start">Starting point for results.</param>
        /// <param name="reverse">If true, will sort results newest first.</param>
        /// <param name="startTime">Starting date filter for results.</param>
        /// <param name="endTime">Ending date filter for results.</param>
        /// <param name="count">Number of results to fetch.</param>
        /// <returns></returns>
        public List <Order> getOrders(string symbol, object filter, List <string> columns, double?start, bool?reverse, DateTime?startTime, DateTime?endTime, double?count)
        {
            // create path and map variables
            var path = "/order".Replace("{format}", "json");

            // query params
            var queryParams  = new Dictionary <String, String>();
            var headerParams = new Dictionary <String, String>();
            var formParams   = new Dictionary <String, object>();

            if (symbol != null)
            {
                string paramStr = (symbol is DateTime) ? ((DateTime)(object)symbol).ToString("u") : Convert.ToString(symbol);
                queryParams.Add("symbol", paramStr);
            }
            if (filter != null)
            {
                string paramStr = (filter is DateTime) ? ((DateTime)(object)filter).ToString("u") : Convert.ToString(filter);
                queryParams.Add("filter", paramStr);
            }
            if (columns != null)
            {
                string paramStr = (columns is DateTime) ? ((DateTime)(object)columns).ToString("u") : Convert.ToString(columns);
                queryParams.Add("columns", paramStr);
            }
            if (count != null)
            {
                string paramStr = (count is DateTime) ? ((DateTime)(object)count).ToString("u") : Convert.ToString(count);
                queryParams.Add("count", paramStr);
            }
            if (start != null)
            {
                string paramStr = (start is DateTime) ? ((DateTime)(object)start).ToString("u") : Convert.ToString(start);
                queryParams.Add("start", paramStr);
            }
            if (reverse != null)
            {
                string paramStr = (reverse is DateTime) ? ((DateTime)(object)reverse).ToString("u") : Convert.ToString(reverse);
                queryParams.Add("reverse", paramStr);
            }
            if (startTime != null)
            {
                string paramStr = (startTime is DateTime) ? ((DateTime)(object)startTime).ToString("u") : Convert.ToString(startTime);
                queryParams.Add("startTime", paramStr);
            }
            if (endTime != null)
            {
                string paramStr = (endTime is DateTime) ? ((DateTime)(object)endTime).ToString("u") : Convert.ToString(endTime);
                queryParams.Add("endTime", paramStr);
            }
            try {
                if (typeof(List <Order>) == typeof(byte[]))
                {
                    var response = apiInvoker.invokeBinaryAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
                    return(((object)response) as List <Order>);
                }
                else
                {
                    var response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
                    if (response != null)
                    {
                        return((List <Order>)ApiInvoker.deserialize(response, typeof(List <Order>)));
                    }
                    else
                    {
                        return(null);
                    }
                }
            } catch (ApiException ex) {
                if (ex.ErrorCode == 404)
                {
                    return(null);
                }
                else
                {
                    throw ex;
                }
            }
        }
Пример #8
0
        /// <summary>
        ///   Summaryradius
        /// </summary>
        /// <returns></returns>
        public string SummaryRadius(string point, string radius, string unit, string page, string size)
        {
            // create path and map variables
            var path = "/properties/summary/radius";

            // query params
            var queryParams  = new Dictionary <String, String>();
            var headerParams = new Dictionary <String, String>();
            var formParams   = new Dictionary <String, object>();

            if (point != null)
            {
                formParams.Add("point", ApiInvoker.parameterToString(point));
            }
            if (radius != null)
            {
                formParams.Add("radius", ApiInvoker.parameterToString(radius));
            }
            if (unit != null)
            {
                formParams.Add("unit", ApiInvoker.parameterToString(unit));
            }
            if (page != null)
            {
                formParams.Add("page", ApiInvoker.parameterToString(page));
            }
            if (size != null)
            {
                formParams.Add("size", ApiInvoker.parameterToString(size));
            }


            // authentication setting
            bool requireAuth = false;

            try {
                if (typeof(void) == typeof(byte[]))
                {
                    var response = apiInvoker.invokeBinaryAPI(basePath, path, "GET", queryParams, null, headerParams, formParams, requireAuth);
                    Debug.Write("SummaryRadius response: " + response.ToString());
                    return(response.ToString());
                }
                else
                {
                    var response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, null, headerParams, formParams, requireAuth);
                    if (response != null)
                    {
                        return(response.ToString());
                    }
                    else
                    {
                        return(response.ToString());
                    }
                }
            } catch (ApiException ex) {
                if (ex.ErrorCode == 404)
                {
                    return(ex.Message);
                }
                else
                {
                    throw ex;
                }
            }
        }