Class OpenBiApiClientMasterDataExtensions
- Namespace
- BiExcellence.OpenBi.Api.MasterData
- Assembly
- BiExcellence.OpenBi.Api.Client.dll
Extension methods for the /masterdataobjects REST API (the dynamic master data table engine,
addressed by IOBJNM key; the legacy DATAPROVIDER_NAME-keyed path is out of scope for this client).
Note that master data value listing uses its own plain search/skip/top query
parameters rather than the $select/$top/... convention used by OpenBiListRequest
elsewhere in this client, so it is not accepted here.
public static class OpenBiApiClientMasterDataExtensions
- Inheritance
-
objectOpenBiApiClientMasterDataExtensions
Methods
CreateHierarchyAsync(IOpenBiApiClient, string, MasterDataHierarchyDetail, CancellationToken)
Creates (or fully replaces) a hierarchy and its node tree: posting an existing name replaces it rather than merging, in one transaction. Nodes refer to values loaded with CreateMasterDataAsync(IOpenBiApiClient, string, MasterDataValue[], CancellationToken); the references are not checked. Without a HierarchyName the hierarchy is a new one, which the server names; the name is in the returned hierarchy.
public static Task<MasterDataHierarchyDetail?> CreateHierarchyAsync(this IOpenBiApiClient client, string iobjnm, MasterDataHierarchyDetail hierarchy, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientiobjnmstringhierarchyMasterDataHierarchyDetailcancellationTokenCancellationToken
Returns
CreateMasterDataAsync(IOpenBiApiClient, string, MasterDataValue[], CancellationToken)
Creates or updates one or more master data values. Every value needs its Chavl (a 400 otherwise); posting an existing one updates its text for that language and the attributes it carries. Attributes not defined with CreateMasterDataAttributeAsync(IOpenBiApiClient, string, MasterDataAttribute, CancellationToken) are not stored. The server writes the values to its database in the background; the result echoes the request.
public static Task<MasterDataValue[]> CreateMasterDataAsync(this IOpenBiApiClient client, string iobjnm, MasterDataValue[] values, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientiobjnmstringvaluesMasterDataValue[]cancellationTokenCancellationToken
Returns
- Task<MasterDataValue[]>
CreateMasterDataAttributeAsync(IOpenBiApiClient, string, MasterDataAttribute, CancellationToken)
Adds an attribute (a column) to the values of a master data object. An empty name or one that is not a valid column name is a 400.
public static Task<MasterDataAttribute?> CreateMasterDataAttributeAsync(this IOpenBiApiClient client, string iobjnm, MasterDataAttribute attribute, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientiobjnmstringattributeMasterDataAttributecancellationTokenCancellationToken
Returns
- Task<MasterDataAttribute>
CreateMasterDataObjectAsync(IOpenBiApiClient, MasterDataObject, CancellationToken)
Creates a master data object in the caller's organisation, lazily creating its dynamic table if it does not already exist - an object that exists is left as it is. There is no method to delete one. Define its attributes with CreateMasterDataAttributeAsync(IOpenBiApiClient, string, MasterDataAttribute, CancellationToken) before loading values with CreateMasterDataAsync(IOpenBiApiClient, string, MasterDataValue[], CancellationToken).
public static Task<MasterDataObject?> CreateMasterDataObjectAsync(this IOpenBiApiClient client, MasterDataObject masterDataObject, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientmasterDataObjectMasterDataObjectcancellationTokenCancellationToken
Returns
- Task<MasterDataObject>
DeleteHierarchyAsync(IOpenBiApiClient, string, string, CancellationToken)
Deletes a hierarchy and all its nodes. The values of the master data object are untouched. An unknown name is not an error.
public static Task DeleteHierarchyAsync(this IOpenBiApiClient client, string iobjnm, string hierarchyName, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientiobjnmstringhierarchyNamestringcancellationTokenCancellationToken
Returns
- Task
DeleteMasterDataAsync(IOpenBiApiClient, string, string, CancellationToken)
Deletes one value of a master data object, in every language. Hierarchy nodes referring to it stop resolving.
public static Task DeleteMasterDataAsync(this IOpenBiApiClient client, string iobjnm, string chavl, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientiobjnmstringchavlstringcancellationTokenCancellationToken
Returns
- Task
DeleteMasterDataAttributeAsync(IOpenBiApiClient, string, string, CancellationToken)
Removes an attribute from a master data object: the column and the values stored in it are dropped.
public static Task DeleteMasterDataAttributeAsync(this IOpenBiApiClient client, string iobjnm, string name, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientiobjnmstringnamestringcancellationTokenCancellationToken
Returns
- Task
GetHierarchiesAsync(IOpenBiApiClient, string, CancellationToken)
Lists the hierarchies defined over the values of a master data object - the drill paths a query can use - without their nodes; GetHierarchyAsync(IOpenBiApiClient, string, string, CancellationToken) reads one in full.
public static Task<OpenBiListResult<MasterDataHierarchy>> GetHierarchiesAsync(this IOpenBiApiClient client, string iobjnm, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientiobjnmstringcancellationTokenCancellationToken
Returns
GetHierarchyAsync(IOpenBiApiClient, string, string, CancellationToken)
Reads one hierarchy in full, with its nodes and their parent-child links. Throws an OpenBiApiException with status 404 when the master data object has no hierarchy with this name.
public static Task<MasterDataHierarchyDetail> GetHierarchyAsync(this IOpenBiApiClient client, string iobjnm, string hierarchyName, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientiobjnmstringhierarchyNamestringcancellationTokenCancellationToken
Returns
GetMasterDataAsync(IOpenBiApiClient, string, string?, int?, int?, CancellationToken)
Lists the values of a master data object (one entry per value per language), optionally filtered by a free-text search and paged with plain skip/top parameters.
public static Task<OpenBiListResult<MasterDataValue>> GetMasterDataAsync(this IOpenBiApiClient client, string iobjnm, string? search = null, int? skip = null, int? top = null, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientThe client.
iobjnmstringThe technical name of the characteristic.
searchstringKeeps the values whose key or any text contains it, case-insensitive.
skipint?The number of values to skip - values, not entries, in
chavlKeyorder.topint?The maximum number of values to return. A value with several languages yields several entries, so the result can hold more entries than this.
cancellationTokenCancellationTokenA cancellation token.
Returns
- Task<OpenBiListResult<MasterDataValue>>
The entries; TotalCount carries the number of matching values before paging.
GetMasterDataAttributesAsync(IOpenBiApiClient, string, CancellationToken)
Lists the attributes of a master data object - the columns each of its values can carry.
public static Task<OpenBiListResult<MasterDataAttribute>> GetMasterDataAttributesAsync(this IOpenBiApiClient client, string iobjnm, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientiobjnmstringcancellationTokenCancellationToken
Returns
GetMasterDataObjectsAsync(IOpenBiApiClient, CancellationToken)
Lists every master data object of the caller's organisation. Master data is the server's own copy of a characteristic: its values, the attributes each value carries, and the hierarchies over them.
public static Task<OpenBiListResult<MasterDataObject>> GetMasterDataObjectsAsync(this IOpenBiApiClient client, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientcancellationTokenCancellationToken
Returns
- Task<OpenBiListResult<MasterDataObject>>