Skip to main content

Class TaskuraiModelFactory

Model factory for models.

Assembly: Taskurai.dll
Declaration
public static class TaskuraiModelFactory

Methods

TokenInfoResponse(string, string, DateTimeOffset?, int?, string, string, string, IEnumerable<string>)

Initializes a new instance of Taskurai.Models.TokenInfoResponse.

Declaration
public static TokenInfoResponse TokenInfoResponse(string id = null, string name = null, DateTimeOffset? created = null, int? validMinutes = null, string type = null, string worker = null, string localIdentifier = null, IEnumerable<string> scopes = null)
Returns

Taskurai.Models.TokenInfoResponse: A new Taskurai.Models.TokenInfoResponse instance for mocking.

Parameters
TypeNameDescription
System.StringidPersonal Access Token id.
System.StringnamePersonal Access Token name.
System.Nullable<System.DateTimeOffset>createdToken created (utc).
System.Nullable<System.Int32>validMinutesValid minutes.
System.StringtypeRefresh type (pat).
System.StringworkerAuthorized worker.
System.StringlocalIdentifierUnique local identifier.
System.Collections.Generic.IEnumerable<System.String>scopesAuthorized scopes.

TaskResponse(string, TaskConfig, DateTimeOffset?, DateTimeOffset?, DateTimeOffset?, DateTimeOffset?, DateTimeOffset?, TaskStatusType?, string, int?, TaskProgress, TaskResult, Error, bool?, bool?, bool?, long?, string, string, string)

Initializes a new instance of Taskurai.Models.TaskResponse.

Declaration
public static TaskResponse TaskResponse(string id = null, TaskConfig config = null, DateTimeOffset? created = null, DateTimeOffset? modified = null, DateTimeOffset? started = null, DateTimeOffset? runStarted = null, DateTimeOffset? stopped = null, TaskStatusType? status = null, string provisioningState = null, int? statusCode = null, TaskProgress progress = null, TaskResult result = null, Error error = null, bool? archived = null, bool? postponed = null, bool? cancelled = null, long? runCount = null, string correlationId = null, string workerName = null, string workerImage = null)
Returns

Taskurai.Models.TaskResponse: A new Taskurai.Models.TaskResponse instance for mocking.

Parameters
TypeNameDescription
System.StringidTask id.
Taskurai.Models.TaskConfigconfigTask configuration.
System.Nullable<System.DateTimeOffset>createdTask created (utc).
System.Nullable<System.DateTimeOffset>modifiedTask modified (utc).
System.Nullable<System.DateTimeOffset>startedTask started (utc).
System.Nullable<System.DateTimeOffset>runStartedTask run started (utc).
System.Nullable<System.DateTimeOffset>stoppedTask stopped (utc).
System.Nullable<Taskurai.Models.TaskStatusType>statusUpdate the status (Creating, Created, Running, Succeeded, Failed, Canceled, IntermediateFailure,...).
System.StringprovisioningStateTask provisioning state.
System.Nullable<System.Int32>statusCodeTask status code.
Taskurai.Models.TaskProgressprogressTask progress.
Taskurai.Models.TaskResultresultTask result.
Taskurai.Models.ErrorerrorTask error.
System.Nullable<System.Boolean>archivedTask archived.
System.Nullable<System.Boolean>postponedTask postponed.
System.Nullable<System.Boolean>cancelledTask cancelled (waiting for deletion).
System.Nullable<System.Int64>runCountTask run count.
System.StringcorrelationIdTask correlation id.
System.StringworkerNameTask worker name.
System.StringworkerImageTask worker image.

TaskDequeueResponse(TaskResponse, long?, string, DateTimeOffset?)

Initializes a new instance of Taskurai.Models.TaskDequeueResponse.

Declaration
public static TaskDequeueResponse TaskDequeueResponse(TaskResponse task = null, long? dequeueCount = null, string taskToken = null, DateTimeOffset? visibleOn = null)
Returns

Taskurai.Models.TaskDequeueResponse: A new Taskurai.Models.TaskDequeueResponse instance for mocking.

Parameters
TypeNameDescription
Taskurai.Models.TaskResponsetask
System.Nullable<System.Int64>dequeueCountNumber of times the task has been retrieved by instances of the worker.
System.StringtaskTokenTask token to be used to complete a task.
System.Nullable<System.DateTimeOffset>visibleOnWhen is the task visible again to other worker instances.

TaskExtendResponse(string, DateTimeOffset?)

Initializes a new instance of Taskurai.Models.TaskExtendResponse.

