// This demo function is for the bug // update_datafeed call failed with status code: BadRequest, error message Internal error occurred, please contact us. private static void UpdateKenshoData() { KenshoData kenshoData = JsonConvert.DeserializeObject <KenshoData>(File.ReadAllText(kenshoDataJsonFilePath)); Console.WriteLine(kenshoData); UpdateDatafeed(kenshoData); }
/// <summary> /// This will update the properties of a datafeed in Kensho. /// </summary> /// <param name="kenshoData">The Kensho configuration data to update.</param> /// <returns>KenshoData</returns> private static void UpdateDatafeed(KenshoData kenshoData) { // Create the update request based on the new Kensho properties set on the dataset. KenshoUpdateDatafeedRequest updateDatafeedRequest = new KenshoUpdateDatafeedRequest() { DatafeedId = kenshoData.DatafeedId.GetValueOrDefault(), DatafeedName = kenshoData.DatafeedName, DataStartFrom = kenshoData.DataStartFrom.GetValueOrDefault(), //GracePeriodInSeconds = kenshoData.GracePeriodInSeconds.GetValueOrDefault(), DisplayColumns = kenshoData.DisplayColumns, Metrics = new List <string>(), ParameterList = kenshoData.ParameterList, ScheduleIngestionDelayInSeconds = kenshoData.ScheduleIngestionDelayInSeconds.GetValueOrDefault(), }; KenshoUpdateDatafeedResponse updateDatafeedResponse = SendUpdateDatafeedRequestAsync(updateDatafeedRequest); if (updateDatafeedResponse.StatusCode != HttpStatusCode.OK) { throw new ProtocolViolationException($"update_datafeed call returned error {updateDatafeedResponse.StatusCode}, error message {updateDatafeedResponse.ContentOrErrorMessage}"); } }