コード例 #1
0
        /// <summary>
        /// Geolocation The Geolocation API helps developers locate IoT, M2M and other connected devices anywhere in the world without GPS. The device first sends the API data about which Cellular networks and WiFi networks it can see nearby. The API then uses Unwired Labs’ large datasets of Cell towers, WiFi networks backed by numerous algorithms to calculate and return the device’s location
        /// </summary>
        /// <exception cref="unwired.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="geolocationSchema"></param>
        /// <returns>Task of Object</returns>
        public async System.Threading.Tasks.Task <Object> GeolocationAsync(GeolocationSchema geolocationSchema)
        {
            ApiResponse <Object> localVarResponse = await GeolocationAsyncWithHttpInfo(geolocationSchema);

            return(localVarResponse.Data);
        }
コード例 #2
0
        /// <summary>
        /// Geolocation The Geolocation API helps developers locate IoT, M2M and other connected devices anywhere in the world without GPS. The device first sends the API data about which Cellular networks and WiFi networks it can see nearby. The API then uses Unwired Labs’ large datasets of Cell towers, WiFi networks backed by numerous algorithms to calculate and return the device’s location
        /// </summary>
        /// <exception cref="unwired.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="geolocationSchema"></param>
        /// <returns>Task of ApiResponse (Object)</returns>
        public async System.Threading.Tasks.Task <ApiResponse <Object> > GeolocationAsyncWithHttpInfo(GeolocationSchema geolocationSchema)
        {
            // verify the required parameter 'geolocationSchema' is set
            if (geolocationSchema == null)
            {
                throw new ApiException(400, "Missing required parameter 'geolocationSchema' when calling GEOLOCATIONApi->Geolocation");
            }

            var    localVarPath         = "/process.php";
            var    localVarPathParams   = new Dictionary <String, String>();
            var    localVarQueryParams  = new List <KeyValuePair <String, String> >();
            var    localVarHeaderParams = new Dictionary <String, String>(this.Configuration.DefaultHeader);
            var    localVarFormParams   = new Dictionary <String, String>();
            var    localVarFileParams   = new Dictionary <String, FileParameter>();
            Object localVarPostBody     = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
                "application/json"
            };
            String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);

            if (localVarHttpHeaderAccept != null)
            {
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
            }

            if (geolocationSchema != null && geolocationSchema.GetType() != typeof(byte[]))
            {
                localVarPostBody = this.Configuration.ApiClient.Serialize(geolocationSchema); // http body (model) parameter
            }
            else
            {
                localVarPostBody = geolocationSchema; // byte array
            }


            // make the HTTP request
            IRestResponse localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath,
                                                                                                            Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                                                                                                            localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int)localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("Geolocation", localVarResponse);
                if (exception != null)
                {
                    throw exception;
                }
            }

            return(new ApiResponse <Object>(localVarStatusCode,
                                            localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                                            (Object)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))));
        }
コード例 #3
0
        /// <summary>
        /// Geolocation The Geolocation API helps developers locate IoT, M2M and other connected devices anywhere in the world without GPS. The device first sends the API data about which Cellular networks and WiFi networks it can see nearby. The API then uses Unwired Labs’ large datasets of Cell towers, WiFi networks backed by numerous algorithms to calculate and return the device’s location
        /// </summary>
        /// <exception cref="unwired.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="geolocationSchema"></param>
        /// <returns>Object</returns>
        public Object Geolocation(GeolocationSchema geolocationSchema)
        {
            ApiResponse <Object> localVarResponse = GeolocationWithHttpInfo(geolocationSchema);

            return(localVarResponse.Data);
        }