Partager via


InsightAttachments.GetInsightAttachmentAsync Méthode

Définition

Obtient une ressource d’insight spécifiée sous une partie particulière.

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)

Paramètres

partyId
String

ID de la partie associée.

modelId
String

ID du modèle associé. Il peut s’agir de « BiomassModelId », « SensorPlacementModelId », « SoilMoistureModelId » ou de n’importe quel ID de solution.

resourceType
String

Type de ressource associé à l’enregistrement.

resourceId
String

ID de la ressource associée.

insightAttachmentId
String

ID de la ressource de pièce jointe d’insight.

context
RequestContext

Contexte de requête, qui peut remplacer les comportements par défaut du pipeline client par appel.

Retours

Réponse retournée par le service. Les détails du schéma du corps de la réponse se trouvent dans la section Remarques ci-dessous.

Exceptions

partyId, modelId, resourceTyperesourceId ou insightAttachmentId a la valeur null.

partyId, modelId, resourceTyperesourceId ou insightAttachmentId est une chaîne vide et devait être non vide.

Le service a retourné un code de status non réussi.

Exemples

Cet exemple montre comment appeler GetInsightAttachmentAsync avec les paramètres requis et analyser le résultat.

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());

Remarques

Vous trouverez ci-dessous le schéma JSON pour la charge utile de réponse.

Corps de réponse :

Schéma pour 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.
}

S’applique à