ring

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2026 License: Apache-2.0 Imports: 29 Imported by: 0

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

View Source
var (
	ErrSessionClosed       = signaling.ErrClosed
	ErrSessionExpired      = signaling.ErrExpired
	ErrSessionHeartbeat    = signaling.ErrHeartbeat
	ErrSessionBackpressure = signaling.ErrBackpressure
)
View Source
var ErrSnapshotNotReady = ringapimodels.NewNotFoundError("fresh snapshot not available", nil)

Functions

This section is empty.

Types

type AuthContext added in v0.3.0

type AuthContext struct {
	AccessToken string
	HardwareID  string
}

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 CapturedTickets struct {
	Host               string   `json:"host"`
	Ticket             string   `json:"ticket"`
	SubscriptionTopics []string `json:"subscriptionTopics,omitempty"`
}

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 NewClient

func NewClient(opts ...Option) (*Client, error)

NewClient creates a new Ring client.

func (*Client) Authenticate

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) Close

func (c *Client) Close() error

Close is retained for source compatibility. Connection lifetimes belong to the objects returned by connection-opening methods; close those objects to end their connections. Client currently owns no long-lived connections.

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

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

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

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

func (c *Client) GetSnapshot(ctx context.Context, req GetSnapshotRequest) (*Snapshot, error)

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

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

Listen listens for events, calls the callback for each event, and returns a context error when canceled.

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

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 is retained for source compatibility; returned connections and
	// sessions have their own Close methods and lifetimes.
	Close() error

	// Authentication and authorization
	Authenticate(ctx context.Context, request AuthenticateRequest) (*ringapimodels.AuthResponse, error)
	Request2FACode(ctx context.Context, request Request2FACodeRequest) error
	RefreshToken(ctx context.Context, request RefreshTokenRequest) (*ringapimodels.AuthResponse, error)
	NewLoginSession(request LoginSessionRequest) (*LoginSession, error)

	// APIs for enumerating and getting data
	ListDevices(ctx context.Context, request ListDevicesRequest) (*ringapimodels.DevicesResponse, error)
	GetDevice(ctx context.Context, request GetDeviceRequest) (*ringapimodels.Device, error)
	GetDeviceSettings(ctx context.Context, request GetDeviceSettingsRequest) (DeviceSettings, error)
	GetDeviceDetail(ctx context.Context, request GetDeviceDetailRequest) (*DeviceDetail, error)
	GetDeviceStatus(ctx context.Context, request GetDeviceDetailRequest) (*DeviceStatus, error)
	ListLocations(ctx context.Context, request ListLocationsRequest) (*LocationList, error)
	GetLocation(ctx context.Context, request GetLocationRequest) (*LocationDetail, error)
	ListLocationGroups(ctx context.Context, request LocationRequest) (*LocationGroups, error)
	ListLocationDevices(ctx context.Context, request LocationRequest) (*LocationGroupDevices, error)
	GetDeviceTimeline(ctx context.Context, request GetDeviceTimelineRequest) (*DeviceTimeline, error)
	GetHistoryDevices(ctx context.Context, request GetHistoryDevicesRequest) (*HistoryDevices, error)
	GetCapturedTickets(ctx context.Context, request GetCapturedTicketsRequest) (*CapturedTickets, error)

	// APIs for modifying or sending requests to a device
	UpdateDeviceHealth(ctx context.Context, request UpdateDeviceHealthRequest) (*ringapimodels.DeviceHealth, error)
	PatchDeviceSettings(ctx context.Context, request PatchDeviceSettingsRequest) error
	GetSnapshot(ctx context.Context, request GetSnapshotRequest) (*Snapshot, error)
	SetVolume(ctx context.Context, request SetVolumeRequest) error
	SetLights(ctx context.Context, request SetLightsRequest) error
	SetMotionDetection(ctx context.Context, request SetMotionDetectionRequest) error
	SetSiren(ctx context.Context, request SetSirenRequest) error
	TestSound(ctx context.Context, request TestSoundRequest) error
	SetInHomeChime(ctx context.Context, request SetInHomeChimeRequest) error
	RebootDevice(ctx context.Context, request DeviceIDRequest) error
	UnlockIntercom(ctx context.Context, request DeviceIDRequest) error
	SetPersistentLiveViewEnabled(ctx context.Context, request SetPersistentLiveViewEnabledRequest) error

	// Various recording APIs
	GetDeviceHistory(ctx context.Context, request GetDeviceHistoryRequest) (*ringapimodels.RecordingHistoryResponse, error)
	GetActiveDings(ctx context.Context, request GetActiveDingsRequest) (*ringapimodels.RecordingHistoryResponse, error)
	GetRecording(ctx context.Context, request GetRecordingRequest) (*ringapimodels.VideoStream, error)
	GetRecordingShareURL(ctx context.Context, request GetRecordingShareURLRequest) (string, error)
	GetLastRecordingID(ctx context.Context, request GetLastRecordingIDRequest) (int64, error)
	FavoriteRecording(ctx context.Context, request RecordingIDRequest) error
	DeleteRecording(ctx context.Context, request DeleteRecordingRequest) error

	// Event and signaling connections
	OpenSignaling(ctx context.Context, request OpenSignalingRequest) (*SignalingConnection, error)
	ConnectEvents(ctx context.Context, request ConnectEventsRequest) (*EventConnection, error)
	ConnectPush(ctx context.Context, request ConnectPushRequest) (*PushConnection, error)
	RegisterPushDevice(ctx context.Context, request RegisterPushDeviceRequest) error
	SubscribeDeviceDing(ctx context.Context, request DeviceIDRequest) error
	SubscribeDeviceMotion(ctx context.Context, request DeviceIDRequest) error
	Listen(ctx context.Context, callback ringapimodels.EventCallback, request 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 DeviceLegacySettings struct {
	DoorbellVolume         *int       `json:"doorbell_volume,omitempty"`
	LiveViewDisabled       *bool      `json:"live_view_disabled,omitempty"`
	MotionDetectionEnabled *bool      `json:"motion_detection_enabled,omitempty"`
	PowerMode              *PowerMode `json:"power_mode,omitempty"`
}

type DeviceOwner added in v0.3.0

type DeviceOwner struct {
	ID        *OwnerID `json:"id,omitempty"`
	FirstName *string  `json:"first_name,omitempty"`
	LastName  *string  `json:"last_name,omitempty"`
	Email     *string  `json:"email,omitempty"`
}

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, request 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, request 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)

