Documentation
¶
Index ¶
- Constants
- type Client
- func (c *Client) DeviceExecuteReadCommand(deviceID string, inputValues url.Values) (*DeviceExecuteReadCommandOutput, error)
- func (c *Client) ListDevices() (ListDevicesOutput, error)
- func (c *Client) Login(username, password string) (*LoginOutput, error)
- func (c *Client) Raw(method string, path string, parameters url.Values, input interface{}) ([]byte, error)
- type DeviceExecuteReadCommandOutput
- type ListDevicesOutput
- type LoginInput
- type LoginOutput
Constants ¶
View Source
const APIKey = "EOOEMOW4YR6QNB07"
View Source
const IAquaLinkAPIBase = "https://r-api.iaqualink.net"
View Source
const LoginAPIBase = "https://prod.zodiac-io.com"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { APIKey string // The API key. If empty, this will default to `APIKey`. LoginAPIBase string // The login API base. If empty, this will default to `LoginAPIBase`. IAquaLinkAPIBase string // The iAquaLink API base. If empty, this will default to `IAquaLinkAPIBase`. AuthenticationToken string // The API token. Client *http.Client // The HTTP client. UserID string // The user ID. }
Client is the iAquaLink client.
func (*Client) DeviceExecuteReadCommand ¶
func (c *Client) DeviceExecuteReadCommand(deviceID string, inputValues url.Values) (*DeviceExecuteReadCommandOutput, error)
DeviceExecuteReadCommand executes a command.
func (*Client) ListDevices ¶
func (c *Client) ListDevices() (ListDevicesOutput, error)
ListDevices lists the devices.
type DeviceExecuteReadCommandOutput ¶
type DeviceExecuteReadCommandOutput struct { Command struct { Request string `json:"request"` Response string `json:"response"` } `json:"command"` RequestID string `json:"requestID"` }
DeviceExecuteReadCommand is the output of executing a command.
type ListDevicesOutput ¶
type ListDevicesOutput []struct { ID int `json:"id"` SerialNumber string `json:"serial_number"` CreatedAt time.Time `json:"created_at"` UpdatedDat time.Time `json:"updated_at"` Name string `json:"name"` DeviceType string `json:"device_type"` OwnerID int `json:"owner_id"` Updating bool `json:"updating"` FirmwareVersion *string `json:"firmware_version"` TargetFirmwareVersion *string `json:"target_firmware_version"` UpdateFirmwareStartAt *time.Time `json:"update_firmware_start_at"` LastActivityAt *time.Time `json:"last_activity_at"` }
ListDevicesOutput is the output of listing the devices.
type LoginInput ¶
type LoginInput struct { APIKey string `json:"apiKey"` Email string `json:"email"` Password string `json:"password"` }
LoginInput is the login input.
type LoginOutput ¶
type LoginOutput struct { Address string `json:"address"` Address1 string `json:"address_1"` Address2 string `json:"address_2"` AuthenticationToken string `json:"authentication_token"` City string `json:"city"` CognitoPool struct { AppClientID string `json:"appClientId"` PoolID string `json:"poolId"` Region string `json:"region"` } `json:"cognitoPool"` Country string `json:"country"` CreatedAt time.Time `json:"created_at"` Credentials struct { AccessKeyID string `json:"AccessKeyId"` Expiration time.Time `json:"Expiration"` IdentityID string `json:"IdentityId"` SecretKey string `json:"SecretKey"` SessionToken string `json:"SessionToken"` } `json:"credentials"` Email string `json:"email"` FirstName string `json:"first_name"` ID string `json:"id"` LastName string `json:"last_name"` OptIn1 string `json:"opt_in_1"` OptIn2 string `json:"opt_in_2"` Phone string `json:"phone"` PostalCode string `json:"postal_code"` Role string `json:"role"` SessionID string `json:"session_id"` State string `json:"state"` TimeZone string `json:"time_zone"` UpdatedAt time.Time `json:"updated_at"` UserPoolOAuth struct { AccessToken string `json:"AccessToken"` ExpiresIn int `json:"ExpiresIn"` IDToken string `json:"IdToken"` RefreshToken string `json:"RefreshToken"` TokenType string `json:"TokenType"` } `json:"userPoolOAuth"` Username string `json:"username"` }
LoginOutput is the login output.