When I make a request /customers/xxx/devices
from the unofficial API I get back a number of GIDs. Some of them come back as numbers, but some come back as null because I only have one Vue2 device. The defensive position is to either ignore these fields or bring them in as interface{} unless somebody can clarify the types for me:
CustomerGID: integer
ChannelTypeGID: I think this is an integer but I’m not sure
ParentChannelNum: I would think this would be an integer, but channel Num is a string in many other places where I would think it would be an integer, and in one case (where it is showing the voltage channels) it’s a string of comma-separated integers. I’m not really sure what’s going on here but I think the intent is that it be a string because, even for the current (power) channels, there might be future provisions for eventually allowing multiple phase circuits to appear here as a list. If that’s the case, this being a string might make sense.
ParentDeviceGid is unpopulated – does it follow the other GIDs and it’s an integer?
EvCharger – I don’t know what this type is so I had to leave it an interface{}
UtilityRateGid – again, since it’s a GID, does this mean it’s an integer if present?
For those unfamiliar with go, interface{} is a kind of way of saying ‘object of unknown type’ – basically it could be anything.