Documentation
¶
Overview ¶
Package ringapimodels provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT.
Index ¶
- func ClassifyHTTPError(resp *http.Response, body string) error
- func IsAuthenticationError(err error) bool
- func IsBadRequestError(err error) bool
- func IsClosedError(err error) bool
- func IsConnectionError(err error) bool
- func IsHTTPError(err error) bool
- func IsHTTPStatusCode(err error, code int) bool
- func IsInternalServerError(err error) bool
- func IsNetworkError(err error) bool
- func IsNotFoundError(err error) bool
- func IsRateLimitError(err error) bool
- func IsRequires2FAError(err error) bool
- func IsTokenError(err error) bool
- func IsUnauthorizedError(err error) bool
- type AuthResponse
- type AuthenticationError
- type BadRequestError
- type Chime
- type ClosedError
- type ConnectionError
- type Device
- type DeviceFamily
- type DeviceHealth
- type DevicesResponse
- type Doorbell
- type Event
- type EventCallback
- type EventKind
- type HTTPError
- type InHomeChimeSettings
- type InternalServerError
- type LightState
- type NetworkError
- type NotFoundError
- type Other
- type RateLimitError
- type Recording
- type RecordingHistoryResponse
- type Requires2FAError
- type SoundKind
- type StickUpCam
- type TokenError
- type UnauthorizedError
- type VideoStream
- type VolumeKind
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClassifyHTTPError ¶ added in v0.3.0
func IsAuthenticationError ¶
func IsBadRequestError ¶
func IsClosedError ¶
func IsConnectionError ¶
func IsHTTPError ¶
func IsHTTPStatusCode ¶
func IsInternalServerError ¶
func IsNetworkError ¶
func IsNotFoundError ¶
func IsRateLimitError ¶
func IsRequires2FAError ¶
func IsTokenError ¶
func IsUnauthorizedError ¶
Types ¶
type AuthResponse ¶
type AuthResponse struct {
AccessToken string `json:"access_token"`
ExpiresIn int `json:"expires_in"`
RefreshToken string `json:"refresh_token"`
// TokenType Bearer is used by the implemented OAuth flow; unknown token types remain representable.
TokenType string `json:"token_type"`
}
AuthResponse defines model for AuthResponse.
type AuthenticationError ¶
type AuthenticationError = ringerrors.AuthenticationError
Public error aliases preserve errors.As and existing SDK callers while the transport packages use the shared internal definitions directly.
func NewAuthenticationError ¶
func NewAuthenticationError(message string, status int) *AuthenticationError
type BadRequestError ¶
type BadRequestError = ringerrors.BadRequestError
func NewBadRequestError ¶
func NewBadRequestError(message string, err error) *BadRequestError
type Chime ¶
type Chime struct {
Address string `json:"address"`
// Family Known family is chimes; unknown families remain valid.
Family string `json:"family"`
Health *DeviceHealth `json:"health,omitempty"`
ID string `json:"id"`
Name string `json:"name"`
Timezone string `json:"timezone"`
Volume int `json:"volume"`
WifiName string `json:"wifi_name"`
WifiSignalStrength int `json:"wifi_signal_strength"`
}
Chime defines model for Chime.
func (*Chime) GetAddress ¶
func (*Chime) GetFamily ¶
func (c *Chime) GetFamily() DeviceFamily
func (*Chime) GetTimezone ¶
type ClosedError ¶
type ClosedError = ringerrors.ClosedError
func NewClosedError ¶
func NewClosedError(message string, cause ...error) *ClosedError
type ConnectionError ¶
type ConnectionError = ringerrors.ConnectionError
func NewConnectionError ¶
func NewConnectionError(message string, err error) *ConnectionError
type Device ¶
type Device interface {
GetID() string
GetName() string
GetFamily() DeviceFamily
GetAddress() string
GetTimezone() string
}
Device represents a generic Ring device
type DeviceFamily ¶
type DeviceFamily string
DeviceFamily represents the family/type of a Ring device
const ( DeviceFamilyDoorbell DeviceFamily = "doorbots" DeviceFamilyChime DeviceFamily = "chimes" DeviceFamilyStickUpCam DeviceFamily = "stickup_cams" DeviceFamilyOther DeviceFamily = "other" )
type DeviceHealth ¶
type DeviceHealth struct {
BatteryLevel *int `json:"battery_level"`
BatteryStatus *string `json:"battery_status"`
FirmwareVersion *string `json:"firmware_version"`
LastUpdate *string `json:"last_update"`
SignalStrength *int `json:"signal_strength"`
}
DeviceHealth defines model for DeviceHealth.
type DevicesResponse ¶
type DevicesResponse struct {
Chimes []Chime `json:"chimes"`
Doorbells []Doorbell `json:"doorbots"`
Other []Other `json:"other"`
StickUpCams []StickUpCam `json:"stickup_cams"`
}
DevicesResponse defines model for DevicesResponse.
func (*DevicesResponse) GetAllDevices ¶
func (d *DevicesResponse) GetAllDevices() []Device
GetAllDevices returns all devices as a slice of Device interfaces
type Doorbell ¶
type Doorbell struct {
Address string `json:"address"`
// Family Known family is doorbots; unknown families remain valid.
Family string `json:"family"`
HasLight bool `json:"has_light"`
Health *DeviceHealth `json:"health,omitempty"`
ID string `json:"id"`
LightBrightness *int `json:"light_brightness,omitempty"`
MotionDetectionEnabled bool `json:"motion_detection_enabled"`
Name string `json:"name"`
Timezone string `json:"timezone"`
Volume int `json:"volume"`
WifiName string `json:"wifi_name"`
WifiSignalStrength int `json:"wifi_signal_strength"`
}
Doorbell defines model for Doorbell.
func (*Doorbell) GetAddress ¶
func (*Doorbell) GetFamily ¶
func (d *Doorbell) GetFamily() DeviceFamily
func (*Doorbell) GetTimezone ¶
type Event ¶
type Event struct {
Data map[string]interface{} `json:"data"`
DeviceID int64 `json:"device_id"`
// Kind Known event kinds are motion, ding and on_demand. Preserve future values from the service.
Kind EventKind `json:"kind"`
Timestamp string `json:"timestamp"`
}
Event defines model for Event.
type EventCallback ¶
EventCallback is a function type for handling events
type EventKind ¶
type EventKind = string
EventKind Known event kinds are motion, ding and on_demand. Preserve future values from the service.
type HTTPError ¶
type HTTPError = ringerrors.HTTPError
type InHomeChimeSettings ¶ added in v0.3.0
type InHomeChimeSettings struct {
Duration *int `json:"duration,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
Type *int `json:"type,omitempty"`
}
InHomeChimeSettings Supply exactly one field per update. Enabled maps to the legacy enable query value.
type InternalServerError ¶
type InternalServerError = ringerrors.InternalServerError
func NewInternalServerError ¶
func NewInternalServerError(message string, err error) *InternalServerError
type LightState ¶ added in v0.3.0
type LightState string
LightState Legacy floodlight action.
const ( LightStateOff LightState = "off" LightStateOn LightState = "on" )
Defines values for LightState.
func (LightState) Valid ¶ added in v0.3.0
func (e LightState) Valid() bool
Valid indicates whether the value is a known member of the LightState enum.
type NetworkError ¶
type NetworkError = ringerrors.NetworkError
func NewNetworkError ¶
func NewNetworkError(message string, err error) *NetworkError
type NotFoundError ¶
type NotFoundError = ringerrors.NotFoundError
func NewNotFoundError ¶
func NewNotFoundError(message string, err error) *NotFoundError
type Other ¶
type Other struct {
Address string `json:"address"`
// Family Known families include other; unknown families remain valid.
Family string `json:"family"`
Health *DeviceHealth `json:"health,omitempty"`
ID string `json:"id"`
// Kind Known legacy kinds include intercom_handset_audio; unfamiliar hardware kinds remain valid.
Kind string `json:"kind"`
Name string `json:"name"`
Timezone string `json:"timezone"`
}
Other defines model for Other.
func (*Other) GetAddress ¶
func (*Other) GetFamily ¶
func (o *Other) GetFamily() DeviceFamily
func (*Other) GetTimezone ¶
type RateLimitError ¶
type RateLimitError = ringerrors.RateLimitError
func NewRateLimitError ¶
func NewRateLimitError(message string) *RateLimitError
type Recording ¶
type Recording struct {
Answered bool `json:"answered"`
CreatedAt string `json:"created_at"`
DeviceID int64 `json:"device_id"`
ID int64 `json:"id"`
// Kind Known recording kinds are motion, ding and on_demand; future values remain valid.
Kind string `json:"kind"`
}
Recording defines model for Recording.
type RecordingHistoryResponse ¶
type RecordingHistoryResponse struct {
Recordings []Recording `json:"recordings"`
}
RecordingHistoryResponse defines model for RecordingHistoryResponse.
type Requires2FAError ¶
type Requires2FAError = ringerrors.Requires2FAError
func NewRequires2FAError ¶
func NewRequires2FAError(message string) *Requires2FAError
type SoundKind ¶
type SoundKind string
SoundKind Accepted legacy chime test sounds.
Defines values for SoundKind.
type StickUpCam ¶
type StickUpCam struct {
Address string `json:"address"`
Description string `json:"description"`
// Family Known family is stickup_cams; unknown families remain valid.
Family string `json:"family"`
HasLight bool `json:"has_light"`
Health *DeviceHealth `json:"health,omitempty"`
ID string `json:"id"`
LightBrightness *int `json:"light_brightness,omitempty"`
MotionDetectionEnabled bool `json:"motion_detection_enabled"`
Name string `json:"name"`
Timezone string `json:"timezone"`
Volume int `json:"volume"`
WifiName string `json:"wifi_name"`
WifiSignalStrength int `json:"wifi_signal_strength"`
}
StickUpCam defines model for StickUpCam.
func (*StickUpCam) GetAddress ¶
func (s *StickUpCam) GetAddress() string
func (*StickUpCam) GetFamily ¶
func (s *StickUpCam) GetFamily() DeviceFamily
func (*StickUpCam) GetID ¶
func (s *StickUpCam) GetID() string
func (*StickUpCam) GetName ¶
func (s *StickUpCam) GetName() string
func (*StickUpCam) GetTimezone ¶
func (s *StickUpCam) GetTimezone() string
type TokenError ¶
type TokenError = ringerrors.TokenError
func NewTokenError ¶
func NewTokenError(message string, err error) *TokenError
type UnauthorizedError ¶
type UnauthorizedError = ringerrors.UnauthorizedError
func NewUnauthorizedError ¶
func NewUnauthorizedError(message string, err error) *UnauthorizedError
type VideoStream ¶
type VideoStream = ringmedia.VideoStream
VideoStream is the customer-facing recording response body.
type VolumeKind ¶ added in v0.3.0
type VolumeKind string
VolumeKind Legacy volume control target; selects the chime or doorbell endpoint.
const ( VolumeKindChime VolumeKind = "chime" VolumeKindDoorbell VolumeKind = "doorbell" )
Defines values for VolumeKind.
func (VolumeKind) Valid ¶ added in v0.3.0
func (e VolumeKind) Valid() bool
Valid indicates whether the value is a known member of the VolumeKind enum.