ringapimodels

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2026 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Overview

Package ringapimodels provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClassifyHTTPError added in v0.3.0

func ClassifyHTTPError(resp *http.Response, body string) error

func IsAuthenticationError

func IsAuthenticationError(err error) bool

func IsBadRequestError

func IsBadRequestError(err error) bool

func IsClosedError

func IsClosedError(err error) bool

func IsConnectionError

func IsConnectionError(err error) bool

func IsHTTPError

func IsHTTPError(err error) bool

func IsHTTPStatusCode

func IsHTTPStatusCode(err error, code int) bool

func IsInternalServerError

func IsInternalServerError(err error) bool

func IsNetworkError

func IsNetworkError(err error) bool

func IsNotFoundError

func IsNotFoundError(err error) bool

func IsRateLimitError

func IsRateLimitError(err error) bool

func IsRequires2FAError

func IsRequires2FAError(err error) bool

func IsTokenError

func IsTokenError(err error) bool

func IsUnauthorizedError

func IsUnauthorizedError(err error) bool

Types

type AuthResponse

type AuthResponse struct {
	AccessToken  string `json:"access_token"`
	ExpiresIn    int    `json:"expires_in"`
	RefreshToken string `json:"refresh_token"`

	// TokenType Bearer is used by the implemented OAuth flow; unknown token types remain representable.
	TokenType string `json:"token_type"`
}

AuthResponse defines model for AuthResponse.

type AuthenticationError

type AuthenticationError = ringerrors.AuthenticationError

Public error aliases preserve errors.As and existing SDK callers while the transport packages use the shared internal definitions directly.

func NewAuthenticationError

func NewAuthenticationError(message string, status int) *AuthenticationError

type BadRequestError

type BadRequestError = ringerrors.BadRequestError

func NewBadRequestError

func NewBadRequestError(message string, err error) *BadRequestError

type Chime

type Chime struct {
	Address string `json:"address"`

	// Family Known family is chimes; unknown families remain valid.
	Family             string        `json:"family"`
	Health             *DeviceHealth `json:"health,omitempty"`
	ID                 string        `json:"id"`
	Name               string        `json:"name"`
	Timezone           string        `json:"timezone"`
	Volume             int           `json:"volume"`
	WifiName           string        `json:"wifi_name"`
	WifiSignalStrength int           `json:"wifi_signal_strength"`
}

Chime defines model for Chime.

func (*Chime) GetAddress

func (c *Chime) GetAddress() string

func (*Chime) GetFamily

func (c *Chime) GetFamily() DeviceFamily

func (*Chime) GetID

func (c *Chime) GetID() string

func (*Chime) GetName

func (c *Chime) GetName() string

func (*Chime) GetTimezone

func (c *Chime) GetTimezone() string

type ClosedError

type ClosedError = ringerrors.ClosedError

func NewClosedError

func NewClosedError(message string, cause ...error) *ClosedError

type ConnectionError

type ConnectionError = ringerrors.ConnectionError

func NewConnectionError

func NewConnectionError(message string, err error) *ConnectionError

type Device

type Device interface {
	GetID() string
	GetName() string
	GetFamily() DeviceFamily
	GetAddress() string
	GetTimezone() string
}

Device represents a generic Ring device

type DeviceFamily

type DeviceFamily string

DeviceFamily represents the family/type of a Ring device

const (
	DeviceFamilyDoorbell   DeviceFamily = "doorbots"
	DeviceFamilyChime      DeviceFamily = "chimes"
	DeviceFamilyStickUpCam DeviceFamily = "stickup_cams"
	DeviceFamilyOther      DeviceFamily = "other"
)

type DeviceHealth

type DeviceHealth struct {
	BatteryLevel    *int    `json:"battery_level"`
	BatteryStatus   *string `json:"battery_status"`
	FirmwareVersion *string `json:"firmware_version"`
	LastUpdate      *string `json:"last_update"`
	SignalStrength  *int    `json:"signal_strength"`
}

DeviceHealth defines model for DeviceHealth.

