C8yEventsService

public class C8yEventsService : JcConnectionRequest<C8yCumulocityConnection>

Allows events related to C8yManagedObject to fetched and posted to Cumulocity

Refer to the c8y API documentation for more information

  • Used when fetching C8yEvents to determines the maximum number allowed in a single request, default is 50

    Declaration

    Swift

    public var pageSize: Int
  • Retrieves the C8yEvent details for the given c8y internal id

    Declaration

    Swift

    public func get(_ id: String) -> AnyPublisher<JcRequestResponse<C8yEvent>, APIError>
  • Retrieves all events associated with the given source C8yManagedObject

    Notes:

    It retreives the newest to oldest events first with a maximum number specified by pageSize in a single request. Call the method incrementing the page number to fetch older and older events if required.

    Declaration

    Swift

    public func get(source: String, pageNum: Int) -> AnyPublisher<JcRequestResponse<C8yPagedEvents>, APIError>
  • Submits the `C8yEvent` to cumulocity for processing
    

    Declaration

    Swift

    public func post(_ event: C8yEvent) throws -> AnyPublisher<JcRequestResponse<C8yEvent>, APIError>