-
Notifications
You must be signed in to change notification settings - Fork 15
/
iot.go
42 lines (33 loc) · 1.05 KB
/
iot.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright (c) 2019 Yandex LLC. All rights reserved.
// Author: Andrey Khaliullin <[email protected]>
package ycsdk
import (
"github.com/yandex-cloud/go-sdk/gen/iot/broker"
brokerdata "github.com/yandex-cloud/go-sdk/gen/iot/brokerdata"
data "github.com/yandex-cloud/go-sdk/gen/iot/data"
"github.com/yandex-cloud/go-sdk/gen/iot/devices"
)
const (
IoTDevicesServiceID Endpoint = "iot-devices"
IoTDataServiceID Endpoint = "iot-data"
IoTBrokerServiceID Endpoint = "iot-broker"
IoTBrokerDataServiceID Endpoint = "broker-data"
)
func (sdk *SDK) IoT() *IoT {
return &IoT{sdk: sdk}
}
type IoT struct {
sdk *SDK
}
func (m *IoT) Devices() *devices.Devices {
return devices.NewDevices(m.sdk.getConn(IoTDevicesServiceID))
}
func (m *IoT) Data() *data.Data {
return data.NewData(m.sdk.getConn(IoTDataServiceID))
}
func (m *IoT) Broker() *broker.Broker {
return broker.NewBroker(m.sdk.getConn(IoTBrokerServiceID))
}
func (m *IoT) BrokerData() *brokerdata.BrokerData {
return brokerdata.NewBrokerData(m.sdk.getConn(IoTBrokerDataServiceID))
}