Table of Contents

Class JobResult

Namespace
CivitaiSharp.Sdk.Models.Results
Assembly
CivitaiSharp.Sdk.dll

Represents the result payload of a job. This type does NOT contain an ErrorMessage property. To check for failures, inspect LastEvent and check if Type is Failed.

[JsonConverter(typeof(JobResultConverter))]
public sealed record JobResult : IEquatable<JobResult>
Inheritance
JobResult
Implements
Inherited Members

Remarks

The Civitai job API can return different shapes for result depending on job type. This type preserves the raw JSON while exposing commonly used blob fields for image jobs.

Constructors

JobResult(JsonElement)

Represents the result payload of a job. This type does NOT contain an ErrorMessage property. To check for failures, inspect LastEvent and check if Type is Failed.

public JobResult(JsonElement Raw)

Parameters

Raw JsonElement

The raw JSON value returned by the API for the result property.

Remarks

The Civitai job API can return different shapes for result depending on job type. This type preserves the raw JSON while exposing commonly used blob fields for image jobs.

Properties

Available

Gets whether the result is available for download. Defaults to false when the API does not provide the field.

[JsonIgnore]
public bool Available { get; }

Property Value

bool

BlobKey

Gets the blob key for an image result, if present.

[JsonIgnore]
public string? BlobKey { get; }

Property Value

string

BlobUrl

Gets the temporary URL for downloading the generated image, if present.

[JsonIgnore]
public string? BlobUrl { get; }

Property Value

string

BlobUrlExpirationDate

Gets the expiration date for the blob URL, if present.

[JsonIgnore]
public DateTime? BlobUrlExpirationDate { get; }

Property Value

DateTime?

Raw

The raw JSON value returned by the API for the result property.

public JsonElement Raw { get; init; }

Property Value

JsonElement