C8yManagedObject

public struct C8yManagedObject : JcEncodableContent

Wraps a c8y ManagedObject, refer to c8y API Reference guid for more info

# Notes: #

Represent nearly all assets that can be stored in c8y such as devices, groups etc. Can be enriched with custom attributes, incidentally these can be accessed here through the dictionary property properties, keyed by the name of the attribute in c8y, but ONLY if they are prefixed with ‘#x#’

If the custom property is not a String, then it will be flatted into constitute parts e.g.

 "c8y_LoRaDevice": {
    "id" : "1234"
    ...
 }

would be accessible via

 var loRaId = obj.properties["c8y_LoRaDevice.id"]

If you cannot prefix your custom property with ‘x’ or you don’t want flattened Strings then you will need to the custom processor to identify a class of your own to encode/decode the custom structure, refer to C8yCustomAssetProcessor class for more information

  • id

    Undocumented

    Declaration

    Swift

    public private(set) var id: String? { get }
  • Undocumented

    Declaration

    Swift

    public var type: String
  • Undocumented

    Declaration

    Swift

    public var name: String?
  • Undocumented

    Declaration

    Swift

    public private(set) var createdTime: Date { get }
  • Undocumented

    Declaration

    Swift

    public internal(set) var lastUpdated: Date { get }
  • Undocumented

    Declaration

    Swift

    public private(set) var owner: String { get }
  • Undocumented

    Declaration

    Swift

    public private(set) var status: Status? { get }
  • Undocumented

    Declaration

    Swift

    public var applicationOwner: String?
  • Undocumented

    Declaration

    Swift

    public var applicationId: String?
  • Undocumented

    Declaration

    Swift

    public var notes: String?
  • Undocumented

    Declaration

    Swift

    public var firmware: Firmware?
  • Undocumented

    Declaration

    Swift

    public private(set) var childDevices: ChildReferences? { get }
  • Undocumented

    Declaration

    Swift

    public private(set) var childAssets: ChildReferences? { get }
  • Undocumented

    Declaration

    Swift

    public internal(set) var connectionStatus: ConnectionStatus? { get }
  • Undocumented

    Declaration

    Swift

    public internal(set) var availability: Availability? { get }
  • Undocumented

    Declaration

    Swift

    public internal(set) var activeAlarmsStatus: ActiveAlarmsStatus? { get }
  • Undocumented

    Declaration

    Swift

    public internal(set) var isDevice: Bool { get }
  • Undocumented

    Declaration

    Swift

    public internal(set) var isGroup: Bool { get }
  • Undocumented

    Declaration

    Swift

    public var requiredAvailability: RequiredAvailability?
  • Undocumented

    Declaration

    Swift

    public var dataPoints: C8yDataPoints?
  • Undocumented

    Declaration

    Swift

    public var sensorType: [SensorType]
  • Used to record current stated of a device that acts as a relay, i.e. open or closed This attribute is passive and should be updated only following an operation.

    Declaration

    Swift

    public var relayState: RelayStateType?
  • GPS postion of device, dynamic GPS tracking of mobile devices should be managed via the event log associated with the device

    Declaration

    Swift

    public internal(set) var position: Position? { get }
  • List of operations that this device supports

    Declaration

    Swift

    public internal(set) var supportedOperations: [String]? { get }
  • Undocumented

    Declaration

    Swift

    public internal(set) var hardware: Hardware? { get }
  • Indicates the type of network that is used to communicate with the device

    Declaration

    Swift

    public internal(set) var network: C8yAssignedNetwork? { get }
  • Access custom properties through this class, only properties prefixed with ‘x’ or provided with a dedicated custom processor class will be available

    Declaration

    Swift

    public var properties: Dictionary<String, C8yCustomAsset>
  • Undocumented

    See more

    Declaration

    Swift

    public enum ConnectionStatusType : String, Codable
  • Undocumented

    See more

    Declaration

    Swift

    public enum AvailabilityStatus : String, Codable
  • Undocumented

    See more

    Declaration

    Swift

    public enum SensorType : String, Codable
  • Undocumented

    See more

    Declaration

    Swift

    public enum RelayStateType : String, Codable
  • Represents child assets related to this object

    See more

    Declaration

    Swift

    public struct ChildReferences : Decodable
  • Status as determined by Cumulocity

    See more

    Declaration

    Swift

    public struct Status : Decodable
  • Status as determined by Cumulocity

    See more

    Declaration

    Swift

    public struct Availability : Decodable
  • Undocumented

    See more

    Declaration

    Swift

    public struct Firmware : Codable
  • Summary of outstanding alarm totals

    See more

    Declaration

    Swift

    public struct ActiveAlarmsStatus : Decodable
  • Specifies after which period that cumulocity will flag a device as unavailable if no activity has been received i.e. mesurements or events

    See more

    Declaration

    Swift

    public struct RequiredAvailability : Codable
  • Only applicable for devices that are capable of connecting to cumulocity i.e. push

    See more

    Declaration

    Swift

    public struct ConnectionStatus : Decodable
  • Represents a GPS position

    See more

    Declaration

    Swift

    public struct Position : Codable
  • Used to indicate whether a device is connected to a LoRa network or not

    See more

    Declaration

    Swift

    public struct LpwanDevice : Codable
  • Description of device

    See more

    Declaration

    Swift

    public struct Hardware : Codable
  • Creates a new empty ManagedObject. Should only be used with the service ManagedObjectService.post(_:) in order to make changes to an existing ManagedObject

    Declaration

    Swift

    public init()
  • Creates a new empty ManagedObject. Should only be used with the service ManagedObjectService.put(_:) in order to make changes to an existing ManagedObject

    Declaration

    Swift

    public init(_ id: String)
  • Convenience constructor to allow the requried availability property to be updated via the ManagedObjectService#put() method

    Declaration

    Swift

    public init(_ id: String, requiredAvailability: RequiredAvailability)
  • Convenience constructor to allow the devices current position to be updated, should only be used with ManagedObjectService#put() method

    Declaration

    Swift

    public init(_ id: String, withPosition position: Position)
  • Convenience constructor to allow a range of different properties to be updated for the given ManagedObject via the ManagedObjectService#put() method You can include both standard and custom attributes. If you want to update attributes within sub-fragments; specify the full name-space using ‘.’ dot separator.

    Declaration

    Swift

    public init(_ id: String, properties: Dictionary<String, String>)
  • Creates a new managed object for the given type

    Declaration

    Swift

    public init(name: String, type: String, notes: String?)
  • Creates a new managed object for a device with the given serial number

    Declaration

    Swift

    public init(deviceWithSerialNumber serialNumber: String?, name: String, type: String, supplier: String?, model: String, notes: String?, revision: String?, requiredResponseInterval: Int?)
  • Declaration

    Swift

    public init(from decoder: Decoder) throws
  • Declaration

    Swift

    public func encode(to encoder: Encoder) throws