public void FindByIdTest() { // TODO: add unit test for the method 'FindById' string cloudAppId = null; // TODO: replace null with proper value string tableName = null; // TODO: replace null with proper value CloudQueryFindById body = null; // TODO: replace null with proper value var response = instance.FindById(cloudAppId, tableName, body); Assert.IsInstanceOf <CloudObject> (response, "response is CloudObject"); }
/// <summary> /// find CloudObject with specific _id /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="cloudAppId">CloudApp id</param> /// <param name="tableName">cloud table name</param> /// <param name="body">query body</param> /// <returns>ApiResponse of CloudObject</returns> public ApiResponse< CloudObject > FindByIdWithHttpInfo (string cloudAppId, string tableName, CloudQueryFindById body) { // verify the required parameter 'cloudAppId' is set if (cloudAppId == null) throw new ApiException(400, "Missing required parameter 'cloudAppId' when calling CloudQueryApi->FindById"); // verify the required parameter 'tableName' is set if (tableName == null) throw new ApiException(400, "Missing required parameter 'tableName' when calling CloudQueryApi->FindById"); // verify the required parameter 'body' is set if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling CloudQueryApi->FindById"); var localVarPath = "data/{cloud_app_id}/{table_name}/find"; var localVarPathParams = new Dictionary<String, String>(); var localVarQueryParams = new Dictionary<String, String>(); var localVarHeaderParams = new Dictionary<String, String>(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 = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json localVarPathParams.Add("format", "json"); if (cloudAppId != null) localVarPathParams.Add("cloud_app_id", Configuration.ApiClient.ParameterToString(cloudAppId)); // path parameter if (tableName != null) localVarPathParams.Add("table_name", Configuration.ApiClient.ParameterToString(tableName)); // path parameter if (body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { localVarPostBody = body; // byte array } // make the HTTP request IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; if (localVarStatusCode >= 400) throw new ApiException (localVarStatusCode, "Error calling FindById: " + localVarResponse.Content, localVarResponse.Content); else if (localVarStatusCode == 0) throw new ApiException (localVarStatusCode, "Error calling FindById: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage); return new ApiResponse<CloudObject>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (CloudObject) Configuration.ApiClient.Deserialize(localVarResponse, typeof(CloudObject))); }
/// <summary> /// find CloudObject with specific _id /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="cloudAppId">CloudApp id</param> /// <param name="tableName">cloud table name</param> /// <param name="body">query body</param> /// <returns>CloudObject</returns> public CloudObject FindById (string cloudAppId, string tableName, CloudQueryFindById body) { ApiResponse<CloudObject> localVarResponse = FindByIdWithHttpInfo(cloudAppId, tableName, body); return localVarResponse.Data; }
/// <summary> /// find CloudObject with specific _id /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="cloudAppId">CloudApp id</param> /// <param name="tableName">cloud table name</param> /// <param name="body">query body</param> /// <returns>Task of CloudObject</returns> public async System.Threading.Tasks.Task<CloudObject> FindByIdAsync (string cloudAppId, string tableName, CloudQueryFindById body) { ApiResponse<CloudObject> localVarResponse = await FindByIdAsyncWithHttpInfo(cloudAppId, tableName, body); return localVarResponse.Data; }
public void Init() { instance = new CloudQueryFindById(); }