Table of Contents

Class CreateTableAttributeRequest

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

Request body for creating or updating a TableAttribute.

public sealed record CreateTableAttributeRequest : ICreateTableAttributeRequest
Inheritance
object
CreateTableAttributeRequest
Implements

Properties

CustomAttributes

The values of the table attributes defined for table attributes themselves; short_description is the label an editor shows for this attribute.

[JsonPropertyName("customAttributes")]
public Dictionary<string, JsonElement>? CustomAttributes { get; init; }

Property Value

Dictionary<string, JsonElement>

DefaultValue

The column default, as text: numbers and dates in invariant format, X for a Boolean that defaults to true.

[JsonPropertyName("defaultValue")]
public string? DefaultValue { get; init; }

Property Value

string

DefaultValues

The values an editor proposes for this attribute - with IsExclusive, the only ones allowed. On a save, a list replaces the stored one and null leaves it as it is.

[JsonPropertyName("defaultValues")]
public string[]? DefaultValues { get; init; }

Property Value

string[]

FieldLength

The column length. Empty or 0 means the type's default; a column that refers to another table gets the maximum key length automatically.

[JsonPropertyName("fieldLength")]
public int? FieldLength { get; init; }

Property Value

int?

Id

Optional: a GUID is generated when it is omitted. UpdateTableAttributeAsync(IOpenBiApiClient, string, CreateTableAttributeRequest, CancellationToken) takes the id from the route instead.

[JsonPropertyName("id")]
public string? Id { get; init; }

Property Value

string

IsExclusive

When set, a value has to be one of DefaultValues, so an editor offers a choice list instead of free text. Not enforced by the server.

[JsonPropertyName("isExclusive")]
public bool IsExclusive { get; init; }

Property Value

bool

IsMultiple

When set, the attribute holds a list of values rather than one; it travels as a JSON array in customAttributes.

[JsonPropertyName("isMultiple")]
public bool IsMultiple { get; init; }

Property Value

bool

Name

The column name: a letter followed by letters, digits or underscores, unique within the table.

[JsonPropertyName("name")]
public string? Name { get; init; }

Property Value

string

Table

The table the attribute adds a column to - one of the Table values of GetTableAttributeTablesAsync(IOpenBiApiClient, CancellationToken). Stored in upper case.

[JsonPropertyName("table")]
public string? Table { get; init; }

Property Value

string

Type

The value type - one of the Type values of GetTableAttributeTypesAsync(IOpenBiApiClient, CancellationToken), see TableAttributeType. A table name, such as a base entity's tableName, makes the column a reference to a row of that table. Stored in upper case.

[JsonPropertyName("type")]
public string? Type { get; init; }

Property Value

string