Table of Contents

Class OpenBiApiClientDownloadExtensions

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

Extension methods for the /downloads REST API. A caller without the download administrator permission only sees downloads that are unassigned or assigned to one of their own usergroups.

public static class OpenBiApiClientDownloadExtensions
Inheritance
object
OpenBiApiClientDownloadExtensions

Methods

CreateDownloadAsync(IOpenBiApiClient, Download, CancellationToken)

Creates a download and returns it with its server-assigned id. A create never overwrites: an id that already exists fails. UpdateDownloadAsync(IOpenBiApiClient, string, Download, CancellationToken) creates as well as updates, for a caller that picks its own id.

public static Task<Download?> CreateDownloadAsync(this IOpenBiApiClient client, Download download, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
download Download
cancellationToken CancellationToken

Returns

Task<Download>

DeleteDownloadAsync(IOpenBiApiClient, string, CancellationToken)

Deletes a download together with its file and usergroup assignments. The role content elements it offered, and the files behind them, are not deleted. An id that does not exist is not an error.

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

Parameters

client IOpenBiApiClient
id string
cancellationToken CancellationToken

Returns

Task

GetDownloadAsync(IOpenBiApiClient, string, CancellationToken)

Reads one download with its files (GET downloads/{id}). Throws an OpenBiApiException with status 404 when there is no download with this id, or when it is assigned only to usergroups the caller is not in and the caller lacks openbi.download.write.

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

Parameters

client IOpenBiApiClient
id string
cancellationToken CancellationToken

Returns

Task<Download>

GetDownloadGroupsAsync(IOpenBiApiClient, CancellationToken)

Lists the distinct download group names in use, across all downloads.

public static Task<OpenBiListResult<string>> GetDownloadGroupsAsync(this IOpenBiApiClient client, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
cancellationToken CancellationToken

Returns

Task<OpenBiListResult<string>>

GetDownloadsAsync(IOpenBiApiClient, CancellationToken)

Lists downloads with their files. A caller without openbi.download.write only sees downloads that are assigned to no usergroup or to one of their own. The route takes no list options.

public static Task<OpenBiListResult<Download>> GetDownloadsAsync(this IOpenBiApiClient client, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
cancellationToken CancellationToken

Returns

Task<OpenBiListResult<Download>>

UpdateDownloadAsync(IOpenBiApiClient, string, Download, CancellationToken)

Creates or updates the download with this id (POST downloads/{id}) - an id that does not exist yet is inserted. The id in the route wins over the one in the body; a non-null Files replaces the attached files.

public static Task<Download?> UpdateDownloadAsync(this IOpenBiApiClient client, string id, Download download, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
id string
download Download
cancellationToken CancellationToken

Returns

Task<Download>