Documentation
¶
Index ¶
- type Client
- func (c *Client) GetDevice() DeviceDTO
- func (c *Client) GetDeviceURL() (string, error)
- func (c *Client) GetWebSocketURL() (string, error)
- func (c *Client) IsRegistered() bool
- func (c *Client) OnRegistered(callback func())
- func (c *Client) Refresh() error
- func (c *Client) Register() error
- func (c *Client) Unregister() error
- func (c *Client) WaitForRegistration(timeout time.Duration) error
- type Config
- type DeviceDTO
- type DeviceResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the Device API client
func (*Client) GetDeviceURL ¶
GetDeviceURL returns the device URL
func (*Client) GetWebSocketURL ¶
GetWebSocketURL returns the WebSocket URL for Mercury connections
func (*Client) IsRegistered ¶
IsRegistered returns true if the device is registered
func (*Client) OnRegistered ¶
func (c *Client) OnRegistered(callback func())
OnRegistered registers a callback function to be called when the device is registered
func (*Client) Unregister ¶
Unregister unregisters a device with Webex
type Config ¶
type Config struct {
// Ephemeral determines if the device is temporary and should be refreshed
Ephemeral bool
// EphemeralDeviceTTL is the time to live for ephemeral devices in seconds
EphemeralDeviceTTL int
// DeviceType specifies the type of device
DeviceType string
// DefaultHeaders to include in requests
DefaultHeaders map[string]string
// DefaultBody to include in requests
DefaultBody map[string]interface{}
// WDMURL is the base URL for the Webex Device Management service.
// Default: https://wdm-a.wbx2.com/wdm/api/v1/devices
WDMURL string
}
Config holds the configuration for the Device plugin
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns the default configuration for the Device plugin
type DeviceDTO ¶
type DeviceDTO struct {
URL string `json:"url,omitempty"` // Device URL for refresh/unregister operations
WebSocketURL string `json:"webSocketUrl,omitempty"` // Mercury WebSocket URL for real-time events
UserID string `json:"userId,omitempty"` // Webex user ID associated with this device
DeviceType string `json:"deviceType,omitempty"` // Device type (e.g., "TEAMS_SDK_JS")
IntranetInactivityDuration int `json:"intranetInactivityDuration,omitempty"` // Intranet inactivity timeout in seconds
InNetworkInactivityDuration int `json:"inNetworkInactivityDuration,omitempty"` // In-network inactivity timeout in seconds
ModificationTime string `json:"modificationTime,omitempty"` // Last modification timestamp
Services interface{} `json:"services,omitempty"` // Service catalog (v1 format)
ServiceHostMap interface{} `json:"serviceHostMap,omitempty"` // Service host catalog including Mobius endpoints
ClientMessagingGiphy string `json:"clientMessagingGiphy,omitempty"` // Giphy messaging setting
ETag string `json:"-"` // HTTP ETag for conditional refresh requests
}
DeviceDTO represents the full device information returned by the WDM service. It captures all fields from the registration response, including service host mappings used for Mobius discovery and Mercury WebSocket URLs.
type DeviceResponse ¶
DeviceResponse represents the response from the device registration