Freigeben über


InsightAttachments.GetInsightAttachmentAsync Methode

Definition

Ruft eine angegebene Erkenntnisressource unter einer bestimmten Partei ab.

public virtual System.Threading.Tasks.Task<Azure.Response> GetInsightAttachmentAsync (string partyId, string modelId, string resourceType, string resourceId, string insightAttachmentId, Azure.RequestContext context = default);
abstract member GetInsightAttachmentAsync : string * string * string * string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetInsightAttachmentAsync : string * string * string * string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetInsightAttachmentAsync (partyId As String, modelId As String, resourceType As String, resourceId As String, insightAttachmentId As String, Optional context As RequestContext = Nothing) As Task(Of Response)

Parameter

partyId
String

ID der zugeordneten Partei.

modelId
String

ID des zugeordneten Modells. Dies kann entweder "BiomassModelId", "SensorPlacementModelId", "SoilMoistureModelId" oder eine beliebige Lösungs-ID sein.

resourceType
String

Ressourcentyp, der dem Datensatz zugeordnet ist.

resourceId
String

ID der zugeordneten Ressource.

insightAttachmentId
String

ID der Insight-Anlageressource.

context
RequestContext

Der Anforderungskontext, der das Standardverhalten der Clientpipeline pro Aufruf außer Kraft setzen kann.

Gibt zurück

Die vom Dienst zurückgegebene Antwort. Details zum Antworttextschema finden Sie unten im Abschnitt Hinweise.

Ausnahmen

partyId, modelId, resourceTyperesourceId oder insightAttachmentId ist NULL.

partyId, modelId, resourceTyperesourceId oder insightAttachmentId ist eine leere Zeichenfolge, und es wurde erwartet, dass sie nicht leer ist.

Der Dienst hat einen nicht erfolgreichen status Code zurückgegeben.

Beispiele

In diesem Beispiel wird gezeigt, wie GetInsightAttachmentAsync mit den erforderlichen Parametern aufgerufen und das Ergebnis analysiert wird.

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

Response response = await client.GetInsightAttachmentAsync("<partyId>", "<modelId>", "<resourceType>", "<resourceId>", "<insightAttachmentId>");

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("insightId").ToString());
Console.WriteLine(result.GetProperty("modelId").ToString());
Console.WriteLine(result.GetProperty("resourceType").ToString());
Console.WriteLine(result.GetProperty("resourceId").ToString());
Console.WriteLine(result.GetProperty("originalFileName").ToString());
Console.WriteLine(result.GetProperty("partyId").ToString());
Console.WriteLine(result.GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("modifiedDateTime").ToString());
Console.WriteLine(result.GetProperty("source").ToString());
Console.WriteLine(result.GetProperty("name").ToString());
Console.WriteLine(result.GetProperty("description").ToString());
Console.WriteLine(result.GetProperty("createdBy").ToString());
Console.WriteLine(result.GetProperty("modifiedBy").ToString());
Console.WriteLine(result.GetProperty("eTag").ToString());

Hinweise

Im Folgenden finden Sie das JSON-Schema für die Antwortnutzlast.

Antworttext:

Schema für InsightAttachment:

{
  insightId: string, # Required. InsightID for this InsightAttachment.
  modelId: string, # Optional. ModelID for this InsightAttachment.
  resourceType: "Party" | "Farm" | "Field" | "SeasonalField" | "Boundary", # Optional. Associated Resource type for this attachment.
  resourceId: string, # Optional. Associated Resource id for this attachment.
  originalFileName: string, # Optional. Original File Name for this attachment.
  partyId: string, # Optional. PartyId id for this attachment.
  id: string, # Optional. Unique id.
  status: string, # Optional. Status of the resource.
  createdDateTime: string (ISO 8601 Format), # Optional. Date when resource was created.
  modifiedDateTime: string (ISO 8601 Format), # Optional. Date when resource was last modified.
  source: string, # Optional. Source of the resource.
  name: string, # Optional. Name to identify resource.
  description: string, # Optional. Textual description of resource.
  createdBy: string, # Optional. Created by user/tenant id.
  modifiedBy: string, # Optional. Modified by user/tenant id.
  eTag: string, # Optional. The ETag value to implement optimistic concurrency.
}

Gilt für: