When using the API to update, delete, or assign generator presets to columns, you use the generator preset identifier.
To retrieve the list of generator presets and their current configuration, use:
The response contains an array of preset objects.
Generator presets are part of the Advanced API, which requires an Enterprise license.
A generator preset is a saved configuration for a generator. Each generator has a built-in generator preset, which provides the default configuration for that generator.
You can also create custom generator presets. For example, you can create different versions of the Address generator that use different configuration options.
Get the available generator presets
Retrieve information about generator presets and their configuration.
Structure of a generator preset
How the Tonic Structural API represents a generator preset.
Create a generator preset
Add a new custom generator preset to the available presets.
Update a generator preset
Change the configuration for an existing generator preset.
Delete a generator preset
Remove a custom generator preset from the available presets.
To update the configuration of an existing generator preset, use:
PUT api/Presets/{preset identifier}
In the request, you provide a preset object with the updated generator preset configuration.
For a successful request, the response contains the updated details for the generator preset.
You can only delete custom generator presets. You cannot delete a built-in generator preset.
To delete a generator preset, use:
DELETE api/Presets/delete/{preset identifier}
For a successful request, the response contains the details for the deleted generator preset.
To create a new generator preset, use:
In the request, you provide a preset object with the details for the new generator preset.
The following example preset object creates a generator preset for the Name generator. This version of the Name generator is intended for values in the format Last Name, First Name
. For example, Smith, John
. It preserves capitalization and is not consistent.
For a successful request, the response contains the full generator preset details, including the identifier of the new generator preset.
The PresetSummary
object is used in requests and responses to provide details about a generator preset.
At a very high level, the general structure of a generator preset is:
Each generator preset object contains:
Identifying information for the generator preset
Information about who most recently modified the generator preset
The generator configuration for the generator preset
When the generator preset was created and most recently modified
id
is the generator preset identifier. When you create a generator preset, Tonic Structural provides the identifier for it in the response. You use the identifier to select a generator preset to update, delete, or assign to a column.
name
is the name that you assign to the generator preset, and description allows you to provide additional information about the generator preset.
generatorId
identifies the type of generator for the generator preset.
isBuiltIn
indicates whether this is a built-in generator preset, and is only included in responses. For a built-in generator preset, id
and generatorId
are the same value. You can update a built-in preset, but you cannot delete a built-in generator preset.
lastModifiedByUser
identifies who most recently modified the generator preset configuration.
The user information includes the user's identifier, first name, last name, and email address.
The metadata
object contains the generator configuration for the generator preset.
For details about the metadata for each generator, go to the Generator API reference.
Generator presets do not include the following configuration options:
Linking
Consistency with another column
Partitioning
Custom value processors
You always set those configuration options in the column configuration.
createdDate
and lastModifiedDate
indicate when the generator preset was created and when it was most recently updated.