The artifacts produced by Parse: the same files, under the same names and with the same content, that the hosted service returns for the same request.
using Nutrient;The SDK creates this class through factory methods or other SDK objects.
Properties
ArtifactNames
public string[] ArtifactNames { get; }The file names of the artifacts this run produced, sorted.
Type: string[]
DocumentJson
public string? DocumentJson { get; }The content of document.json, or null when this run did not produce it.
Type: string?
DocumentMd
public string? DocumentMd { get; }The content of document.md, or null when this run did not produce it.
Type: string?
Methods
GetArtifact
public string GetArtifact(string name)Returns the content of an artifact, exactly as the run produced it.
Parameters
| Name | Type | Description |
|---|---|---|
name | string | The artifact file name, for example document.json. |
Returns: string - The artifact content. Throws: NutrientException - Thrown when name is null or empty.
Throws: NutrientException - Thrown when this run did not produce that artifact.
HasArtifact
public bool HasArtifact(string name)Whether this run produced an artifact with the given file name.
Parameters
| Name | Type | Description |
|---|---|---|
name | string | The artifact file name, for example document.json. |
Returns: bool - True when the artifact was produced.
SaveTo
public void SaveTo(string directory)Writes every artifact into a directory under its own file name, creating the directory when needed and replacing files that already exist.
Parameters
| Name | Type | Description |
|---|---|---|
directory | string | The directory to write into. |
Throws: NutrientException - Thrown when directory is null or empty.
Throws: NutrientException - Thrown when an artifact name is not a plain file name.
Resource management
public void Dispose()ParseResult implements IDisposable. Call Dispose() or use a C# using declaration to release its native handle right away. If you don’t, the handle is released when the object is garbage collected.