Documentation
¶
Overview ¶
Package kii provides APIs to access to Kii Cloud and Thing Interaction Framework (thing-if).
Index ¶
- func SetDefaultUserAgent(s string)
- type APIAuthor
- func (a APIAuthor) AddEndNode(gatewayID string, endnodeID string) error
- func (a APIAuthor) CreateThingScopeObject(thingID, bucketName string, object map[string]interface{}) (*CreateObjectResponse, error)deprecated
- func (a APIAuthor) DeleteBucket(bucket Bucket) error
- func (a *APIAuthor) DeleteKiiUser(userID string) error
- func (a APIAuthor) DeleteObject(bucket Bucket, objectID string) error
- func (a APIAuthor) DeleteThing(thingID string) error
- func (a APIAuthor) DeleteThingScopeBucket(thingID, bucketName string) errordeprecated
- func (a APIAuthor) GenerateEndNodeToken(gatewayID string, endnodeID string, r *EndNodeTokenRequest) (*EndNodeTokenResponse, error)
- func (a *APIAuthor) GetCommand(thingID, commandID string) (*GetCommandResponse, error)
- func (a APIAuthor) GetMqttEndpoint(installationID string) (endpoint *MqttEndpoint, err error)
- func (a APIAuthor) GetObject(bucket Bucket, objectID string) (interface{}, error)
- func (a APIAuthor) GetState(thingID string) (interface{}, error)
- func (a APIAuthor) GetThing(thingID string) (interface{}, error)
- func (a APIAuthor) InstallMqtt(development bool) (installationID string, err error)
- func (a APIAuthor) ListAllThingScopeObjects(thingID, bucketName string, listPara ListRequest) (*ListObjectsResponse, error)
- func (a *APIAuthor) ListEndNodes(gatewayID string, listPara ListRequest) (*ListEndNodesResponse, error)
- func (a *APIAuthor) LoginAsKiiUser(request UserLoginRequest) (*UserLoginResponse, error)
- func (a *APIAuthor) OnboardEndnodeWithGatewayThingID(request OnboardEndnodeWithGatewayThingIDRequest) (*OnboardEndnodeResponse, error)
- func (a *APIAuthor) OnboardEndnodeWithGatewayVendorThingID(request OnboardEndnodeWithGatewayVendorThingIDRequest) (*OnboardEndnodeResponse, error)
- func (a *APIAuthor) OnboardGateway(r *OnboardGatewayRequest) (*OnboardGatewayResponse, error)
- func (a *APIAuthor) OnboardThingByOwner(request OnboardByOwnerRequest) (*OnboardGatewayResponse, error)
- func (a APIAuthor) PostCommand(thingID string, request PostCommandRequest) (*PostCommandResponse, error)
- func (a APIAuthor) PostObject(bucket Bucket, data map[string]interface{}) (*CreateObjectResponse, error)
- func (a APIAuthor) PostTraitCommand(thingID string, request PostCommandRequest) (*PostCommandResponse, error)
- func (a APIAuthor) QueryObjects(thingID, bucketName string, request QueryObjectsRequest) (*QueryObjectResponse, error)
- func (a APIAuthor) QueryThings(request ThingQueryRequest) (*QueryThingsResponse, error)
- func (a APIAuthor) QueryUsers(request QueryUsersRequest) (*QueryUsersResponse, error)
- func (a *APIAuthor) RegisterKiiUser(request UserRegisterRequest) (*UserRegisterResponse, error)
- func (a APIAuthor) RegisterThing(request interface{}) (*RegisterThingResponse, error)
- func (a APIAuthor) ReportEndnodeStatus(gatewayID, endnodeID string, request ReportEndnodeStatusRequest) error
- func (a APIAuthor) ResetThingPassword(thingID, newPassword string) error
- func (a APIAuthor) UpdateCommandResults(thingID string, commandID string, request UpdateCommandResultsRequest) error
- func (a APIAuthor) UpdateMultipleTraitState(thingID string, request interface{}) error
- func (a APIAuthor) UpdateState(thingID string, request interface{}) error
- func (a APIAuthor) UpdateThing(thingID string, data map[string]interface{}) error
- func (a APIAuthor) UpdateTraitCommandResults(thingID string, commandID string, request UpdateCommandResultsRequest) error
- func (a APIAuthor) UpdateTraitState(thingID string, alias string, request interface{}) error
- func (a APIAuthor) UpdateVendorThingID(thingID string, request UpdateVendorThingIDRequest) error
- type App
- type AppBucket
- type Bucket
- type BucketQuery
- type Clause
- type CloudError
- type CreateObjectResponse
- type DefaultLogger
- func (df *DefaultLogger) Debug(message string)
- func (df *DefaultLogger) Debugf(format string, v ...interface{})
- func (df *DefaultLogger) Error(message string)
- func (df *DefaultLogger) Errorf(format string, v ...interface{})
- func (df *DefaultLogger) Info(message string)
- func (df *DefaultLogger) Infof(format string, v ...interface{})
- func (df *DefaultLogger) Warn(message string)
- func (df *DefaultLogger) Warnf(format string, v ...interface{})
- type EndNode
- type EndNodeTokenRequest
- type EndNodeTokenResponse
- type ErrorResponse
- type GetCommandResponse
- type GroupBucket
- type KiiLogger
- type LayoutPosition
- type ListEndNodesResponse
- type ListObjectsResponse
- type ListRequest
- type MqttEndpoint
- type OnboardByOwnerRequest
- type OnboardEndnodeRequestCommon
- type OnboardEndnodeResponse
- type OnboardEndnodeWithGatewayThingIDRequest
- type OnboardEndnodeWithGatewayVendorThingIDRequest
- type OnboardGatewayRequest
- type OnboardGatewayResponse
- type PostCommandRequest
- type PostCommandResponse
- type Query
- type QueryObjectResponse
- type QueryObjectsRequest
- type QueryThingsResponse
- type QueryUsersRequest
- type QueryUsersResponse
- type RegisterThingRequest
- type RegisterThingResponse
- type ReportEndnodeStatusRequest
- type ThingBucket
- type ThingQueryRequest
- type UpdateCommandResultsRequest
- type UpdateVendorThingIDRequest
- type UserBucket
- type UserLoginRequest
- type UserLoginResponse
- type UserRegisterRequest
- type UserRegisterResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetDefaultUserAgent ¶
func SetDefaultUserAgent(s string)
SetDefaultUserAgent sets default of user agent. If the default user agent is not empty, it is used for "User-Agent" for all requests which made by kii_go.
Types ¶
type APIAuthor ¶
APIAuthor represents API author. Can be Gateway, EndNode or KiiUser, depending on the token.
func AdminLogin ¶
AdminLogin logins as admin user. When there's no error, APIAuthor is returned.
func AnonymousLogin ¶
AnonymousLogin logins as Anonymous user. When there's no error, APIAuthor is returned.
func (APIAuthor) AddEndNode ¶
AddEndNode adds an end node thing to gateway Notes that the APIAuthor should be a Gateway
func (APIAuthor) CreateThingScopeObject
deprecated
func (a APIAuthor) CreateThingScopeObject(thingID, bucketName string, object map[string]interface{}) (*CreateObjectResponse, error)
CreateThingScopeObject create Thing scope object
Deprecated: Use PostObject instead.
func (APIAuthor) DeleteBucket ¶
DeleteBucket deletes bucket
func (*APIAuthor) DeleteKiiUser ¶
DeleteKiiUser deletes kii user by id.
func (APIAuthor) DeleteObject ¶
DeleteObject deletes a kii object with object ID
func (APIAuthor) DeleteThing ¶
DeleteThing delete an exsiting Thing
func (APIAuthor) DeleteThingScopeBucket
deprecated
func (APIAuthor) GenerateEndNodeToken ¶
func (a APIAuthor) GenerateEndNodeToken(gatewayID string, endnodeID string, r *EndNodeTokenRequest) (*EndNodeTokenResponse, error)
GenerateEndNodeToken Requests access token of end node of gateway. Notes the APIAuthor should be a Gateway. When there's no error, EndNodeTokenResponse is returned.
func (*APIAuthor) GetCommand ¶
func (a *APIAuthor) GetCommand(thingID, commandID string) (*GetCommandResponse, error)
GetCommand gets command info
func (APIAuthor) GetMqttEndpoint ¶
func (a APIAuthor) GetMqttEndpoint(installationID string) (endpoint *MqttEndpoint, err error)
GetMqttEndpoint gets mqtt endpoint with specified installationID.
func (APIAuthor) InstallMqtt ¶
InstallMqtt a MQTT installation to the Kii cloud for current logged in user.
func (APIAuthor) ListAllThingScopeObjects ¶
func (a APIAuthor) ListAllThingScopeObjects(thingID, bucketName string, listPara ListRequest) (*ListObjectsResponse, error)
ListAllThingScopeObjects list all objects of the specified thing scope bucket
func (*APIAuthor) ListEndNodes ¶
func (a *APIAuthor) ListEndNodes(gatewayID string, listPara ListRequest) (*ListEndNodesResponse, error)
ListEndNodes request list of endnodes belong to geateway
func (*APIAuthor) LoginAsKiiUser ¶
func (a *APIAuthor) LoginAsKiiUser(request UserLoginRequest) (*UserLoginResponse, error)
LoginAsKiiUser logins as a KiiUser. If there is no error, UserLoginResponse is returned. Notes that after login successfully, api doesn't update token of APIAuthor, you should update by yourself with the token in response.
func (*APIAuthor) OnboardEndnodeWithGatewayThingID ¶
func (a *APIAuthor) OnboardEndnodeWithGatewayThingID(request OnboardEndnodeWithGatewayThingIDRequest) (*OnboardEndnodeResponse, error)
OnboardEndnodeWithGatewayThingID onboards an endnode with thingID of gateway
func (*APIAuthor) OnboardEndnodeWithGatewayVendorThingID ¶
func (a *APIAuthor) OnboardEndnodeWithGatewayVendorThingID(request OnboardEndnodeWithGatewayVendorThingIDRequest) (*OnboardEndnodeResponse, error)
OnboardEndnodeWithGatewayVendorThingID onboards an endnode with vendorThingID of gateway
func (*APIAuthor) OnboardGateway ¶
func (a *APIAuthor) OnboardGateway(r *OnboardGatewayRequest) (*OnboardGatewayResponse, error)
OnboardGateway lets Gateway onboard to the cloud. When there's no error, OnboardGatewayResponse is returned.
func (*APIAuthor) OnboardThingByOwner ¶
func (a *APIAuthor) OnboardThingByOwner(request OnboardByOwnerRequest) (*OnboardGatewayResponse, error)
OnboardThingByOwner onboards a thing by its owner.
func (APIAuthor) PostCommand ¶
func (a APIAuthor) PostCommand(thingID string, request PostCommandRequest) (*PostCommandResponse, error)
PostCommand posts command to Thing. Notes that it requires Thing already onboard. If there is no error, PostCommandRequest is returned.
func (APIAuthor) PostObject ¶
func (a APIAuthor) PostObject(bucket Bucket, data map[string]interface{}) (*CreateObjectResponse, error)
PostObject creates a kii object with data
func (APIAuthor) PostTraitCommand ¶
func (a APIAuthor) PostTraitCommand(thingID string, request PostCommandRequest) (*PostCommandResponse, error)
PostTraitCommand posts trait command to Thing. Notes that it requires Thing already onboard. If there is no error, PostCommandResponse is returned.
func (APIAuthor) QueryObjects ¶
func (a APIAuthor) QueryObjects(thingID, bucketName string, request QueryObjectsRequest) (*QueryObjectResponse, error)
QueryObjects query objects of bucket under Thing Scope
func (APIAuthor) QueryThings ¶
func (a APIAuthor) QueryThings(request ThingQueryRequest) (*QueryThingsResponse, error)
QueryThings query things owned by user
func (APIAuthor) QueryUsers ¶
func (a APIAuthor) QueryUsers(request QueryUsersRequest) (*QueryUsersResponse, error)
QueryUsers query users
func (*APIAuthor) RegisterKiiUser ¶
func (a *APIAuthor) RegisterKiiUser(request UserRegisterRequest) (*UserRegisterResponse, error)
RegisterKiiUser registers a KiiUser. If there is no error, UserRegisterResponse is returned.
func (APIAuthor) RegisterThing ¶
func (a APIAuthor) RegisterThing(request interface{}) (*RegisterThingResponse, error)
RegisterThing registers a Thing on Kii Cloud. The request must consist of the predefined fields(see RegisterThingRequest). If you want to add the custom fileds, you can simply make RegisterThingRequest as anonymous field of your defined request struct, like:
type MyRegisterThingRequest struct {
RegisterThingRequest
MyField1 string
}
Where there is no error, RegisterThingResponse is returned
func (APIAuthor) ReportEndnodeStatus ¶
func (a APIAuthor) ReportEndnodeStatus(gatewayID, endnodeID string, request ReportEndnodeStatusRequest) error
ReportEndnodeStatus reports online status of endnode by gateway
func (APIAuthor) ResetThingPassword ¶
ResetThingPassword reset password of existing thing.
func (APIAuthor) UpdateCommandResults ¶
func (a APIAuthor) UpdateCommandResults(thingID string, commandID string, request UpdateCommandResultsRequest) error
UpdateCommandResults updates command results.
func (APIAuthor) UpdateMultipleTraitState ¶
UpdateMultipleTraitState updates multiple traits formatted Thing state. You should first define trait, thingType, firmwareVersion and alias in server. Then onboard the thing with thingType and firmwareVersion Notes that the APIAuthor should be already initialized as a Gateway or EndNode
func (APIAuthor) UpdateState ¶
UpdateState updates Thing state. Notes that the APIAuthor should be already initialized as a Gateway or EndNode
func (APIAuthor) UpdateThing ¶
UpdateThing update thing properites.
func (APIAuthor) UpdateTraitCommandResults ¶
func (a APIAuthor) UpdateTraitCommandResults(thingID string, commandID string, request UpdateCommandResultsRequest) error
UpdateTraitCommandResults updates trait format command results.
func (APIAuthor) UpdateTraitState ¶
UpdateTraitState updates Thing state with specified trait/alias. You should first define trait, thingType, firmwareVersion and alias in server. Then onboard the thing with thingType and firmwareVersion Notes that the APIAuthor should be already initialized as a Gateway or EndNode
func (APIAuthor) UpdateVendorThingID ¶
func (a APIAuthor) UpdateVendorThingID(thingID string, request UpdateVendorThingIDRequest) error
UpdateVendorThingID update Vendor ThingID of exsiting Thing
type App ¶
App represents Application in Kii Cloud.
func (*App) ThingIFURL ¶
ThingIFURL returns Thing-IF API URL for the app.
type Clause ¶
type Clause map[string]interface{}
Clause for query
func EqualsClause ¶
EqualsClause return clause for equals
type CloudError ¶
type CloudError struct {
ErrorResponse
HTTPStatus int
RawResponse string
}
CloudError represents error returned by Kii Cloud.
func (CloudError) Error ¶
func (e CloudError) Error() string
type CreateObjectResponse ¶
type CreateObjectResponse struct {
ObjectID string `json:"objectID"`
CreateAt int64 `json:"createAt"`
DataType string `json:"dataType"`
}
CreateObjectResponse for receiving response of create object
type DefaultLogger ¶
DefaultLogger Default implementation for KiiLogger. This implementation use log.Logger.
func (*DefaultLogger) Debug ¶
func (df *DefaultLogger) Debug(message string)
Debug writes debug message to log.
func (*DefaultLogger) Debugf ¶
func (df *DefaultLogger) Debugf(format string, v ...interface{})
Debugf formats debug message according to a format specifier and write it to log.
func (*DefaultLogger) Error ¶
func (df *DefaultLogger) Error(message string)
Error writes error message to log.
func (*DefaultLogger) Errorf ¶
func (df *DefaultLogger) Errorf(format string, v ...interface{})
Errorf formats error message according to a format specifier and write it to log.
func (*DefaultLogger) Info ¶
func (df *DefaultLogger) Info(message string)
Info writes info message to log.
func (*DefaultLogger) Infof ¶
func (df *DefaultLogger) Infof(format string, v ...interface{})
Infof formats info message according to a format specifier and write it to log.
func (*DefaultLogger) Warn ¶
func (df *DefaultLogger) Warn(message string)
Warn writes warn message to log.
func (*DefaultLogger) Warnf ¶
func (df *DefaultLogger) Warnf(format string, v ...interface{})
Warnf formats warn message according to a format specifier and write it to log.
type EndNodeTokenRequest ¶
type EndNodeTokenRequest struct {
ExpiresIn string `json:"expires_in,omitempty"`
}
EndNodeTokenRequest for requesting end node token
type EndNodeTokenResponse ¶
type EndNodeTokenResponse struct {
AccessToken string `json:"access_token"`
ExpiresIn int `json:"expires_in"`
ThingID string `json:"id"`
RefreshToken string `json:"refresh_token"`
}
EndNodeTokenResponse for receiving response of end node token
type ErrorResponse ¶
ErrorResponse represents error response returned by Kii Cloud.
type GetCommandResponse ¶
type GetCommandResponse struct {
CommandID string `json:"commandId"`
Target string `json:"target"`
Issuer string `json:"issuer"`
Actions []map[string]interface{} `json:"actions"`
ActionResults []map[string]interface{} `json:"actionResults"`
CommandState string `json:"commandState"`
CreatedAt int64 `json:"createdAt"`
ModifiedAt int64 `json:"modifiedAt"`
}
GetCommandResponse represents reponse of geting command
type GroupBucket ¶
GroupBucket represents group bucket
func (GroupBucket) Path ¶
func (gb GroupBucket) Path() string
Path generates path string of group bucket
type KiiLogger ¶
type KiiLogger interface {
Debug(format string)
Debugf(format string, args ...interface{})
Info(format string)
Infof(format string, args ...interface{})
Warn(format string)
Warnf(format string, args ...interface{})
Error(format string)
Errorf(format string, args ...interface{})
}
KiiLogger Logger interface for this library
type LayoutPosition ¶
type LayoutPosition int
LayoutPosition represents Layout position of the Thing.
const ( // ENDNODE represents layout position of endnodes. ENDNODE LayoutPosition = iota // STANDALONE represents layout position of standalone. STANDALONE // GATEWAY represents layout position of gateway. GATEWAY )
func (LayoutPosition) String ¶
func (lp LayoutPosition) String() string
Obtain Layout position of the Thing in string.
type ListEndNodesResponse ¶
type ListEndNodesResponse struct {
Results []EndNode `json:"results"`
NextPaginationKey string `json:"nextPaginationKey"`
}
ListEndNodesResponse for receiving response of list request
type ListObjectsResponse ¶
ListObjectsResponse for receiving response of list object request
type ListRequest ¶
ListRequest consist of parameters when request list of data(like end-nodes) from Kii Cloud
type MqttEndpoint ¶
type MqttEndpoint struct {
InstallationID string `json:"installationID"`
Host string `json:"host"`
MqttTopic string `json:"mqttTopic"`
Username string `json:"userName"`
Password string `json:"password"`
PortSSL int `json:"portSSL"`
PortTCP int `json:"portTCP"`
PortWS int `json:"portWS,omitempty"`
PortWSS int `json:"portWSS,omitempty"`
XMqttTTL int `json:"X-MQTT-TTL,omitempty"`
}
MqttEndpoint represents MQTT endpoint.
type OnboardByOwnerRequest ¶
type OnboardByOwnerRequest struct {
ThingID string `json:"thingID"`
ThingPassword string `json:"thingPassword"`
Owner string `json:"owner"`
LayoutPosition string `json:"layoutPosition,omitempty"` // pattern: GATEWAY|STANDALONE|ENDNODE, STANDALONE by default
}
OnboardByOwnerRequest for requesting Onboard by Thing Owner.
type OnboardEndnodeRequestCommon ¶
type OnboardEndnodeRequestCommon struct {
EndNodeVendorThingID string `json:"endNodeVendorThingID"`
EndNodePassword string `json:"endNodePassword"`
Owner string `json:"owner"`
EndNodeThingProperties string `json:"endNodeThingProperties,omitempty"`
EndNodeThingType string `json:"endNodeThingType,omitempty"`
EndNodeFirmwareVersion string `json:"endNodeFirmwareVersion,omitempty"`
}
OnboardEndnodeRequestCommon is the command fields for OnboardEndnodeWithGatewayThingIDRequest and OnboardEndnodeWithGatewayVendorThingIDRequest
type OnboardEndnodeResponse ¶
type OnboardEndnodeResponse struct {
AccessToken string `json:"accessToken"`
EndNodeThingID string `json:"endNodeThingID"`
}
OnboardEndnodeResponse for receiving response of onboarding endnode with gateway
type OnboardEndnodeWithGatewayThingIDRequest ¶
type OnboardEndnodeWithGatewayThingIDRequest struct {
GatewayThingID string `json:"gatewayThingID"`
OnboardEndnodeRequestCommon
}
OnboardEndnodeWithGatewayThingIDRequest for requesting Onboard with thingID of gateway
type OnboardEndnodeWithGatewayVendorThingIDRequest ¶
type OnboardEndnodeWithGatewayVendorThingIDRequest struct {
GatewayVendorThingID string `json:"gatewayVendorThingID"`
OnboardEndnodeRequestCommon
}
OnboardEndnodeWithGatewayVendorThingIDRequest for requesting Onboard with vendorThingID of gateway
type OnboardGatewayRequest ¶
type OnboardGatewayRequest struct {
VendorThingID string `json:"vendorThingID"`
ThingPassword string `json:"thingPassword"`
ThingType string `json:"thingType"`
LayoutPosition string `json:"layoutPosition"`
ThingProperties map[string]interface{} `json:"thingProperties"`
FirmwareVersion string `json:"firmwareVersion"`
}
OnboardGatewayRequest for requesting Gateway Onboard.
type OnboardGatewayResponse ¶
type OnboardGatewayResponse struct {
ThingID string `json:"thingID"`
AccessToken string `json:"accessToken"`
MqttEndpoint MqttEndpoint `json:"mqttEndpoint"`
}
OnboardGatewayResponse for receiving response of Gateway Onboard.
type PostCommandRequest ¶
type PostCommandRequest struct {
Issuer string `json:"issuer"`
Actions []map[string]interface{} `json:"actions"`
Schema string `json:"schema,omitempty"`
SchemaVersion int `json:"schemaVersion,omitempty"`
FiredByTriggerID string `json:"firedByTriggerID,omitempty"`
Title string `json:"title,omitempty"`
Description string `json:"description,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
PostCommandRequest for posting command Issuer can be group or user. If user, must be "user:<user-id>".
type PostCommandResponse ¶
type PostCommandResponse struct {
CommandID string `json:"commandID"`
}
PostCommandResponse for receiving response of posting command
type Query ¶
type Query struct {
Clause Clause `json:"clause"`
OrderBy string `json:"orderBy,omitempty"`
Descending bool `json:"descending,omitempty"`
}
Query contains the parameters for query bucket/users.
type QueryObjectResponse ¶
type QueryObjectResponse struct {
QueryDescription string `json:"queryDescription"`
Results []map[string]interface{} `json:"results"`
NextPaginationKey string `json:"nextPaginationKey"`
}
QueryObjectResponse for receiving query buckt e
type QueryObjectsRequest ¶
type QueryObjectsRequest struct {
BucketQuery BucketQuery `json:"bucketQuery"`
BestEffortLimit string `json:"bestEffortLimit,omitempty"`
PaginationKey string `json:"paginationKey,omitempty"`
}
QueryObjectsRequest for query object for bucket
type QueryThingsResponse ¶
type QueryThingsResponse struct {
Results []interface{} `json:"results"`
NextPaginationKey string `json:"nextPaginationKey"`
}
QueryThingsResponse represents response of querying things
type QueryUsersRequest ¶
type QueryUsersRequest struct {
UserQuery Query `json:"userQuery"`
BestEffortLimit string `json:"bestEffortLimit,omitempty"`
PaginationKey string `json:"paginationKey,omitempty"`
}
QueryUsersRequest for query users
type QueryUsersResponse ¶
type QueryUsersResponse struct {
QueryDescription string `json:"queryDescription"`
Results []map[string]interface{} `json:"results"`
NextPaginationKey string `json:"nextPaginationKey"`
}
QueryUsersResponse for receiving query users
type RegisterThingRequest ¶
type RegisterThingRequest struct {
VendorThingID string `json:"_vendorThingID"`
ThingPassword string `json:"_password"`
ThingType string `json:"_thingType,omitempty"`
LayoutPosition string `json:"_layoutPosition,omitempty"`
Vendor string `json:"_vendor,omitempty"`
FirmwareVersion string `json:"_firmwareVersion,omitempty"`
Lot string `json:"_lot,omitempty"`
StringField1 string `json:"_stringField1,omitempty"`
StringField2 string `json:"_stringField2,omitempty"`
StringField3 string `json:"_stringField3,omitempty"`
StringField4 string `json:"_stringField4,omitempty"`
StringField5 string `json:"_stringField5,omitempty"`
NumberField1 int64 `json:"_numberField1,omitempty"`
NumberField2 int64 `json:"_numberField2,omitempty"`
NumberField3 int64 `json:"_numberField3,omitempty"`
NumberField4 int64 `json:"_numberField4,omitempty"`
NumberField5 int64 `json:"_numberField5,omitempty"`
}
RegisterThingRequest reresents predefined fileds for requesting Thing Registration.
type RegisterThingResponse ¶
type RegisterThingResponse struct {
ThingID string `json:"_thingID"`
VendorThingID string `json:"_vendorThingID"`
ThingType string `json:"_thingType"`
LayoutPosition string `json:"_layoutPosition"`
Created int `json:"_created"`
Disabled bool `json:"_disabled"`
}
RegisterThingResponse for receiving response of end node token
type ReportEndnodeStatusRequest ¶
type ReportEndnodeStatusRequest struct {
Online bool `json:"online"`
}
ReportEndnodeStatusRequest for reporting endnode online status
type ThingBucket ¶
ThingBucket represents thing bucket
func (ThingBucket) Path ¶
func (tb ThingBucket) Path() string
Path generates path string of user bucket
type ThingQueryRequest ¶
type ThingQueryRequest struct {
OwnerID string
Clause Clause
ListRequest
}
ThingQueryRequest for querying thing owner by user
type UpdateCommandResultsRequest ¶
type UpdateCommandResultsRequest struct {
ActionResults []map[string]interface{} `json:"actionResults"`
}
UpdateCommandResultsRequest for updating command results
type UpdateVendorThingIDRequest ¶
type UpdateVendorThingIDRequest struct {
VendorThingID string `json:"_vendorThingID"`
Password string `json:"_password"`
}
UpdateVendorThingIDRequest for requesting update vendorThingID of existing Thing
type UserBucket ¶
UserBucket represents user bucket
func (UserBucket) Path ¶
func (ub UserBucket) Path() string
Path generates path string of user bucket
type UserLoginRequest ¶
type UserLoginRequest struct {
UserName string `json:"username"`
Password string `json:"password"`
ExpiresAt string `json:"expiresAt,omitempty"`
RefreshToken string `json:"refresh_token,omitempty"`
GrantType string `json:"grant_type,omitempty"`
}
UserLoginRequest for requesting login of KiiUser
type UserLoginResponse ¶
type UserLoginResponse struct {
ID string `json:"id"`
AccessToken string `json:"access_token"`
ExpiresIn int `json:"expires_in"`
TokenType string `json:"token_type"`
RefreshToken string `json:"refresh_token"`
}
UserLoginResponse for receiving response of login
type UserRegisterRequest ¶
type UserRegisterRequest struct {
LoginName string `json:"loginName,omitempty"`
DisplayName string `json:"displayName,omitempty"`
Country string `json:"country,omitempty"`
Locale string `json:"locale,omitempty"`
EmailAddress string `json:"emailAddress,omitempty"`
PhoneNumber string `json:"phoneNumber,omitempty"`
PhoneNumberVerified bool `json:"phoneNumberVerified,omitempty"`
Password string `json:"password"`
}
UserRegisterRequest for request registration of KiiUser. At least one of LoginName, EmailAddress or PhoneNumber must be provided.
type UserRegisterResponse ¶
type UserRegisterResponse struct {
UserID string `json:"userID"`
LoginName string `json:"loginName"`
DisplayName string `json:"displayName"`
Country string `json:"country"`
Locale string `json:"locale"`
EmailAddress string `json:"emailAddress"`
PhoneNumber string `json:"phoneNumber"`
PhoneNumberVerified bool `json:"phoneNumberVerified"`
HasPassword bool `json:"_hasPassword"`
}
UserRegisterResponse for receiving registration of KiiUser.