Class OpenBiApiClientTableAttributeExtensions
- Namespace
- BiExcellence.OpenBi.Api.TableAttributes
- Assembly
- BiExcellence.OpenBi.Api.Client.dll
Extension methods for the /tableattributes REST API (the dynamic custom-attribute / EAV schema engine).
public static class OpenBiApiClientTableAttributeExtensions
- Inheritance
-
objectOpenBiApiClientTableAttributeExtensions
Methods
CreateTableAttributeAsync(IOpenBiApiClient, CreateTableAttributeRequest, CancellationToken)
Creates a table attribute (POST tableattributes), adding a real column to its table. The table has
to be one of GetTableAttributeTablesAsync(IOpenBiApiClient, CancellationToken) and the type one of
GetTableAttributeTypesAsync(IOpenBiApiClient, CancellationToken); an invalid column name is a 400, and an id or a column name that
already exists is a 409. UpdateTableAttributeAsync(IOpenBiApiClient, string, CreateTableAttributeRequest, CancellationToken) creates as well, under an id of the
caller's choosing. To add the attribute as a column of a base entity, create it on table
SHOP_PRODUCT and attach it with
AssignTableAttributeToBaseEntityAsync(IOpenBiApiClient, string, string, CancellationToken).
public static Task<TableAttribute?> CreateTableAttributeAsync(this IOpenBiApiClient client, CreateTableAttributeRequest tableAttribute, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClienttableAttributeCreateTableAttributeRequestcancellationTokenCancellationToken
Returns
- Task<TableAttribute>
DeleteTableAttributeAsync(IOpenBiApiClient, string, CancellationToken)
Deletes a table attribute: the column and every value in it are dropped. An attribute of table
SHOP_PRODUCT is also detached from every base entity it was attached to. An unknown id is not an
error.
public static Task DeleteTableAttributeAsync(this IOpenBiApiClient client, string id, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientidstringcancellationTokenCancellationToken
Returns
- Task
GetTableAttributeTablesAsync(IOpenBiApiClient, CancellationToken)
Lists every table that supports dynamic custom attributes (i.e. implements the EAV engine) - the values Table accepts.
public static Task<OpenBiListResult<TableAttributeTable>> GetTableAttributeTablesAsync(this IOpenBiApiClient client, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientcancellationTokenCancellationToken
Returns
GetTableAttributeTypesAsync(IOpenBiApiClient, CancellationToken)
Lists every value type available for a table attribute - the values Type accepts - including one entry per base entity (custom configurator table type).
public static Task<OpenBiListResult<TableAttributeTypeDto>> GetTableAttributeTypesAsync(this IOpenBiApiClient client, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientcancellationTokenCancellationToken
Returns
GetTableAttributesAsync(IOpenBiApiClient, string, CancellationToken)
Lists the table attributes defined for the given table - a Table value
of GetTableAttributeTablesAsync(IOpenBiApiClient, CancellationToken), or a base entity's tableName for the columns attached
to that base entity - with their proposed values. The shared list options are not supported here.
public static Task<OpenBiListResult<TableAttribute>> GetTableAttributesAsync(this IOpenBiApiClient client, string table, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClienttablestringcancellationTokenCancellationToken
Returns
- Task<OpenBiListResult<TableAttribute>>
UpdateTableAttributeAsync(IOpenBiApiClient, string, CreateTableAttributeRequest, CancellationToken)
Creates or updates the table attribute with the given id: an id that is not there yet is inserted rather than answered with a 404. A column name that already exists on that table is a 409.
public static Task<TableAttribute?> UpdateTableAttributeAsync(this IOpenBiApiClient client, string id, CreateTableAttributeRequest tableAttribute, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientidstringtableAttributeCreateTableAttributeRequestcancellationTokenCancellationToken
Returns
- Task<TableAttribute>