C8yCustomAsset
public protocol C8yCustomAsset : Decodable, Encodable
Your custom asset Struct must implement the following methods in order that it can decoded/encoded as a JSON fragment from the c8y ManageObject
-
Optional, used to decode fragments fetched from c8y in
C8yManagedObject
instancesDeclaration
Swift
mutating func decode(_ container: KeyedDecodingContainer<C8yCustomAssetProcessor.AssetObjectKey>, forKey: C8yCustomAssetProcessor.AssetObjectKey) throws
-
Used to encode fragments to be included a
C8yManagedObject
instance that need to be uploaded to c8yDeclaration
Swift
func encode(_ container: KeyedEncodingContainer<C8yCustomAssetProcessor.AssetObjectKey>, forKey: C8yCustomAssetProcessor.AssetObjectKey) throws -> KeyedEncodingContainer<C8yCustomAssetProcessor.AssetObjectKey>