Class OpenBiApiClientTransportTaskExtensions
Extension methods for the /transporttasks REST API.
public static class OpenBiApiClientTransportTaskExtensions
- Inheritance
-
objectOpenBiApiClientTransportTaskExtensions
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
clientIOpenBiApiClienttransportTaskIdstringelementTransportTaskElementcancellationTokenCancellationToken
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
clientIOpenBiApiClienttransportTaskTransportTaskcancellationTokenCancellationToken
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
clientIOpenBiApiClientidstringcancellationTokenCancellationToken
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
clientIOpenBiApiClientidstringcancellationTokenCancellationToken
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
clientIOpenBiApiClienttransportTaskIdstringrequestOpenBiListRequestcancellationTokenCancellationToken
Returns
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
clientIOpenBiApiClientrequestOpenBiListRequestcancellationTokenCancellationToken
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
clientIOpenBiApiClienttransportTaskIdstringelementIdlongcancellationTokenCancellationToken
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
clientIOpenBiApiClientidstringtransportTaskTransportTaskcancellationTokenCancellationToken
Returns
- Task<TransportTask>