From 54591222db3b4dd5b41a875fcb0b77bf52205b82 Mon Sep 17 00:00:00 2001 From: Asaf Levi <100200009+asaflevi-ms@users.noreply.github.com> Date: Fri, 31 Mar 2023 00:58:08 +0300 Subject: [PATCH] Fix: use operation.Value to get Response (#35248) * Fix: use operation.Value to get Response * fix typo in readme snippet --- .../Azure.Health.Insights.CancerProfiling/README.md | 3 +-- .../samples/Sample01_InferCancerProfile.md | 3 +-- .../samples/Sample01_InferCancerProfileAsync.md | 3 +-- .../tests/Samples/Sample01_InferCancerProfile.cs | 3 +-- .../tests/Samples/Sample01_InferCancerProfileAsync.cs | 3 +-- .../Azure.Health.Insights.ClinicalMatching/README.md | 3 +-- .../samples/Sample01_MatchTrials.md | 3 +-- .../samples/Sample01_MatchTrialsAsync.md | 3 +-- .../tests/Samples/Sample01_MatchTrials.cs | 3 +-- .../tests/Samples/Sample01_MatchTrialsAsync.cs | 3 +-- 10 files changed, 10 insertions(+), 20 deletions(-) diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/README.md b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/README.md index 7d327e6064b11..867c37c77aad0 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/README.md +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/README.md @@ -71,8 +71,7 @@ OncoPhenotypeResult oncoPhenotypeResult = default; try { Operation operation = await client.InferCancerProfileAsync(WaitUntil.Completed, oncoPhenotypeData); - Response resp = operation.GetRawResponse(); - oncoPhenotypeResult = OncoPhenotypeResult.FromResponse(resp); + oncoPhenotypeResult = operation.Value; } catch (Exception ex) { diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/Sample01_InferCancerProfile.md b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/Sample01_InferCancerProfile.md index 0fddec84e69d4..e05d6c75384e0 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/Sample01_InferCancerProfile.md +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/Sample01_InferCancerProfile.md @@ -148,8 +148,7 @@ OncoPhenotypeResult oncoPhenotypeResult = default; try { Operation operation = client.InferCancerProfile(WaitUntil.Completed, oncoPhenotypeData); - Response resp = operation.GetRawResponse(); - oncoPhenotypeResult = OncoPhenotypeResult.FromResponse(resp); + oncoPhenotypeResult = operation.Value; } catch (Exception ex) { diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/Sample01_InferCancerProfileAsync.md b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/Sample01_InferCancerProfileAsync.md index 7c24790401749..ddd99e0412738 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/Sample01_InferCancerProfileAsync.md +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/Sample01_InferCancerProfileAsync.md @@ -148,8 +148,7 @@ OncoPhenotypeResult oncoPhenotypeResult = default; try { Operation operation = await client.InferCancerProfileAsync(WaitUntil.Completed, oncoPhenotypeData); - Response resp = operation.GetRawResponse(); - oncoPhenotypeResult = OncoPhenotypeResult.FromResponse(resp); + oncoPhenotypeResult = operation.Value; } catch (Exception ex) { diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Samples/Sample01_InferCancerProfile.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Samples/Sample01_InferCancerProfile.cs index 1c1e46907a433..3e6c1438efc6e 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Samples/Sample01_InferCancerProfile.cs +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Samples/Sample01_InferCancerProfile.cs @@ -148,8 +148,7 @@ Ductal carcinoma in situ (DCIS): Present try { Operation operation = client.InferCancerProfile(WaitUntil.Completed, oncoPhenotypeData); - Response resp = operation.GetRawResponse(); - oncoPhenotypeResult = OncoPhenotypeResult.FromResponse(resp); + oncoPhenotypeResult = operation.Value; } catch (Exception ex) { diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Samples/Sample01_InferCancerProfileAsync.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Samples/Sample01_InferCancerProfileAsync.cs index b48471867890f..b91ac40550e84 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Samples/Sample01_InferCancerProfileAsync.cs +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Samples/Sample01_InferCancerProfileAsync.cs @@ -148,8 +148,7 @@ Ductal carcinoma in situ (DCIS): Present try { Operation operation = await client.InferCancerProfileAsync(WaitUntil.Completed, oncoPhenotypeData); - Response resp = operation.GetRawResponse(); - oncoPhenotypeResult = OncoPhenotypeResult.FromResponse(resp); + oncoPhenotypeResult = operation.Value; } catch (Exception ex) { diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/README.md b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/README.md index fef9503311847..ae448d1a5fa93 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/README.md +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/README.md @@ -75,8 +75,7 @@ try { // Using ClinicalMatchingClient + MatchTrialsAsync Operation operation = await clinicalMatchingClient.MatchTrialsAsync(WaitUntil.Completed, trialMatcherData); - Response resp = operation.GetRawResponse(); - trialMatcherResult = TrialMatcherResult.FromResponse(resp); + trialMatcherResult = operation.Value; } catch (Exception ex) { diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/samples/Sample01_MatchTrials.md b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/samples/Sample01_MatchTrials.md index 0add04d871456..cfcaae7f087f2 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/samples/Sample01_MatchTrials.md +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/samples/Sample01_MatchTrials.md @@ -118,8 +118,7 @@ try { // Using ClinicalMatchingClient + MatchTrials Operation operation = clinicalMatchingClient.MatchTrials(WaitUntil.Completed, trialMatcherData); - Response resp = operation.GetRawResponse(); - trialMatcherResult = TrialMatcherResult.FromResponse(resp); + trialMatcherResult = operation.Value; } catch (Exception ex) { diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/samples/Sample01_MatchTrialsAsync.md b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/samples/Sample01_MatchTrialsAsync.md index e7438a9a79900..703c6dd5ad8a7 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/samples/Sample01_MatchTrialsAsync.md +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/samples/Sample01_MatchTrialsAsync.md @@ -118,8 +118,7 @@ try { // Using ClinicalMatchingClient + MatchTrialsAsync Operation operation = await clinicalMatchingClient.MatchTrialsAsync(WaitUntil.Completed, trialMatcherData); - Response resp = operation.GetRawResponse(); - trialMatcherResult = TrialMatcherResult.FromResponse(resp); + trialMatcherResult = operation.Value; } catch (Exception ex) { diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Samples/Sample01_MatchTrials.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Samples/Sample01_MatchTrials.cs index 35363c3a96d82..35e588d7ae319 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Samples/Sample01_MatchTrials.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Samples/Sample01_MatchTrials.cs @@ -123,8 +123,7 @@ public void MatchTrials() { // Using ClinicalMatchingClient + MatchTrials Operation operation = clinicalMatchingClient.MatchTrials(WaitUntil.Completed, trialMatcherData); - Response resp = operation.GetRawResponse(); - trialMatcherResult = TrialMatcherResult.FromResponse(resp); + trialMatcherResult = operation.Value; } catch (Exception ex) { diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Samples/Sample01_MatchTrialsAsync.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Samples/Sample01_MatchTrialsAsync.cs index bcb8997c3f07b..3199f901c9f30 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Samples/Sample01_MatchTrialsAsync.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Samples/Sample01_MatchTrialsAsync.cs @@ -123,8 +123,7 @@ public async Task MatchTrialsAsync() { // Using ClinicalMatchingClient + MatchTrialsAsync Operation operation = await clinicalMatchingClient.MatchTrialsAsync(WaitUntil.Completed, trialMatcherData); - Response resp = operation.GetRawResponse(); - trialMatcherResult = TrialMatcherResult.FromResponse(resp); + trialMatcherResult = operation.Value; } catch (Exception ex) {