internal static TaxAuthorityList getTaxAuthorityList(HttpResponseMessage response) { var taxAuthorityList = new TaxAuthorityList(); var jsonObj = JsonConvert.DeserializeObject<Dictionary<string, object>>(response.Content.ReadAsStringAsync().Result); if (jsonObj.ContainsKey("tax_authorities")) { var taxAuthorityArray = JsonConvert.DeserializeObject<List<object>>(jsonObj["tax_authorities"].ToString()); foreach(var taxAuthorityObj in taxAuthorityArray) { var taxAuthority = new TaxAuthority(); taxAuthority = JsonConvert.DeserializeObject<TaxAuthority>(taxAuthorityObj.ToString()); taxAuthorityList.Add(taxAuthority); } } return taxAuthorityList; }
/// <summary> /// Updates the tax authority. /// </summary> /// <param name="tax_authority_id">The tax_authority_id.</param> /// <param name="update_tax_authoriry_info">The update_tax_authoriry_info.</param> /// <returns>TaxAuthority.</returns> public TaxAuthority UpdateTaxAuthority(string tax_authority_id,TaxAuthority update_tax_authoriry_info) { string url = baseAddress + "/taxauthorities/" + tax_authority_id; var json = JsonConvert.SerializeObject(update_tax_authoriry_info); var jsonParams = new Dictionary<object, object>(); jsonParams.Add("JSONString", json); var response = ZohoHttpClient.put(url, getQueryParameters(jsonParams)); return SettingsParser.getTaxAuthority(response); }
internal static TaxAuthority getTaxAuthority(HttpResponseMessage response) { var taxAuthority = new TaxAuthority(); var jsonObj = JsonConvert.DeserializeObject<Dictionary<string, object>>(response.Content.ReadAsStringAsync().Result); if (jsonObj.ContainsKey("tax_authority")) { taxAuthority = JsonConvert.DeserializeObject<TaxAuthority>(jsonObj["tax_authority"].ToString()); } return taxAuthority; }