Values the telemetry API accepts for enumerated fields
telem_enums.RdEach function returns the values its field accepts, mirroring
app/Enums/*.php in telemetry-api. Use them to build valid data, and to
offer choices in a user interface rather than hard-coding strings.
Usage
telem_event_types()
telem_event_statuses()
telem_event_sources()
telem_device_states()
telem_sample_states()
telem_blueprint_types()
telem_capture_methods()
telem_deployment_statuses()
telem_fates()
telem_sexes()
telem_device_manufacturers()Details
The telem_create_*() functions validate against these before sending, so a
bad value fails locally with the full list of alternatives instead of
returning a 422 from the server.
telem_event_sources() is the one soft case. The API validates source
only as a string of at most 25 characters, so any value is accepted and
supplying something else warns rather than errors. Note that "API" means
the record was fetched from the manufacturer's API by the server, not that
a client wrote it — the two are indistinguishable in the data.
Examples
telem_event_types()
#> [1] "Unknown" "Position" "Health" "Alert" "Mortality"
#> [6] "Conditions" "Reproduction" "Drop-Off" "Low-Battery" "Trap"
#> [11] "Geo-Fence" "Observation" "Depredation" "Activity" "Proximity"
telem_device_states()
#> [1] "Unknown" "Deployed" "On" "Off"
#> [5] "Paused" "Halted" "Faulty" "Offline"
#> [9] "Low-Battery" "Depleted" "Dropped" "In-Hand"
#> [13] "In-Repair" "At-Warehouse" "At-Manufacturer" "Decommissioned"
#> [17] "Retired"
telem_fates()
#> [1] "Unknown" "Alive" "Sick" "Injured" "Dead"