Class: MojioModelSDK
| Defined in: | MojioModelSDK.coffee |
Overview
The Model segment of the Mojio SDK. The model part of the SDK is the lowest level of the fluent chain and is used by all other SDK segments. It provides ways to specify the type of resource, identification of particular resources, and data for the resource.
Direct Known Subclasses
Instance Method Summary
- # (void) setup(data)
- # (void) setCriteria(data)
- # (object) users(data) Specify a list of users to apply operations to in the fluent chain.
- # (object) vehicles(data) Specify a list of vehicles to apply operations to in the fluent chain.
- # (object) mojios(data) Specify a list of mojios to apply operations to in the fluent chain.
- # (object) trips(data) Specify a list of trips to apply operations to in the fluent chain.
- # (object) apps(data) Specify a list of apps to apply operations to in the fluent chain.
- # (object) groups(data) group
- # (object) permissions(data) permissions
- # (object) images(data) Specify an image to apply operations to in the fluent chain.
- # (object) tags(data) Specify a tag to apply operations to in the fluent chain.
- # (object) details(data) Return the changeable details of a resource
- # (object) histories(measurement = null) Return the changeable details of a resource
- # (object) states() Return the changeable details of a resource
- # (object) locations() Return the changeable details of a resource
- # (object) mock() Create models for testing purposes.
Instance Method Details
#
(void)
setup(data)
#
(void)
setCriteria(data)
#
(object)
users(data)
Specify a list of users to apply operations to in the fluent chain.
A list of users can be specified either with an array of users (id's or objects), or a query string. Pass null or undefined for all users accessible by the current user.
Examples:
Observe a list of users.
sdk.observe("key").users(["user_id1", "user_id2", { some user object }]).callback((error, result) ->
...
)
#
(object)
vehicles(data)
Specify a list of vehicles to apply operations to in the fluent chain.
A list of vehicles can be specified either with an array of vehicles (id's or objects), or a query string. Pass null or undefined for all vehicles accessible by the current vehicle.
Examples:
Observe a list of vehicles.
sdk.observe("key").vehicles(["vehicle_id1", "vehicle_id2", { some vehicle object }]).callback((error, result) ->
...
)
#
(object)
mojios(data)
Specify a list of mojios to apply operations to in the fluent chain.
A list of mojios can be specified either with an array of mojios (id's or objects), or a query string. Pass null or undefined for all mojios accessible by the current mojio.
Examples:
Observe a list of mojios.
sdk.observe("key").mojios(["mojio_id1", "mojio_id2", { some mojio object }]).callback((error, result) ->
...
)
#
(object)
trips(data)
Specify a list of trips to apply operations to in the fluent chain.
A list of trips can be specified either with an array of trips (id's or objects), or a query string. Pass null or undefined for all trips accessible by the current trip.
Examples:
Observe a list of trips.
sdk.observe("key").trips(["trip_id1", "trip_id2", { some trip object }]).callback((error, result) ->
...
)
#
(object)
apps(data)
Specify a list of apps to apply operations to in the fluent chain.
#
(object)
groups(data)
group
#
(object)
permissions(data)
permissions
#
(object)
images(data)
Specify an image to apply operations to in the fluent chain. One image can be associated with either Vehicles or Users.
#
(object)
tags(data)
Specify a tag to apply operations to in the fluent chain. Tags are secondary resources associated with Vehicles, Mojios, Users, Groups, or Trips
#
(object)
details(data)
Return the changeable details of a resource
#
(object)
histories(measurement = null)
Return the changeable details of a resource
#
(object)
states()
Return the changeable details of a resource
#
(object)
locations()
Return the changeable details of a resource
#
(object)
mock()
Create models for testing purposes.
Mocks up objects for testing, objects are not persisted and are created with random values.
Examples:
Create a Vehicle for unit testing
sdk.mock().vehicle().callback((error, result) ->
...
)