Table of Contents

Class OpenBiApiClientOrganisationExtensions

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

Extension methods for the /organisations REST API.

public static class OpenBiApiClientOrganisationExtensions
Inheritance
object
OpenBiApiClientOrganisationExtensions

Methods

AssignOrganisationRoleAsync(IOpenBiApiClient, string, string, RoleAssignmentRequest?, CancellationToken)

Links a role to an organisation, making its content available to every user of the organisation. assignment sets the validity and the edit/delete rights; without it the link is valid for 30 days from now and grants neither. Idempotent - linking again overwrites those settings; RemoveOrganisationRoleAsync(IOpenBiApiClient, string, string, CancellationToken) undoes it. A 404 means there is no organisation or no role with these ids.

public static Task AssignOrganisationRoleAsync(this IOpenBiApiClient client, string organisationId, string roleId, RoleAssignmentRequest? assignment = null, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
organisationId string
roleId string
assignment RoleAssignmentRequest
cancellationToken CancellationToken

Returns

Task

AssignOrganisationUserAsync(IOpenBiApiClient, string, string, CancellationToken)

Links a user to an organisation, so the organisation's usergroups, roles and auth object values apply to them. Idempotent; RemoveOrganisationUserAsync(IOpenBiApiClient, string, string, CancellationToken) undoes it. The same link is written by AssignUserOrganisationAsync(IOpenBiApiClient, string, string, CancellationToken). A 404 means there is no organisation or no user with these ids.

public static Task AssignOrganisationUserAsync(this IOpenBiApiClient client, string organisationId, string userId, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
organisationId string
userId string
cancellationToken CancellationToken

Returns

Task

AssignOrganisationUsergroupAsync(IOpenBiApiClient, string, string, CancellationToken)

Links a usergroup to an organisation: every user of the organisation gets the usergroup - with its permissions and roles - without being a member of it. Idempotent; RemoveOrganisationUsergroupAsync(IOpenBiApiClient, string, string, CancellationToken) undoes it. The same link is written by AssignUsergroupOrganisationAsync(IOpenBiApiClient, string, string, CancellationToken). A 404 means there is no organisation or no usergroup with these ids.

public static Task AssignOrganisationUsergroupAsync(this IOpenBiApiClient client, string organisationId, string usergroupId, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
organisationId string
usergroupId string
cancellationToken CancellationToken

Returns

Task

CreateOrganisationAsync(IOpenBiApiClient, Organisation, CancellationToken)

Creates an organisation and returns it as stored, including the server-assigned id. A caller that picks its own id can use UpdateOrganisationAsync(IOpenBiApiClient, string, Organisation, CancellationToken) instead, which creates as well.

public static Task<Organisation?> CreateOrganisationAsync(this IOpenBiApiClient client, Organisation organisation, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
organisation Organisation
cancellationToken CancellationToken

Returns

Task<Organisation>

DeleteOrganisationAsync(IOpenBiApiClient, string, CancellationToken)

Deletes an organisation. Its user, usergroup and role links and the auth object values it owns are deleted with it; the users, usergroups and roles themselves survive.

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

Parameters

client IOpenBiApiClient
id string
cancellationToken CancellationToken

Returns

Task

GetOrganisationAsync(IOpenBiApiClient, string, CancellationToken)

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

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

Parameters

client IOpenBiApiClient
id string
cancellationToken CancellationToken

Returns

Task<Organisation>

GetOrganisationRolesAsync(IOpenBiApiClient, string, OpenBiListRequest?, CancellationToken)

Lists the roles linked to an organisation. The same links are read per role with GetRoleOrganisationsAsync(IOpenBiApiClient, string, OpenBiListRequest?, CancellationToken).

public static Task<OpenBiListResult<Role>> GetOrganisationRolesAsync(this IOpenBiApiClient client, string organisationId, OpenBiListRequest? request = null, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
organisationId string
request OpenBiListRequest
cancellationToken CancellationToken

Returns

Task<OpenBiListResult<Role>>

GetOrganisationUsergroupsAsync(IOpenBiApiClient, string, OpenBiListRequest?, CancellationToken)

Lists the usergroups linked to an organisation. The same links are read per usergroup with GetUsergroupOrganisationsAsync(IOpenBiApiClient, string, OpenBiListRequest?, CancellationToken).

public static Task<OpenBiListResult<Usergroup>> GetOrganisationUsergroupsAsync(this IOpenBiApiClient client, string organisationId, OpenBiListRequest? request = null, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
organisationId string
request OpenBiListRequest
cancellationToken CancellationToken

Returns

Task<OpenBiListResult<Usergroup>>

GetOrganisationUsersAsync(IOpenBiApiClient, string, OpenBiListRequest?, CancellationToken)

Lists the users linked to an organisation. The same links are read per user with GetUserOrganisationsAsync(IOpenBiApiClient, string, OpenBiListRequest?, CancellationToken).

public static Task<OpenBiListResult<User>> GetOrganisationUsersAsync(this IOpenBiApiClient client, string organisationId, OpenBiListRequest? request = null, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
organisationId string
request OpenBiListRequest
cancellationToken CancellationToken

Returns

Task<OpenBiListResult<User>>

GetOrganisationsAsync(IOpenBiApiClient, OpenBiListRequest?, CancellationToken)

Lists organisations (GET organisations), with the shared list options of request. Use QueryOrganisationsAsync(IOpenBiApiClient, OpenBiListRequest?, CancellationToken) when a filter is too long for a URL.

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

Parameters

client IOpenBiApiClient
request OpenBiListRequest
cancellationToken CancellationToken

Returns

Task<OpenBiListResult<Organisation>>

QueryOrganisationsAsync(IOpenBiApiClient, OpenBiListRequest?, CancellationToken)

Lists organisations with the options in the request body instead of in the query string - the QUERY-method form of the list route, for filters that do not fit in a URL.

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

Parameters

client IOpenBiApiClient
request OpenBiListRequest
cancellationToken CancellationToken

Returns

Task<OpenBiListResult<Organisation>>

RemoveOrganisationRoleAsync(IOpenBiApiClient, string, string, CancellationToken)

Unlinks a role from an organisation. Removes the link only; removing a link that is not there is not an error.

public static Task RemoveOrganisationRoleAsync(this IOpenBiApiClient client, string organisationId, string roleId, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
organisationId string
roleId string
cancellationToken CancellationToken

Returns

Task

RemoveOrganisationUserAsync(IOpenBiApiClient, string, string, CancellationToken)

Unlinks a user from an organisation. Removes the link only; removing a link that is not there is not an error.

public static Task RemoveOrganisationUserAsync(this IOpenBiApiClient client, string organisationId, string userId, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
organisationId string
userId string
cancellationToken CancellationToken

Returns

Task

RemoveOrganisationUsergroupAsync(IOpenBiApiClient, string, string, CancellationToken)

Unlinks a usergroup from an organisation. Removes the link only; removing a link that is not there is not an error.

public static Task RemoveOrganisationUsergroupAsync(this IOpenBiApiClient client, string organisationId, string usergroupId, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
organisationId string
usergroupId string
cancellationToken CancellationToken

Returns

Task

UpdateOrganisationAsync(IOpenBiApiClient, string, Organisation, CancellationToken)

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

public static Task<Organisation?> UpdateOrganisationAsync(this IOpenBiApiClient client, string id, Organisation organisation, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
id string
organisation Organisation
cancellationToken CancellationToken

Returns

Task<Organisation>