37 lines
1.4 KiB
Go
37 lines
1.4 KiB
Go
package devtodev
|
|
|
|
// Payload is the top-level request body for Data API 2.0.
|
|
type Payload struct {
|
|
Reports []Report `json:"reports"`
|
|
}
|
|
|
|
// Report groups events for a device (or a player).
|
|
type Report struct {
|
|
DeviceID string `json:"deviceId"`
|
|
UserID string `json:"userId,omitempty"`
|
|
PreviousDeviceID string `json:"previousDeviceId,omitempty"`
|
|
PreviousUserID string `json:"previousUserId,omitempty"`
|
|
DevtodevID string `json:"devtodevId,omitempty"`
|
|
Packages []Package `json:"packages"`
|
|
}
|
|
|
|
// Package groups events under a locale and metadata.
|
|
type Package struct {
|
|
Language string `json:"language,omitempty"`
|
|
Country string `json:"country,omitempty"`
|
|
Platform string `json:"platform,omitempty"`
|
|
IP string `json:"ip,omitempty"`
|
|
AppVersion string `json:"appVersion,omitempty"`
|
|
AppBuildVersion string `json:"appBuildVersion,omitempty"`
|
|
SDKVersion string `json:"sdkVersion,omitempty"`
|
|
SDKCodeVersion int `json:"sdkCodeVersion,omitempty"`
|
|
Bundle string `json:"bundle,omitempty"`
|
|
InstallationSource string `json:"installationSource,omitempty"`
|
|
Engine string `json:"engine,omitempty"`
|
|
Events []Event `json:"events"`
|
|
}
|
|
|
|
// Event is a raw devtodev event object.
|
|
// Use the Data API 2.0 event schema when building this map.
|
|
type Event map[string]interface{}
|