/// <summary> /// Delete an entry Delete an entry in an existing dictionary. /// </summary> /// <param name="DictionaryId">Dictionary Id</param>/// <param name="Input">Input with dictionary id + entry id (src or tgt) to delete</param> /// <returns>EntryDeleteResponse</returns> public async Task<EntryDeleteResponse> ResourcesDictionaryEntryDeletePostAsync (string DictionaryId, EntryDeleteBody Input) { // verify the required parameter 'DictionaryId' is set if (DictionaryId == null) throw new ApiException(400, "Missing required parameter 'DictionaryId' when calling ResourcesDictionaryEntryDeletePost"); // verify the required parameter 'Input' is set if (Input == null) throw new ApiException(400, "Missing required parameter 'Input' when calling ResourcesDictionaryEntryDeletePost"); var path = "/resources/dictionary/entry/delete"; path = path.Replace("{format}", "json"); var queryParams = new Dictionary<String, String>(); var headerParams = new Dictionary<String, String>(); var formParams = new Dictionary<String, String>(); var fileParams = new Dictionary<String, String>(); String postBody = null; if (DictionaryId != null) queryParams.Add("dictionaryId", apiClient.ParameterToString(DictionaryId)); // query parameter postBody = apiClient.Serialize(Input); // http body (model) parameter // authentication setting, if any String[] authSettings = new String[] { "accessToken", "apiKey" }; // make the HTTP request IRestResponse response = (IRestResponse) await apiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); if (((int)response.StatusCode) >= 400) { throw new ApiException ((int)response.StatusCode, "Error calling ResourcesDictionaryEntryDeletePost: " + response.Content, response.Content); } return (EntryDeleteResponse) apiClient.Deserialize(response.Content, typeof(EntryDeleteResponse)); }
public void ResourcesDictionaryEntryDeletePostTest() { EntriesListResponse entriesListResponse = new EntriesListResponse(); EntriesListFilters entriesListFilters = new EntriesListFilters(); entriesListResponse = dictionaryApi.ResourcesDictionaryEntryListPost(dictionaryId, entriesListFilters); EntryDeleteBody entryDeleteBody = new EntryDeleteBody(); EntryDeleteInput entryDeleteInput = new EntryDeleteInput(); entryDeleteInput.SourceId = entriesListResponse.Entries[0].SourceId; entryDeleteInput.TargetId = entriesListResponse.Entries[0].TargetId; entryDeleteBody.Entry = entryDeleteInput; EntryDeleteResponse entryDeleteResponse = new EntryDeleteResponse(); entryDeleteResponse = dictionaryApi.ResourcesDictionaryEntryDeletePost(dictionaryId, entryDeleteBody); Assert.IsNotNull(entryDeleteResponse.Status); }