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

Type

Description

string(datetime)

Date with format %Y-%m-%dT%H:%M:%S%z.
For example, "2020-06-30T07:15:23+0000".

string(datetime_range)

A range of date and time values ​​with a lower and upper bound specified as a pair of string(datetime) separated by a pipe character (|).

Both the lower and upper bounds are optional:
-If only the upper limit is specified, the system will include all date and time values ​​preceding the upper limit in the range.
-If only the lower limit is specified, the range will include all date and time values ​​later than the lower limit.

Examples:
Lower and upper bounds are specified: 2020-06-30T07:15:23+0000|2020-07-30T07:15:23+0000.
Only the lower bound is specified: 2020-06-30T07:15:23+0000|.
Only the upper bound is specified: |2020-06-30T07:15:23+0000.

string(date)

Date with format %Y-%m-%d. For example, "2020-07-09".

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 [email protected] format. For example, "[email protected]"
For more information, please see https://en.wikipedia.org/wiki/Email_address.

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).
For example, "3m" for three months, "1d" for one day, "15w" for 15 weeks, and "2y" for two years.

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, “100.01”. Decimals are optional.
The amount cannot be larger than 999999999 and cannot be negative.

string(signed_amount)

The signed_amount is the same as the amount but may be negative. In this case, it is preceded by a minus sign like '-999999999.00'.

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 all or a valid integer ranging from 0 to 100.

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

Type

Description

integer(signed_integer_id)

A non-zero signed integer that should not exceed the maximum limit of 2147483647.


Did this page help you?