//
// Copyright (c) 2017 Mainflux
//
// SPDX-License-Identifier: Apache-2.0
//

package export

// Message - Encapsulating / wrapper message object that contains Event
// to be exported and the client export registration details
type Message struct {
	Registration Registration
	Evt          Event
}

// Event - packet of Readings
type Event struct {
	Pushed   int64     `json:"pushed"`
	Device   string    `json:"device,omitempty"`
	Readings []Reading `json:"readings,omitempty"`
	Created  int64     `json:"created"`
	Modified int64     `json:"modified"`
	Origin   int64     `json:"origin"`
}

// Reading - Sensor measurement
type Reading struct {
	Pushed   int64  `json:"pushed"`
	Name     string `json:"name,omitempty"`
	Value    string `json:"value,omitempty"`
	Device   string `json:"device,omitempty"`
	Created  int64  `json:"created"`
	Modified int64  `json:"modified"`
	Origin   int64  `json:"origin"`
}

//
// Copyright (c) 2017 Mainflux
//
// SPDX-License-Identifier: Apache-2.0
//

package export

// Message - Encapsulating / wrapper message object that contains Event
// to be exported and the client export registration details
type Message struct {
	Registration Registration
	Evt          Event
}

// Event - packet of Readings
type Event struct {
	ID       string    `json:"id,omitempty"`
	Pushed   int64     `json:"pushed"`
	Device   string    `json:"device,omitempty"`
	Readings []Reading `json:"readings,omitempty"`
	Created  int64     `json:"created"`
	Modified int64     `json:"modified"`
	Origin   int64     `json:"origin"`
}

// Reading - Sensor measurement
type Reading struct {
	ID       string `json:"id,omitempty"`
	Pushed   int64  `json:"pushed"`
	Name     string `json:"name,omitempty"`
	Value    string `json:"value,omitempty"`
	Device   string `json:"device,omitempty"`
	Created  int64  `json:"created"`
	Modified int64  `json:"modified"`
	Origin   int64  `json:"origin"`
}

Add missing id fields in readings and events
Add missing id fields in readings and events

Signed-off-by: Federico Claramonte <9aaaa8bfe6a7a51765b462c528e1446dcf049286@caviumnetworks.com>
