Table of Contents

Class OpenBiApiClientAuthObjectExtensions

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

Extension methods for the /authobjects and /authvalues REST API.

public static class OpenBiApiClientAuthObjectExtensions
Inheritance
object
OpenBiApiClientAuthObjectExtensions

Methods

CreateAuthObjectAsync(IOpenBiApiClient, AuthObject, CancellationToken)

Creates an auth object and returns it as stored, including the server-assigned id. A caller that picks its own id can use UpdateAuthObjectAsync(IOpenBiApiClient, string, AuthObject, CancellationToken) instead, which creates as well. The object permits nothing until values are added with CreateAuthObjectValueAsync(IOpenBiApiClient, string, AuthObjectValue, CancellationToken).

public static Task<AuthObject?> CreateAuthObjectAsync(this IOpenBiApiClient client, AuthObject authObject, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
authObject AuthObject
cancellationToken CancellationToken

Returns

Task<AuthObject>

CreateAuthObjectValueAsync(IOpenBiApiClient, string, AuthObjectValue, CancellationToken)

Adds a value to an auth object and returns it as stored, including the server-assigned id. The value names its owner - a user or organisation - so the same object can permit different values to different people. UpdateAuthObjectValueAsync(IOpenBiApiClient, string, string, AuthObjectValue, CancellationToken) creates as well, for a caller that picks its own id.

public static Task<AuthObjectValue?> CreateAuthObjectValueAsync(this IOpenBiApiClient client, string authObjectId, AuthObjectValue value, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
authObjectId string
value AuthObjectValue
cancellationToken CancellationToken

Returns

Task<AuthObjectValue>

DeleteAuthObjectAsync(IOpenBiApiClient, string, CancellationToken)

Deletes an auth object. Its values are deleted with it, and the restriction stops applying.

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

Parameters

client IOpenBiApiClient
id string
cancellationToken CancellationToken

Returns

Task

DeleteAuthObjectValueAsync(IOpenBiApiClient, string, string, CancellationToken)

Deletes one value of an auth object. That owner loses this value; the object and its other values stay.

public static Task DeleteAuthObjectValueAsync(this IOpenBiApiClient client, string authObjectId, string valueId, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
authObjectId string
valueId string
cancellationToken CancellationToken

Returns

Task

GetAuthObjectAsync(IOpenBiApiClient, string, CancellationToken)

Reads one auth object by id. Throws OpenBiApiException with status 404 when there is no auth object with this id.

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

Parameters

client IOpenBiApiClient
id string
cancellationToken CancellationToken

Returns

Task<AuthObject>

GetAuthObjectValuesAsync(IOpenBiApiClient, string, OpenBiListRequest?, CancellationToken)

Lists all values permitted for one auth object, each with the owner it applies to; an unknown auth object id yields an empty list. To look them up by owner instead, use GetAuthObjectValuesForOwnerAsync(IOpenBiApiClient, string?, string?, OpenBiListRequest?, CancellationToken).

public static Task<OpenBiListResult<AuthObjectValue>> GetAuthObjectValuesAsync(this IOpenBiApiClient client, string authObjectId, OpenBiListRequest? request = null, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
authObjectId string
request OpenBiListRequest
cancellationToken CancellationToken

Returns

Task<OpenBiListResult<AuthObjectValue>>

GetAuthObjectValuesForOwnerAsync(IOpenBiApiClient, string?, string?, OpenBiListRequest?, CancellationToken)

Looks up authorized value ranges across all auth objects (GET authvalues), optionally filtered by owner and/or auth object - use it to answer what one user or organisation is allowed to see. GetAuthObjectValuesAsync(IOpenBiApiClient, string, OpenBiListRequest?, CancellationToken) is the same data grouped by object.

public static Task<OpenBiListResult<AuthObjectValue>> GetAuthObjectValuesForOwnerAsync(this IOpenBiApiClient client, string? owner = null, string? authObjectId = null, OpenBiListRequest? request = null, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
owner string
authObjectId string
request OpenBiListRequest
cancellationToken CancellationToken

Returns

Task<OpenBiListResult<AuthObjectValue>>

GetAuthObjectsAsync(IOpenBiApiClient, OpenBiListRequest?, CancellationToken)

Lists auth objects (GET authobjects), with the shared list options of request. An auth object is a data-level authorization on one characteristic; its permitted values are read with GetAuthObjectValuesAsync(IOpenBiApiClient, string, OpenBiListRequest?, CancellationToken).

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

Parameters

client IOpenBiApiClient
request OpenBiListRequest
cancellationToken CancellationToken

Returns

Task<OpenBiListResult<AuthObject>>

UpdateAuthObjectAsync(IOpenBiApiClient, string, AuthObject, CancellationToken)

Creates or updates the auth object with the given id: an id that is not there yet is inserted rather than answered with a 404.

public static Task<AuthObject?> UpdateAuthObjectAsync(this IOpenBiApiClient client, string id, AuthObject authObject, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
id string
authObject AuthObject
cancellationToken CancellationToken

Returns

Task<AuthObject>

UpdateAuthObjectValueAsync(IOpenBiApiClient, string, string, AuthObjectValue, CancellationToken)

Creates or updates the value with the given id under an auth object: an id that is not there yet is inserted rather than answered with a 404.

public static Task<AuthObjectValue?> UpdateAuthObjectValueAsync(this IOpenBiApiClient client, string authObjectId, string valueId, AuthObjectValue value, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
authObjectId string
valueId string
value AuthObjectValue
cancellationToken CancellationToken

Returns

Task<AuthObjectValue>