type DevicesResponse

type DevicesResponse struct {
	Chimes      []Chime      `json:"chimes"`
	Doorbells   []Doorbell   `json:"doorbots"`
	Other       []Other      `json:"other"`
	StickUpCams []StickUpCam `json:"stickup_cams"`
}

DevicesResponse defines model for DevicesResponse.

func (*DevicesResponse) GetAllDevices

func (d *DevicesResponse) GetAllDevices() []Device

GetAllDevices returns all devices as a slice of Device interfaces

type Doorbell

type Doorbell struct {
	Address string `json:"address"`

	// Family Known family is doorbots; unknown families remain valid.
	Family                 string        `json:"family"`
	HasLight               bool          `json:"has_light"`
	Health                 *DeviceHealth `json:"health,omitempty"`
	ID                     string        `json:"id"`
	LightBrightness        *int          `json:"light_brightness,omitempty"`
	MotionDetectionEnabled bool          `json:"motion_detection_enabled"`
	Name                   string        `json:"name"`
	Timezone               string        `json:"timezone"`
	Volume                 int           `json:"volume"`
	WifiName               string        `json:"wifi_name"`
	WifiSignalStrength     int           `json:"wifi_signal_strength"`
}

Doorbell defines model for Doorbell.

func (*Doorbell) GetAddress

func (d *Doorbell) GetAddress() string

func (*Doorbell) GetFamily

func (d *Doorbell) GetFamily() DeviceFamily

func (*Doorbell) GetID

func (d *Doorbell) GetID() string

func (*Doorbell) GetName

func (d *Doorbell) GetName() string

func (*Doorbell) GetTimezone

func (d *Doorbell) GetTimezone() string

type Event

type Event struct {
	Data     map[string]interface{} `json:"data"`
	DeviceID int64                  `json:"device_id"`

	// Kind Known event kinds are motion, ding and on_demand. Preserve future values from the service.
	Kind      EventKind `json:"kind"`
	Timestamp string    `json:"timestamp"`
}

Event defines model for Event.

type EventCallback

type EventCallback func(*Event) error

EventCallback is a function type for handling events

type EventKind

type EventKind = string

EventKind Known event kinds are motion, ding and on_demand. Preserve future values from the service.

const (
	EventKindMotion   EventKind = "motion"
	EventKindDing     EventKind = "ding"
	EventKindOnDemand EventKind = "on_demand"
)

type HTTPError

type HTTPError = ringerrors.HTTPError

func NewHTTPError

func NewHTTPError(resp *http.Response, body string) *HTTPError

type InHomeChimeSettings added in v0.3.0

type InHomeChimeSettings struct {
	Duration *int  `json:"duration,omitempty"`
	Enabled  *bool `json:"enabled,omitempty"`
	Type     *int  `json:"type,omitempty"`
}

InHomeChimeSettings Supply exactly one field per update. Enabled maps to the legacy enable query value.

type InternalServerError

type InternalServerError = ringerrors.InternalServerError

func NewInternalServerError

func NewInternalServerError(message string, err error) *InternalServerError

type LightState added in v0.3.0

type LightState string

LightState Legacy floodlight action.

const (
	LightStateOff LightState = "off"
	LightStateOn  LightState = "on"
)

Defines values for LightState.

func (LightState) Valid added in v0.3.0

func (e LightState) Valid() bool

Valid indicates whether the value is a known member of the LightState enum.

type NetworkError

type NetworkError = ringerrors.NetworkError

func NewNetworkError

func NewNetworkError(message string, err error) *NetworkError

type NotFoundError

type NotFoundError = ringerrors.NotFoundError

func NewNotFoundError

func NewNotFoundError(message string, err error) *NotFoundError

type Other

type Other struct {
	Address string `json:"address"`

	// Family Known families include other; unknown families remain valid.
	Family string        `json:"family"`
	Health *DeviceHealth `json:"health,omitempty"`
	ID     string        `json:"id"`

	// Kind Known legacy kinds include intercom_handset_audio; unfamiliar hardware kinds remain valid.
	Kind     string `json:"kind"`
	Name     string `json:"name"`
	Timezone string `json:"timezone"`
}

