public void SaveTest() { // TODO: add unit test for the method 'Save' string appId = null; // TODO: replace null with proper value string tableName = null; // TODO: replace null with proper value CloudObjectSaveRequest body = null; // TODO: replace null with proper value var response = instance.Save(appId, tableName, body); Assert.IsInstanceOf <CloudObject> (response, "response is CloudObject"); }
public void Init() { instance = new CloudObjectSaveRequest(); }
/// <summary> /// saves a cloud object to cloudboost /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="appId">CloudApp id</param> /// <param name="tableName">cloud table name</param> /// <param name="body">CloudObject that needs to be added to cloudboost</param> /// <returns>Task of CloudObject</returns> public async System.Threading.Tasks.Task<CloudObject> SaveAsync (string appId, string tableName, CloudObjectSaveRequest body) { ApiResponse<CloudObject> localVarResponse = await SaveAsyncWithHttpInfo(appId, tableName, body); return localVarResponse.Data; }
/// <summary> /// saves a cloud object to cloudboost /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="appId">CloudApp id</param> /// <param name="tableName">cloud table name</param> /// <param name="body">CloudObject that needs to be added to cloudboost</param> /// <returns>Task of ApiResponse (CloudObject)</returns> public async System.Threading.Tasks.Task<ApiResponse<CloudObject>> SaveAsyncWithHttpInfo (string appId, string tableName, CloudObjectSaveRequest body) { // verify the required parameter 'appId' is set if (appId == null) throw new ApiException(400, "Missing required parameter 'appId' when calling Save"); // verify the required parameter 'tableName' is set if (tableName == null) throw new ApiException(400, "Missing required parameter 'tableName' when calling Save"); // verify the required parameter 'body' is set if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling Save"); var localVarPath = "data/{app_id}/{table_name}"; 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 (appId != null) localVarPathParams.Add("app_id", Configuration.ApiClient.ParameterToString(appId)); // 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) await Configuration.ApiClient.CallApiAsync(localVarPath, Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; if (localVarStatusCode >= 400) throw new ApiException (localVarStatusCode, "Error calling Save: " + localVarResponse.Content, localVarResponse.Content); else if (localVarStatusCode == 0) throw new ApiException (localVarStatusCode, "Error calling Save: " + 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> /// saves a cloud object to cloudboost /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="appId">CloudApp id</param> /// <param name="tableName">cloud table name</param> /// <param name="body">CloudObject that needs to be added to cloudboost</param> /// <returns>CloudObject</returns> public CloudObject Save (string appId, string tableName, CloudObjectSaveRequest body) { ApiResponse<CloudObject> localVarResponse = SaveWithHttpInfo(appId, tableName, body); return localVarResponse.Data; }
/// <summary> /// saves a cloud object to cloudboost /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="appId">CloudApp id</param> /// <param name="tableName">cloud table name</param> /// <param name="body">CloudObject that needs to be added to cloudboost</param> /// <returns>Task of ApiResponse (CloudObject)</returns> public async System.Threading.Tasks.Task <ApiResponse <CloudObject> > SaveAsyncWithHttpInfo(string appId, string tableName, CloudObjectSaveRequest body) { // verify the required parameter 'appId' is set if (appId == null) { throw new ApiException(400, "Missing required parameter 'appId' when calling Save"); } // verify the required parameter 'tableName' is set if (tableName == null) { throw new ApiException(400, "Missing required parameter 'tableName' when calling Save"); } // verify the required parameter 'body' is set if (body == null) { throw new ApiException(400, "Missing required parameter 'body' when calling Save"); } var localVarPath = "data/{app_id}/{table_name}"; 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 (appId != null) { localVarPathParams.Add("app_id", Configuration.ApiClient.ParameterToString(appId)); // 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)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int)localVarResponse.StatusCode; if (localVarStatusCode >= 400) { throw new ApiException(localVarStatusCode, "Error calling Save: " + localVarResponse.Content, localVarResponse.Content); } else if (localVarStatusCode == 0) { throw new ApiException(localVarStatusCode, "Error calling Save: " + 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> /// saves a cloud object to cloudboost /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="appId">CloudApp id</param> /// <param name="tableName">cloud table name</param> /// <param name="body">CloudObject that needs to be added to cloudboost</param> /// <returns>Task of CloudObject</returns> public async System.Threading.Tasks.Task <CloudObject> SaveAsync(string appId, string tableName, CloudObjectSaveRequest body) { ApiResponse <CloudObject> localVarResponse = await SaveAsyncWithHttpInfo(appId, tableName, body); return(localVarResponse.Data); }
/// <summary> /// saves a cloud object to cloudboost /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="appId">CloudApp id</param> /// <param name="tableName">cloud table name</param> /// <param name="body">CloudObject that needs to be added to cloudboost</param> /// <returns>CloudObject</returns> public CloudObject Save(string appId, string tableName, CloudObjectSaveRequest body) { ApiResponse <CloudObject> localVarResponse = SaveWithHttpInfo(appId, tableName, body); return(localVarResponse.Data); }
public void Init() { instance = new CloudObjectSaveRequest(); }