AnyC8yObject

public struct AnyC8yObject : Identifiable, Equatable, Hashable

Wrapper to allow objects deviced from C8yObject to managed as a collection. Swift does not allow Arrays or Dictionaries to reference protocol types, hence why this is needed.

This class is used by C8yAssetCollection to allow both C8yDevice and C8yGroup objects to managed together.

  • id

    Local id reference for wrapped object

    Declaration

    Swift

    public let id: String
  • Cumulocity internal id from wrapped object

    Declaration

    Swift

    public let c8yId: String?
  • Specifies the object type of the wrapped content, either C8yDevice or C8yGroup

    Declaration

    Swift

    public let type: WrappedType
  • The name attributed to the wrapped object

    Declaration

    Swift

    public var name: String { get }
  • Array of child objects associated with the wrapped object, both C8yGroup and C8yDevice support child elements

    Declaration

    Swift

    public var children: [AnyC8yObject] { get }
  • Constructor for a wrapper containing the given object

    Declaration

    Swift

    public init<T>(_ obj: T) where T : C8yObject
  • The wrapped object

    Declaration

    Swift

    public func wrappedValue<T>() -> T where T : C8yObject
  • Declaration

    Swift

    public static func == (lhs: AnyC8yObject, rhs: AnyC8yObject) -> Bool
  • Declaration

    Swift

    public func hash(into hasher: inout Hasher)
  • Enumerator type for possoble content types

    See more

    Declaration

    Swift

    public enum WrappedType : String