kii

package module
v0.0.0-...-d524564 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 19, 2019 License: MIT Imports: 13 Imported by: 0

README

# Kii Go
[![Go Report Card](https://goreportcard.com/badge/github.com/KiiPlatform/kii_go)](https://goreportcard.com/report/github.com/KiiPlatform/kii_go)
[![Circle CI](https://circleci.com/gh/KiiPlatform/kii_go/tree/master.svg?style=svg)](https://circleci.com/gh/KiiPlatform/kii_go/tree/master)

Go library connect to Kii cloud API.
## How to use
```shell
mkdir -p $GOPATH/github.com/KiiPlatform
cd $GOPATH/github.com/KiiPlatform
git clone git@github.com:KiiPlatform/kii_go.git
go build github.com/KiiPlatform/kii_go
go install github.com/KiiPlatform/kii_go
go test github.com/KiiPlatform/kii_go
```

Documentation

Overview

Package kii provides APIs to access to Kii Cloud and Thing Interaction Framework (thing-if).

Index

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

type APIAuthor struct {
	Token string
	App   App
}

APIAuthor represents API author. Can be Gateway, EndNode or KiiUser, depending on the token.

func AdminLogin

func AdminLogin(app App, clientID, clientSecret string) (*APIAuthor, error)

AdminLogin logins as admin user. When there's no error, APIAuthor is returned.

func AnonymousLogin

func AnonymousLogin(app App) (*APIAuthor, error)

AnonymousLogin logins as Anonymous user. When there's no error, APIAuthor is returned.

func (APIAuthor) AddEndNode

func (a APIAuthor) AddEndNode(gatewayID string, endnodeID string) error

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

func (a APIAuthor) DeleteBucket(bucket Bucket) error

DeleteBucket deletes bucket

func (*APIAuthor) DeleteKiiUser

func (a *APIAuthor) DeleteKiiUser(userID string) error

DeleteKiiUser deletes kii user by id.

func (APIAuthor) DeleteObject

func (a APIAuthor) DeleteObject(bucket Bucket, objectID string) error

DeleteObject deletes a kii object with object ID

func (APIAuthor) DeleteThing

func (a APIAuthor) DeleteThing(thingID string) error

DeleteThing delete an exsiting Thing

func (APIAuthor) DeleteThingScopeBucket deprecated

func (a APIAuthor) DeleteThingScopeBucket(thingID, bucketName string) error

DeleteThingScopeBucket delete ThingScope bucket

Deprecated: Use DeleBucket instead.

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) GetObject

func (a APIAuthor) GetObject(bucket Bucket, objectID string) (interface{}, error)

GetObject retrieves kii object with object ID

func (APIAuthor) GetState

func (a APIAuthor) GetState(thingID string) (interface{}, error)

GetState get Thing state.

func (APIAuthor) GetThing

func (a APIAuthor) GetThing(thingID string) (interface{}, error)

GetThing get thing info

func (APIAuthor) InstallMqtt

func (a APIAuthor) InstallMqtt(development bool) (installationID string, err error)

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

func (a APIAuthor) ResetThingPassword(thingID, newPassword string) error

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

func (a APIAuthor) UpdateMultipleTraitState(thingID string, request interface{}) error

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

func (a APIAuthor) UpdateState(thingID string, request interface{}) error

UpdateState updates Thing state. Notes that the APIAuthor should be already initialized as a Gateway or EndNode

func (APIAuthor) UpdateThing

func (a APIAuthor) UpdateThing(thingID string, data map[string]interface{}) error

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

func (a APIAuthor) UpdateTraitState(thingID string, alias string, request interface{}) error

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

type App struct {
	AppID    string
	AppKey   string
	Location string
}

App represents Application in Kii Cloud.

func (*App) CloudURL

func (a *App) CloudURL(path string) string

CloudURL returns regular API URL for the app.

func (*App) HostName

func (a *App) HostName() string

HostName returns host name of the Application endpoint.

func (*App) ThingIFURL

func (a *App) ThingIFURL(path string) string

ThingIFURL returns Thing-IF API URL for the app.

type AppBucket

type AppBucket struct {
	BucketName string
}

AppBucket represents app bucket

func (AppBucket) Path

func (ab AppBucket) Path() string

Path generates path string of app bucket

type Bucket

type Bucket interface {
	Path() string
}

Bucket represents bucket

type BucketQuery

type BucketQuery Query

BucketQuery struct for QueryObjectsRequest

type Clause

type Clause map[string]interface{}

Clause for query

func AllQueryClause

func AllQueryClause() Clause

AllQueryClause return clause for all query

func AndClause

func AndClause(clauses ...Clause) Clause

AndClause return clause for and

func EqualsClause

func EqualsClause(key string, value interface{}) Clause

EqualsClause return clause for equals

func OrClause

func OrClause(clauses ...Clause) Clause

OrClause return clause for and

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

type DefaultLogger struct {
	Logger *log.Logger
}

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 EndNode

type EndNode struct {
	ThingID       string `json:"thingID"`
	VendorThingID string `json:"vendorThingID"`
}

EndNode represents end-node

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

type ErrorResponse struct {
	ErrorCode string `json:"errorCode"`
	Message   string `json:"message"`
}

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

type GroupBucket struct {
	BucketName string
	GroupID    string
}

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

var Logger KiiLogger = &DefaultLogger{
	Logger: log.New(ioutil.Discard, "", 0),
}

Logger set logger for kii module. Default is discard logger, no logs are outputted. Please set a valid logger if you want to make kii module put logs.

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

type ListObjectsResponse struct {
	Results           []map[string]interface{}
	NextPaginationKey string
}

ListObjectsResponse for receiving response of list object request

type ListRequest

type ListRequest struct {
	BestEffortLimit   int
	NextPaginationKey string
}

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

type ThingBucket struct {
	BucketName string
	ThingID    string
}

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

type UserBucket struct {
	BucketName string
	UserID     string
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL