Documentation
ΒΆ
Index ΒΆ
- Constants
- type APIResponseEnvelope
- type APIResponseEnvelopePagination
- type Budget
- type BudgetsResponse
- type Client
- func (c *Client) Authenticate(ctx context.Context, username, password string) error
- func (c *Client) GetBudgets(ctx context.Context, deviceID string, params *GetBudgetsParams) (*BudgetsResponse, error)
- func (c *Client) GetContacts(ctx context.Context, params *GetContactsParams) (*ContactsResponse, error)
- func (c *Client) GetCurrentFlow(ctx context.Context, deviceID string) (*FlowResponse, error)
- func (c *Client) GetDevice(ctx context.Context, deviceID string, params *DeviceParams) (*DeviceResponse, error)
- func (c *Client) GetDevices(ctx context.Context, params *DevicesParams) (*DevicesResponse, error)
- func (c *Client) GetEventRules(ctx context.Context, deviceID string, params *GetEventRulesParams) (*EventRulesResponse, error)
- func (c *Client) GetLocation(ctx context.Context, locationID string) (*LocationResponse, error)
- func (c *Client) GetLocations(ctx context.Context, params *GetLocationsParams) (*LocationsResponse, error)
- func (c *Client) GetNotifications(ctx context.Context, params *GetNotificationsParams) (*NotificationsResponse, error)
- func (c *Client) GetSubscription(ctx context.Context, subscriptionID string) (*SubscriptionResponse, error)
- func (c *Client) GetSubscriptions(ctx context.Context, params *GetSubscriptionsParams) (*SubscriptionsResponse, error)
- func (c *Client) GetUsageAlertRule(ctx context.Context, deviceID, ruleID string) (*UsageAlertRuleResponse, error)
- func (c *Client) GetUsageAlertRules(ctx context.Context, deviceID string, params *GetUsageAlertRulesParams) (*UsageAlertRulesResponse, error)
- func (c *Client) GetUsageAlerts(ctx context.Context, params *GetUsageAlertsParams) (*UsageAlertsResponse, error)
- func (c *Client) GetUser(ctx context.Context) (*UserResponse, error)
- func (c *Client) QueryUsage(ctx context.Context, deviceID string, data QueryUsageRequestBody) (*QueryUsageResponse, error)
- func (c *Client) RefreshAccessToken(ctx context.Context) error
- func (c *Client) UpdateLocation(ctx context.Context, locationID string, patch LocationPatch) (*APIResponseEnvelope, error)
- type Contact
- type ContactsResponse
- type Device
- type DeviceParams
- type DeviceResponse
- type DevicesParams
- type DevicesResponse
- type EventRule
- type EventRulesResponse
- type Flow
- type FlowResponse
- type GetBudgetsParams
- type GetContactsParams
- type GetEventRulesParams
- type GetLocationsParams
- type GetNotificationsParams
- type GetSubscriptionsParams
- type GetUsageAlertRulesParams
- type GetUsageAlertsParams
- type JWTPayload
- type Location
- type LocationPatch
- type LocationResponse
- type LocationsResponse
- type Notification
- type NotificationsResponse
- type Pagination
- type QueryUsageRequestBody
- type QueryUsageResponse
- type Subscription
- type SubscriptionResponse
- type SubscriptionsResponse
- type Token
- type TokenResponse
- type UsageAlert
- type UsageAlertQuery
- type UsageAlertRule
- type UsageAlertRuleResponse
- type UsageAlertRulesResponse
- type UsageAlertsResponse
- type UsageQuery
- type User
- type UserResponse
Constants ΒΆ
View Source
const BaseApiUrl = "https://api.flumewater.com"
Variables ΒΆ
This section is empty.
Functions ΒΆ
This section is empty.
Types ΒΆ
type APIResponseEnvelope ΒΆ
type APIResponseEnvelopePagination ΒΆ
type APIResponseEnvelopePagination struct {
Success bool `json:"success"`
Code int `json:"code"`
Message string `json:"message"`
HTTPCode int `json:"http_code"`
HTTPMessage string `json:"http_message"`
Detailed string `json:"detailed"`
Count int `json:"count"`
Pagination Pagination `json:"pagination"`
}
type BudgetsResponse ΒΆ
type BudgetsResponse struct {
APIResponseEnvelope
Data []Budget `json:"data"`
}
type Client ΒΆ
type Client struct {
BaseURL string
ClientID string
ClientSecret string
HTTPClient *http.Client
Token Token
JWT JWTPayload
}
func (*Client) Authenticate ΒΆ
func (*Client) GetBudgets ΒΆ
func (c *Client) GetBudgets(ctx context.Context, deviceID string, params *GetBudgetsParams) (*BudgetsResponse, error)
func (*Client) GetContacts ΒΆ
func (c *Client) GetContacts(ctx context.Context, params *GetContactsParams) (*ContactsResponse, error)
func (*Client) GetCurrentFlow ΒΆ
func (*Client) GetDevice ΒΆ
func (c *Client) GetDevice(ctx context.Context, deviceID string, params *DeviceParams) (*DeviceResponse, error)
func (*Client) GetDevices ΒΆ
func (c *Client) GetDevices(ctx context.Context, params *DevicesParams) (*DevicesResponse, error)
func (*Client) GetEventRules ΒΆ
func (c *Client) GetEventRules(ctx context.Context, deviceID string, params *GetEventRulesParams) (*EventRulesResponse, error)
func (*Client) GetLocation ΒΆ
func (*Client) GetLocations ΒΆ
func (c *Client) GetLocations(ctx context.Context, params *GetLocationsParams) (*LocationsResponse, error)
func (*Client) GetNotifications ΒΆ
func (c *Client) GetNotifications(ctx context.Context, params *GetNotificationsParams) (*NotificationsResponse, error)
func (*Client) GetSubscription ΒΆ
func (*Client) GetSubscriptions ΒΆ
func (c *Client) GetSubscriptions(ctx context.Context, params *GetSubscriptionsParams) (*SubscriptionsResponse, error)
func (*Client) GetUsageAlertRule ΒΆ
func (*Client) GetUsageAlertRules ΒΆ
func (c *Client) GetUsageAlertRules(ctx context.Context, deviceID string, params *GetUsageAlertRulesParams) (*UsageAlertRulesResponse, error)
func (*Client) GetUsageAlerts ΒΆ
func (c *Client) GetUsageAlerts(ctx context.Context, params *GetUsageAlertsParams) (*UsageAlertsResponse, error)
func (*Client) QueryUsage ΒΆ
func (c *Client) QueryUsage(ctx context.Context, deviceID string, data QueryUsageRequestBody) (*QueryUsageResponse, error)
func (*Client) UpdateLocation ΒΆ
func (c *Client) UpdateLocation(ctx context.Context, locationID string, patch LocationPatch) (*APIResponseEnvelope, error)
type ContactsResponse ΒΆ
type ContactsResponse struct {
APIResponseEnvelope
Data []Contact `json:"data"`
}
type Device ΒΆ
type Device struct {
ID string `json:"id"`
Type int `json:"type"`
LocationID int `json:"location_id"`
UserID int `json:"user_id"`
BridgeID string `json:"bridge_id"`
Oriented bool `json:"oriented"`
LastSeen string `json:"last_seen"`
Connected bool `json:"connected"`
BatteryLevel string `json:"battery_level"`
Product string `json:"product"`
}
type DeviceParams ΒΆ
type DeviceResponse ΒΆ
type DeviceResponse struct {
APIResponseEnvelope
Data []Device `json:"data"`
}
type DevicesParams ΒΆ
type DevicesParams struct {
Limit *int32 // How many devices to return (Defaults to 50)
Offset *int32 // Offset of devices to return (Defaults to 0)
SortField *string // Which field to sort devices on (Defaults to id)
SortDirection *string // Which direction to sort devices on (Defaults to ASC)
User *bool // Include user data in response (Defaults to false)
Location *bool // Include location data in response (Defaults to false)
PrimaryLocation *bool // Only include devices associated with a primary location if true
LocationID *int32 // Find devices associated with a specified location ID
Type *int32 // Filter devices by their type
}
type DevicesResponse ΒΆ
type DevicesResponse struct {
APIResponseEnvelope
Data []Device `json:"data"`
}
type EventRulesResponse ΒΆ
type EventRulesResponse struct {
APIResponseEnvelope
Data []EventRule `json:"data"`
}
type FlowResponse ΒΆ
type FlowResponse struct {
APIResponseEnvelope
Data []Flow `json:"data"`
}
type GetBudgetsParams ΒΆ
type GetContactsParams ΒΆ
type GetContactsParams struct {
Limit *int32 // Max number of contacts to return (Defaults to 50)
Offset *int32 // Offset of contacts to return (Defaults to 0)
SortField *string // Field to sort contacts on (Defaults to id)
SortDirection *string // Sort direction (Defaults to ASC)
Type *string // Filter by this type of contact information
Category *string // Filter by this category of contact information
}
type GetEventRulesParams ΒΆ
type GetLocationsParams ΒΆ
type GetLocationsParams struct {
Limit *int32 // Max number of locations to return (Defaults to 50)
Offset *int32 // Offset of locations to return (Defaults to 0)
SortField *string // Field to sort locations on (Defaults to id)
SortDirection *string // Which direction to sort locations on (Defaults to ASC)
}
type GetNotificationsParams ΒΆ
type GetNotificationsParams struct {
Limit *int32 // How many notifications to return (Defaults to 50)
Offset *int32 // Offset of notifications to return (Defaults to 0)
SortField *string // Which field to sort notifications on (Defaults to created_datetime)
SortDirection *string // Which direction to sort notifications on (Defaults to ASC)
DeviceID *string // Return notifications sent from a device with this device_id
LocationID *int32 // Returns notifications for this location
Type *int32 // Filter notifications by this type
Types *int32 // Return notifications of the bitmask of notification types
Read *bool // Filter by notifications that are read or not
}
type GetSubscriptionsParams ΒΆ
type GetSubscriptionsParams struct {
Limit *int32 // How many subscriptions to return (Defaults to 50)
Offset *int32 // Offset of subscriptions to return (Defaults to 0)
SortField *string // Which field to sort the subscriptions on (Defaults to id)
SortDirection *string // The direction to sort the subscriptions on (Defaults to ASC)
AlertType *string // Only return subscriptions with this alert type
NotificationTypes *int32 // Only return subscriptions that subscribe to the exact bitmask of notification types
NotificationType *int32 // Return all subscriptions that contain the bit
DeviceID *string // Only return subscriptions that are for this device
DeviceType *int32 // Only return subscriptions for devices of this type
LocationID *int32 // Only return subscriptions that are associated with a device at this location
}
type GetUsageAlertsParams ΒΆ
type GetUsageAlertsParams struct {
Limit *int32 // How many usage alerts to return (Defaults to 50)
Offset *int32 // Offset of usage alerts to return (Defaults to 0)
SortField *string // Which field to sort usage alerts on (Defaults to id)
SortDirection *string // Which direction to sort usage alerts on (Defaults to ASC)
DeviceID *string // Return usage alerts for this device_id
FlumeLeak *bool // Returns usage alerts determined to be leak s
}
type JWTPayload ΒΆ
type Location ΒΆ
type Location struct {
ID int `json:"id"`
UserID int `json:"user_id"`
Name string `json:"name"`
PrimaryLocation bool `json:"primary_location"`
Address string `json:"address"`
Address2 string `json:"address_2"`
City string `json:"city"`
State string `json:"state"`
PostalCode string `json:"postal_code"`
Country string `json:"country"`
TZ string `json:"tz"`
Installation string `json:"installation"`
InsurerID int `json:"insurer_id"`
BuildingType string `json:"building_type"`
AwayMode bool `json:"away_mode"`
}
type LocationPatch ΒΆ
type LocationPatch struct {
AwayMode bool `json:"away_mode"`
}
type LocationResponse ΒΆ
type LocationResponse struct {
APIResponseEnvelope
Data []Location `json:"data"`
}
type LocationsResponse ΒΆ
type LocationsResponse struct {
APIResponseEnvelope
Data []Location `json:"data"`
}
type Notification ΒΆ
type NotificationsResponse ΒΆ
type NotificationsResponse struct {
APIResponseEnvelope
Data []Notification `json:"data"`
}
type Pagination ΒΆ
type QueryUsageRequestBody ΒΆ
type QueryUsageRequestBody struct {
RequestID string `json:"request_id"`
Bucket string `json:"bucket"`
SinceDatetime string `json:"since_datetime,omitempty"`
UntilDatetime string `json:"until_datetime,omitempty"`
GroupMultiplier string `json:"group_multiplier,omitempty"`
Operation string `json:"operation,omitempty"`
SortDirection string `json:"sort_direction,omitempty"`
Units string `json:"units,omitempty"`
Types []string `json:"types,omitempty"`
}
type QueryUsageResponse ΒΆ
type QueryUsageResponse struct {
APIResponseEnvelope
Data []UsageQuery `json:"data"`
}
type Subscription ΒΆ
type Subscription struct {
ID int `json:"id"`
UserID int `json:"user_id"`
AlertType string `json:"alert_type"`
AlertInfo string `json:"alert_info"`
DeviceID string `json:"device_id"`
NotificationTypes int `json:"notification_types"`
CreatedDatetime string `json:"created_datetime"`
UpdatedDatetime string `json:"updated_datetime"`
}
type SubscriptionResponse ΒΆ
type SubscriptionResponse struct {
APIResponseEnvelope
Data Subscription `json:"data"`
}
type SubscriptionsResponse ΒΆ
type SubscriptionsResponse struct {
APIResponseEnvelopePagination
Data []Subscription `json:"data"`
}
type TokenResponse ΒΆ
type TokenResponse struct {
APIResponseEnvelope
Data []Token `json:"data"`
}
type UsageAlert ΒΆ
type UsageAlertQuery ΒΆ
type UsageAlertRule ΒΆ
type UsageAlertRuleResponse ΒΆ
type UsageAlertRuleResponse struct {
APIResponseEnvelope
Data []UsageAlertRule `json:"data"`
}
type UsageAlertRulesResponse ΒΆ
type UsageAlertRulesResponse struct {
APIResponseEnvelope
Data []UsageAlertRule `json:"data"`
}
type UsageAlertsResponse ΒΆ
type UsageAlertsResponse struct {
APIResponseEnvelope
Data []UsageAlert `json:"data"`
}
type UsageQuery ΒΆ
type UserResponse ΒΆ
type UserResponse struct {
APIResponseEnvelope
Data []User `json:"data"`
}
Click to show internal directories.
Click to hide internal directories.