Documentation ¶
Index ¶
- Variables
- func IsRetriable(err error) bool
- func NewOAuth2Config(clientID, clientSecret, redirectURL string) *oauth2.Config
- type AvatarSize
- type Client
- type ConnectionStatusRequest
- type ConnectionStatusResponse
- type DeviceInfo
- type DeviceService
- func (s *DeviceService) GetConnectionStatus(ctx context.Context, data *ConnectionStatusRequest) (*ConnectionStatusResponse, error)
- func (s *DeviceService) GetListDevices(ctx context.Context) (*ListDevicesResponse, error)
- func (s *DeviceService) GetListDevicesByPlace(ctx context.Context, data *ListDevicesByPlaceRequest) (*ListDevicesResponse, error)
- func (s *DeviceService) UpdateDevice(ctx context.Context, data *UpdateDeviceRequest) error
- type DeviceStatus
- type HttpClient
- type ListDevicesByPlaceRequest
- type ListDevicesResponse
- type Person
- type PersonFaceUpdateRequest
- type PersonListByPlaceRequest
- type PersonListItem
- type PersonRegisterRequest
- type PersonRegisterResponse
- type PersonRemoveByPlaceRequest
- type PersonRemoveRequest
- type PersonService
- func (s *PersonService) ListByPlace(ctx context.Context, data PersonListByPlaceRequest) ([]PersonListItem, error)
- func (s *PersonService) Register(ctx context.Context, pu PersonRegisterRequest) (*PersonRegisterResponse, error)
- func (s *PersonService) Remove(ctx context.Context, data PersonRemoveRequest) error
- func (s *PersonService) RemoveByPlace(ctx context.Context, data PersonRemoveByPlaceRequest) error
- func (s *PersonService) Update(ctx context.Context, data PersonUpdateRequest) error
- func (s *PersonService) UpdateAliasID(ctx context.Context, data PersonUpdateAliasRequest) error
- func (s *PersonService) UpdateByFaceImage(ctx context.Context, pu PersonFaceUpdateRequest) error
- type PersonUpdateAliasRequest
- type PersonUpdateRequest
- type Place
- type PlaceService
- type ServerError
- type UpdateDeviceRequest
- type UrlValuesSetter
Constants ¶
This section is empty.
Variables ¶
var DefaultAvatarSize = AvatarSize{
Height: 736,
Width: 1280,
}
Functions ¶
func IsRetriable ¶
IsRetriable checks if a given error is an Hanet retriable error
func NewOAuth2Config ¶
Types ¶
type AvatarSize ¶
AvatarSize store avatar size in height*width
func (AvatarSize) SetUrlValues ¶
func (s AvatarSize) SetUrlValues(setter UrlValuesSetter)
type Client ¶
type Client struct { // Base URL for API requests. BaseURL *url.URL // User agent used when communicating with the Hanet AI API. UserAgent string Devices *DeviceService Persons *PersonService Places *PlaceService // contains filtered or unexported fields }
func NewClient ¶
func NewClient(httpClient HttpClient, ts oauth2.TokenSource) *Client
func (*Client) Do ¶
Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred.
The provided ctx must be non-nil, if it is nil an error is returned. If it is canceled or times out, ctx.Err() will be returned.
func (*Client) NewRequest ¶
NewRequest creates an API request. A relative URL can be provided in urlStr, in which case it is resolved relative to the BaseURL of the Client. Relative URLs should always be specified without a preceding slash. If specified, the value pointed to by body is JSON encoded and included as the request body.
type ConnectionStatusRequest ¶
type ConnectionStatusRequest struct {
DeviceIDs []string `json:"deviceIDs" url:"deviceIDs"`
}
type ConnectionStatusResponse ¶
type ConnectionStatusResponse struct {
Devices []DeviceStatus
}
type DeviceInfo ¶
type DeviceService ¶
type DeviceService service
func (*DeviceService) GetConnectionStatus ¶
func (s *DeviceService) GetConnectionStatus(ctx context.Context, data *ConnectionStatusRequest) (*ConnectionStatusResponse, error)
func (*DeviceService) GetListDevices ¶
func (s *DeviceService) GetListDevices(ctx context.Context) (*ListDevicesResponse, error)
func (*DeviceService) GetListDevicesByPlace ¶
func (s *DeviceService) GetListDevicesByPlace(ctx context.Context, data *ListDevicesByPlaceRequest) (*ListDevicesResponse, error)
func (*DeviceService) UpdateDevice ¶
func (s *DeviceService) UpdateDevice(ctx context.Context, data *UpdateDeviceRequest) error
type DeviceStatus ¶
type ListDevicesByPlaceRequest ¶
type ListDevicesByPlaceRequest struct {
PlaceID int `url:"placeID"`
}
type ListDevicesResponse ¶
type ListDevicesResponse struct {
Devices []DeviceInfo
}
type PersonFaceUpdateRequest ¶
type PersonListItem ¶
type PersonRegisterRequest ¶
type PersonRegisterRequest struct { *PersonFaceUpdateRequest Name string `json:"name"` Title string `json:"title"` Type string `json:"type"` }
type PersonRegisterResponse ¶
type PersonRemoveRequest ¶
type PersonRemoveRequest struct {
AliasID string `url:"aliasID"`
}
type PersonService ¶
type PersonService service
func (*PersonService) ListByPlace ¶
func (s *PersonService) ListByPlace(ctx context.Context, data PersonListByPlaceRequest) ([]PersonListItem, error)
func (*PersonService) Register ¶
func (s *PersonService) Register(ctx context.Context, pu PersonRegisterRequest) (*PersonRegisterResponse, error)
func (*PersonService) Remove ¶
func (s *PersonService) Remove(ctx context.Context, data PersonRemoveRequest) error
func (*PersonService) RemoveByPlace ¶
func (s *PersonService) RemoveByPlace(ctx context.Context, data PersonRemoveByPlaceRequest) error
func (*PersonService) Update ¶
func (s *PersonService) Update(ctx context.Context, data PersonUpdateRequest) error
func (*PersonService) UpdateAliasID ¶
func (s *PersonService) UpdateAliasID(ctx context.Context, data PersonUpdateAliasRequest) error
func (*PersonService) UpdateByFaceImage ¶
func (s *PersonService) UpdateByFaceImage(ctx context.Context, pu PersonFaceUpdateRequest) error
type PersonUpdateRequest ¶
type PlaceService ¶
type PlaceService service
func (*PlaceService) UpdatePlace ¶
func (s *PlaceService) UpdatePlace(ctx context.Context, place Place) error
type ServerError ¶
func (ServerError) Error ¶
func (se ServerError) Error() string