Documentation
¶
Overview ¶
Package ringapimodels provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT.
Index ¶
- func ClassifyHTTPError(resp *http.Response, body string) error
- func IsAuthenticationError(err error) bool
- func IsBadRequestError(err error) bool
- func IsClosedError(err error) bool
- func IsConnectionError(err error) bool
- func IsHTTPError(err error) bool
- func IsHTTPStatusCode(err error, code int) bool
- func IsInternalServerError(err error) bool
- func IsNetworkError(err error) bool
- func IsNotFoundError(err error) bool
- func IsRateLimitError(err error) bool
- func IsRequires2FAError(err error) bool
- func IsTokenError(err error) bool
- func IsUnauthorizedError(err error) bool
- type AuthResponse
- type AuthenticationError
- type BadRequestError
- type BatteryReading
- type CapturedTickets
- type ClosedError
- type ConnectionError
- type ConnectionState
- type DetailDeviceFamily
- type Device
- type DeviceAlerts
- type DeviceCapability
- type DeviceDetail
- type DeviceDetailDevice
- type DeviceDetailHealth
- type DeviceFamily
- type DeviceFeatures
- type DeviceHealth
- type DeviceKind
- type DeviceLegacySettings
- type DeviceOwner
- type DeviceStatus
- type DeviceTimeline
- type DeviceType
- type DevicesResponse
- type Event
- type EventCallback
- type EventKind
- type FeatureAvailability
- type FeatureEligibility
- type FeatureEnablement
- type GeoCoordinates
- type HTTPError
- type HistoryDevices
- type HistoryFeedItem
- type HistoryFeedType
- type InHomeChimeSettings
- type InternalServerError
- type LightState
- type LocationAddress
- type LocationAttributes
- type LocationDetail
- type LocationGroup
- type LocationGroupDevices
- type LocationGroups
- type LocationList
- type LocationMeta
- type LocationResource
- type LocationResourceType
- type LocationSummary
- type NetworkError
- type NotFoundError
- type OwnerID
- type PowerMode
- type RateLimitError
- type Recording
- type RecordingHistoryResponse
- type RecordingStatus
- type Requires2FAError
- type SoundKind
- type TimelineDevice
- type TimelineEvent
- type TimelineEventType
- type TimelineState
- type TokenError
- type UnauthorizedError
- type VideoRenderingFeature
- type VideoStream
- type VolumeKind
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClassifyHTTPError ¶ added in v0.3.0
func IsAuthenticationError ¶
func IsBadRequestError ¶
func IsClosedError ¶
func IsConnectionError ¶
func IsHTTPError ¶
func IsHTTPStatusCode ¶
func IsInternalServerError ¶
func IsNetworkError ¶
func IsNotFoundError ¶
func IsRateLimitError ¶
func IsRequires2FAError ¶
func IsTokenError ¶
func IsUnauthorizedError ¶
Types ¶
type AuthResponse ¶
type AuthResponse struct {
AccessToken string `json:"access_token"`
ExpiresIn int `json:"expires_in"`
RefreshToken string `json:"refresh_token"`
// TokenType Bearer is used by the implemented OAuth flow; unknown token types remain representable.
TokenType string `json:"token_type"`
}
AuthResponse defines model for AuthResponse.
type AuthenticationError ¶
type AuthenticationError = ringerrors.AuthenticationError
Public error aliases preserve errors.As and existing SDK callers while the transport packages use the shared internal definitions directly.
func NewAuthenticationError ¶
func NewAuthenticationError(message string, status int) *AuthenticationError
type BadRequestError ¶
type BadRequestError = ringerrors.BadRequestError
func NewBadRequestError ¶
func NewBadRequestError(message string, err error) *BadRequestError
type BatteryReading ¶ added in v0.5.0
type BatteryReading = ringtypes.BatteryReading
BatteryReading Battery percentage accepted as a JSON number or numeric text by the SDK adapter.
type CapturedTickets ¶ added in v0.5.0
type CapturedTickets struct {
Host string `json:"host"`
SubscriptionTopics []string `json:"subscriptionTopics,omitempty"`
Ticket string `json:"ticket"`
}
CapturedTickets defines model for CapturedTickets.
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 ConnectionState ¶ added in v0.5.0
type ConnectionState = ringtypes.ConnectionState
ConnectionState Open connection state.
type DetailDeviceFamily ¶ added in v0.5.0
type DetailDeviceFamily = ringtypes.DeviceFamily
DetailDeviceFamily Open device family in detail and inventory responses.
type Device ¶
type Device struct {
Address string `json:"address"`
Capabilities []DeviceCapability `json:"capabilities"`
// Family Open server family; absent on some v3 responses
Family string `json:"family"`
Health *DeviceHealth `json:"health,omitempty"`
ID string `json:"id"`
// Kind Open hardware kind from the server
Kind string `json:"kind"`
LightBrightness *int `json:"light_brightness,omitempty"`
MotionDetectionEnabled *bool `json:"motion_detection_enabled,omitempty"`
Name string `json:"name"`
Timezone string `json:"timezone"`
// Type Normalized device class derived from a known hardware kind or explicit family. Unknown kinds remain OTHER; live-view support alone does not classify hardware.
Type DeviceType `json:"type"`
Volume *int `json:"volume,omitempty"`
WifiName *string `json:"wifi_name,omitempty"`
WifiSignalStrength *int `json:"wifi_signal_strength,omitempty"`
}
Device One account device. An absent capability means support was not confirmed by inventory; it does not prove the operation is unsupported.
func (Device) Supports ¶ added in v0.5.0
func (d Device) Supports(capability DeviceCapability) bool
Supports reports whether inventory explicitly confirms a device operation. False also covers unknown support, so callers must not treat it as proof that the server rejects an operation.
type DeviceAlerts ¶ added in v0.5.0
type DeviceAlerts struct {
// Connection Open connection state.
Connection *ConnectionState `json:"connection,omitempty"`
}
DeviceAlerts defines model for DeviceAlerts.
type DeviceCapability ¶ added in v0.5.0
type DeviceCapability = string
DeviceCapability A supported operation confirmed by an explicit inventory field. Unknown server capabilities remain representable.
const ( DeviceCapabilityLight DeviceCapability = "light" DeviceCapabilityMotionDetection DeviceCapability = "motion_detection" DeviceCapabilitySiren DeviceCapability = "siren" DeviceCapabilityLiveView DeviceCapability = "live_view" DeviceCapabilityPtzPanStep DeviceCapability = "ptz_pan_step" DeviceCapabilityPtzTiltStep DeviceCapability = "ptz_tilt_step" DeviceCapabilityPtzPanContinuous DeviceCapability = "ptz_pan_continuous" DeviceCapabilityPtzTiltContinuous DeviceCapability = "ptz_tilt_continuous" )
Device capabilities are reported only when an inventory field confirms them.
type DeviceDetail ¶ added in v0.5.0
type DeviceDetail struct {
Device DeviceDetailDevice `json:"device"`
}
DeviceDetail SDK projection of the generated device-detail wire response; operation sets are derived separately.
type DeviceDetailDevice ¶ added in v0.5.0
type DeviceDetailDevice struct {
Address *string `json:"address,omitempty"`
Alerts *DeviceAlerts `json:"alerts,omitempty"`
// BatteryLife Battery percentage accepted as a JSON number or numeric text by the SDK adapter.
BatteryLife *BatteryReading `json:"battery_life,omitempty"`
// BatteryLife2 Battery percentage accepted as a JSON number or numeric text by the SDK adapter.
BatteryLife2 *BatteryReading `json:"battery_life_2,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
DeactivatedAt *time.Time `json:"deactivated_at,omitempty"`
Description string `json:"description"`
DeviceID *string `json:"device_id,omitempty"`
ExternalConnection *bool `json:"external_connection,omitempty"`
// Family Open device family in detail and inventory responses.
Family *DetailDeviceFamily `json:"family,omitempty"`
Features *DeviceFeatures `json:"features,omitempty"`
HasLight *bool `json:"has_light,omitempty"`
Health *DeviceDetailHealth `json:"health,omitempty"`
ID int64 `json:"id"`
// Kind Open hardware kind in device detail.
Kind DeviceKind `json:"kind"`
LightBrightness *int `json:"light_brightness,omitempty"`
LocationID *string `json:"location_id,omitempty"`
MotionDetectionEnabled *bool `json:"motion_detection_enabled,omitempty"`
Name *string `json:"name,omitempty"`
OperationSet *string `json:"operation_set,omitempty"`
Owned *bool `json:"owned,omitempty"`
Owner *DeviceOwner `json:"owner,omitempty"`
Settings *DeviceLegacySettings `json:"settings,omitempty"`
TimeZone *string `json:"time_zone,omitempty"`
Timezone *string `json:"timezone,omitempty"`
Volume *int `json:"volume,omitempty"`
WifiName *string `json:"wifi_name,omitempty"`
WifiSignalStrength *int `json:"wifi_signal_strength,omitempty"`
}
DeviceDetailDevice defines model for DeviceDetailDevice.
func (DeviceDetailDevice) Status ¶ added in v0.7.0
func (device DeviceDetailDevice) Status() DeviceStatus
Status derives a concise health view without implying a battery on wired devices.
type DeviceDetailHealth ¶ added in v0.5.0
type DeviceDetailHealth struct {
BatteryLevel *int `json:"battery_level,omitempty"`
BatteryPercentage *float64 `json:"battery_percentage,omitempty"`
BatteryPercentageCategory *string `json:"battery_percentage_category,omitempty"`
BatteryPresent *bool `json:"battery_present,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"`
}
DeviceDetailHealth defines model for DeviceDetailHealth.
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 DeviceFeatures ¶ added in v0.5.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"`
}
DeviceFeatures defines model for DeviceFeatures.
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 DeviceKind ¶ added in v0.5.0
type DeviceKind = ringtypes.DeviceKind
DeviceKind Open hardware kind in device detail.
type DeviceLegacySettings ¶ added in v0.5.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 Open device power mode.
PowerMode *PowerMode `json:"power_mode,omitempty"`
}
DeviceLegacySettings defines model for DeviceLegacySettings.
type DeviceOwner ¶ added in v0.5.0
type DeviceOwner struct {
Email *string `json:"email,omitempty"`
FirstName *string `json:"first_name,omitempty"`
// ID Numeric or text vendor owner identifier normalized to text by the SDK adapter.
ID *OwnerID `json:"id,omitempty"`
LastName *string `json:"last_name,omitempty"`
}
DeviceOwner defines model for DeviceOwner.
type DeviceStatus ¶ added in v0.5.0
type DeviceStatus struct {
BatteryPercent *float64 `json:"battery_percent,omitempty"`
// Connection Open connection state.
Connection *ConnectionState `json:"connection,omitempty"`
IsOffline bool `json:"is_offline"`
// PowerMode Open device power mode.
PowerMode *PowerMode `json:"power_mode,omitempty"`
}
DeviceStatus SDK-derived status from device detail, not an additional wire response.
type DeviceTimeline ¶ added in v0.5.0
type DeviceTimeline struct {
Items []TimelineEvent `json:"items"`
PaginationKey *string `json:"pagination_key,omitempty"`
}
DeviceTimeline defines model for DeviceTimeline.
type DeviceType ¶ added in v0.6.0
type DeviceType string
DeviceType Normalized device class derived from a known hardware kind or explicit family. Unknown kinds remain OTHER; live-view support alone does not classify hardware.
const ( DeviceTypeCamera DeviceType = "CAMERA" DeviceTypeChime DeviceType = "CHIME" DeviceTypeDoorbell DeviceType = "DOORBELL" DeviceTypeOther DeviceType = "OTHER" )
Defines values for DeviceType.
func (DeviceType) Valid ¶ added in v0.6.0
func (e DeviceType) Valid() bool
Valid indicates whether the value is a known member of the DeviceType enum.
type DevicesResponse ¶
type DevicesResponse struct {
Devices []Device `json:"devices"`
}
DevicesResponse defines model for DevicesResponse.
type Event ¶
type Event struct {
Data map[string]interface{} `json:"data"`
DeviceID int64 `json:"device_id"`
// Kind Known event kinds are motion, ding and on_demand. Preserve future values from the service.
Kind EventKind `json:"kind"`
Timestamp string `json:"timestamp"`
}
Event defines model for Event.
type EventCallback ¶
EventCallback is a function type for handling events.
type EventKind ¶
type EventKind = string
EventKind Known event kinds are motion, ding and on_demand. Preserve future values from the service.
type FeatureAvailability ¶ added in v0.5.0
type FeatureAvailability struct {
Eligibility *FeatureEligibility `json:"eligibility,omitempty"`
Enablement *FeatureEnablement `json:"enablement,omitempty"`
}
FeatureAvailability defines model for FeatureAvailability.
type FeatureEligibility ¶ added in v0.5.0
type FeatureEligibility struct {
Eligible *bool `json:"eligible,omitempty"`
IneligibilityReasons []string `json:"ineligibility_reasons,omitempty"`
}
FeatureEligibility defines model for FeatureEligibility.
type FeatureEnablement ¶ added in v0.5.0
type FeatureEnablement struct {
Allowed *bool `json:"allowed,omitempty"`
DisallowReasons []string `json:"disallow_reasons,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
}
FeatureEnablement defines model for FeatureEnablement.
type GeoCoordinates ¶ added in v0.5.0
type GeoCoordinates struct {
Latitude *float32 `json:"latitude,omitempty"`
Longitude *float32 `json:"longitude,omitempty"`
}
GeoCoordinates defines model for GeoCoordinates.
type HTTPError ¶
type HTTPError = ringerrors.HTTPError
type HistoryDevices ¶ added in v0.5.0
type HistoryDevices struct {
Events []TimelineEvent `json:"events"`
Feed []HistoryFeedItem `json:"feed,omitempty"`
PaginationKey *string `json:"pagination_key,omitempty"`
Schema *string `json:"schema,omitempty"`
}
HistoryDevices defines model for HistoryDevices.
type HistoryFeedItem ¶ added in v0.5.0
type HistoryFeedItem struct {
ID *string `json:"id,omitempty"`
Type *HistoryFeedType `json:"type,omitempty"`
}
HistoryFeedItem defines model for HistoryFeedItem.
type HistoryFeedType ¶ added in v0.5.0
type HistoryFeedType = ringtypes.HistoryFeedType
HistoryFeedType defines model for HistoryFeedType.
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 LocationAddress ¶ added in v0.5.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"`
}
LocationAddress defines model for LocationAddress.
type LocationAttributes ¶ added in v0.5.0
type LocationAttributes struct {
City *string `json:"city,omitempty"`
Country *string `json:"country,omitempty"`
Latitude *float32 `json:"latitude,omitempty"`
Longitude *float32 `json:"longitude,omitempty"`
Name *string `json:"name,omitempty"`
State *string `json:"state,omitempty"`
TimeZone *string `json:"time_zone,omitempty"`
}
LocationAttributes defines model for LocationAttributes.
type LocationDetail ¶ added in v0.5.0
type LocationDetail struct {
Data LocationResource `json:"data"`
Included []LocationResource `json:"included,omitempty"`
Meta *LocationMeta `json:"meta,omitempty"`
}
LocationDetail defines model for LocationDetail.
type LocationGroup ¶ added in v0.5.0
LocationGroup defines model for LocationGroup.
type LocationGroupDevices ¶ added in v0.5.0
type LocationGroupDevices struct {
Groups []LocationGroup `json:"groups"`
}
LocationGroupDevices defines model for LocationGroupDevices.
type LocationGroups ¶ added in v0.5.0
type LocationGroups struct {
DeviceGroups []LocationGroup `json:"device_groups,omitempty"`
IsOwner *bool `json:"is_owner,omitempty"`
}
LocationGroups defines model for LocationGroups.
type LocationList ¶ added in v0.5.0
type LocationList struct {
Locations []LocationSummary `json:"user_locations"`
}
LocationList SDK projection; OperationSets is derived outside JSON.
type LocationMeta ¶ added in v0.5.0
LocationMeta defines model for LocationMeta.
type LocationResource ¶ added in v0.5.0
type LocationResource struct {
Attributes *LocationAttributes `json:"attributes,omitempty"`
ID string `json:"id"`
Type LocationResourceType `json:"type"`
}
LocationResource defines model for LocationResource.
type LocationResourceType ¶ added in v0.5.0
type LocationResourceType = ringtypes.LocationResourceType
LocationResourceType defines model for LocationResourceType.
type LocationSummary ¶ added in v0.5.0
type LocationSummary struct {
Address *LocationAddress `json:"address,omitempty"`
GeoCoordinates *GeoCoordinates `json:"geo_coordinates,omitempty"`
IsOwner *bool `json:"is_owner,omitempty"`
ID string `json:"location_id"`
LocationType *string `json:"location_type,omitempty"`
Name string `json:"name"`
OwnerID *int64 `json:"owner_id,omitempty"`
}
LocationSummary defines model for LocationSummary.
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 OwnerID ¶ added in v0.5.0
OwnerID Numeric or text vendor owner identifier normalized to text by the SDK adapter.
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 RecordingStatus ¶ added in v0.5.0
type RecordingStatus = ringtypes.RecordingStatus
RecordingStatus defines model for RecordingStatus.
type Requires2FAError ¶
type Requires2FAError = ringerrors.Requires2FAError
func NewRequires2FAError ¶
func NewRequires2FAError(message string) *Requires2FAError
type SoundKind ¶
type SoundKind string
SoundKind Accepted legacy chime test sounds.
Defines values for SoundKind.
type TimelineDevice ¶ added in v0.5.0
type TimelineDevice struct {
Description *string `json:"description,omitempty"`
ID *int64 `json:"id,omitempty"`
Type *string `json:"type,omitempty"`
}
TimelineDevice defines model for TimelineDevice.
type TimelineEvent ¶ added in v0.5.0
type TimelineEvent struct {
Device *TimelineDevice `json:"device,omitempty"`
DurationMS *int `json:"duration_ms,omitempty"`
EndTime *time.Time `json:"end_time,omitempty"`
ID string `json:"event_id"`
Type TimelineEventType `json:"event_type"`
IsFavorite *bool `json:"is_favorite,omitempty"`
RecordingStatus *RecordingStatus `json:"recording_status,omitempty"`
Schema *string `json:"schema,omitempty"`
SourceID *string `json:"source_id,omitempty"`
StartTime time.Time `json:"start_time"`
State *TimelineState `json:"state,omitempty"`
}
TimelineEvent defines model for TimelineEvent.
type TimelineEventType ¶ added in v0.5.0
type TimelineEventType = ringtypes.TimelineEventType
TimelineEventType defines model for TimelineEventType.
type TimelineState ¶ added in v0.5.0
type TimelineState = ringtypes.TimelineState
TimelineState defines model for TimelineState.
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 VideoRenderingFeature ¶ added in v0.5.0
type VideoRenderingFeature struct {
MaxDigitalZoomLevel *float32 `json:"max_digital_zoom_level,omitempty"`
}
VideoRenderingFeature defines model for VideoRenderingFeature.
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.