Events
Models and methods for fetching the event history of a profile.
TFApplicationProfileEvent
A single event in a profile's history.
- iOS (Swift)
- Android (Java)
public struct TFApplicationProfileEvent: Decodable {
public typealias RawIdentifier = Identifier<Self, String>
public enum EventType: String, Codable, CaseIterable {
case contractRemoveFromAnotherDevice
case contractShare
case contractRecover
case contractAssociation
case contractAssociationV2
case contractRemove
case contractReset
case operation
}
public let uniqueKey: RawIdentifier
public let profileID: TFApplicationProfile.ID
public let data: Data
public var createdOn: Date { get }
}
public class TFApplicationProfileEvent {
public String getUniqueKey()
/** Corresponds to TFApplicationProfile.Id.getAppId(). */
public String getAppUniqueID()
/** Corresponds to TFApplicationProfile.Id.getUserId(). */
public String getAppUserID()
public double getTimestamp()
public Data getData()
public Date getCreatedOn()
}
TFApplicationProfileEvent.EventType
- iOS (Swift)
- Android (Java)
public enum TFApplicationProfileEvent.EventType: String, Codable, CaseIterable {
case contractRemoveFromAnotherDevice
case contractShare
case contractRecover
case contractAssociation
case contractAssociationV2
case contractRemove
case contractReset
case operation
}
public enum TFApplicationProfileEvent.EventType {
CONTRACT_REMOVE_FROM_ANOTHER_DEVICE,
CONTRACT_SHARE,
CONTRACT_RECOVER,
CONTRACT_ASSOCIATION,
CONTRACT_ASSOCIATION_V2,
CONTRACT_REMOVE,
CONTRACT_RESET,
OPERATION;
public static final List<EventType> PROFILE_EVENTS
public static final List<EventType> ALL_EVENTS
}
TFApplicationProfileEvent.Data
The payload attached to an event. Fields are populated based on the event type.
- iOS (Swift)
- Android (Java)
public struct TFApplicationProfileEvent.Data: Decodable {
public let eventType: TFApplicationProfileEvent.EventType?
public let affected: TFApplicationProfileEvent.Device?
public let device: TFApplicationProfileEvent.Device?
public let deviceIP: String?
public let transaction: TFOperation?
public let from_device: TFApplicationProfileEvent.Device?
public let to_device: TFApplicationProfileEvent.Device?
}
public static class TFApplicationProfileEvent.Data {
public EventType getEventType()
public TFApplicationProfileDevice getAffected()
public TFApplicationProfileDevice getDevice()
public String getDeviceIP()
public TFOperation getTransaction()
public TFApplicationProfileDevice getFromDevice()
public TFApplicationProfileDevice getToDevice()
}
TFApplicationProfileEvent.Device
A snapshot of a device as recorded at event time.
- iOS (Swift)
- Android (Java)
public struct TFApplicationProfileEvent.Device: Codable {
public let maskedDeviceIDSHA: String
public let key: String
public let name: String
public let manufacturer: String
public let model: String
public let operatingSystem: String
public let osVersion: String
public let marketingName: String
}
Android uses TFApplicationProfileDevice directly. See Applications & Profiles.
TFProfileEventsFeed
A paginated list of profile events returned by the server.
- iOS (Swift)
- Android (Java)
public struct TFProfileEventsFeed {
public let events: [TFApplicationProfileEvent]
public let maxResults: Int
public let count: Int
public init(events: [TFApplicationProfileEvent], maxResults: Int, count: Int)
}
public class TFProfileEventsFeed {
public TFProfileEventsFeed(
List<TFApplicationProfileEvent> events,
int maxResults,
int count
)
public List<TFApplicationProfileEvent> getEvents()
public int getMaxResults()
public int getCount()
}
TFEventsFeedFilter
A filter to narrow down events returned by fetchEventsHistory. Multiple filters of the same kind are combined.
- iOS (Swift)
- Android (Java)
public enum TFEventsFeedFilter {
case devices([TFApplicationProfileDevice.KeyIdentifier])
case eventTypes([TFApplicationProfileEvent.EventType])
case risk([TFOperation.Risk])
case status([TFOperation.Status])
case dateInterval(DateInterval)
// Convenience variadic initializers
public static func devices(_ ids: TFApplicationProfileDevice.KeyIdentifier...) -> Self
public static func eventTypes(_ types: TFApplicationProfileEvent.EventType...) -> Self
public static func risk(_ risks: TFOperation.Risk...) -> Self
public static func status(_ status: TFOperation.Status...) -> Self
}
/// A list of filters. Repeated entries of the same kind are merged.
public typealias TFEventsFeedFilters = [TFEventsFeedFilter]
// Named TFApplicationProfileEventHistoryFilter on Android
public class TFApplicationProfileEventHistoryFilter {
public TFApplicationProfileEventHistoryFilter(
List<String> deviceKeyList,
List<TFApplicationProfileEvent.EventType> eventTypes,
List<Risk> risk,
List<Status> status,
Date dateSince,
Date dateUntil
)
public static TFApplicationProfileEventHistoryFilter empty()
public boolean isEmpty()
public void clear()
public List<String> getDeviceKeyList()
public void setDevices(List<String> deviceKeyList)
public List<TFApplicationProfileEvent.EventType> getEventTypes()
public void setEventTypes(List<TFApplicationProfileEvent.EventType> eventTypes)
public List<Risk> getRisk()
public void setRisk(List<Risk> risk)
public List<Status> getStatus()
public void setStatus(List<Status> status)
public Date getDateSince()
public void setDateSince(Date dateSince)
public Date getDateUntil()
public void setDateUntil(Date dateUntil)
}