func (*DeviceSession) Wait added in v0.3.0

func (s *DeviceSession) Wait(ctx context.Context) error

type DeviceSessionAPI added in v0.3.0

type DeviceSessionAPI interface {
	Answer() SessionDescription
	State() SessionState
	Wait(ctx context.Context) error
	Receive(ctx context.Context) (*SessionEvent, error)
	SendICE(ctx context.Context, request ICECandidateRequest) error
	PanStep(ctx context.Context, request PanStepRequest) (*PTZResult, error)
	TiltStep(ctx context.Context, request TiltStepRequest) (*PTZResult, error)
	PanContinuous(ctx context.Context, request PanContinuousRequest) (*PTZResult, error)
	TiltContinuous(ctx context.Context, request TiltContinuousRequest) (*PTZResult, error)
	StopPTZ(ctx context.Context, request StopPTZRequest) (*PTZResult, error)
	SetMicrophone(ctx context.Context, request SetMicrophoneRequest) error
	SetStreamOptions(ctx context.Context, request 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 FCMDialContext added in v0.5.0

type FCMDialContext func(context.Context, string, string) (net.Conn, error)

FCMDialContext supplies the already-secured connection used for FCM MCS frames. The default receiver performs TLS before returning its connection.

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

type FCMSource func(context.Context, json.RawMessage) (<-chan FCMEvent, error)

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 FeatureEligibility struct {
	Eligible             *bool    `json:"eligible,omitempty"`
	IneligibilityReasons []string `json:"ineligibility_reasons,omitempty"`
}

type FeatureEnablement added in v0.3.0

type FeatureEnablement struct {
	Allowed         *bool    `json:"allowed,omitempty"`
	Enabled         *bool    `json:"enabled,omitempty"`
	DisallowReasons []string `json:"disallow_reasons,omitempty"`
}

type GeoCoordinates added in v0.3.0

type GeoCoordinates struct {
	Latitude  *float32 `json:"latitude,omitempty"`
	Longitude *float32 `json:"longitude,omitempty"`
}

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 {
	Auth        AuthContext
	RecordingID int64
}

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 ICECandidateRequest struct {
	Candidate  string
	MID        string
	MLineIndex int
}

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 LocationGroup struct {
	ID   *string `json:"id,omitempty"`
	Name *string `json:"name,omitempty"`
}

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 LocationMeta struct {
	Time *time.Time `json:"time,omitempty"`
}

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 (*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(ctx context.Context) error
	Authenticate(ctx context.Context, request CompleteLoginRequest) (*ringapimodels.AuthResponse, error)
	Close() error
}

LoginSessionAPI is one isolated OAuth/2FA exchange.

type LoginSessionRequest added in v0.3.0

type LoginSessionRequest struct {
	Username   string
	Password   string
	HardwareID string
}

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

func WithEndpoints(endpoints Endpoints) Option

WithEndpoints overrides endpoint origins for this client. Overrides take precedence over the selected region regardless of option order.

func WithEventWebSocketURL

func WithEventWebSocketURL(url string) Option

WithEventWebSocketURL configures the event endpoint, including local test servers. The default vendor endpoint is experimental; callers must verify vendor support.

func WithFCMDialContext added in v0.5.0

func WithFCMDialContext(dialContext FCMDialContext) Option

WithFCMDialContext configures the context-aware FCM MCS connection function. The default receiver establishes TLS; injected functions return the connection that carries MCS frames.

func WithFCMHTTPTransport added in v0.5.0

func WithFCMHTTPTransport(transport http.RoundTripper) Option

WithFCMHTTPTransport configures the HTTP transport used by the built-in FCM receiver. It has no effect when WithFCMSource supplies a custom receiver.

func WithFCMSource added in v0.4.0

func WithFCMSource(source FCMSource) Option

WithFCMSource replaces the receiver while preserving Ring registration and event lifecycle behavior.

func WithHTTPClient

func WithHTTPClient(httpClient *http.Client) Option

WithHTTPClient sets a custom HTTP client for REST API calls.

func WithRegion added in v0.3.0

func WithRegion(region Region) Option

func WithSignalingWebSocketURL added in v0.3.0

func WithSignalingWebSocketURL(url string) Option

WithSignalingWebSocketURL explicitly overrides the configured signaling URL. It takes precedence over WithEndpoints and the selected region, regardless of option order.

func WithUserAgent

func WithUserAgent(userAgent string) Option

WithUserAgent sets a custom user agent.

func WithWebSocketDialer added in v0.3.0

func WithWebSocketDialer(d WebSocketDialer) Option

WithWebSocketDialer configures the event and signaling WebSocket transport.

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

func (id *OwnerID) UnmarshalJSON(data []byte) error

type PTZAxis added in v0.3.0

type PTZAxis string
const (
	PanAxis  PTZAxis = "pan"
	TiltAxis PTZAxis = "tilt"
)

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(ctx context.Context, request ICECandidateRequest) error
	Receive(ctx 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

func (*PushSubscription) Receive added in v0.3.0

func (s *PushSubscription) Receive(ctx context.Context) (PushEvent, error)

type PushSubscriptionAPI added in v0.3.0

type PushSubscriptionAPI interface {
	Receive(ctx context.Context) (PushEvent, error)
	Close() error
}

PushSubscriptionAPI receives push notifications until closed.

type RPCError added in v0.3.0

type RPCError = signaling.RPCError

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

type RefreshTokenRequest struct {
	RefreshToken string
	HardwareID   string
}

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.

const (
	RegionUS Region = "US"
	RegionEU Region = "EU"
	RegionFE Region = "FE"
)

type RegisterPushDeviceRequest added in v0.4.0

type RegisterPushDeviceRequest struct {
	Auth  AuthContext
	Token string
}

type Request2FACodeRequest

type Request2FACodeRequest struct {
	Username   string
	Password   string
	HardwareID string
}

type SDPType added in v0.3.0

type SDPType uint8

SDPType identifies the role of a session description.

const (
	SDPTypeUnknown SDPType = iota
	SDPTypeOffer
	SDPTypeAnswer
)

func (SDPType) MarshalJSON added in v0.3.0

func (t SDPType) MarshalJSON() ([]byte, error)

func (SDPType) String added in v0.3.0

func (t SDPType) String() string

String returns the wire name of a known SDP type.

func (*SDPType) UnmarshalJSON added in v0.3.0

func (t *SDPType) UnmarshalJSON(data []byte) error

type SessionDescription added in v0.3.0

type SessionDescription struct {
	Type SDPType `json:"type"`
	SDP  string  `json:"sdp"`
}

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 SetStreamOptionsRequest struct {
	AudioEnabled *bool
	VideoEnabled *bool
}

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 (*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(ctx context.Context, request StartDeviceSessionRequest) (*DeviceSession, error)
	StartPlayback(ctx context.Context, request StartPlaybackRequest) (*PlaybackSession, error)
	SubscribePush(ctx context.Context, filters []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

type Snapshot struct {
	Bytes       []byte
	Timestamp   time.Time
	ContentType string
}

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 TimelineDevice struct {
	ID          *int64  `json:"id,omitempty"`
	Description *string `json:"description,omitempty"`
	Type        *string `json:"type,omitempty"`
}

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"`
}

type WebSocketDialer added in v0.3.0

type WebSocketDialer interface {
	DialContext(ctx context.Context, url string, headers http.Header) (*websocket.Conn, *http.Response, error)
}

Signaling dialer configuration WebSocketDialer is the small portion of Gorilla's dialer used by client WebSocket connections.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL