arrow-left

All pages
gitbookPowered by GitBook
1 of 6

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Structure of a generator preset

The PresetSummaryarrow-up-right object is used in requests and responses to provide details about a generator preset.

hashtag
High-level structure overview

At a very high level, the general structure of a generator preset is:

Structure of a generator preset

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.

hashtag
Identifying information for the generator preset

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.

hashtag
Information about who most recently modified the 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.

hashtag
Generator configuration

The metadata object contains the generator configuration for the generator preset.

For details about the metadata for each generator, go to the .

Generator presets do not include the following configuration options:

  • Linking

  • Consistency with another column

  • Partitioning

You always set those configuration options in the column configuration.

hashtag
Creation and update dates

createdDate and lastModifiedDate indicate when the generator preset was created and when it was most recently updated.

When the generator preset was created and most recently modified.
Custom value processors
Generator API reference

Retrieving the list of generator presets

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.

GET api/Presetsarrow-up-right

Deleting a generator preset

You can only delete custom generator presets. You cannot delete a built-in generator preset.

To delete a generator preset, use:

For a successful request, the response contains the details for the deleted generator preset.

DELETE api/Presets/delete/{preset identifier}arrow-up-right

Creating a custom generator preset

To create a new generator preset, use:

POST api/Presetsarrow-up-right

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.

{
  name: "Name - Last Name, First Name"
  description: "Use for values in the format Last Name, First Name."
  generatorId: "NameGenerator"
  "metadata": {
    "links": {
      "metadata": {
        "nameType": "LastCommaFirstName",
        "preserveCapitalization": true,
        "isConsistent": false  
      }
    }
  }
}

For a successful request, the response contains the full generator preset details, including the identifier of the new generator preset.

Manage generator presets

circle-info

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 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.

Updating an existing generator preset

To update the configuration of an existing generator preset, use:

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.

PUT api/Presets/{preset identifier}arrow-up-right