Udostępnij za pośrednictwem


SolutionInference.FetchAsync(String, RequestContent, RequestContext) Method

Definition

Fetches details of triggered job for a solution.

public virtual System.Threading.Tasks.Task<Azure.Response> FetchAsync (string solutionId, Azure.Core.RequestContent content, Azure.RequestContext context = default);
abstract member FetchAsync : string * Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.FetchAsync : string * Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function FetchAsync (solutionId As String, content As RequestContent, Optional context As RequestContext = Nothing) As Task(Of Response)

Parameters

solutionId
String

Id of the solution.

content
RequestContent

The content to send as the body of the request. Details of the request body schema are in the Remarks section below.

context
RequestContext

The request context, which can override default behaviors of the client pipeline on a per-call basis.

Returns

The response returned from the service.

Exceptions

solutionId or content is null.

solutionId is an empty string, and was expected to be non-empty.

Service returned a non-success status code.

Examples

This sample shows how to call FetchAsync with required parameters and request content, and how to parse the result.

var credential = new DefaultAzureCredential();
var client = new FarmBeatsClient(credential).GetSolutionInferenceClient(<2022-11-01-preview>);

var data = new {
    requestPath = "<requestPath>",
};

Response response = await client.FetchAsync("<solutionId>", RequestContent.Create(data));

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("<test>").ToString());

This sample shows how to call FetchAsync with all parameters and request content, and how to parse the result.

var credential = new DefaultAzureCredential();
var client = new FarmBeatsClient(credential).GetSolutionInferenceClient(<2022-11-01-preview>);

var data = new {
    requestPath = "<requestPath>",
    partnerRequestBody = new {
        key = new {},
    },
};

Response response = await client.FetchAsync("<solutionId>", RequestContent.Create(data));

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("<test>").ToString());

Remarks

Below is the JSON schema for the request payload.

Request Body:

Schema for SolutionInference:

{
  requestPath: string, # Required. RequestPath containing the api-version, query parameters and path route to be called for partner request.
Expected format is "/{api-version}/{resourceExposedByPartner}/{customerDefinedJobId}?query1=value1".
Not following this format may result into validation errors.
  partnerRequestBody: Dictionary<string, any>, # Optional. Api input parameters required by partner to trigger/cancel job request.
}

Applies to