/// <summary> /// List entries List entries for a specific dictionary. /// </summary> /// <param name="DictionaryId">Dictionary Id</param>/// <param name="Filters">Different filters that can be applied to the list functionality (skip/limit/sort/match)</param> /// <returns>EntriesListResponse</returns> public async Task<EntriesListResponse> ResourcesDictionaryEntryListPostAsync (string DictionaryId, EntriesListFilters Filters) { // verify the required parameter 'DictionaryId' is set if (DictionaryId == null) throw new ApiException(400, "Missing required parameter 'DictionaryId' when calling ResourcesDictionaryEntryListPost"); var path = "/resources/dictionary/entry/list"; 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(Filters); // 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 ResourcesDictionaryEntryListPost: " + response.Content, response.Content); } return (EntriesListResponse) apiClient.Deserialize(response.Content, typeof(EntriesListResponse)); }
public void ResourcesDictionaryEntryListPostTest() { EntriesListFilters entriesListFilters = new EntriesListFilters(); EntriesListResponse entriesListResponse = new EntriesListResponse(); entriesListResponse = dictionaryApi.ResourcesDictionaryEntryListPost(dictionaryId, entriesListFilters); Assert.IsNotNull(entriesListResponse.TotalNoLimit); }
public void ResourcesDictionaryEntryUpdatePostTest() { EntriesListFilters entriesListFilters = new EntriesListFilters(); EntriesListResponse entriesListResponse = new EntriesListResponse(); entriesListResponse = dictionaryApi.ResourcesDictionaryEntryListPost(dictionaryId, entriesListFilters); EntryUpdateBody entryUpdateBody = new EntryUpdateBody(); EntryUpdateInput entryUpdateInput = new EntryUpdateInput(); EntryUpdateResponse entryUpdateResponse = new EntryUpdateResponse(); entryUpdateBody.SourceId = entriesListResponse.Entries[0].SourceId; entryUpdateBody.TargetId = entriesListResponse.Entries[0].TargetId; entryUpdateInput.Priority = ""; entryUpdateInput.Type = ""; entryUpdateInput.SourcePos = ""; entryUpdateInput.TargetPos = ""; entryUpdateInput.Source = "example"; entryUpdateInput.Target = "exemple"; entryUpdateInput.TargetLang = "fr"; entryUpdateInput.SourceLang = "en"; entryUpdateBody.Update = entryUpdateInput; entryUpdateResponse = dictionaryApi.ResourcesDictionaryEntryUpdatePost(dictionaryId, entryUpdateBody); Assert.IsNotNull(entryUpdateResponse.TargetId); }
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); }