Declaration
public static TaskExtendResponse TaskExtendResponse(string taskToken = null, DateTimeOffset? visibleOn = null)
Returns

Taskurai.Models.TaskExtendResponse: A new Taskurai.Models.TaskExtendResponse instance for mocking.

Parameters
TypeNameDescription
System.StringtaskTokenTask token to be used to complete a task.
System.Nullable<System.DateTimeOffset>visibleOnWhen is the task visible again to other worker instances.

TaskHistoryResponse(string, DateTimeOffset?, TaskResponse)

Initializes a new instance of Taskurai.Models.TaskHistoryResponse.

Declaration
public static TaskHistoryResponse TaskHistoryResponse(string id = null, DateTimeOffset? created = null, TaskResponse task = null)
Returns

Taskurai.Models.TaskHistoryResponse: A new Taskurai.Models.TaskHistoryResponse instance for mocking.

Parameters
TypeNameDescription
System.StringidTask history id.
System.Nullable<System.DateTimeOffset>createdTask history created (utc).
Taskurai.Models.TaskResponsetaskTask.

LogMessage(DateTimeOffset?, DateTimeOffset?, double?, string, string)

Initializes a new instance of Taskurai.Models.LogMessage.

Declaration
public static LogMessage LogMessage(DateTimeOffset? timeGenerated = null, DateTimeOffset? time = null, double? timestamp = null, string message = null, string logTableName = null)
Returns

Taskurai.Models.LogMessage: A new Taskurai.Models.LogMessage instance for mocking.

Parameters
TypeNameDescription
System.Nullable<System.DateTimeOffset>timeGeneratedTime generated (utc).
System.Nullable<System.DateTimeOffset>timeTime (utc).
System.Nullable<System.Double>timestampTime (utc).
System.StringmessageLog message.
System.StringlogTableNameLog table name.

ConsoleLogMessage(DateTimeOffset?, DateTimeOffset?, double?, long?, string, string, string, string, string, string, string, string, IReadOnlyDictionary<string, object>, string)

Initializes a new instance of Taskurai.Models.ConsoleLogMessage.

Declaration
public static ConsoleLogMessage ConsoleLogMessage(DateTimeOffset? timeGenerated = null, DateTimeOffset? time = null, double? timestamp = null, long? runCount = null, string message = null, string taskId = null, string command = null, string taskCorrelationId = null, string sourceContext = null, string workerName = null, string containerImage = null, string plainMessage = null, IReadOnlyDictionary<string, object> customColumns = null, string logTableName = null)
Returns

Taskurai.Models.ConsoleLogMessage: A new Taskurai.Models.ConsoleLogMessage instance for mocking.

Parameters
TypeNameDescription
System.Nullable<System.DateTimeOffset>timeGeneratedTime generated (utc).
System.Nullable<System.DateTimeOffset>timeTime (utc).
System.Nullable<System.Double>timestampTime (utc).
System.Nullable<System.Int64>runCountTask run count.
System.StringmessageLog message.
System.StringtaskIdLog message.
System.StringcommandCommand.
System.StringtaskCorrelationIdTask correlation id.
System.StringsourceContextSource context.
System.StringworkerNameWorker name.
System.StringcontainerImageContainer image.
System.StringplainMessagePlain message.
System.Collections.Generic.IReadOnlyDictionary<System.String,System.Object>customColumnsCustom columns.
System.StringlogTableNameLog table name.

SystemLogMessage(DateTimeOffset?, DateTimeOffset?, double?, long?, string, string, string, string, string, string, string)

Initializes a new instance of Taskurai.Models.SystemLogMessage.

Declaration
public static SystemLogMessage SystemLogMessage(DateTimeOffset? timeGenerated = null, DateTimeOffset? time = null, double? timestamp = null, long? count = null, string message = null, string reason = null, string containerAppName = null, string level = null, string type = null, string workerRevision = null, string workerInstance = null)
Returns

Taskurai.Models.SystemLogMessage: A new Taskurai.Models.SystemLogMessage instance for mocking.

Parameters
TypeNameDescription
System.Nullable<System.DateTimeOffset>timeGeneratedTime generated (utc).
System.Nullable<System.DateTimeOffset>timeTime (utc).
System.Nullable<System.Double>timestampTime (utc).
System.Nullable<System.Int64>countCount.
System.StringmessageLog message.
System.StringreasonReason.
System.StringcontainerAppNameContainer app name.
System.StringlevelLog level.
System.StringtypeLog type.
System.StringworkerRevisionWorker revision.
System.StringworkerInstanceWorker instance.