Class TaskuraiModelFactory
Model factory for models.
Assembly: Taskurai.dll
public static class TaskuraiModelFactory
Methods
TokenInfoResponse(string, string, DateTimeOffset?, int?, string, string, string, IEnumerable<string>)
Initializes a new instance of Taskurai.Models.TokenInfoResponse.
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
Type | Name | Description |
---|---|---|
System.String | id | Personal Access Token id. |
System.String | name | Personal Access Token name. |
System.Nullable<System.DateTimeOffset> | created | Token created (utc). |
System.Nullable<System.Int32> | validMinutes | Valid minutes. |
System.String | type | Refresh type (pat). |
System.String | worker | Authorized worker. |
System.String | localIdentifier | Unique local identifier. |
System.Collections.Generic.IEnumerable<System.String> | scopes | Authorized 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.
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
Type | Name | Description |
---|---|---|
System.String | id | Task id. |
Taskurai.Models.TaskConfig | config | Task configuration. |
System.Nullable<System.DateTimeOffset> | created | Task created (utc). |
System.Nullable<System.DateTimeOffset> | modified | Task modified (utc). |
System.Nullable<System.DateTimeOffset> | started | Task started (utc). |
System.Nullable<System.DateTimeOffset> | runStarted | Task run started (utc). |
System.Nullable<System.DateTimeOffset> | stopped | Task stopped (utc). |
System.Nullable<Taskurai.Models.TaskStatusType> | status | Update the status (Creating, Created, Running, Succeeded, Failed, Canceled, IntermediateFailure,...). |
System.String | provisioningState | Task provisioning state. |
System.Nullable<System.Int32> | statusCode | Task status code. |
Taskurai.Models.TaskProgress | progress | Task progress. |
Taskurai.Models.TaskResult | result | Task result. |
Taskurai.Models.Error | error | Task error. |
System.Nullable<System.Boolean> | archived | Task archived. |
System.Nullable<System.Boolean> | postponed | Task postponed. |
System.Nullable<System.Boolean> | cancelled | Task cancelled (waiting for deletion). |
System.Nullable<System.Int64> | runCount | Task run count. |
System.String | correlationId | Task correlation id. |
System.String | workerName | Task worker name. |
System.String | workerImage | Task worker image. |
TaskDequeueResponse(TaskResponse, long?, string, DateTimeOffset?)
Initializes a new instance of Taskurai.Models.TaskDequeueResponse.
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
Type | Name | Description |
---|---|---|
Taskurai.Models.TaskResponse | task | |
System.Nullable<System.Int64> | dequeueCount | Number of times the task has been retrieved by instances of the worker. |
System.String | taskToken | Task token to be used to complete a task. |
System.Nullable<System.DateTimeOffset> | visibleOn | When is the task visible again to other worker instances. |
TaskExtendResponse(string, DateTimeOffset?)
Initializes a new instance of Taskurai.Models.TaskExtendResponse.
public static TaskExtendResponse TaskExtendResponse(string taskToken = null, DateTimeOffset? visibleOn = null)
Returns
Taskurai.Models.TaskExtendResponse: A new Taskurai.Models.TaskExtendResponse instance for mocking.
Parameters
Type | Name | Description |
---|---|---|
System.String | taskToken | Task token to be used to complete a task. |
System.Nullable<System.DateTimeOffset> | visibleOn | When is the task visible again to other worker instances. |
TaskHistoryResponse(string, DateTimeOffset?, TaskResponse)
Initializes a new instance of Taskurai.Models.TaskHistoryResponse.
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
Type | Name | Description |
---|---|---|
System.String | id | Task history id. |
System.Nullable<System.DateTimeOffset> | created | Task history created (utc). |
Taskurai.Models.TaskResponse | task | Task. |
LogMessage(DateTimeOffset?, DateTimeOffset?, double?, string, string)
Initializes a new instance of Taskurai.Models.LogMessage.
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
Type | Name | Description |
---|---|---|
System.Nullable<System.DateTimeOffset> | timeGenerated | Time generated (utc). |
System.Nullable<System.DateTimeOffset> | time | Time (utc). |
System.Nullable<System.Double> | timestamp | Time (utc). |
System.String | message | Log message. |
System.String | logTableName | Log 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.
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
Type | Name | Description |
---|---|---|
System.Nullable<System.DateTimeOffset> | timeGenerated | Time generated (utc). |
System.Nullable<System.DateTimeOffset> | time | Time (utc). |
System.Nullable<System.Double> | timestamp | Time (utc). |
System.Nullable<System.Int64> | runCount | Task run count. |
System.String | message | Log message. |
System.String | taskId | Log message. |
System.String | command | Command. |
System.String | taskCorrelationId | Task correlation id. |
System.String | sourceContext | Source context. |
System.String | workerName | Worker name. |
System.String | containerImage | Container image. |
System.String | plainMessage | Plain message. |
System.Collections.Generic.IReadOnlyDictionary<System.String,System.Object> | customColumns | Custom columns. |
System.String | logTableName | Log table name. |
SystemLogMessage(DateTimeOffset?, DateTimeOffset?, double?, long?, string, string, string, string, string, string, string)
Initializes a new instance of Taskurai.Models.SystemLogMessage.
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
Type | Name | Description |
---|---|---|
System.Nullable<System.DateTimeOffset> | timeGenerated | Time generated (utc). |
System.Nullable<System.DateTimeOffset> | time | Time (utc). |
System.Nullable<System.Double> | timestamp | Time (utc). |
System.Nullable<System.Int64> | count | Count. |
System.String | message | Log message. |
System.String | reason | Reason. |
System.String | containerAppName | Container app name. |
System.String | level | Log level. |
System.String | type | Log type. |
System.String | workerRevision | Worker revision. |
System.String | workerInstance | Worker instance. |