Classes
- BasicAuthAuthenticator
-
An
Authenticatorthat logs in a service account using basic auth. - OAuth2Authenticator
-
An
Authenticatorthat logs in a service account using OAuth2 with a JWT Bearer Token as an authorization grant. This is a more secure flow than the basic auth counter-part, and is the recommended way to authenticate a service account in a production environment. - DeviceEventStream
-
Represent an event stream for a device, and is implemented using Server-Sent Events.
Structures
- Disruptive
-
This is the core of the
DisruptiveSwift API, and implements the majority of the Disruptive Technologies REST API endpoints. - ServiceAccountCredentials
-
A set of
ServiceAccountCredentialsis used to authenticate against the Disruptive Technologies API. It can be created in DT Studio by clicking theService Accounttab underAPI Integrationsin the side menu, and creating a new key. - Auth
-
Encapsulates authentication details like access token and expiration date.
- TouchEvent
-
An event that is sent whenever a device is touched. This event is sent for almost all the available device types (except a few like the counting sensors).
- TemperatureEvent
-
A temperature event that is sent for temperature sensors every heartbeat, and whenever the sensor is touched.
- TemperatureEvent.TemperatureSample
-
Represents a temperature value sampled within a single heartbeat.
- ObjectPresentEvent
-
An event that is sent whenever an object is close to a proximity sensor or not.
- HumidityEvent
-
A humidity event that is sent for humidity sensors every heartbeat, and whenever the sensor is touched. This event contains both the measured temperature as well as the relative humidity.
- ObjectPresentCountEvent
-
An event that includes the accumulated count of proximity state changes for a Counting Proximity sensor. These events are sent every heartbeat, and not when the sensor is touched or when the state is switched (to save battery life).
- TouchCountEvent
-
An event that includes the accumulated count of touches for a Counting Touch sensor. These events are sent every heartbeat, and not when the sensor is touched (to save battery life).
- WaterPresentEvent
-
An event that indicates whether or not water is present to a Water Detector sensor. This event is sent every heartbeat, and when the sensor is touched.
- NetworkStatusEvent
-
A network status event describes which Cloud Connectors a sensor is connected to, and how strong that connection is. A network status event is sent on every heartbeat, as well as when a sensor is touched.
- NetworkStatusEvent.CloudConnector
-
A Cloud Connector that picked a network status event for a sensor.
- BatteryStatusEvent
-
A battery status event is sent quite rarely since the battery life of the sensors lasts up to 15 years. It indicates how much battery life is left in the sensor.
- LabelsChangedEvent
-
Labels changed events are sent when the labels for a device are changed (added, deleted, or modified).
- ConnectionStatusEvent
-
Indicates the current connectivity of a Cloud Connector. This is sent when there is a change in the connectivity of a Cloud Connector.
- EthernetStatusEvent
-
Details about the current ethernet connection status of a Cloud Connector.
- EthernetStatusEvent.ErrorMessage
-
Indicates an error related to connecting to the local network.
- CellularStatusEvent
-
Details about the current cellular connection status of a Cloud Connector.
- CellularStatusEvent.ErrorMessage
-
Indicates an error related to connecting to the cellular network.
- DataConnector
-
A Data Connector is a mechanism to send device events in real-time from Disruptive Technologies' backend to an external service. It can be set up to send specific types of events to a configurable endpoint through an HTTP POST request.
- DataConnector.Metrics
-
Represents the metrics such as success-rate and latency for the past 3 hours of a Data Connector.
- Device
-
Represents a Sensor or Cloud Connector from Disruptive Technologies.
- Device.ReportedEvents
-
Represents the latest known reported values for a
Device. Any of the event types that is not available for that particular device type, or that have not yet received an event, will benil. - Events
-
Contains an array of events for each type of event for a specific
Device. Detailed documentation for each event type can be found on Disruptive Technologies' developer website. - Member
-
A
Memberassigns a specific role to an account within a project or an organization. The account can be either a user or a service account. - Organization
-
Represents an organization registered with Disruptive Technologies.
- Project
-
Represents a project within an
Organization. - Role
-
Represents a role that a user can have within a project or an organization.
- ServiceAccount
-
All programmatic interaction with the Disruptive Technologies API is done via a logged-in Service Account.
- ServiceAccount.Key
-
A key that can be used to authenticate a Service Account.
- ServiceAccount.KeySecret
-
A secret along with the corresponding key used to authenticate a Service Account. This is the response value for when a new key is created for a Service Account.
Enumerations
- LogLevel
-
The severity of the log. Might be used to prefix the log message with a symbol to make it easily distinguishable.
- DisruptiveError
-
An enumeration of all the possible errors that could occur by calling one of the endpoints.
- EventType
-
An enumeration of all the possible types of events that a device can emit.
- ObjectPresentEvent.State
-
The proximity state of a sensor.
- WaterPresentEvent.State
-
The water presence state of a sensor.
- NetworkStatusEvent.TransmissionMode
-
The transmission mode the sensor is currently in. The sensor will automatically switch transmission modes when the sensor has low connectivity to a Cloud Connector. See the Help Center for more details.
- ConnectionStatusEvent.Connection
-
Indicates the current connectivity of a Cloud Connector.
- ConnectionStatusEvent.Available
-
Indicates a connectivity that is available for a Cloud Connector.
- DataConnector.Status
-
The current status of a Data Connector. This will indicate whether or not the Data Connector is currently sending out events.
- DataConnector.PushType
-
The mechanism used by a Data Connector to push device events to an external service.
- Device.DeviceType
-
Represents the type of a
Device. - Member.Status
-
Indicates the current status of the membership.
- Member.AccountType
-
The type of account the membership represents.
- Permission
-
A permission is a specific action that an authenticated account is allowed to do within a specific project or organization.
- Role.RoleType
-
The level of access that is given to a role.
Protocols
- Authenticator
-
Defines the interface required to authenticate the
Disruptivestruct. - PublishableEvent
-
Used by event types (such as
TouchEvent) to indicate that they can be published to the device emulator.
Functions
- DTLog(_:level:filePath:functionName:lineNumber:)
-
Provides a nicely formatted log output with the file, function, and line number the log statement came from. Also includes a timestamp with millisecond accuracy.