@@ -35,7 +35,6 @@ const (
3535 EventTypePostback EventType = "postback"
3636 EventTypeBeacon EventType = "beacon"
3737 EventTypeAccountLink EventType = "accountLink"
38- EventTypeThings EventType = "things"
3938 EventTypeUnsend EventType = "unsend"
4039 EventTypeVideoPlayComplete EventType = "videoPlayComplete"
4140)
@@ -126,52 +125,6 @@ type AccountLink struct {
126125 Nonce string
127126}
128127
129- // ThingsResult type
130- // Deprecated: Use OpenAPI based classes instead.
131- type ThingsResult struct {
132- ScenarioID string
133- Revision int
134- StartTime int64
135- EndTime int64
136- ResultCode ThingsResultCode
137- ActionResults []* ThingsActionResult
138- BLENotificationPayload []byte
139- ErrorReason string
140- }
141-
142- // ThingsResultCode type
143- type ThingsResultCode string
144-
145- // ThingsResultCode constants
146- const (
147- ThingsResultCodeSuccess ThingsResultCode = "success"
148- ThingsResultCodeGattError ThingsResultCode = "gatt_error"
149- ThingsResultCodeRuntimeError ThingsResultCode = "runtime_error"
150- )
151-
152- // ThingsActionResult type
153- // Deprecated: Use OpenAPI based classes instead.
154- type ThingsActionResult struct {
155- Type ThingsActionResultType
156- Data []byte
157- }
158-
159- // ThingsActionResultType type
160- type ThingsActionResultType string
161-
162- // ThingsActionResultType constants
163- const (
164- ThingsActionResultTypeBinary ThingsActionResultType = "binary"
165- ThingsActionResultTypeVoid ThingsActionResultType = "void"
166- )
167-
168- // Things type
169- // Deprecated: Use OpenAPI based classes instead.
170- type Things struct {
171- DeviceID string
172- Type string
173- Result * ThingsResult
174- }
175128
176129// Unsend type
177130// Deprecated: Use OpenAPI based classes instead.
@@ -220,7 +173,6 @@ type Event struct {
220173 Postback * Postback
221174 Beacon * Beacon
222175 AccountLink * AccountLink
223- Things * Things
224176 Members []* EventSource
225177 Unsend * Unsend
226178 VideoPlayComplete * VideoPlayComplete
@@ -241,7 +193,6 @@ type rawEvent struct {
241193 AccountLink * rawAccountLinkEvent `json:"link,omitempty"`
242194 Joined * rawMemberEvent `json:"joined,omitempty"`
243195 Left * rawMemberEvent `json:"left,omitempty"`
244- Things * rawThingsEvent `json:"things,omitempty"`
245196 Unsend * Unsend `json:"unsend,omitempty"`
246197 VideoPlayComplete * VideoPlayComplete `json:"videoPlayComplete,omitempty"`
247198 WebhookEventID string `json:"webhookEventId"`
@@ -288,30 +239,6 @@ type rawAccountLinkEvent struct {
288239 Nonce string `json:"nonce"`
289240}
290241
291- // Deprecated: Use OpenAPI based classes instead.
292- type rawThingsResult struct {
293- ScenarioID string `json:"scenarioId"`
294- Revision int `json:"revision"`
295- StartTime int64 `json:"startTime"`
296- EndTime int64 `json:"endTime"`
297- ResultCode ThingsResultCode `json:"resultCode"`
298- ActionResults []* rawThingsActionResult `json:"actionResults"`
299- BLENotificationPayload string `json:"bleNotificationPayload,omitempty"`
300- ErrorReason string `json:"errorReason,omitempty"`
301- }
302-
303- // Deprecated: Use OpenAPI based classes instead.
304- type rawThingsActionResult struct {
305- Type ThingsActionResultType `json:"type,omitempty"`
306- Data string `json:"data,omitempty"`
307- }
308-
309- // Deprecated: Use OpenAPI based classes instead.
310- type rawThingsEvent struct {
311- DeviceID string `json:"deviceId"`
312- Type string `json:"type"`
313- Result * rawThingsResult `json:"result,omitempty"`
314- }
315242
316243const (
317244 milliSecPerSec = int64 (time .Second / time .Millisecond )
@@ -355,33 +282,7 @@ func (e *Event) MarshalJSON() ([]byte, error) {
355282 raw .Left = & rawMemberEvent {
356283 Members : e .Members ,
357284 }
358- case EventTypeThings :
359- raw .Things = & rawThingsEvent {
360- DeviceID : e .Things .DeviceID ,
361- Type : e .Things .Type ,
362- }
363- if e .Things .Result != nil {
364- raw .Things .Result = & rawThingsResult {
365- ScenarioID : e .Things .Result .ScenarioID ,
366- Revision : e .Things .Result .Revision ,
367- StartTime : e .Things .Result .StartTime ,
368- EndTime : e .Things .Result .EndTime ,
369- ResultCode : e .Things .Result .ResultCode ,
370-
371- BLENotificationPayload : string (e .Things .Result .BLENotificationPayload ),
372- ErrorReason : e .Things .Result .ErrorReason ,
373- }
374- if e .Things .Result .ActionResults != nil {
375- raw .Things .Result .ActionResults = make ([]* rawThingsActionResult , len (e .Things .Result .ActionResults ))
376- }
377- for i := range e .Things .Result .ActionResults {
378- raw .Things .Result .ActionResults [i ] = & rawThingsActionResult {
379- Type : e .Things .Result .ActionResults [i ].Type ,
380- Data : string (e .Things .Result .ActionResults [i ].Data ),
381- }
382- }
383- }
384- }
285+ }
385286
386287 switch m := e .Message .(type ) {
387288 case * TextMessage :
@@ -532,30 +433,6 @@ func (e *Event) UnmarshalJSON(body []byte) (err error) {
532433 e .Members = rawEvent .Joined .Members
533434 case EventTypeMemberLeft :
534435 e .Members = rawEvent .Left .Members
535- case EventTypeThings :
536- e .Things = & Things {
537- Type : rawEvent .Things .Type ,
538- DeviceID : rawEvent .Things .DeviceID ,
539- }
540- if rawEvent .Things .Result != nil {
541- rawResult := rawEvent .Things .Result
542- e .Things .Result = & ThingsResult {
543- ScenarioID : rawResult .ScenarioID ,
544- Revision : rawResult .Revision ,
545- StartTime : rawResult .StartTime ,
546- EndTime : rawResult .EndTime ,
547- ResultCode : rawResult .ResultCode ,
548- ActionResults : make ([]* ThingsActionResult , len (rawResult .ActionResults )),
549- BLENotificationPayload : []byte (rawResult .BLENotificationPayload ),
550- ErrorReason : rawResult .ErrorReason ,
551- }
552- for i := range rawResult .ActionResults {
553- e .Things .Result .ActionResults [i ] = & ThingsActionResult {
554- Type : rawResult .ActionResults [i ].Type ,
555- Data : []byte (rawResult .ActionResults [i ].Data ),
556- }
557- }
558- }
559436 case EventTypeUnsend :
560437 e .Unsend = rawEvent .Unsend
561438 case EventTypeVideoPlayComplete :
0 commit comments