static async Task ReportStatus(string moduleId, MethodResponse response, AnalyzerClient analyzerClient) { try { await analyzerClient.ReportResultAsync(new TestOperationResult { Source = moduleId, Result = response.Status.ToString(), CreatedAt = DateTime.UtcNow, Type = "LegacyDirectMethod" }); } catch (Exception e) { Logger.LogError(e.ToString()); } }
static async Task ReportStatus(string moduleId, HttpStatusCode result, AnalyzerClient analyzerClient) { try { await analyzerClient.ReportResultAsync(new TestOperationResult { Source = moduleId, Result = result.ToString(), CreatedAt = DateTime.UtcNow, Type = Enum.GetName(typeof(TestOperationResultType), TestOperationResultType.LegacyDirectMethod) }); } catch (Exception e) { Logger.LogError(e.ToString()); } }
protected async Task CallAnalyzerToReportStatusAsync(AnalyzerClient analyzerClient, string moduleId, string status) { try { await analyzerClient.ReportResultAsync(new TestOperationResult { Source = moduleId, Result = status, CreatedAt = DateTime.UtcNow, Type = "LegacyTwin" }); } catch (Exception e) { this.Logger.LogError($"Failed call to report status to analyzer: {e}"); } }
static async Task ReportStatus(string moduleId, CloudToDeviceMethodResult result, AnalyzerClient analyzerClient) { try { await analyzerClient.ReportResultAsync(new TestOperationResult { Source = moduleId, Result = result.Status.ToString(), CreatedAt = DateTime.UtcNow, Type = "LegacyDirectMethod" }); } catch (Exception e) { Logger.LogError(e, "Failed call to report status to analyzer"); } }