Type reference
Attributes and objects in the Oneflow REST API use the following format to describe their type: type(subtype)
.
Base types
Type | Description |
---|---|
string | Regular string. This is the default type. |
integer | Unsigned integer. |
boolean | True or false. |
object | JSON object {} - https://www.json.org/. |
array | JSON array [] - https://www.json.org/. The type in the [] defines the type of the item in the list, e.g., “list[int]” for a list of int. |
null | JSON null - https://www.json.org/. |
Subtypes for str
str
Type | Description |
---|---|
string(datetime) | Date with format |
string(datetime_range) | A range of date and time values with a lower and upper bound specified as a pair of Both the lower and upper bounds are optional: Examples: |
string(date) | Date with format |
string(enum) | Any of the set of predefined strings. |
string(country_code) | Country code, 2 uppercase characters like “SE” and “US” (ISO 3166-1 alpha-2) - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2. |
string(email) | E-mail address in the |
string(phone_number) | International phone number, with the country code (E.164) - https://en.wikipedia.org/wiki/E.164. See https://support.twilio.com/hc/en-us/articles/223183008-Formatting-International-Phone-Numbers for help. |
string(duration) | Length of time with a numeric part followed by a letter representing days (d), weeks (w), months (m), or years (y). |
string(currency) | Currency name represented by three uppercase characters like "SEK" and "USD" (ISO 4217) - https://en.wikipedia.org/wiki/ISO_4217. |
string(amount) | Amount with up to two decimals, |
string(signed_amount) | The |
string(percent) | A percentage value with three decimal places between "0.000" and "100.000" where, for instance, "50.000" represents 50%. |
string(limit) | The limit for receiving a paginated response. It can be |
string(simple) | A string value suitable for enum values, slugs, and identifiers. Accepted characters: letters (a-z), numbers (0-9), hyphen (-), underscore (_), and colon (:). |
Subtypes for int
int
Type | Description |
---|---|
integer(signed_integer_id) | A non-zero signed integer that should not exceed the maximum limit of 2147483647. |
Updated about 1 month ago