Table of Contents

Class JobEvent

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

Represents a single event in the lifecycle of a job. Check the Type property to determine job outcome (Succeeded, Failed, etc.). The API does not provide an ErrorMessage property - use Context for error details when Type is Failed.

public sealed record JobEvent : IEquatable<JobEvent>
Inheritance
JobEvent
Implements
Inherited Members

Constructors

JobEvent(Guid?, JobEventType, DateTime?, Provider, string?, IReadOnlyDictionary<string, JsonElement>?, TimeSpanDetails?, TimeSpanDetails?, int?, decimal?, IReadOnlyDictionary<string, JsonElement>?, string?, int?, bool?, bool?)

Represents a single event in the lifecycle of a job. Check the Type property to determine job outcome (Succeeded, Failed, etc.). The API does not provide an ErrorMessage property - use Context for error details when Type is Failed.

public JobEvent(Guid? JobId, JobEventType Type, DateTime? DateTime, Provider Provider, string? WorkerId, IReadOnlyDictionary<string, JsonElement>? Context, TimeSpanDetails? ClaimDuration, TimeSpanDetails? JobDuration, int? RetryAttempt, decimal? Cost, IReadOnlyDictionary<string, JsonElement>? JobProperties, string? JobType, int? JobPriority, bool? ClaimHasCompleted, bool? JobHasCompleted)

Parameters

JobId Guid?
Type JobEventType
DateTime DateTime?
Provider Provider
WorkerId string
Context IReadOnlyDictionary<string, JsonElement>
ClaimDuration TimeSpanDetails
JobDuration TimeSpanDetails
RetryAttempt int?
Cost decimal?
JobProperties IReadOnlyDictionary<string, JsonElement>
JobType string
JobPriority int?
ClaimHasCompleted bool?
JobHasCompleted bool?

Properties

ClaimDuration

[JsonPropertyName("claimDuration")]
public TimeSpanDetails? ClaimDuration { get; init; }

Property Value

TimeSpanDetails

ClaimHasCompleted

[JsonPropertyName("claimHasCompleted")]
public bool? ClaimHasCompleted { get; init; }

Property Value

bool?

Context

[JsonPropertyName("context")]
public IReadOnlyDictionary<string, JsonElement>? Context { get; init; }

Property Value

IReadOnlyDictionary<string, JsonElement>

Cost

[JsonPropertyName("cost")]
public decimal? Cost { get; init; }

Property Value

decimal?

DateTime

[JsonPropertyName("dateTime")]
public DateTime? DateTime { get; init; }

Property Value

DateTime?

JobDuration

[JsonPropertyName("jobDuration")]
public TimeSpanDetails? JobDuration { get; init; }

Property Value

TimeSpanDetails

JobHasCompleted

[JsonPropertyName("jobHasCompleted")]
public bool? JobHasCompleted { get; init; }

Property Value

bool?

JobId

[JsonPropertyName("jobId")]
public Guid? JobId { get; init; }

Property Value

Guid?

JobPriority

[JsonPropertyName("jobPriority")]
public int? JobPriority { get; init; }

Property Value

int?

JobProperties

[JsonPropertyName("jobProperties")]
public IReadOnlyDictionary<string, JsonElement>? JobProperties { get; init; }

Property Value

IReadOnlyDictionary<string, JsonElement>

JobType

[JsonPropertyName("jobType")]
public string? JobType { get; init; }

Property Value

string

Provider

[JsonRequired]
[JsonPropertyName("provider")]
public Provider Provider { get; init; }

Property Value

Provider

RetryAttempt

[JsonPropertyName("retryAttempt")]
public int? RetryAttempt { get; init; }

Property Value

int?

Type

[JsonRequired]
[JsonPropertyName("type")]
public JobEventType Type { get; init; }

Property Value

JobEventType

WorkerId

[JsonPropertyName("workerId")]
public string? WorkerId { get; init; }

Property Value

string