Other defines model for Other.

func (*Other) GetAddress

func (o *Other) GetAddress() string

func (*Other) GetFamily

func (o *Other) GetFamily() DeviceFamily

func (*Other) GetID

func (o *Other) GetID() string

func (*Other) GetName

func (o *Other) GetName() string

func (*Other) GetTimezone

func (o *Other) GetTimezone() string

type RateLimitError

type RateLimitError = ringerrors.RateLimitError

func NewRateLimitError

func NewRateLimitError(message string) *RateLimitError

type Recording

type Recording struct {
	Answered  bool   `json:"answered"`
	CreatedAt string `json:"created_at"`
	DeviceID  int64  `json:"device_id"`
	ID        int64  `json:"id"`

	// Kind Known recording kinds are motion, ding and on_demand; future values remain valid.
	Kind string `json:"kind"`
}

Recording defines model for Recording.

type RecordingHistoryResponse

type RecordingHistoryResponse struct {
	Recordings []Recording `json:"recordings"`
}

RecordingHistoryResponse defines model for RecordingHistoryResponse.

type Requires2FAError

type Requires2FAError = ringerrors.Requires2FAError

func NewRequires2FAError

func NewRequires2FAError(message string) *Requires2FAError

type SoundKind

type SoundKind string

SoundKind Accepted legacy chime test sounds.

const (
	SoundKindDing   SoundKind = "ding"
	SoundKindMotion SoundKind = "motion"
)

Defines values for SoundKind.

func (SoundKind) Valid added in v0.3.0

func (e SoundKind) Valid() bool

Valid indicates whether the value is a known member of the SoundKind enum.

type StickUpCam

type StickUpCam struct {
	Address     string `json:"address"`
	Description string `json:"description"`

	// Family Known family is stickup_cams; unknown families remain valid.
	Family                 string        `json:"family"`
	HasLight               bool          `json:"has_light"`
	Health                 *DeviceHealth `json:"health,omitempty"`
	ID                     string        `json:"id"`
	LightBrightness        *int          `json:"light_brightness,omitempty"`
	MotionDetectionEnabled bool          `json:"motion_detection_enabled"`
	Name                   string        `json:"name"`
	Timezone               string        `json:"timezone"`
	Volume                 int           `json:"volume"`
	WifiName               string        `json:"wifi_name"`
	WifiSignalStrength     int           `json:"wifi_signal_strength"`
}

StickUpCam defines model for StickUpCam.

func (*StickUpCam) GetAddress

func (s *StickUpCam) GetAddress() string

func (*StickUpCam) GetFamily

func (s *StickUpCam) GetFamily() DeviceFamily

func (*StickUpCam) GetID

func (s *StickUpCam) GetID() string

func (*StickUpCam) GetName

func (s *StickUpCam) GetName() string

func (*StickUpCam) GetTimezone

func (s *StickUpCam) GetTimezone() string

type TokenError

type TokenError = ringerrors.TokenError

func NewTokenError

func NewTokenError(message string, err error) *TokenError

type UnauthorizedError

type UnauthorizedError = ringerrors.UnauthorizedError

func NewUnauthorizedError

func NewUnauthorizedError(message string, err error) *UnauthorizedError

type VideoStream

type VideoStream = ringmedia.VideoStream

VideoStream is the customer-facing recording response body.

type VolumeKind added in v0.3.0

type VolumeKind string

VolumeKind Legacy volume control target; selects the chime or doorbell endpoint.

const (
	VolumeKindChime    VolumeKind = "chime"
	VolumeKindDoorbell VolumeKind = "doorbell"
)

Defines values for VolumeKind.

func (VolumeKind) Valid added in v0.3.0

func (e VolumeKind) Valid() bool

Valid indicates whether the value is a known member of the VolumeKind enum.

Jump to

Keyboard shortcuts

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