Table of Contents

Class OpenBiApiClientTransportTaskExtensions

Namespace
BiExcellence.OpenBi.Api.Transport
Assembly
BiExcellence.OpenBi.Api.Client.dll

Extension methods for the /transporttasks REST API.

public static class OpenBiApiClientTransportTaskExtensions
Inheritance
object
OpenBiApiClientTransportTaskExtensions

Methods

AssignTransportTaskElementAsync(IOpenBiApiClient, string, TransportTaskElement, CancellationToken)

Assigns an element to a transport task (POST transporttasks/{id}/elements) and returns the stored element. An element already tracked with the same ElementId, ElementType, parent and language is updated instead - so recording a change twice is not an error, and a later Delete replaces an earlier Create. The server sets TransportTaskId and Date. RemoveTransportTaskElementAsync(IOpenBiApiClient, string, long, CancellationToken) takes it out again.

public static Task<TransportTaskElement?> AssignTransportTaskElementAsync(this IOpenBiApiClient client, string transportTaskId, TransportTaskElement element, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
transportTaskId string
element TransportTaskElement
cancellationToken CancellationToken

Returns

Task<TransportTaskElement>

CreateTransportTaskAsync(IOpenBiApiClient, TransportTask, CancellationToken)

Creates a transport task (POST transporttasks) and returns it, including the id the server generates when Id is empty. The task starts empty: add what it should carry with AssignTransportTaskElementAsync(IOpenBiApiClient, string, TransportTaskElement, CancellationToken). A client that picks its own id can use UpdateTransportTaskAsync(IOpenBiApiClient, string, TransportTask, CancellationToken) instead, which creates as well.

public static Task<TransportTask?> CreateTransportTaskAsync(this IOpenBiApiClient client, TransportTask transportTask, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
transportTask TransportTask
cancellationToken CancellationToken

Returns

Task<TransportTask>

DeleteTransportTaskAsync(IOpenBiApiClient, string, CancellationToken)

Deletes a transport task together with its element list (DELETE transporttasks/{id}). The configuration objects the elements name are untouched - only the change set goes. Deleting a task that is not there is not an error.

public static Task DeleteTransportTaskAsync(this IOpenBiApiClient client, string id, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
id string
cancellationToken CancellationToken

Returns

Task

GetTransportTaskAsync(IOpenBiApiClient, string, CancellationToken)

Reads one transport task (GET transporttasks/{id}). Throws OpenBiApiException (404) when there is no such task.

public static Task<TransportTask> GetTransportTaskAsync(this IOpenBiApiClient client, string id, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
id string
cancellationToken CancellationToken

Returns

Task<TransportTask>

GetTransportTaskElementsAsync(IOpenBiApiClient, string, OpenBiListRequest?, CancellationToken)

Lists the elements a transport task carries (GET transporttasks/{id}/elements). An unknown task id answers an empty list.

public static Task<OpenBiListResult<TransportTaskElement>> GetTransportTaskElementsAsync(this IOpenBiApiClient client, string transportTaskId, OpenBiListRequest? request = null, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
transportTaskId string
request OpenBiListRequest
cancellationToken CancellationToken

Returns

Task<OpenBiListResult<TransportTaskElement>>

GetTransportTasksAsync(IOpenBiApiClient, OpenBiListRequest?, CancellationToken)

Lists transport tasks (GET transporttasks).

public static Task<OpenBiListResult<TransportTask>> GetTransportTasksAsync(this IOpenBiApiClient client, OpenBiListRequest? request = null, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
request OpenBiListRequest
cancellationToken CancellationToken

Returns

Task<OpenBiListResult<TransportTask>>

RemoveTransportTaskElementAsync(IOpenBiApiClient, string, long, CancellationToken)

Takes an element out of a transport task by its Id (DELETE transporttasks/{id}/elements/{elementId}). Removes it from the change set only; the configuration object itself stays.

public static Task RemoveTransportTaskElementAsync(this IOpenBiApiClient client, string transportTaskId, long elementId, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
transportTaskId string
elementId long
cancellationToken CancellationToken

Returns

Task

UpdateTransportTaskAsync(IOpenBiApiClient, string, TransportTask, CancellationToken)

Creates or updates the transport task with the given id (POST transporttasks/{id}) - an id that is not there yet is inserted. Saving it in state Closed or Transported sets Released to the time of the save.

public static Task<TransportTask?> UpdateTransportTaskAsync(this IOpenBiApiClient client, string id, TransportTask transportTask, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
id string
transportTask TransportTask
cancellationToken CancellationToken

Returns

Task<TransportTask>