Documentation
¶
Overview ¶
Package ring provides the main client for interacting with Ring services. It orchestrates authentication, API clients (REST), and event connections.
Package ring provides the main client for interacting with Ring services. Public interfaces and types for clients, connections, and sessions.
Index ¶
- Constants
- Variables
- type AuthContext
- type AuthenticateRequest
- type BatteryReading
- type CapturedTickets
- type CapturedTicketsParams
- type Client
- func (c *Client) Authenticate(ctx context.Context, req AuthenticateRequest) (*ringapimodels.AuthResponse, error)
- func (c *Client) Close() error
- func (c *Client) ConnectEvents(ctx context.Context, req ConnectEventsRequest) (*EventConnection, error)
- func (c *Client) ConnectPush(ctx context.Context, req ConnectPushRequest) (*PushConnection, error)
- func (c *Client) DeleteRecording(ctx context.Context, req DeleteRecordingRequest) error
- func (c *Client) FavoriteRecording(ctx context.Context, req RecordingIDRequest) error
- func (c *Client) GetActiveDings(ctx context.Context, req GetActiveDingsRequest) (*ringapimodels.RecordingHistoryResponse, error)
- func (c *Client) GetCapturedTickets(ctx context.Context, req GetCapturedTicketsRequest) (*CapturedTickets, error)
- func (c *Client) GetDevice(ctx context.Context, req GetDeviceRequest) (ringapimodels.Device, error)
- func (c *Client) GetDeviceDetail(ctx context.Context, req GetDeviceDetailRequest) (*DeviceDetail, error)
- func (c *Client) GetDeviceHistory(ctx context.Context, req GetDeviceHistoryRequest) (*ringapimodels.RecordingHistoryResponse, error)
- func (c *Client) GetDeviceSettings(ctx context.Context, req GetDeviceSettingsRequest) (DeviceSettings, error)
- func (c *Client) GetDeviceStatus(ctx context.Context, req GetDeviceDetailRequest) (*DeviceStatus, error)
- func (c *Client) GetDeviceTimeline(ctx context.Context, req GetDeviceTimelineRequest) (*DeviceTimeline, error)
- func (c *Client) GetHistoryDevices(ctx context.Context, req GetHistoryDevicesRequest) (*HistoryDevices, error)
- func (c *Client) GetLastRecordingID(ctx context.Context, req GetLastRecordingIDRequest) (int64, error)
- func (c *Client) GetLocation(ctx context.Context, req GetLocationRequest) (*LocationDetail, error)
- func (c *Client) GetRecording(ctx context.Context, req GetRecordingRequest) (*ringapimodels.VideoStream, error)
- func (c *Client) GetRecordingShareURL(ctx context.Context, req GetRecordingShareURLRequest) (string, error)
- func (c *Client) GetSnapshot(ctx context.Context, req GetSnapshotRequest) (*Snapshot, error)
- func (c *Client) ListDevices(ctx context.Context, req ListDevicesRequest) (*ringapimodels.DevicesResponse, error)
- func (c *Client) ListLocationDevices(ctx context.Context, req LocationRequest) (*LocationGroupDevices, error)
- func (c *Client) ListLocationGroups(ctx context.Context, req LocationRequest) (*LocationGroups, error)
- func (c *Client) ListLocations(ctx context.Context, req ListLocationsRequest) (*LocationList, error)
- func (c *Client) Listen(ctx context.Context, callback ringapimodels.EventCallback, ...) error
- func (c *Client) NewLoginSession(req LoginSessionRequest) (*LoginSession, error)
- func (c *Client) OpenSignaling(ctx context.Context, req OpenSignalingRequest) (*SignalingConnection, error)
- func (c *Client) PatchDeviceSettings(ctx context.Context, req PatchDeviceSettingsRequest) error
- func (c *Client) RebootDevice(ctx context.Context, req DeviceIDRequest) error
- func (c *Client) RefreshToken(ctx context.Context, req RefreshTokenRequest) (*ringapimodels.AuthResponse, error)
- func (c *Client) RegisterPushDevice(ctx context.Context, req RegisterPushDeviceRequest) error
- func (c *Client) Request2FACode(ctx context.Context, req Request2FACodeRequest) error
- func (c *Client) SetInHomeChime(ctx context.Context, req SetInHomeChimeRequest) error
- func (c *Client) SetLights(ctx context.Context, req SetLightsRequest) error
- func (c *Client) SetMotionDetection(ctx context.Context, req SetMotionDetectionRequest) error
- func (c *Client) SetPersistentLiveViewEnabled(ctx context.Context, req SetPersistentLiveViewEnabledRequest) error
- func (c *Client) SetSiren(ctx context.Context, req SetSirenRequest) error
- func (c *Client) SetVolume(ctx context.Context, req SetVolumeRequest) error
- func (c *Client) SubscribeDeviceDing(ctx context.Context, req DeviceIDRequest) error
- func (c *Client) SubscribeDeviceMotion(ctx context.Context, req DeviceIDRequest) error
- func (c *Client) TestSound(ctx context.Context, req TestSoundRequest) error
- func (c *Client) UnlockIntercom(ctx context.Context, req DeviceIDRequest) error
- func (c *Client) UpdateDeviceHealth(ctx context.Context, req UpdateDeviceHealthRequest) (*ringapimodels.DeviceHealth, error)
- type ClientAPI
- type CompleteLoginRequest
- type ConnectEventsRequest
- type ConnectPushRequest
- type ConnectionState
- type DeleteRecordingRequest
- type DeviceAlerts
- type DeviceDetail
- type DeviceDetailDevice
- type DeviceDetailHealth
- type DeviceFamily
- type DeviceFeatures
- type DeviceIDRequest
- type DeviceKind
- type DeviceLegacySettings
- type DeviceOwner
- type DeviceSession
- func (s *DeviceSession) Answer() SessionDescription
- func (s *DeviceSession) Close() error
- func (s *DeviceSession) PanContinuous(ctx context.Context, r PanContinuousRequest) (*PTZResult, error)
- func (s *DeviceSession) PanStep(ctx context.Context, r PanStepRequest) (*PTZResult, error)
- func (s *DeviceSession) Receive(ctx context.Context) (*SessionEvent, error)
- func (s *DeviceSession) SendICE(ctx context.Context, req ICECandidateRequest) error
- func (s *DeviceSession) SetMicrophone(ctx context.Context, r SetMicrophoneRequest) error
- func (s *DeviceSession) SetStreamOptions(ctx context.Context, r SetStreamOptionsRequest) error
- func (s *DeviceSession) State() SessionState
- func (s *DeviceSession) StopPTZ(ctx context.Context, r StopPTZRequest) (*PTZResult, error)
- func (s *DeviceSession) TiltContinuous(ctx context.Context, r TiltContinuousRequest) (*PTZResult, error)
- func (s *DeviceSession) TiltStep(ctx context.Context, r TiltStepRequest) (*PTZResult, error)
- func (s *DeviceSession) Wait(ctx context.Context) error
- type DeviceSessionAPI
- type DeviceSettings
- type DeviceStatus
- type DeviceTimeline
- type Endpoints
- type EventCapability
- type EventConnection
- type EventConnectionAPI
- type FCMEvent
- type FCMEventKind
- type FCMSource
- type FeatureAvailability
- type FeatureEligibility
- type FeatureEnablement
- type GeoCoordinates
- type GetActiveDingsRequest
- type GetCapturedTicketsRequest
- type GetDeviceDetailRequest
- type GetDeviceHistoryRequest
- type GetDeviceRequest
- type GetDeviceSettingsRequest
- type GetDeviceTimelineRequest
- type GetHistoryDevicesRequest
- type GetLastRecordingIDRequest
- type GetLocationRequest
- type GetRecordingRequest
- type GetRecordingShareURLRequest
- type GetSnapshotRequest
- type HistoryDevices
- type HistoryDevicesParams
- type HistoryFeedItem
- type HistoryFeedType
- type HistoryKind
- type ICECandidateMode
- type ICECandidateRequest
- type ListDevicesRequest
- type ListLocationsRequest
- type LocationAddress
- type LocationAttributes
- type LocationDetail
- type LocationExpansion
- type LocationGroup
- type LocationGroupDevices
- type LocationGroups
- type LocationList
- type LocationMeta
- type LocationParams
- type LocationRequest
- type LocationResource
- type LocationResourceType
- type LocationSummary
- type LoginSession
- type LoginSessionAPI
- type LoginSessionRequest
- type OpenSignalingRequest
- type Option
- func WithEndpoints(endpoints Endpoints) Option
- func WithEventWebSocketURL(url string) Option
- func WithFCMSource(source FCMSource) Option
- func WithHTTPClient(httpClient *http.Client) Option
- func WithRegion(region Region) Option
- func WithSignalingWebSocketURL(url string) Option
- func WithUserAgent(userAgent string) Option
- func WithWebSocketDialer(d WebSocketDialer) Option
- type OwnerID
- type PTZAxis
- type PTZResult
- type PanContinuousRequest
- type PanDirection
- type PanStepRequest
- type PatchDeviceSettingsRequest
- type PlaybackSession
- type PlaybackSessionAPI
- type PowerMode
- type PushAction
- type PushConnection
- type PushEvent
- type PushFilter
- type PushFilters
- type PushSubscription
- type PushSubscriptionAPI
- type RPCError
- type RecordingIDRequest
- type RecordingStatus
- type RefreshTokenRequest
- type Region
- type RegisterPushDeviceRequest
- type Request2FACodeRequest
- type SDPType
- type SessionDescription
- type SessionEvent
- type SessionState
- type SetInHomeChimeRequest
- type SetLightsRequest
- type SetMicrophoneRequest
- type SetMotionDetectionRequest
- type SetPersistentLiveViewEnabledRequest
- type SetSirenRequest
- type SetStreamOptionsRequest
- type SetVolumeRequest
- type SignalingConnection
- func (c *SignalingConnection) Close() error
- func (c *SignalingConnection) Err() error
- func (c *SignalingConnection) StartDeviceSession(ctx context.Context, req StartDeviceSessionRequest) (*DeviceSession, error)
- func (c *SignalingConnection) StartPlayback(ctx context.Context, req StartPlaybackRequest) (*PlaybackSession, error)
- func (c *SignalingConnection) SubscribePush(ctx context.Context, filters []PushFilter) (*PushSubscription, error)
- type SignalingConnectionAPI
- type SignalingTransport
- type Snapshot
- type StartDeviceSessionRequest
- type StartPlaybackRequest
- type StopPTZRequest
- type TestSoundRequest
- type TiltContinuousRequest
- type TiltDirection
- type TiltStepRequest
- type TimelineDevice
- type TimelineEvent
- type TimelineEventType
- type TimelineOrder
- type TimelineParams
- type TimelineState
- type UpdateDeviceHealthRequest
- type VideoRenderingFeature
- type WebSocketDialer
Constants ¶
const ( PanLeft PanDirection = protocol.PanLeft PanRight PanDirection = protocol.PanRight TiltUp TiltDirection = protocol.TiltUp TiltDown TiltDirection = protocol.TiltDown )
Variables ¶
var ( ErrSessionClosed = signaling.ErrClosed ErrSessionExpired = signaling.ErrExpired ErrSessionHeartbeat = signaling.ErrHeartbeat ErrSessionBackpressure = signaling.ErrBackpressure )
var ErrSnapshotNotReady = ringapimodels.NewNotFoundError("fresh snapshot not available", nil)
Functions ¶
This section is empty.
Types ¶
type AuthContext ¶ added in v0.3.0
AuthContext is supplied with each account-level operation. Its values are scoped to that call and never mutate a shared Client.
type AuthenticateRequest ¶
type AuthenticateRequest struct {
Username string
Password string
OTPCode string
HardwareID string
}
AuthenticateRequest performs an independent credential exchange. Use LoginSession when the same PKCE exchange spans a 2FA challenge.
type BatteryReading ¶ added in v0.4.0
type BatteryReading float64
BatteryReading accepts the numeric and numeric-text percentages Ring returns.
func (*BatteryReading) UnmarshalJSON ¶ added in v0.4.0
func (b *BatteryReading) UnmarshalJSON(data []byte) error
type CapturedTickets ¶ added in v0.3.0
type CapturedTicketsParams ¶ added in v0.3.0
type CapturedTicketsParams struct {
AllowUserOnly *bool
LocationID *string
LocationSubscription *string
EnableExtendedEmergencyCellUsage *bool
RequestedTransport *SignalingTransport
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the main client for interacting with Ring services
func (*Client) Authenticate ¶
func (c *Client) Authenticate(ctx context.Context, req AuthenticateRequest) (*ringapimodels.AuthResponse, error)
Authenticate performs an isolated exchange and never binds its token to Client. Use NewLoginSession when a 2FA challenge must be completed in the same flow.
func (*Client) ConnectEvents ¶
func (c *Client) ConnectEvents(ctx context.Context, req ConnectEventsRequest) (*EventConnection, error)
ConnectEvents establishes a WebSocket connection for receiving events This is a wrapper that calls the internal ConnectEvents method
func (*Client) ConnectPush ¶ added in v0.4.0
func (c *Client) ConnectPush(ctx context.Context, req ConnectPushRequest) (*PushConnection, error)
func (*Client) DeleteRecording ¶ added in v0.3.0
func (c *Client) DeleteRecording(ctx context.Context, req DeleteRecordingRequest) error
func (*Client) FavoriteRecording ¶ added in v0.3.0
func (c *Client) FavoriteRecording(ctx context.Context, req RecordingIDRequest) error
func (*Client) GetActiveDings ¶
func (c *Client) GetActiveDings(ctx context.Context, req GetActiveDingsRequest) (*ringapimodels.RecordingHistoryResponse, error)
GetActiveDings retrieves currently active dings
func (*Client) GetCapturedTickets ¶ added in v0.3.0
func (c *Client) GetCapturedTickets(ctx context.Context, req GetCapturedTicketsRequest) (*CapturedTickets, error)
GetCapturedTickets reads the recorded location ticket resource. It does not replace the separate POST ticket used by OpenSignaling.
func (*Client) GetDevice ¶
func (c *Client) GetDevice(ctx context.Context, req GetDeviceRequest) (ringapimodels.Device, error)
GetDevice retrieves a specific device by ID
func (*Client) GetDeviceDetail ¶ added in v0.3.0
func (c *Client) GetDeviceDetail(ctx context.Context, req GetDeviceDetailRequest) (*DeviceDetail, error)
func (*Client) GetDeviceHistory ¶
func (c *Client) GetDeviceHistory(ctx context.Context, req GetDeviceHistoryRequest) (*ringapimodels.RecordingHistoryResponse, error)
GetDeviceHistory retrieves the history of recordings for a device
func (*Client) GetDeviceSettings ¶ added in v0.3.0
func (c *Client) GetDeviceSettings(ctx context.Context, req GetDeviceSettingsRequest) (DeviceSettings, error)
GetDeviceSettings reads the motion_detection_enabled field from the captured v1 settings resource. Unrecognized settings are ignored.
func (*Client) GetDeviceStatus ¶ added in v0.4.0
func (c *Client) GetDeviceStatus(ctx context.Context, req GetDeviceDetailRequest) (*DeviceStatus, error)
GetDeviceStatus returns the connection and battery state derived from device detail.
func (*Client) GetDeviceTimeline ¶ added in v0.3.0
func (c *Client) GetDeviceTimeline(ctx context.Context, req GetDeviceTimelineRequest) (*DeviceTimeline, error)
func (*Client) GetHistoryDevices ¶ added in v0.3.0
func (c *Client) GetHistoryDevices(ctx context.Context, req GetHistoryDevicesRequest) (*HistoryDevices, error)
func (*Client) GetLastRecordingID ¶
func (c *Client) GetLastRecordingID(ctx context.Context, req GetLastRecordingIDRequest) (int64, error)
GetLastRecordingID retrieves the ID of the most recent recording for a device
func (*Client) GetLocation ¶ added in v0.3.0
func (c *Client) GetLocation(ctx context.Context, req GetLocationRequest) (*LocationDetail, error)
func (*Client) GetRecording ¶
func (c *Client) GetRecording(ctx context.Context, req GetRecordingRequest) (*ringapimodels.VideoStream, error)
GetRecording retrieves a video stream for a recording
func (*Client) GetRecordingShareURL ¶ added in v0.3.0
func (c *Client) GetRecordingShareURL(ctx context.Context, req GetRecordingShareURLRequest) (string, error)
GetRecordingShareURL returns the legacy playback share URL for a recording. Access permissions and subscription checks are resolved by the server.
func (*Client) GetSnapshot ¶ added in v0.3.0
GetSnapshot triggers a fresh legacy snapshot, polls its timestamp, then fetches the image. This follows pinned Python behavior; it is not the C1 app-snaps endpoint, whose response was absent from the capture.
func (*Client) ListDevices ¶
func (c *Client) ListDevices(ctx context.Context, req ListDevicesRequest) (*ringapimodels.DevicesResponse, error)
ListDevices retrieves all devices associated with the account
func (*Client) ListLocationDevices ¶ added in v0.3.0
func (c *Client) ListLocationDevices(ctx context.Context, req LocationRequest) (*LocationGroupDevices, error)
func (*Client) ListLocationGroups ¶ added in v0.3.0
func (c *Client) ListLocationGroups(ctx context.Context, req LocationRequest) (*LocationGroups, error)
func (*Client) ListLocations ¶ added in v0.3.0
func (c *Client) ListLocations(ctx context.Context, req ListLocationsRequest) (*LocationList, error)
func (*Client) Listen ¶
func (c *Client) Listen(ctx context.Context, callback ringapimodels.EventCallback, req ConnectEventsRequest) error
Listen listens for events and calls the callback for each event
func (*Client) NewLoginSession ¶ added in v0.3.0
func (c *Client) NewLoginSession(req LoginSessionRequest) (*LoginSession, error)
func (*Client) OpenSignaling ¶ added in v0.3.0
func (c *Client) OpenSignaling(ctx context.Context, req OpenSignalingRequest) (*SignalingConnection, error)
OpenSignaling obtains the currently supported legacy signaling ticket and opens its websocket. The captured C1 GET /api/v1/clap/tickets profile is intentionally not substituted for this POST route.
func (*Client) PatchDeviceSettings ¶ added in v0.3.0
func (c *Client) PatchDeviceSettings(ctx context.Context, req PatchDeviceSettingsRequest) error
PatchDeviceSettings updates only the supported motion detection flag. A nil field is rejected instead of silently sending an empty or guessed patch.
func (*Client) RebootDevice ¶ added in v0.3.0
func (c *Client) RebootDevice(ctx context.Context, req DeviceIDRequest) error
func (*Client) RefreshToken ¶
func (c *Client) RefreshToken(ctx context.Context, req RefreshTokenRequest) (*ringapimodels.AuthResponse, error)
RefreshToken refreshes an access token using a refresh token
func (*Client) RegisterPushDevice ¶ added in v0.4.0
func (c *Client) RegisterPushDevice(ctx context.Context, req RegisterPushDeviceRequest) error
func (*Client) Request2FACode ¶
func (c *Client) Request2FACode(ctx context.Context, req Request2FACodeRequest) error
Request2FACode starts an isolated exchange. NewLoginSession retains its challenge when the caller needs to follow it with Authenticate.
func (*Client) SetInHomeChime ¶
func (c *Client) SetInHomeChime(ctx context.Context, req SetInHomeChimeRequest) error
SetInHomeChime sets in-home chime settings for a doorbell req.Settings can include: "type" (e.g., "Mechanical"), "enabled" (bool), "duration" (int)
func (*Client) SetLights ¶
func (c *Client) SetLights(ctx context.Context, req SetLightsRequest) error
SetLights sets the lights for a device (floodlight cams).
func (*Client) SetMotionDetection ¶
func (c *Client) SetMotionDetection(ctx context.Context, req SetMotionDetectionRequest) error
SetMotionDetection sets motion detection for a device
func (*Client) SetPersistentLiveViewEnabled ¶ added in v0.3.0
func (c *Client) SetPersistentLiveViewEnabled(ctx context.Context, req SetPersistentLiveViewEnabledRequest) error
func (*Client) SetSiren ¶ added in v0.3.0
func (c *Client) SetSiren(ctx context.Context, req SetSirenRequest) error
SetSiren calls the captured on/off doorbot route. The captured server response reports 30 seconds for the on call, but the request does not accept duration.
func (*Client) SetVolume ¶
func (c *Client) SetVolume(ctx context.Context, req SetVolumeRequest) error
SetVolume uses the legacy chime or doorbell route selected by Kind.
func (*Client) SubscribeDeviceDing ¶ added in v0.4.0
func (c *Client) SubscribeDeviceDing(ctx context.Context, req DeviceIDRequest) error
func (*Client) SubscribeDeviceMotion ¶ added in v0.4.0
func (c *Client) SubscribeDeviceMotion(ctx context.Context, req DeviceIDRequest) error
func (*Client) TestSound ¶
func (c *Client) TestSound(ctx context.Context, req TestSoundRequest) error
TestSound tests a sound on a chime device req.Sound can be "ding" or "motion".
func (*Client) UnlockIntercom ¶ added in v0.4.0
func (c *Client) UnlockIntercom(ctx context.Context, req DeviceIDRequest) error
UnlockIntercom requests an unlock on an intercom device ID.
func (*Client) UpdateDeviceHealth ¶
func (c *Client) UpdateDeviceHealth(ctx context.Context, req UpdateDeviceHealthRequest) (*ringapimodels.DeviceHealth, error)
UpdateDeviceHealth refreshes health data via the generic device route.
type ClientAPI ¶ added in v0.3.0
type ClientAPI interface {
Close() error
// Authentication and authorization
Authenticate(context.Context, AuthenticateRequest) (*ringapimodels.AuthResponse, error)
Request2FACode(context.Context, Request2FACodeRequest) error
RefreshToken(context.Context, RefreshTokenRequest) (*ringapimodels.AuthResponse, error)
NewLoginSession(LoginSessionRequest) (*LoginSession, error)
// APIs for enumerating and getting data
ListDevices(context.Context, ListDevicesRequest) (*ringapimodels.DevicesResponse, error)
GetDevice(context.Context, GetDeviceRequest) (ringapimodels.Device, error)
GetDeviceSettings(context.Context, GetDeviceSettingsRequest) (DeviceSettings, error)
GetDeviceDetail(context.Context, GetDeviceDetailRequest) (*DeviceDetail, error)
GetDeviceStatus(context.Context, GetDeviceDetailRequest) (*DeviceStatus, error)
ListLocations(context.Context, ListLocationsRequest) (*LocationList, error)
GetLocation(context.Context, GetLocationRequest) (*LocationDetail, error)
ListLocationGroups(context.Context, LocationRequest) (*LocationGroups, error)
ListLocationDevices(context.Context, LocationRequest) (*LocationGroupDevices, error)
GetDeviceTimeline(context.Context, GetDeviceTimelineRequest) (*DeviceTimeline, error)
GetHistoryDevices(context.Context, GetHistoryDevicesRequest) (*HistoryDevices, error)
GetCapturedTickets(context.Context, GetCapturedTicketsRequest) (*CapturedTickets, error)
// APIs for modifying or sending requests to a device
UpdateDeviceHealth(context.Context, UpdateDeviceHealthRequest) (*ringapimodels.DeviceHealth, error)
PatchDeviceSettings(context.Context, PatchDeviceSettingsRequest) error
GetSnapshot(context.Context, GetSnapshotRequest) (*Snapshot, error)
SetVolume(context.Context, SetVolumeRequest) error
SetLights(context.Context, SetLightsRequest) error
SetMotionDetection(context.Context, SetMotionDetectionRequest) error
SetSiren(context.Context, SetSirenRequest) error
TestSound(context.Context, TestSoundRequest) error
SetInHomeChime(context.Context, SetInHomeChimeRequest) error
RebootDevice(context.Context, DeviceIDRequest) error
UnlockIntercom(context.Context, DeviceIDRequest) error
SetPersistentLiveViewEnabled(context.Context, SetPersistentLiveViewEnabledRequest) error
// Various recording APIs
GetDeviceHistory(context.Context, GetDeviceHistoryRequest) (*ringapimodels.RecordingHistoryResponse, error)
GetActiveDings(context.Context, GetActiveDingsRequest) (*ringapimodels.RecordingHistoryResponse, error)
GetRecording(context.Context, GetRecordingRequest) (*ringapimodels.VideoStream, error)
GetLastRecordingID(context.Context, GetLastRecordingIDRequest) (int64, error)
FavoriteRecording(context.Context, RecordingIDRequest) error
DeleteRecording(context.Context, DeleteRecordingRequest) error
// Event and signaling connections
OpenSignaling(context.Context, OpenSignalingRequest) (*SignalingConnection, error)
ConnectEvents(context.Context, ConnectEventsRequest) (*EventConnection, error)
ConnectPush(context.Context, ConnectPushRequest) (*PushConnection, error)
RegisterPushDevice(context.Context, RegisterPushDeviceRequest) error
SubscribeDeviceDing(context.Context, DeviceIDRequest) error
SubscribeDeviceMotion(context.Context, DeviceIDRequest) error
Listen(context.Context, ringapimodels.EventCallback, ConnectEventsRequest) error
}
ClientAPI is the complete public account-level surface implemented by Client. A caller that needs only part of it may define a smaller local interface. OpenSignaling creates a connection that can start live and playback sessions.
type CompleteLoginRequest ¶ added in v0.3.0
type CompleteLoginRequest struct{ OTPCode string }
type ConnectEventsRequest ¶ added in v0.3.0
type ConnectEventsRequest struct{ Auth AuthContext }
type ConnectPushRequest ¶ added in v0.4.0
type ConnectPushRequest struct {
Auth AuthContext
Credentials json.RawMessage
DeviceIDs []string
Ding bool
Motion bool
}
ConnectPushRequest creates a caller-scoped FCM connection. Credentials come from a previous credentials event and are never stored on Client.
type ConnectionState ¶ added in v0.4.0
type ConnectionState string
ConnectionState is open to new server-provided states.
const ( ConnectionOnline ConnectionState = "online" ConnectionOffline ConnectionState = "offline" )
type DeleteRecordingRequest ¶ added in v0.3.0
type DeleteRecordingRequest struct {
Auth AuthContext
RecordingID int64
ConfirmDeleteFavorite *bool
}
type DeviceAlerts ¶ added in v0.4.0
type DeviceAlerts struct {
Connection *ConnectionState `json:"connection,omitempty"`
}
type DeviceDetail ¶ added in v0.3.0
type DeviceDetail struct {
Device DeviceDetailDevice `json:"device"`
OperationSets map[string][]string `json:"-"`
}
DeviceDetail is the stable, typed subset of the captured device detail. Unobserved vendor fields remain internal to the wire transport.
type DeviceDetailDevice ¶ added in v0.3.0
type DeviceDetailDevice struct {
ID int64 `json:"id"`
DeviceID *string `json:"device_id,omitempty"`
Description string `json:"description"`
Kind DeviceKind `json:"kind"`
Family *DeviceFamily `json:"family,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
DeactivatedAt *time.Time `json:"deactivated_at,omitempty"`
Name *string `json:"name,omitempty"`
Address *string `json:"address,omitempty"`
LocationID *string `json:"location_id,omitempty"`
OperationSet *string `json:"operation_set,omitempty"`
Owner *DeviceOwner `json:"owner,omitempty"`
Settings *DeviceLegacySettings `json:"settings,omitempty"`
Features *DeviceFeatures `json:"features,omitempty"`
TimeZone *string `json:"time_zone,omitempty"`
Timezone *string `json:"timezone,omitempty"`
WifiName *string `json:"wifi_name,omitempty"`
WifiSignalStrength *int `json:"wifi_signal_strength,omitempty"`
Owned *bool `json:"owned,omitempty"`
MotionDetectionEnabled *bool `json:"motion_detection_enabled,omitempty"`
HasLight *bool `json:"has_light,omitempty"`
LightBrightness *int `json:"light_brightness,omitempty"`
Volume *int `json:"volume,omitempty"`
Health *DeviceDetailHealth `json:"health,omitempty"`
Alerts *DeviceAlerts `json:"alerts,omitempty"`
BatteryLife *BatteryReading `json:"battery_life,omitempty"`
BatteryLife2 *BatteryReading `json:"battery_life_2,omitempty"`
ExternalConnection *bool `json:"external_connection,omitempty"`
}
func (DeviceDetailDevice) Status ¶ added in v0.4.0
func (d DeviceDetailDevice) Status() DeviceStatus
type DeviceDetailHealth ¶ added in v0.3.0
type DeviceDetailHealth struct {
BatteryLevel *int `json:"battery_level,omitempty"`
BatteryPercentage *float64 `json:"battery_percentage,omitempty"`
BatteryPresent *bool `json:"battery_present,omitempty"`
BatteryPercentageCategory *string `json:"battery_percentage_category,omitempty"`
BatteryStatus *string `json:"battery_status,omitempty"`
Connected *bool `json:"connected,omitempty"`
FirmwareVersion *string `json:"firmware_version,omitempty"`
LastUpdate *string `json:"last_update,omitempty"`
PTZConnected *string `json:"ptz_connected,omitempty"`
RSSI *float32 `json:"rssi,omitempty"`
SignalStrength *int `json:"signal_strength,omitempty"`
SupportedRPCCommands []string `json:"supported_rpc_commands,omitempty"`
}
type DeviceFamily ¶ added in v0.3.0
type DeviceFamily string
DeviceFamily selects a legacy family endpoint. Only doorbots and chimes currently have a captured family-specific health operation.
const ( DeviceFamilyDoorbells DeviceFamily = "doorbots" DeviceFamilyChimes DeviceFamily = "chimes" DeviceFamilyCameras DeviceFamily = "stickup_cams" DeviceFamilyOther DeviceFamily = "other" )
type DeviceFeatures ¶ added in v0.3.0
type DeviceFeatures struct {
AutoTrack *FeatureAvailability `json:"auto_track,omitempty"`
AutoZoomTrack *FeatureAvailability `json:"auto_zoom_track,omitempty"`
MotionsEnabled *bool `json:"motions_enabled,omitempty"`
VideoRendering *VideoRenderingFeature `json:"video_rendering,omitempty"`
}
type DeviceIDRequest ¶ added in v0.3.0
type DeviceIDRequest struct {
Auth AuthContext
DeviceID string
}
Captured HTTP operations keep wire query encodings inside the transport.
type DeviceKind ¶ added in v0.3.0
type DeviceKind string
DeviceKind is an open hardware kind; this PTZ kind was observed in capture.
const DeviceKindStickUpMiniPTZ DeviceKind = "stickup_cam_mini_ptz_v1"
type DeviceLegacySettings ¶ added in v0.3.0
type DeviceOwner ¶ added in v0.3.0
type DeviceSession ¶ added in v0.3.0
type DeviceSession struct {
// contains filtered or unexported fields
}
DeviceSession is a live camera session created by SignalingConnection.
func (*DeviceSession) Answer ¶ added in v0.3.0
func (s *DeviceSession) Answer() SessionDescription
func (*DeviceSession) Close ¶ added in v0.3.0
func (s *DeviceSession) Close() error
func (*DeviceSession) PanContinuous ¶ added in v0.3.0
func (s *DeviceSession) PanContinuous(ctx context.Context, r PanContinuousRequest) (*PTZResult, error)
func (*DeviceSession) PanStep ¶ added in v0.3.0
func (s *DeviceSession) PanStep(ctx context.Context, r PanStepRequest) (*PTZResult, error)
func (*DeviceSession) Receive ¶ added in v0.3.0
func (s *DeviceSession) Receive(ctx context.Context) (*SessionEvent, error)
func (*DeviceSession) SendICE ¶ added in v0.3.0
func (s *DeviceSession) SendICE(ctx context.Context, req ICECandidateRequest) error
func (*DeviceSession) SetMicrophone ¶ added in v0.3.0
func (s *DeviceSession) SetMicrophone(ctx context.Context, r SetMicrophoneRequest) error
func (*DeviceSession) SetStreamOptions ¶ added in v0.3.0
func (s *DeviceSession) SetStreamOptions(ctx context.Context, r SetStreamOptionsRequest) error
func (*DeviceSession) State ¶ added in v0.3.0
func (s *DeviceSession) State() SessionState
func (*DeviceSession) StopPTZ ¶ added in v0.3.0
func (s *DeviceSession) StopPTZ(ctx context.Context, r StopPTZRequest) (*PTZResult, error)
func (*DeviceSession) TiltContinuous ¶ added in v0.3.0
func (s *DeviceSession) TiltContinuous(ctx context.Context, r TiltContinuousRequest) (*PTZResult, error)
func (*DeviceSession) TiltStep ¶ added in v0.3.0
func (s *DeviceSession) TiltStep(ctx context.Context, r TiltStepRequest) (*PTZResult, error)
type DeviceSessionAPI ¶ added in v0.3.0
type DeviceSessionAPI interface {
Answer() SessionDescription
State() SessionState
Wait(context.Context) error
Receive(context.Context) (*SessionEvent, error)
SendICE(context.Context, ICECandidateRequest) error
PanStep(context.Context, PanStepRequest) (*PTZResult, error)
TiltStep(context.Context, TiltStepRequest) (*PTZResult, error)
PanContinuous(context.Context, PanContinuousRequest) (*PTZResult, error)
TiltContinuous(context.Context, TiltContinuousRequest) (*PTZResult, error)
StopPTZ(context.Context, StopPTZRequest) (*PTZResult, error)
SetMicrophone(context.Context, SetMicrophoneRequest) error
SetStreamOptions(context.Context, SetStreamOptionsRequest) error
Close() error
}
DeviceSessionAPI is the live camera session surface.
type DeviceSettings ¶ added in v0.3.0
type DeviceSettings struct {
// MotionDetectionEnabled is nil when the response omits or nulls the field.
MotionDetectionEnabled *bool
}
Device settings DeviceSettings contains only fields confirmed in captured settings exchanges. Fields not represented here remain opaque to callers of the typed API.
type DeviceStatus ¶ added in v0.4.0
type DeviceStatus struct {
BatteryPercent *float64 `json:"battery_percent,omitempty"`
Connection *ConnectionState `json:"connection,omitempty"`
IsOffline bool `json:"is_offline"`
PowerMode *PowerMode `json:"power_mode,omitempty"`
}
DeviceStatus derives a concise health view without implying a battery on wired devices.
type DeviceTimeline ¶ added in v0.3.0
type DeviceTimeline struct {
Items []TimelineEvent `json:"items"`
PaginationKey *string `json:"pagination_key,omitempty"`
}
type Endpoints ¶ added in v0.3.0
type Endpoints struct {
OAuthBaseURL string
APIBaseURL string
SolutionsBaseURL string
SignalingURL string
}
Endpoints overrides service origins for a client. Empty fields inherit the selected region's verified defaults.
type EventCapability ¶ added in v0.3.0
type EventCapability string
EventCapability is an open server capability token.
const ( CapabilityOfflineEvent EventCapability = "offline_event" CapabilityVehicle EventCapability = "vehicle" CapabilityRingtercom EventCapability = "ringtercom" )
type EventConnection ¶
type EventConnection struct {
// contains filtered or unexported fields
}
EventConnection exposes customer-facing account events while the WebSocket dependency owns the experimental event transport.
func (*EventConnection) Close ¶
func (c *EventConnection) Close() error
func (*EventConnection) Receive ¶
func (c *EventConnection) Receive() (*ringapimodels.Event, error)
type EventConnectionAPI ¶ added in v0.3.0
type EventConnectionAPI interface {
Receive() (*ringapimodels.Event, error)
Close() error
}
EventConnectionAPI receives account events until closed.
type FCMEvent ¶ added in v0.4.0
type FCMEvent struct {
Kind FCMEventKind
Token string
DeviceID string
Action PushAction
Credentials json.RawMessage
Data json.RawMessage
Err error
}
PushEvent reports setup progress and incoming notifications. Credentials are sensitive and should be saved securely by the caller for reconnection.
func ParseFCMNotification ¶ added in v0.4.0
func ParseFCMNotification(data json.RawMessage) FCMEvent
ParseFCMNotification extracts common Ring event fields while retaining the original payload for newer event categories.
type FCMEventKind ¶ added in v0.4.0
type FCMEventKind string
const ( PushCredentials FCMEventKind = "credentials" PushRegistered FCMEventKind = "registered" PushConnected FCMEventKind = "connected" PushMessage FCMEventKind = "message" PushRetry FCMEventKind = "retry" PushClosed FCMEventKind = "closed" )
type FCMSource ¶ added in v0.4.0
FCMSource supplies receiver events. Most callers use the built-in receiver; an alternate source can be injected for controlled replay or other transports.
type FeatureAvailability ¶ added in v0.3.0
type FeatureAvailability struct {
Eligibility *FeatureEligibility `json:"eligibility,omitempty"`
Enablement *FeatureEnablement `json:"enablement,omitempty"`
}
type FeatureEligibility ¶ added in v0.3.0
type FeatureEnablement ¶ added in v0.3.0
type GeoCoordinates ¶ added in v0.3.0
type GetActiveDingsRequest ¶ added in v0.3.0
type GetActiveDingsRequest struct{ Auth AuthContext }
type GetCapturedTicketsRequest ¶ added in v0.3.0
type GetCapturedTicketsRequest struct {
Auth AuthContext
Params CapturedTicketsParams
}
GetCapturedTickets is the recorded GET profile, separate from OpenSignaling's POST ticket.
type GetDeviceDetailRequest ¶ added in v0.3.0
type GetDeviceDetailRequest struct {
Auth AuthContext
DeviceID string
}
type GetDeviceHistoryRequest ¶
type GetDeviceHistoryRequest struct {
Auth AuthContext
DeviceID string
Limit int
// OlderThan is an optional Unix timestamp cursor for older recordings.
OlderThan *int64
// Kind is an open server value; unfamiliar history kinds are forwarded.
Kind HistoryKind
}
GetDeviceHistoryRequest contains parameters for GetDeviceHistory
type GetDeviceRequest ¶
type GetDeviceRequest struct {
Auth AuthContext
DeviceID string
}
GetDeviceRequest contains parameters for GetDevice
type GetDeviceSettingsRequest ¶ added in v0.3.0
type GetDeviceSettingsRequest struct {
Auth AuthContext
DeviceID string
}
GetDeviceSettingsRequest identifies a device whose supported settings are read.
type GetDeviceTimelineRequest ¶ added in v0.3.0
type GetDeviceTimelineRequest struct {
Auth AuthContext
DeviceID string
Params TimelineParams
}
type GetHistoryDevicesRequest ¶ added in v0.3.0
type GetHistoryDevicesRequest struct {
Auth AuthContext
Params HistoryDevicesParams
}
type GetLastRecordingIDRequest ¶
type GetLastRecordingIDRequest struct {
Auth AuthContext
DeviceID string
}
GetLastRecordingIDRequest contains parameters for GetLastRecordingID
type GetLocationRequest ¶ added in v0.3.0
type GetLocationRequest struct {
Auth AuthContext
LocationID string
Params LocationParams
}
type GetRecordingRequest ¶
type GetRecordingRequest struct {
Auth AuthContext
RecordingID int64
}
GetRecordingRequest contains parameters for GetRecording
type GetRecordingShareURLRequest ¶ added in v0.3.0
type GetRecordingShareURLRequest struct {
}
type GetSnapshotRequest ¶ added in v0.3.0
type GetSnapshotRequest struct {
Auth AuthContext
DeviceID string
MaxAttempts int
PollInterval time.Duration
}
Snapshots GetSnapshotRequest controls the bounded Python-legacy freshness poll. Zero attempts defaults to three; a zero interval polls without delay.
type HistoryDevices ¶ added in v0.3.0
type HistoryDevices struct {
Events []TimelineEvent `json:"events"`
Feed []HistoryFeedItem `json:"feed,omitempty"`
PaginationKey *string `json:"pagination_key,omitempty"`
Schema *string `json:"schema,omitempty"`
}
type HistoryDevicesParams ¶ added in v0.3.0
type HistoryDevicesParams struct {
SourceIDs []string
Capabilities []EventCapability
}
type HistoryFeedItem ¶ added in v0.3.0
type HistoryFeedItem struct {
ID *string `json:"id,omitempty"`
Type *HistoryFeedType `json:"type,omitempty"`
}
type HistoryFeedType ¶ added in v0.3.0
type HistoryFeedType string
const HistoryFeedEvent HistoryFeedType = "EVENT"
type HistoryKind ¶ added in v0.3.0
type HistoryKind string
HistoryKind is an open recording kind. These values are known from legacy history; unfamiliar server kinds may still be passed by conversion.
const ( HistoryDing HistoryKind = "ding" HistoryMotion HistoryKind = "motion" HistoryOnDemand HistoryKind = "on_demand" )
type ICECandidateMode ¶ added in v0.3.0
type ICECandidateMode string
const ( ICETrickle ICECandidateMode = "trickle" ICENonTrickle ICECandidateMode = "non_trickle" )
type ICECandidateRequest ¶ added in v0.3.0
type ListDevicesRequest ¶ added in v0.3.0
type ListDevicesRequest struct{ Auth AuthContext }
type ListLocationsRequest ¶ added in v0.3.0
type ListLocationsRequest struct{ Auth AuthContext }
type LocationAddress ¶ added in v0.3.0
type LocationAddress struct {
Address1 *string `json:"address1,omitempty"`
Address2 *string `json:"address2,omitempty"`
City *string `json:"city,omitempty"`
Country *string `json:"country,omitempty"`
State *string `json:"state,omitempty"`
Timezone *string `json:"timezone,omitempty"`
ZipCode *string `json:"zip_code,omitempty"`
}
type LocationAttributes ¶ added in v0.3.0
type LocationAttributes struct {
Name *string `json:"name,omitempty"`
City *string `json:"city,omitempty"`
Country *string `json:"country,omitempty"`
State *string `json:"state,omitempty"`
Latitude *float32 `json:"latitude,omitempty"`
Longitude *float32 `json:"longitude,omitempty"`
TimeZone *string `json:"time_zone,omitempty"`
}
type LocationDetail ¶ added in v0.3.0
type LocationDetail struct {
Data LocationResource `json:"data"`
Included []LocationResource `json:"included,omitempty"`
Meta *LocationMeta `json:"meta,omitempty"`
}
type LocationExpansion ¶ added in v0.3.0
type LocationExpansion string
LocationExpansion is an open set of location detail expansions. The named values were observed in recordings; future values may be passed.
const ( LocationCapabilities LocationExpansion = "capabilities" LocationPresentation LocationExpansion = "presentation" LocationStatus LocationExpansion = "status" )
type LocationGroup ¶ added in v0.3.0
type LocationGroupDevices ¶ added in v0.3.0
type LocationGroupDevices struct {
Groups []LocationGroup `json:"groups"`
}
type LocationGroups ¶ added in v0.3.0
type LocationGroups struct {
DeviceGroups []LocationGroup `json:"device_groups,omitempty"`
IsOwner *bool `json:"is_owner,omitempty"`
}
type LocationList ¶ added in v0.3.0
type LocationList struct {
Locations []LocationSummary `json:"user_locations"`
OperationSets map[string][]string `json:"-"`
}
type LocationMeta ¶ added in v0.3.0
type LocationParams ¶ added in v0.3.0
type LocationParams struct {
Include []LocationExpansion
}
type LocationRequest ¶ added in v0.3.0
type LocationRequest struct {
Auth AuthContext
LocationID string
}
type LocationResource ¶ added in v0.3.0
type LocationResource struct {
ID string `json:"id"`
Type LocationResourceType `json:"type"`
Attributes *LocationAttributes `json:"attributes,omitempty"`
}
type LocationResourceType ¶ added in v0.3.0
type LocationResourceType string
const LocationResourceLocations LocationResourceType = "locations"
type LocationSummary ¶ added in v0.3.0
type LocationSummary struct {
ID string `json:"location_id"`
Name string `json:"name"`
LocationType *string `json:"location_type,omitempty"`
IsOwner *bool `json:"is_owner,omitempty"`
OwnerID *int64 `json:"owner_id,omitempty"`
Address *LocationAddress `json:"address,omitempty"`
GeoCoordinates *GeoCoordinates `json:"geo_coordinates,omitempty"`
}
type LoginSession ¶ added in v0.3.0
type LoginSession struct {
// contains filtered or unexported fields
}
LoginSession owns one customer's PKCE challenge and cookies. Separate login sessions may run concurrently on the same Client.
func (*LoginSession) Authenticate ¶ added in v0.3.0
func (s *LoginSession) Authenticate(ctx context.Context, req CompleteLoginRequest) (*ringapimodels.AuthResponse, error)
func (*LoginSession) Close ¶ added in v0.3.0
func (s *LoginSession) Close() error
func (*LoginSession) HardwareID ¶ added in v0.3.0
func (s *LoginSession) HardwareID() string
func (*LoginSession) Request2FACode ¶ added in v0.3.0
func (s *LoginSession) Request2FACode(ctx context.Context) error
type LoginSessionAPI ¶ added in v0.3.0
type LoginSessionAPI interface {
HardwareID() string
Request2FACode(context.Context) error
Authenticate(context.Context, CompleteLoginRequest) (*ringapimodels.AuthResponse, error)
Close() error
}
LoginSessionAPI is one isolated OAuth/2FA exchange.
type LoginSessionRequest ¶ added in v0.3.0
type OpenSignalingRequest ¶ added in v0.3.0
type OpenSignalingRequest struct{ Auth AuthContext }
Signaling connection request
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Client configuration Option configures a Client only during NewClient construction.
func WithEndpoints ¶ added in v0.3.0
WithEndpoints overrides endpoint origins for this client. Overrides take precedence over the selected region regardless of option order.
func WithEventWebSocketURL ¶
WithEventWebSocketURL configures the event endpoint, including local test servers. The default vendor endpoint is experimental; callers must verify vendor support.
func WithFCMSource ¶ added in v0.4.0
WithFCMSource replaces the receiver while preserving Ring registration and event lifecycle behavior.
func WithHTTPClient ¶
WithHTTPClient sets a custom HTTP client for REST API calls.
func WithRegion ¶ added in v0.3.0
func WithSignalingWebSocketURL ¶ added in v0.3.0
WithSignalingWebSocketURL explicitly overrides the configured signaling URL. It takes precedence over WithEndpoints and the selected region, regardless of option order.
func WithUserAgent ¶
WithUserAgent sets a custom user agent
func WithWebSocketDialer ¶ added in v0.3.0
func WithWebSocketDialer(d WebSocketDialer) Option
type OwnerID ¶ added in v0.3.0
type OwnerID string
OwnerID normalizes numeric and text identifiers to a string for callers.
func (*OwnerID) UnmarshalJSON ¶ added in v0.3.0
type PTZResult ¶ added in v0.3.0
type PTZResult struct {
SessionID string `json:"sessionId"`
Timestamp float64 `json:"timestamp"`
Version float64 `json:"version"`
Raw json.RawMessage `json:"-"`
}
PTZResult exposes captured acknowledgement fields while Raw retains unknown extensions.
type PanContinuousRequest ¶ added in v0.3.0
type PanContinuousRequest struct {
Direction PanDirection
// Speed is normalized from 0 (stop) to 1 (full requested speed).
Speed float64
}
type PanDirection ¶ added in v0.3.0
type PanDirection string
type PanStepRequest ¶ added in v0.3.0
type PanStepRequest struct{ Direction PanDirection }
type PatchDeviceSettingsRequest ¶ added in v0.3.0
type PatchDeviceSettingsRequest struct {
Auth AuthContext
DeviceID string
MotionDetectionEnabled *bool
}
PatchDeviceSettingsRequest changes only explicitly supplied supported fields.
type PlaybackSession ¶ added in v0.3.0
type PlaybackSession struct {
// contains filtered or unexported fields
}
PlaybackSession is a cloud playback negotiation on a signaling connection. Live camera controls remain on DeviceSession.
func (*PlaybackSession) Answer ¶ added in v0.3.0
func (s *PlaybackSession) Answer() SessionDescription
func (*PlaybackSession) Close ¶ added in v0.3.0
func (s *PlaybackSession) Close() error
func (*PlaybackSession) Receive ¶ added in v0.3.0
func (s *PlaybackSession) Receive(ctx context.Context) (SessionEvent, error)
func (*PlaybackSession) SendICE ¶ added in v0.3.0
func (s *PlaybackSession) SendICE(ctx context.Context, candidate ICECandidateRequest) error
type PlaybackSessionAPI ¶ added in v0.3.0
type PlaybackSessionAPI interface {
Answer() SessionDescription
SendICE(context.Context, ICECandidateRequest) error
Receive(context.Context) (SessionEvent, error)
Close() error
}
PlaybackSessionAPI is the cloud recording session surface.
type PowerMode ¶ added in v0.4.0
type PowerMode string
PowerMode is open to new device power configurations.
const PowerModeWired PowerMode = "wired"
type PushAction ¶ added in v0.4.0
type PushAction string
const ( PushActionDing PushAction = "ding" PushActionMotion PushAction = "motion" )
type PushConnection ¶ added in v0.4.0
type PushConnection struct {
// contains filtered or unexported fields
}
PushConnection owns one FCM receiver and Ring device subscriptions.
func (*PushConnection) Close ¶ added in v0.4.0
func (p *PushConnection) Close() error
func (*PushConnection) Events ¶ added in v0.4.0
func (p *PushConnection) Events() <-chan FCMEvent
Events closes when the connection ends. Receive errors arrive as retry events.
type PushEvent ¶ added in v0.3.0
type PushEvent struct {
FilterIdentifiers []string `json:"filter_identifiers"`
IngestionTimeMS int64 `json:"ingestion_time_ms"`
NotificationScope string `json:"notification_scope"`
NotificationType string `json:"notification_type"`
Payload json.RawMessage `json:"payload"`
SubscriptionID string `json:"subscription_id"`
}
type PushFilter ¶ added in v0.3.0
type PushFilter struct {
FilterIdentifier string `json:"filter_identifier"`
Filters PushFilters `json:"filters"`
NotificationScope string `json:"notification_scope"`
NotificationType string `json:"notification_type"`
}
Push notifications PushFilter is the captured subscription filter. Identifiers are caller supplied so one subscriber can distinguish multiple requested filters.
type PushFilters ¶ added in v0.3.0
type PushFilters struct {
DoorbotIDs []int64 `json:"doorbot_ids"`
}
type PushSubscription ¶ added in v0.3.0
type PushSubscription struct {
// contains filtered or unexported fields
}
PushSubscription receives push notifications on a signaling connection.
func (*PushSubscription) Close ¶ added in v0.3.0
func (s *PushSubscription) Close() error
type PushSubscriptionAPI ¶ added in v0.3.0
PushSubscriptionAPI receives push notifications until closed.
type RPCError ¶ added in v0.3.0
RPCError describes a command rejection returned by the signaling service.
type RecordingIDRequest ¶ added in v0.3.0
type RecordingIDRequest struct {
Auth AuthContext
RecordingID int64
}
type RecordingStatus ¶ added in v0.3.0
type RecordingStatus string
RecordingStatus is an open server status; ready was captured.
const RecordingStatusReady RecordingStatus = "ready"
type RefreshTokenRequest ¶
RefreshTokenRequest contains parameters for RefreshToken
type Region ¶ added in v0.3.0
type Region string
Regional endpoints Region selects a Ring account region. Regional Solutions bootstrap origins are not currently verified for EU or FE and must be supplied explicitly.
type RegisterPushDeviceRequest ¶ added in v0.4.0
type RegisterPushDeviceRequest struct {
Auth AuthContext
Token string
}
type Request2FACodeRequest ¶
type SDPType ¶ added in v0.3.0
type SDPType uint8
SDPType identifies the role of a session description.
func (SDPType) MarshalJSON ¶ added in v0.3.0
func (*SDPType) UnmarshalJSON ¶ added in v0.3.0
type SessionDescription ¶ added in v0.3.0
type SessionEvent ¶ added in v0.3.0
type SessionEvent struct {
Method string
Body json.RawMessage
}
type SessionState ¶ added in v0.3.0
type SessionState string
Live and playback session values
const ( SessionActive SessionState = "active" SessionClosed SessionState = "closed" SessionExpired SessionState = "expired" SessionFailed SessionState = "failed" )
type SetInHomeChimeRequest ¶
type SetInHomeChimeRequest struct {
Auth AuthContext
DeviceID string
Description string
Settings ringapimodels.InHomeChimeSettings
}
SetInHomeChimeRequest carries the legacy doorbell update fields.
type SetLightsRequest ¶
type SetLightsRequest struct {
Auth AuthContext
DeviceID string
Enabled bool
}
SetLightsRequest sets a device's floodlight state.
type SetMicrophoneRequest ¶ added in v0.3.0
type SetMicrophoneRequest struct{ Enabled bool }
type SetMotionDetectionRequest ¶
type SetMotionDetectionRequest struct {
Auth AuthContext
DeviceID string
Enabled bool
}
SetMotionDetectionRequest contains parameters for SetMotionDetection
type SetPersistentLiveViewEnabledRequest ¶ added in v0.3.0
type SetPersistentLiveViewEnabledRequest struct {
Auth AuthContext
DeviceID string
Enabled bool
}
type SetSirenRequest ¶ added in v0.3.0
type SetSirenRequest struct {
Auth AuthContext
DeviceID string
Enabled bool
}
SetSirenRequest controls the captured legacy doorbot siren endpoint.
type SetStreamOptionsRequest ¶ added in v0.3.0
type SetVolumeRequest ¶
type SetVolumeRequest struct {
Auth AuthContext
DeviceID string
Kind ringapimodels.VolumeKind
Description string
Volume int
}
SetVolumeRequest carries the legacy chime or doorbell update fields.
type SignalingConnection ¶ added in v0.3.0
type SignalingConnection struct {
// contains filtered or unexported fields
}
SignalingConnection owns one authenticated signaling socket and its child sessions.
func (*SignalingConnection) Close ¶ added in v0.3.0
func (c *SignalingConnection) Close() error
func (*SignalingConnection) Err ¶ added in v0.3.0
func (c *SignalingConnection) Err() error
func (*SignalingConnection) StartDeviceSession ¶ added in v0.3.0
func (c *SignalingConnection) StartDeviceSession(ctx context.Context, req StartDeviceSessionRequest) (*DeviceSession, error)
func (*SignalingConnection) StartPlayback ¶ added in v0.3.0
func (c *SignalingConnection) StartPlayback(ctx context.Context, req StartPlaybackRequest) (*PlaybackSession, error)
func (*SignalingConnection) SubscribePush ¶ added in v0.3.0
func (c *SignalingConnection) SubscribePush(ctx context.Context, filters []PushFilter) (*PushSubscription, error)
SubscribePush registers captured shoulder-tap style notification filters. It keeps the subscription alive until Close or its parent connection ends.
type SignalingConnectionAPI ¶ added in v0.3.0
type SignalingConnectionAPI interface {
StartDeviceSession(context.Context, StartDeviceSessionRequest) (*DeviceSession, error)
StartPlayback(context.Context, StartPlaybackRequest) (*PlaybackSession, error)
SubscribePush(context.Context, []PushFilter) (*PushSubscription, error)
Err() error
Close() error
}
SignalingConnectionAPI creates sessions and push subscriptions on one socket.
type SignalingTransport ¶ added in v0.3.0
type SignalingTransport string
SignalingTransport is an open transport selector. Only WebSocket is captured.
const SignalingTransportWebSocket SignalingTransport = "ws"
type Snapshot ¶ added in v0.3.0
Snapshot contains buffered image bytes and the timestamp returned by the legacy polling endpoint. The caller may choose how to persist the bytes.
type StartDeviceSessionRequest ¶ added in v0.3.0
type StartDeviceSessionRequest struct {
DeviceID string
Offer SessionDescription
AudioEnabled bool
VideoEnabled bool
MaxAge time.Duration
ICEMode ICECandidateMode
}
type StartPlaybackRequest ¶ added in v0.3.0
type StartPlaybackRequest struct {
DeviceID string
Offer SessionDescription
EntryPoint string
}
Playback request
type StopPTZRequest ¶ added in v0.3.0
type StopPTZRequest struct{ Axis PTZAxis }
type TestSoundRequest ¶
type TestSoundRequest struct {
Auth AuthContext
DeviceID string
Sound ringapimodels.SoundKind
}
TestSoundRequest selects an actual sound to play on a chime.
type TiltContinuousRequest ¶ added in v0.3.0
type TiltContinuousRequest struct {
Direction TiltDirection
// Speed is normalized from 0 (stop) to 1 (full requested speed).
Speed float64
}
type TiltDirection ¶ added in v0.3.0
type TiltDirection string
type TiltStepRequest ¶ added in v0.3.0
type TiltStepRequest struct{ Direction TiltDirection }
type TimelineDevice ¶ added in v0.3.0
type TimelineEvent ¶ added in v0.3.0
type TimelineEvent struct {
ID string `json:"event_id"`
Type TimelineEventType `json:"event_type"`
StartTime time.Time `json:"start_time"`
EndTime *time.Time `json:"end_time,omitempty"`
DurationMS *int `json:"duration_ms,omitempty"`
Device *TimelineDevice `json:"device,omitempty"`
SourceID *string `json:"source_id,omitempty"`
IsFavorite *bool `json:"is_favorite,omitempty"`
RecordingStatus *RecordingStatus `json:"recording_status,omitempty"`
State *TimelineState `json:"state,omitempty"`
Schema *string `json:"schema,omitempty"`
}
type TimelineEventType ¶ added in v0.3.0
type TimelineEventType string
TimelineEventType is an open server event kind; on_demand was captured.
const ( TimelineEventOnDemand TimelineEventType = "on_demand" TimelineEventDing TimelineEventType = "ding" TimelineEventMotion TimelineEventType = "motion" )
type TimelineOrder ¶ added in v0.3.0
type TimelineOrder string
TimelineOrder is an open server value. Descending order was recorded.
const ( TimelineAscending TimelineOrder = "asc" TimelineDescending TimelineOrder = "desc" )
type TimelineParams ¶ added in v0.3.0
type TimelineParams struct {
StartTime *time.Time
EndTime *time.Time
Order *TimelineOrder
Limit *int
Capabilities []EventCapability
}
type TimelineState ¶ added in v0.3.0
type TimelineState string
TimelineState is an open server state; completed was captured.
const TimelineStateCompleted TimelineState = "completed"
type UpdateDeviceHealthRequest ¶
type UpdateDeviceHealthRequest struct {
Auth AuthContext
DeviceID string
}
UpdateDeviceHealthRequest identifies a device on the generic health route.
type VideoRenderingFeature ¶ added in v0.3.0
type VideoRenderingFeature struct {
MaxDigitalZoomLevel *float32 `json:"max_digital_zoom_level,omitempty"`
}
Source Files
¶
- client.go
- client_auth.go
- client_captured_http.go
- client_control.go
- client_devices.go
- client_events.go
- client_options.go
- client_push.go
- client_query_types.go
- client_read_models.go
- client_recordings.go
- client_session.go
- client_settings.go
- client_snapshot.go
- device_session.go
- endpoints.go
- error_classification.go
- interface.go
- login_session.go
- sdp_type.go
- signaling_connection.go
- signaling_extras.go