Documentation ¶
Index ¶
- Variables
- func CacheExpires(r *http.Response) time.Time
- type APIClient
- type APIKey
- type APIResponse
- type Action
- type ActionType
- type AppLifecycle
- type BasicAuth
- type BasicBackgroundImage
- type BasicBody
- type BasicButton
- type BasicButtonPosition
- type BasicButtonType
- type BasicCard
- type BasicIconButton
- type BasicImage
- type BasicImagePosition
- type BasicText
- type BasicTextButton
- type BasicV2Body
- type BasicV2Button
- type BasicV2Card
- type BasicV2IconButton
- type BasicV2Image
- type BasicV2ImageItem
- type BasicV2Item
- type BasicV2Text
- type BasicV2TextButton
- type BooleanSetting
- type BooleanSettingAllOf
- type ClientDetails
- type ConfigEntry
- type Configuration
- type ConfigurationData
- type ConfigurationPhase
- type ConfigurationResponseData
- type ConfirmationData
- type DashboardCard
- type DashboardCardTemplate
- type DashboardData
- type DashboardResponseData
- type DecimalSetting
- type DecimalSettingAllOf
- type DefaultApiService
- type DeviceCommandsEvent
- type DeviceCommandsEventCommand
- type DeviceConfig
- type DeviceEvent
- type DeviceHealthEvent
- type DeviceLifecycle
- type DeviceLifecycleEvent
- type DeviceLifecycleMove
- type DeviceSetting
- type DeviceSettingAllOf
- type EmailSetting
- type EnumSetting
- type EnumSettingAllOf
- type EnumStyleType
- type Event
- type EventData
- type EventType
- type ExecuteAction
- type ExecuteData
- type ExecutionRequest
- type ExecutionResponse
- type FreeFormCard
- type GenericOpenAPIError
- type GroupedOption
- type ImageSetting
- type ImagesSetting
- type ImagesSettingAllOf
- type InitializeSetting
- type InitializeSettingAllOf
- type InstallData
- type InstalledApp
- type LaunchPluginAction
- type LinkSetting
- type LinkSettingAllOf
- type LinkStyleType
- type MessageConfig
- type ModeConfig
- type ModeEvent
- type ModeSetting
- type ModeSettingAllOf
- type NumberSetting
- type NumberSettingAllOf
- type OAuthCallbackData
- type OAuthSetting
- type OAuthSettingAllOf
- type Option
- type Page
- type PageSetting
- type PageSettingAllOf
- type ParagraphSetting
- type PasswordSetting
- type PasswordSettingAllOf
- type PhoneSetting
- type PhoneSettingAllOf
- type PingData
- type PingResponseData
- type SceneConfig
- type SceneLifecycle
- type SceneLifecycleEvent
- type SceneSetting
- type SceneSettingAllOf
- type Section
- type SectionSetting
- type SectionSettingAllOf
- type SectionSettingInterface
- type SecurityArmStateEvent
- type ServerConfiguration
- type ServerVariable
- type Setting
- type SettingType
- type SimpleValue
- type StringConfig
- type StyleType
- type TextSetting
- type TextSettingAllOf
- type TimeSetting
- type TimeSettingAllOf
- type TimerEvent
- type TimerType
- type UninstallData
- type UpdateData
- type VideoSetting
- type VideoSettingAllOf
Constants ¶
This section is empty.
Variables ¶
var ( // ContextOAuth2 takes an oauth2.TokenSource as authentication for the request. ContextOAuth2 = contextKey("token") // ContextBasicAuth takes BasicAuth as authentication for the request. ContextBasicAuth = contextKey("basic") // ContextAccessToken takes a string oauth2 access token as authentication for the request. ContextAccessToken = contextKey("accesstoken") // ContextAPIKey takes an APIKey as authentication for the request ContextAPIKey = contextKey("apikey") )
Functions ¶
Types ¶
type APIClient ¶
type APIClient struct { DefaultApi *DefaultApiService // contains filtered or unexported fields }
APIClient manages communication with the SmartThings SmartApps API API vv1.0.3 In most cases there should be only one, shared, APIClient.
func NewAPIClient ¶
func NewAPIClient(cfg *Configuration) *APIClient
NewAPIClient creates a new API client. Requires a userAgent string describing your application. optionally a custom http.Client to allow for advanced features such as caching.
func (*APIClient) ChangeBasePath ¶
ChangeBasePath changes base path to allow switching to mocks
func (*APIClient) GetConfig ¶
func (c *APIClient) GetConfig() *Configuration
Allow modification of underlying config for alternate implementations and testing Caution: modifying the configuration while live can cause data races and potentially unwanted behavior
type APIKey ¶
APIKey provides API key based authentication to a request passed via context using ContextAPIKey
type APIResponse ¶
type APIResponse struct { *http.Response `json:"-"` Message string `json:"message,omitempty"` // Operation is the name of the OpenAPI operation. Operation string `json:"operation,omitempty"` // RequestURL is the request URL. This value is always available, even if the // embedded *http.Response is nil. RequestURL string `json:"url,omitempty"` // Method is the HTTP method used for the request. This value is always // available, even if the embedded *http.Response is nil. Method string `json:"method,omitempty"` // Payload holds the contents of the response body (which may be nil or empty). // This is provided here as the raw response.Body() reader will have already // been drained. Payload []byte `json:"-"` }
APIResponse stores the API response returned by the server.
func NewAPIResponse ¶
func NewAPIResponse(r *http.Response) *APIResponse
NewAPIResponse returns a new APIResonse object.
func NewAPIResponseWithError ¶
func NewAPIResponseWithError(errorMessage string) *APIResponse
NewAPIResponseWithError returns a new APIResponse object with the provided error message.
type Action ¶
type Action struct { Type ActionType `json:"type,omitempty"` LaunchPlugin LaunchPluginAction `json:"launchPlugin,omitempty"` Execute ExecuteAction `json:"execute,omitempty"` }
Action A definition of the action to be taken when button is activated.
type ActionType ¶
type ActionType string
ActionType The type of action to take when UI element is activated. * LAUNCH_PLUGIN - Launch a corresponding UI plugin. * EXECUTE - Execute an API call to the backing SmartApp.
const ( ACTIONTYPE_LAUNCH_PLUGIN ActionType = "LAUNCH_PLUGIN" ACTIONTYPE_EXECUTE ActionType = "EXECUTE" )
List of ActionType
type AppLifecycle ¶
type AppLifecycle string
AppLifecycle Every invocation of a SmartApp is associated to a specific lifecycle event. These lifecycles include: * INSTALL - Lifecycle that will be invoked once at the time of installation of a SmartApp. * UPDATE - Invoked when a user modifies the configuration values assigned to the SmartApp. * UNINSTALL - A clean up lifecycle invoked upon the deletion of an SmartApp from a user's account. * EVENT - Lifecycle event used when the SmartApp is invoked as the result of a subscription or schedule. * PING - Lifecycle used during App creation to verify connectivity, and ownership of a particular target. * CONFIGURATION - Lifecycle used to drive the UX during the installation process of a SmartApp into a user's account. * OAUTH_CALLBACK - Lifecycle used for integrations that implement a third-party OAuth out. * CONFIRMATION - Lifecycle used to send confirmation link to a SmartApp for ownership validation.
const ( APPLIFECYCLE_INSTALL AppLifecycle = "INSTALL" APPLIFECYCLE_UPDATE AppLifecycle = "UPDATE" APPLIFECYCLE_UNINSTALL AppLifecycle = "UNINSTALL" APPLIFECYCLE_EVENT AppLifecycle = "EVENT" APPLIFECYCLE_PING AppLifecycle = "PING" APPLIFECYCLE_CONFIGURATION AppLifecycle = "CONFIGURATION" APPLIFECYCLE_OAUTH_CALLBACK AppLifecycle = "OAUTH_CALLBACK" APPLIFECYCLE_CONFIRMATION AppLifecycle = "CONFIRMATION" )
List of AppLifecycle
type BasicAuth ¶
type BasicAuth struct { UserName string `json:"userName,omitempty"` Password string `json:"password,omitempty"` }
BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth
type BasicBackgroundImage ¶
type BasicBackgroundImage struct { // URL of image. HTTPS url is required. Url string `json:"url,omitempty"` // some color code Color string `json:"color,omitempty"` // transparency of the color/image Alpha float32 `json:"alpha,omitempty"` }
BasicBackgroundImage A background image.
type BasicBody ¶
type BasicBody struct { Image BasicImage `json:"image,omitempty"` Text BasicText `json:"text,omitempty"` }
BasicBody Body definition for a Basic V1 template.
type BasicButton ¶
type BasicButton struct { Type BasicButtonType `json:"type,omitempty"` TextButton BasicTextButton `json:"textButton,omitempty"` IconButton BasicIconButton `json:"iconButton,omitempty"` }
BasicButton A button definition for a Basic V1 template.
type BasicButtonPosition ¶
type BasicButtonPosition string
BasicButtonPosition Position of where the button should be rendered within card.
const ( BASICBUTTONPOSITION_LEFT BasicButtonPosition = "LEFT" BASICBUTTONPOSITION_CENTER BasicButtonPosition = "CENTER" BASICBUTTONPOSITION_RIGHT BasicButtonPosition = "RIGHT" )
List of BasicButtonPosition
type BasicButtonType ¶
type BasicButtonType string
BasicButtonType The type of buttons to render. * TEXT - A colored button with a text overrlay. * ICON - A button with an image backgroup and text overrlay.
const ( BASICBUTTONTYPE_TEXT BasicButtonType = "TEXT" BASICBUTTONTYPE_ICON BasicButtonType = "ICON" )
List of BasicButtonType
type BasicCard ¶
type BasicCard struct { // name of the card Name string `json:"name,omitempty"` // A title icon url for card. Angit HTTPS URL is required. IconUrl string `json:"iconUrl,omitempty"` BgImage BasicBackgroundImage `json:"bgImage,omitempty"` Body BasicBody `json:"body,omitempty"` // A list of buttons to render and buttons must be of the same type. Buttons []BasicButton `json:"buttons,omitempty"` }
BasicCard Data requirements for a Basic V1 card template.
type BasicIconButton ¶
type BasicIconButton struct { // The name of the button Name string `json:"name,omitempty"` Position BasicButtonPosition `json:"position,omitempty"` Action Action `json:"action,omitempty"` // A default icon image url. HTTPS url required. IconUrl string `json:"iconUrl,omitempty"` }
BasicIconButton A text button definition for a basic template.
type BasicImage ¶
type BasicImage struct { // An icon name. Name string `json:"name,omitempty"` Position BasicImagePosition `json:"position,omitempty"` // URL of image. HTTPS url is required. Url string `json:"url,omitempty"` }
BasicImage struct for BasicImage
type BasicImagePosition ¶
type BasicImagePosition string
BasicImagePosition Position of where the image should be rendered within card.
const ( BASICIMAGEPOSITION_LEFT BasicImagePosition = "LEFT" BASICIMAGEPOSITION_CENTER BasicImagePosition = "CENTER" BASICIMAGEPOSITION_RIGHT BasicImagePosition = "RIGHT" )
List of BasicImagePosition
type BasicText ¶
type BasicText struct { // Text to display. Content string `json:"content,omitempty"` }
BasicText A text object.
type BasicTextButton ¶
type BasicTextButton struct { // The name of the button Name string `json:"name,omitempty"` Position BasicButtonPosition `json:"position,omitempty"` Action Action `json:"action,omitempty"` }
BasicTextButton A text button definition for a basic template.
type BasicV2Body ¶
type BasicV2Body struct { Image BasicV2Image `json:"image,omitempty"` // Body item array definition for a Basic V2 template Items []BasicV2Item `json:"items,omitempty"` Text BasicV2Text `json:"text,omitempty"` }
BasicV2Body Body definition for a Basic V2 template.
type BasicV2Button ¶
type BasicV2Button struct { Type BasicButtonType `json:"type,omitempty"` TextButton BasicV2TextButton `json:"textButton,omitempty"` IconButton BasicV2IconButton `json:"iconButton,omitempty"` }
BasicV2Button A button definition for a Basic V2 template.
type BasicV2Card ¶
type BasicV2Card struct { // An title icon url for card. A HTTPS URL is required. IconUrl string `json:"iconUrl,omitempty"` // name of the card Name string `json:"name,omitempty"` // sublined text of the card Description string `json:"description,omitempty"` BgImage BasicBackgroundImage `json:"bgImage,omitempty"` Body BasicV2Body `json:"body,omitempty"` // A list of buttons to render and buttons must be of the same type. Buttons []BasicV2Button `json:"buttons,omitempty"` }
BasicV2Card Data requirements for a Basic V2 card template.
type BasicV2IconButton ¶
type BasicV2IconButton struct { // The name of the button Name string `json:"name,omitempty"` // An icon image url on button-released. HTTPS url required. ReleasedIconUrl string `json:"releasedIconUrl,omitempty"` // An icon image url on button-pressed. HTTPS url required. PressedIconUrl string `json:"pressedIconUrl,omitempty"` Action Action `json:"action,omitempty"` }
BasicV2IconButton A text button definition for a basic V2 template.
type BasicV2Image ¶
type BasicV2Image struct { Position BasicImagePosition `json:"position,omitempty"` // URL of image. HTTPS url is required. Url string `json:"url,omitempty"` Action Action `json:"action,omitempty"` }
BasicV2Image struct for BasicV2Image
type BasicV2ImageItem ¶
type BasicV2ImageItem struct { // URL of image. HTTPS url is required. Url string `json:"url,omitempty"` // The text that would be shown under image Description string `json:"description,omitempty"` BgImage BasicBackgroundImage `json:"bgImage,omitempty"` Action Action `json:"action,omitempty"` }
BasicV2ImageItem Body item object definition for a Basic V2 template
type BasicV2Item ¶
type BasicV2Item struct {
Item BasicV2ImageItem `json:"item,omitempty"`
}
BasicV2Item Item in Basic V2 items
type BasicV2Text ¶
type BasicV2Text struct { // Text to display. Content string `json:"content,omitempty"` Action Action `json:"action,omitempty"` }
BasicV2Text A text object.
type BasicV2TextButton ¶
type BasicV2TextButton struct { // The name of the button Name string `json:"name,omitempty"` Action Action `json:"action,omitempty"` }
BasicV2TextButton A text button definition for a basic V2 template.
type BooleanSetting ¶
type BooleanSetting struct { // A developer defined configuration ID. Id string `json:"id,omitempty"` // Name of the setting to be configured. Name string `json:"name,omitempty"` // Description of the app to be configured. Description string `json:"description,omitempty"` // Indicates if this setting is required for configuration. Required bool `json:"required,omitempty"` // Indicates if this setting should be disabled Disabled bool `json:"disabled,omitempty"` Type SettingType `json:"type"` // A default value for the setting. DefaultValue string `json:"defaultValue,omitempty"` // The image url. Image string `json:"image,omitempty"` // Indicates if this input should refresh configs after a change in value. SubmitOnChange bool `json:"submitOnChange,omitempty"` }
BooleanSetting Boolean Setting
type BooleanSettingAllOf ¶
type BooleanSettingAllOf struct { // A default value for the setting. DefaultValue string `json:"defaultValue,omitempty"` // The image url. Image string `json:"image,omitempty"` // Indicates if this input should refresh configs after a change in value. SubmitOnChange bool `json:"submitOnChange,omitempty"` }
BooleanSettingAllOf struct for BooleanSettingAllOf
type ClientDetails ¶
type ClientDetails struct { // The operating system of the client application initiating the request. Os string `json:"os,omitempty"` // The version of the client application initiating the request. Version string `json:"version,omitempty"` // Language header representing the client's preferred language. The format of the `Accept-Language` header follows what is defined in [RFC 7231, section 5.3.5](https://tools.ietf.org/html/rfc7231#section-5.3.5) Language string `json:"language,omitempty"` // Templates that could be renderable in the client SupportedTemplates []string `json:"supportedTemplates,omitempty"` }
ClientDetails Known details about the client application from which the request was initiated. This information is provided on best effort basis. All properties maybe null or empty.
type ConfigEntry ¶
type ConfigEntry struct { // The value type. * A valueType of STRING will have a stringConfig field present. * A valueType of DEVICE will have a deviceConfig field present. * A valueType of MODE will have a modeConfig field present. * A valueType of SCENE will have a sceneConfig field present. * A valueType of MESSAGE will have a messageConfig field present. ValueType string `json:"valueType,omitempty"` StringConfig StringConfig `json:"stringConfig,omitempty"` DeviceConfig DeviceConfig `json:"deviceConfig,omitempty"` ModeConfig ModeConfig `json:"modeConfig,omitempty"` SceneConfig SceneConfig `json:"sceneConfig,omitempty"` MessageConfig MessageConfig `json:"messageConfig,omitempty"` }
ConfigEntry A configuration value type and the correspodning configuration.
type Configuration ¶
type Configuration struct { BasePath string `json:"basePath,omitempty"` Host string `json:"host,omitempty"` Scheme string `json:"scheme,omitempty"` DefaultHeader map[string]string `json:"defaultHeader,omitempty"` UserAgent string `json:"userAgent,omitempty"` Debug bool `json:"debug,omitempty"` Servers []ServerConfiguration HTTPClient *http.Client }
Configuration stores the configuration of the API client
func NewConfiguration ¶
func NewConfiguration() *Configuration
NewConfiguration returns a new Configuration object
func (*Configuration) AddDefaultHeader ¶
func (c *Configuration) AddDefaultHeader(key string, value string)
AddDefaultHeader adds a new HTTP header to the default header in the request
type ConfigurationData ¶
type ConfigurationData struct { // The id of the installed app. InstalledAppId string `json:"installedAppId,omitempty"` Phase ConfigurationPhase `json:"phase"` // A developer defined page ID. Must be URL safe characters. PageId string `json:"pageId,omitempty"` // The previous page the user completed. Must be URL safe characters. PreviousPageId string `json:"previousPageId,omitempty"` // A map of configurations for an Installed App. The map 'key' is the configuration name and the 'value' is an array of strings. Config map[string][]ConfigEntry `json:"config,omitempty"` }
ConfigurationData A request for a pages flow to drive app installation. This will only be available for executions of type \"CONFIGURATION\".
type ConfigurationPhase ¶
type ConfigurationPhase string
ConfigurationPhase Denotes the current installation phase.
const ( CONFIGURATIONPHASE_INITIALIZE ConfigurationPhase = "INITIALIZE" CONFIGURATIONPHASE_PAGE ConfigurationPhase = "PAGE" )
List of ConfigurationPhase
type ConfigurationResponseData ¶
type ConfigurationResponseData struct { Initialize InitializeSetting `json:"initialize,omitempty"` Page Page `json:"page,omitempty"` }
ConfigurationResponseData Expected response for a Configuration lifecycle execution. ConfigurationResponseData follows a compositional structure. * When a request is made for the INITIALIZE phase, a InitializeInstall model should be returned. * When a request is made for the PAGE phase, a Page model should be returned.
type ConfirmationData ¶
type ConfirmationData struct { // A globally unique identifier for an app. AppId string `json:"appId,omitempty"` // An HTTPS url that may be visted to confirm / activate an App registration. ConfirmationUrl string `json:"confirmationUrl,omitempty"` }
ConfirmationData A request to send a confirmation link to a SmartApp for ownership validation. type: object
type DashboardCard ¶
type DashboardCard struct { TemplateId DashboardCardTemplate `json:"templateId"` // A unique identifier for a card of service CardId string `json:"cardId"` BasicV1 BasicCard `json:"basicV1,omitempty"` BasicV2 BasicV2Card `json:"basicV2,omitempty"` FreeForm FreeFormCard `json:"freeForm,omitempty"` }
DashboardCard payload of dashboard card
type DashboardCardTemplate ¶
type DashboardCardTemplate string
DashboardCardTemplate A directive to the SmartThings client to use a specific template for rendering the dashboard card. Each card template may have a different set requirement for data needs. * BASIC_V1 - The basic / default template. * FREE_FORM - A free form template with minimal constraints.
const ( DASHBOARDCARDTEMPLATE_BASIC_V1 DashboardCardTemplate = "BASIC_V1" DASHBOARDCARDTEMPLATE_BASIC_V2 DashboardCardTemplate = "BASIC_V2" DASHBOARDCARDTEMPLATE_FREE_FORM DashboardCardTemplate = "FREE_FORM" )
List of DashboardCardTemplate
type DashboardData ¶
type DashboardData struct { // An OAuth token to use when calling into SmartThings API's. AuthToken string `json:"authToken"` InstalledApp InstalledApp `json:"installedApp"` }
DashboardData The data payload to an execution request with an AppLifecycle of DASHBOARD.
type DashboardResponseData ¶
type DashboardResponseData struct { // A unique identifier for a card of service ServiceName string `json:"serviceName,omitempty"` // list of card object Cards []DashboardCard `json:"cards,omitempty"` }
DashboardResponseData Expected response for a Dashboard lifecycle execution.
type DecimalSetting ¶
type DecimalSetting struct { // A developer defined configuration ID. Id string `json:"id,omitempty"` // Name of the setting to be configured. Name string `json:"name,omitempty"` // Description of the app to be configured. Description string `json:"description,omitempty"` // Indicates if this setting is required for configuration. Required bool `json:"required,omitempty"` // Indicates if this setting should be disabled Disabled bool `json:"disabled,omitempty"` Type SettingType `json:"type"` // A default value for the setting. DefaultValue string `json:"defaultValue,omitempty"` // The maximum inclusive value the decimal can be set to. Max int32 `json:"max,omitempty"` // The minumum inclusive value the decimal can be set to. Min int32 `json:"min,omitempty"` // The image url. Image string `json:"image,omitempty"` // A string to be shown after the text input field. PostMessage string `json:"postMessage,omitempty"` }
DecimalSetting DECIMAL Setting
type DecimalSettingAllOf ¶
type DecimalSettingAllOf struct { // A default value for the setting. DefaultValue string `json:"defaultValue,omitempty"` // The maximum inclusive value the decimal can be set to. Max int32 `json:"max,omitempty"` // The minumum inclusive value the decimal can be set to. Min int32 `json:"min,omitempty"` // The image url. Image string `json:"image,omitempty"` // A string to be shown after the text input field. PostMessage string `json:"postMessage,omitempty"` }
DecimalSettingAllOf struct for DecimalSettingAllOf
type DefaultApiService ¶
type DefaultApiService service
DefaultApiService DefaultApi service
func (*DefaultApiService) Execute ¶
func (a *DefaultApiService) Execute(ctx _context.Context, executionRequest ExecutionRequest) (ExecutionResponse, *_nethttp.Response, error)
Execute Execute a third-party SmartApp. Execute a SmartThings SmartApp. Each SmartThings app execution is expected to contain the information outlined in the ExecutionRequest.
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param executionRequest
@return ExecutionResponse
type DeviceCommandsEvent ¶
type DeviceCommandsEvent struct { // The id of the event. EventId string `json:"eventId,omitempty"` // The guid of the device that the commands are for. DeviceId string `json:"deviceId,omitempty"` // The device profile ID of the device instance. ProfileId string `json:"profileId,omitempty"` // The external ID that was set during install of a device. ExternalId string `json:"externalId,omitempty"` Commands []DeviceCommandsEventCommand `json:"commands,omitempty"` }
DeviceCommandsEvent An event that contains commands for devices that were created by this app.
type DeviceCommandsEventCommand ¶
type DeviceCommandsEventCommand struct { ComponentId string `json:"componentId,omitempty"` Capability string `json:"capability,omitempty"` Command string `json:"command,omitempty"` Arguments []map[string]interface{} `json:"arguments,omitempty"` }
DeviceCommandsEventCommand struct for DeviceCommandsEventCommand
type DeviceConfig ¶
type DeviceConfig struct { // The ID of the device. DeviceId string `json:"deviceId,omitempty"` // The component ID on the device. ComponentId string `json:"componentId,omitempty"` }
DeviceConfig A device configuration.
type DeviceEvent ¶
type DeviceEvent struct { // The ID of the event. EventId string `json:"eventId,omitempty"` // The ID of the location in which the event was triggered. LocationId string `json:"locationId,omitempty"` // The ID of the device associated with the DEVICE_EVENT. DeviceId string `json:"deviceId,omitempty"` // The name of the component on the device that the event is associated with. ComponentId string `json:"componentId,omitempty"` // The name of the capability associated with the DEVICE_EVENT. Capability string `json:"capability,omitempty"` // The name of the DEVICE_EVENT. This typically corresponds to an attribute name of the device-handler’s capabilities. Attribute string `json:"attribute,omitempty"` // The value of the event. The type of the value is dependent on the capability's attribute type. Value map[string]interface{} `json:"value,omitempty"` // The root level data type of the value field. The data types are representitive of standard JSON data types. ValueType string `json:"valueType,omitempty"` // Whether or not the state of the device has changed as a result of the DEVICE_EVENT. StateChange bool `json:"stateChange,omitempty"` // json map as defined by capability data schema Data map[string]interface{} `json:"data,omitempty"` // The name of subscription that caused delivery. SubscriptionName string `json:"subscriptionName,omitempty"` }
DeviceEvent An event on a device that matched a subscription for this app.
type DeviceHealthEvent ¶
type DeviceHealthEvent struct { // The id of the event. EventId string `json:"eventId,omitempty"` // The id of the location in which the event was triggered. LocationId string `json:"locationId,omitempty"` // The id of the device. DeviceId string `json:"deviceId,omitempty"` // The id of the hub. HubId string `json:"hubId,omitempty"` // The status of the device. Status string `json:"status,omitempty"` // The reason the device is offline. Reason string `json:"reason,omitempty"` }
DeviceHealthEvent An event that represents a change in the health of the a device.
type DeviceLifecycle ¶
type DeviceLifecycle string
DeviceLifecycle The device lifecycle. The lifecycle will be one of: * CREATE - Invoked when a device is created. * DELETE - Invoked when a device is deleted. * UPDATE - Invoked when a device is updated. * MOVE_FROM - Invoked when a device is moved from a location. * MOVE_TO - Invoked when a device is moved to a location.
const ( DEVICELIFECYCLE_CREATE DeviceLifecycle = "CREATE" DEVICELIFECYCLE_DELETE DeviceLifecycle = "DELETE" DEVICELIFECYCLE_UPDATE DeviceLifecycle = "UPDATE" DEVICELIFECYCLE_MOVE_FROM DeviceLifecycle = "MOVE_FROM" DEVICELIFECYCLE_MOVE_TO DeviceLifecycle = "MOVE_TO" )
List of DeviceLifecycle
type DeviceLifecycleEvent ¶
type DeviceLifecycleEvent struct { Lifecycle DeviceLifecycle `json:"lifecycle,omitempty"` // The id of the event. EventId string `json:"eventId,omitempty"` // The id of the location in which the event was triggered. LocationId string `json:"locationId,omitempty"` // The id of the device. DeviceId string `json:"deviceId,omitempty"` // The name of the device DeviceName string `json:"deviceName,omitempty"` // The principal that made the change Principal string `json:"principal,omitempty"` // Create device lifecycle. Create map[string]interface{} `json:"create,omitempty"` // Delete device lifecycle. Delete map[string]interface{} `json:"delete,omitempty"` // Update device lifecycle. Update map[string]interface{} `json:"update,omitempty"` MoveFrom DeviceLifecycleMove `json:"moveFrom,omitempty"` MoveTo DeviceLifecycleMove `json:"moveTo,omitempty"` }
DeviceLifecycleEvent A device lifecycle event.
type DeviceLifecycleMove ¶
type DeviceLifecycleMove struct {
LocationId string `json:"locationId,omitempty"`
}
DeviceLifecycleMove Move device lifecycle.
type DeviceSetting ¶
type DeviceSetting struct { // A developer defined configuration ID. Id string `json:"id,omitempty"` // Name of the setting to be configured. Name string `json:"name,omitempty"` // Description of the app to be configured. Description string `json:"description,omitempty"` // Indicates if this setting is required for configuration. Required bool `json:"required,omitempty"` // Indicates if this setting should be disabled Disabled bool `json:"disabled,omitempty"` Type SettingType `json:"type"` // A default value for the setting. DefaultValue string `json:"defaultValue,omitempty"` // Indicates if this device setting can have multiple values. Multiple bool `json:"multiple,omitempty"` // Indicates if this input should close on selection. CloseOnSelection bool `json:"closeOnSelection,omitempty"` // Indicates if this input should refresh configs after a change in value. SubmitOnChange bool `json:"submitOnChange,omitempty"` // Indicates if the first device in the list of options should be pre selected. Preselect bool `json:"preselect,omitempty"` // The required capabilities for the device(s) options. Capabilities []string `json:"capabilities,omitempty"` // The excluded capabilities for the device(s) options. ExcludeCapabilities []string `json:"excludeCapabilities,omitempty"` // The required permissions for the selected device(s). Permissions []string `json:"permissions,omitempty"` Style StyleType `json:"style,omitempty"` }
DeviceSetting Device Setting
type DeviceSettingAllOf ¶
type DeviceSettingAllOf struct { // A default value for the setting. DefaultValue string `json:"defaultValue,omitempty"` // Indicates if this device setting can have multiple values. Multiple bool `json:"multiple,omitempty"` // Indicates if this input should close on selection. CloseOnSelection bool `json:"closeOnSelection,omitempty"` // Indicates if this input should refresh configs after a change in value. SubmitOnChange bool `json:"submitOnChange,omitempty"` // Indicates if the first device in the list of options should be pre selected. Preselect bool `json:"preselect,omitempty"` // The required capabilities for the device(s) options. Capabilities []string `json:"capabilities,omitempty"` // The excluded capabilities for the device(s) options. ExcludeCapabilities []string `json:"excludeCapabilities,omitempty"` // The required permissions for the selected device(s). Permissions []string `json:"permissions,omitempty"` Style StyleType `json:"style,omitempty"` }
DeviceSettingAllOf struct for DeviceSettingAllOf
type EmailSetting ¶
type EmailSetting struct { // A developer defined configuration ID. Id string `json:"id,omitempty"` // Name of the setting to be configured. Name string `json:"name,omitempty"` // Description of the app to be configured. Description string `json:"description,omitempty"` // Indicates if this setting is required for configuration. Required bool `json:"required,omitempty"` // Indicates if this setting should be disabled Disabled bool `json:"disabled,omitempty"` Type SettingType `json:"type"` // A default value for the setting. DefaultValue string `json:"defaultValue,omitempty"` // The image url. Image string `json:"image,omitempty"` }
EmailSetting Email Setting
type EnumSetting ¶
type EnumSetting struct { // A developer defined configuration ID. Id string `json:"id,omitempty"` // Name of the setting to be configured. Name string `json:"name,omitempty"` // Description of the app to be configured. Description string `json:"description,omitempty"` // Indicates if this setting is required for configuration. Required bool `json:"required,omitempty"` // Indicates if this setting should be disabled Disabled bool `json:"disabled,omitempty"` Type SettingType `json:"type"` // A default value for the setting. DefaultValue string `json:"defaultValue,omitempty"` // Indicates if this enum setting can have multiple values. Multiple bool `json:"multiple,omitempty"` // Indicates if this input should close on selection. CloseOnSelection bool `json:"closeOnSelection,omitempty"` // Display the enum options as groups. GroupedOptions []GroupedOption `json:"groupedOptions,omitempty"` // The enum options. Options []Option `json:"options,omitempty"` // Indicates if this input should refresh configs after a change in value. SubmitOnChange bool `json:"submitOnChange,omitempty"` Style EnumStyleType `json:"style,omitempty"` }
EnumSetting Enum Setting
type EnumSettingAllOf ¶
type EnumSettingAllOf struct { // A default value for the setting. DefaultValue string `json:"defaultValue,omitempty"` // Indicates if this enum setting can have multiple values. Multiple bool `json:"multiple,omitempty"` // Indicates if this input should close on selection. CloseOnSelection bool `json:"closeOnSelection,omitempty"` // Display the enum options as groups. GroupedOptions []GroupedOption `json:"groupedOptions,omitempty"` // The enum options. Options []Option `json:"options,omitempty"` // Indicates if this input should refresh configs after a change in value. SubmitOnChange bool `json:"submitOnChange,omitempty"` Style EnumStyleType `json:"style,omitempty"` }
EnumSettingAllOf struct for EnumSettingAllOf
type EnumStyleType ¶
type EnumStyleType string
EnumStyleType Style of the setting.
const ( ENUMSTYLETYPE_COMPLETE EnumStyleType = "COMPLETE" ENUMSTYLETYPE_ERROR EnumStyleType = "ERROR" ENUMSTYLETYPE_DEFAULT EnumStyleType = "DEFAULT" ENUMSTYLETYPE_DROPDOWN EnumStyleType = "DROPDOWN" )
List of EnumStyleType
type Event ¶
type Event struct { // The IS0-8601 date time string in UTC that this event was created. EventTime time.Time `json:"eventTime,omitempty"` EventType EventType `json:"eventType,omitempty"` DeviceEvent DeviceEvent `json:"deviceEvent,omitempty"` DeviceLifecycleEvent DeviceLifecycleEvent `json:"deviceLifecycleEvent,omitempty"` DeviceHealthEvent DeviceHealthEvent `json:"deviceHealthEvent,omitempty"` DeviceCommandsEvent DeviceCommandsEvent `json:"deviceCommandsEvent,omitempty"` ModeEvent ModeEvent `json:"modeEvent,omitempty"` TimerEvent TimerEvent `json:"timerEvent,omitempty"` SceneLifecycleEvent SceneLifecycleEvent `json:"sceneLifecycleEvent,omitempty"` SecurityArmStateEvent SecurityArmStateEvent `json:"securityArmStateEvent,omitempty"` }
Event The event information, only populated if the execution type is EVENT.
type EventData ¶
type EventData struct { // An OAuth token to use when calling into SmartThings API's. AuthToken string `json:"authToken"` InstalledApp InstalledApp `json:"installedApp"` Events []Event `json:"events,omitempty"` }
EventData The data payload to an execution request with an AppLifecycle of EVENT.
type EventType ¶
type EventType string
EventType The type of event passed to the app being executed. The type will be one of: * DEVICE_COMMANDS_EVENT - _Only applicable for cloud-to-cloud device integration apps._ An event as a result of a device command execution request. * DEVICE_EVENT - A device event as a result of a subscription the app created. * DEVICE_HEALTH_EVENT - A device health event as a result of a change in a device's health. * DEVICE_LIFECYCLE_EVENT - A device lifecycle event as the result of a life change to the device. * MODE_EVENT - A mode event is triggered when the location's mode is changed. * SCENE_LIFECYCLE_EVENT - A scene lifecycle event as a result of a life change to the scene. * SECURITY_ARM_STATE_EVENT - A security arm state event as a result of a change in the arm state of a security system. * TIMER_EVENT - An event as a result of a scheduled app execution.
const ( EVENTTYPE_DEVICE_COMMANDS_EVENT EventType = "DEVICE_COMMANDS_EVENT" EVENTTYPE_DEVICE_EVENT EventType = "DEVICE_EVENT" EVENTTYPE_DEVICE_HEALTH_EVENT EventType = "DEVICE_HEALTH_EVENT" EVENTTYPE_DEVICE_LIFECYCLE_EVENT EventType = "DEVICE_LIFECYCLE_EVENT" EVENTTYPE_MODE_EVENT EventType = "MODE_EVENT" EVENTTYPE_SCENE_LIFECYCLE_EVENT EventType = "SCENE_LIFECYCLE_EVENT" EVENTTYPE_SECURITY_ARM_STATE_EVENT EventType = "SECURITY_ARM_STATE_EVENT" EVENTTYPE_TIMER_EVENT EventType = "TIMER_EVENT" )
List of EventType
type ExecuteAction ¶
type ExecuteAction struct { // An arbitrary map of input parameters which the SmartApp can use to build a custom response. Parameters map[string]string `json:"parameters,omitempty"` }
ExecuteAction Call the EXECUTE lifecycle on the backing SmartApp.
type ExecuteData ¶
type ExecuteData struct { // An OAuth token to use when calling into SmartThings API's. AuthToken string `json:"authToken"` InstalledApp InstalledApp `json:"installedApp"` // An arbitrary map of input parameters which the SmartApp can use to build a custom response. Parameters map[string]string `json:"parameters"` }
ExecuteData The data payload to an execution request with an AppLifecycle of EXECUTE.
type ExecutionRequest ¶
type ExecutionRequest struct { Lifecycle AppLifecycle `json:"lifecycle,omitempty"` // This is a correlation id that is assigned to the execution that is useful for support requests. ExecutionId string `json:"executionId,omitempty"` // A globally unique identifier for the application being executed. It should match the ID of the application itself. AppId string `json:"appId,omitempty"` // An IETF BCP 47 language tag representing the chosen locale for this account. Locale string `json:"locale,omitempty"` // The version of the execution's request model. Version string `json:"version,omitempty"` Client ClientDetails `json:"client,omitempty"` EventData EventData `json:"eventData,omitempty"` InstallData InstallData `json:"installData,omitempty"` UpdateData UpdateData `json:"updateData,omitempty"` UninstallData UninstallData `json:"uninstallData,omitempty"` ConfigurationData ConfigurationData `json:"configurationData,omitempty"` PingData PingData `json:"pingData,omitempty"` OauthCallbackData OAuthCallbackData `json:"oauthCallbackData,omitempty"` ExecuteData ExecuteData `json:"executeData,omitempty"` DashboardData DashboardData `json:"dashboardData,omitempty"` ConfirmationData ConfirmationData `json:"confirmationData,omitempty"` // Global settings as defined on the App. Settings map[string]string `json:"settings,omitempty"` }
ExecutionRequest The root model for all executions. An execution request is compositional in nature. Client's can expect exactly one *Data field set depending on the type of execution. For example, if execution is of type EVENT, the \"eventData\" field will be set.
type ExecutionResponse ¶
type ExecutionResponse struct { StatusCode int32 `json:"statusCode,omitempty"` // Empty object response for an Event lifecycle execution. EventData map[string]interface{} `json:"eventData,omitempty"` // Empty object response for an Install lifecycle execution. InstallData map[string]interface{} `json:"installData,omitempty"` // Empty object response for an Update lifecycle execution. UpdateData map[string]interface{} `json:"updateData,omitempty"` // Empty object response for an Uninstall lifecycle execution. UninstallData map[string]interface{} `json:"uninstallData,omitempty"` ConfigurationData ConfigurationResponseData `json:"configurationData,omitempty"` PingData PingResponseData `json:"pingData,omitempty"` // Empty object response for an OAuth Callback lifecycle execution. OauthCallbackData map[string]interface{} `json:"oauthCallbackData,omitempty"` // A custom JSON formatted response object with a maximum size of 64kb. ExecuteData map[string]interface{} `json:"executeData,omitempty"` DashboardData DashboardResponseData `json:"dashboardData,omitempty"` }
ExecutionResponse Expected response structure for an SmartApp execution. An execution response is compositional in nature. Client's should set exactly one *Data field depending on the type of execution. For example, if the execution request's lifecycle was of type EVENT, the \"eventData\" field should be returned.
type FreeFormCard ¶
type FreeFormCard struct { // An arbitrary set of key / value pairs useful for passing any custom metadata. * Supports a maximum of 5 entries. * Maximum key length: 36 Unicode characters in UTF-8 * Maximum value length: 1000 Unicode characters in UTF-8 * Allowed characters for *keys* are letters, plus the following special characters: `:`, `_` * Allowed characters for *values* are letters, whitespace, and numbers, plus the following special characters: `+`, `-`, `=`, `.`, `_`, `:`, `/` * If you need characters outside this allowed set, you can apply standard base-64 encoding. Attributes map[string]string `json:"attributes,omitempty"` }
FreeFormCard struct for FreeFormCard
type GenericOpenAPIError ¶
type GenericOpenAPIError struct {
// contains filtered or unexported fields
}
GenericOpenAPIError Provides access to the body, error and model on returned errors.
func (GenericOpenAPIError) Body ¶
func (e GenericOpenAPIError) Body() []byte
Body returns the raw bytes of the response
func (GenericOpenAPIError) Error ¶
func (e GenericOpenAPIError) Error() string
Error returns non-empty string if there was an error.
func (GenericOpenAPIError) Model ¶
func (e GenericOpenAPIError) Model() interface{}
Model returns the unpacked model of the error
type GroupedOption ¶
type GroupedOption struct { // The display name of this group of enum options. Name string `json:"name,omitempty"` // The enum options. Options []Option `json:"options,omitempty"` }
GroupedOption struct for GroupedOption
type ImageSetting ¶
type ImageSetting struct { // A developer defined configuration ID. Id string `json:"id,omitempty"` // Name of the setting to be configured. Name string `json:"name,omitempty"` // Description of the app to be configured. Description string `json:"description,omitempty"` // Indicates if this setting is required for configuration. Required bool `json:"required,omitempty"` // Indicates if this setting should be disabled Disabled bool `json:"disabled,omitempty"` Type SettingType `json:"type"` // A default value for the setting. DefaultValue string `json:"defaultValue,omitempty"` // The image url. Image string `json:"image,omitempty"` }
ImageSetting Image Setting
type ImagesSetting ¶
type ImagesSetting struct { // A developer defined configuration ID. Id string `json:"id,omitempty"` // Name of the setting to be configured. Name string `json:"name,omitempty"` // Description of the app to be configured. Description string `json:"description,omitempty"` // Indicates if this setting is required for configuration. Required bool `json:"required,omitempty"` // Indicates if this setting should be disabled Disabled bool `json:"disabled,omitempty"` Type SettingType `json:"type"` // A default value for the setting. DefaultValue string `json:"defaultValue,omitempty"` // The images to display. Images []string `json:"images,omitempty"` }
ImagesSetting Images Setting
type ImagesSettingAllOf ¶
type ImagesSettingAllOf struct { // A default value for the setting. DefaultValue string `json:"defaultValue,omitempty"` // The images to display. Images []string `json:"images,omitempty"` }
ImagesSettingAllOf struct for ImagesSettingAllOf
type InitializeSetting ¶
type InitializeSetting struct { // A developer defined configuration ID. Id string `json:"id,omitempty"` // Name of the setting to be configured. Name string `json:"name,omitempty"` // Description of the app to be configured. Description string `json:"description,omitempty"` // A developer defined page ID of the first page to display. Must be URL safe characters. FirstPageId string `json:"firstPageId,omitempty"` // Disable the ability for the user to customize the display name. DisableCustomDisplayName bool `json:"disableCustomDisplayName,omitempty"` // Disable the ability to remove the app from the configuration flow. DisableRemoveApp bool `json:"disableRemoveApp,omitempty"` Permissions []string `json:"permissions,omitempty"` }
InitializeSetting The initial setting to be returned when starting a new configuration install.
type InitializeSettingAllOf ¶
type InitializeSettingAllOf struct { // A developer defined page ID of the first page to display. Must be URL safe characters. FirstPageId string `json:"firstPageId,omitempty"` // Disable the ability for the user to customize the display name. DisableCustomDisplayName bool `json:"disableCustomDisplayName,omitempty"` // Disable the ability to remove the app from the configuration flow. DisableRemoveApp bool `json:"disableRemoveApp,omitempty"` Permissions []string `json:"permissions,omitempty"` }
InitializeSettingAllOf struct for InitializeSettingAllOf
type InstallData ¶
type InstallData struct { // An OAuth token to use when calling into SmartThings API's. AuthToken string `json:"authToken"` // A refresh token which maybe used to obtain authorization to SmartThings API after expiration of the authToken. An integration will need to use this refreshToken to support calling the SmartThings API outside the context of an event. RefreshToken string `json:"refreshToken"` InstalledApp InstalledApp `json:"installedApp"` }
InstallData The data payload to an execution request with an AppLifecycle of INSTALL.
type InstalledApp ¶
type InstalledApp struct { // The id of the installed app. InstalledAppId string `json:"installedAppId,omitempty"` // The location that the installed App is associated with LocationId string `json:"locationId,omitempty"` // A map of configurations for an Installed App. The map 'key' is the configuration name and the 'value' is an array of strings. Config map[string][]ConfigEntry `json:"config,omitempty"` // A list of permissions associated with this execution. See `securityDefinitions` for more information. Permissions []string `json:"permissions,omitempty"` }
InstalledApp The information associated with this installed app.
type LaunchPluginAction ¶
type LaunchPluginAction struct { // The ID of the plugin to launch. PluginId string `json:"pluginId,omitempty"` // parameter to be passed to plugin Uri string `json:"uri,omitempty"` }
LaunchPluginAction Launch a backing UI plugin in SmartThings Client.
type LinkSetting ¶
type LinkSetting struct { // A developer defined configuration ID. Id string `json:"id,omitempty"` // Name of the setting to be configured. Name string `json:"name,omitempty"` // Description of the app to be configured. Description string `json:"description,omitempty"` // Indicates if this setting is required for configuration. Required bool `json:"required,omitempty"` // Indicates if this setting should be disabled Disabled bool `json:"disabled,omitempty"` Type SettingType `json:"type"` // A default value for the setting. DefaultValue string `json:"defaultValue,omitempty"` // The page to navigate to. Url string `json:"url,omitempty"` // The image url. Image string `json:"image,omitempty"` Style LinkStyleType `json:"style,omitempty"` }
LinkSetting URL link Setting
type LinkSettingAllOf ¶
type LinkSettingAllOf struct { // A default value for the setting. DefaultValue string `json:"defaultValue,omitempty"` // The page to navigate to. Url string `json:"url,omitempty"` // The image url. Image string `json:"image,omitempty"` Style LinkStyleType `json:"style,omitempty"` }
LinkSettingAllOf struct for LinkSettingAllOf
type LinkStyleType ¶
type LinkStyleType string
LinkStyleType Style of the setting.
const ( LINKSTYLETYPE_COMPLETE LinkStyleType = "COMPLETE" LINKSTYLETYPE_ERROR LinkStyleType = "ERROR" LINKSTYLETYPE_DEFAULT LinkStyleType = "DEFAULT" LINKSTYLETYPE_BUTTON LinkStyleType = "BUTTON" )
List of LinkStyleType
type MessageConfig ¶
type MessageConfig struct { // The key value of the message group. MessageGroupKey string `json:"messageGroupKey,omitempty"` }
MessageConfig A message configuration.
type ModeConfig ¶
type ModeConfig struct { // The ID of the mode. ModeId string `json:"modeId,omitempty"` }
ModeConfig A mode configuration.
type ModeEvent ¶
type ModeEvent struct { // The id of the event. EventId string `json:"eventId,omitempty"` // The id of the location in which the event was triggered. LocationId string `json:"locationId,omitempty"` // The ID of the mode associated with a MODE_EVENT. ModeId string `json:"modeId,omitempty"` }
ModeEvent struct for ModeEvent
type ModeSetting ¶
type ModeSetting struct { // A developer defined configuration ID. Id string `json:"id,omitempty"` // Name of the setting to be configured. Name string `json:"name,omitempty"` // Description of the app to be configured. Description string `json:"description,omitempty"` // Indicates if this setting is required for configuration. Required bool `json:"required,omitempty"` // Indicates if this setting should be disabled Disabled bool `json:"disabled,omitempty"` Type SettingType `json:"type"` // A default value for the setting. DefaultValue string `json:"defaultValue,omitempty"` // Indicates if this enum setting can have multiple values. Multiple bool `json:"multiple,omitempty"` // Indicates if this input should close on selection. CloseOnSelection bool `json:"closeOnSelection,omitempty"` // Indicates if this input should refresh configs after a change in value. SubmitOnChange bool `json:"submitOnChange,omitempty"` Style StyleType `json:"style,omitempty"` }
ModeSetting Mode Setting
type ModeSettingAllOf ¶
type ModeSettingAllOf struct { // A default value for the setting. DefaultValue string `json:"defaultValue,omitempty"` // Indicates if this enum setting can have multiple values. Multiple bool `json:"multiple,omitempty"` // Indicates if this input should close on selection. CloseOnSelection bool `json:"closeOnSelection,omitempty"` // Indicates if this input should refresh configs after a change in value. SubmitOnChange bool `json:"submitOnChange,omitempty"` Style StyleType `json:"style,omitempty"` }
ModeSettingAllOf struct for ModeSettingAllOf
type NumberSetting ¶
type NumberSetting struct { // A developer defined configuration ID. Id string `json:"id,omitempty"` // Name of the setting to be configured. Name string `json:"name,omitempty"` // Description of the app to be configured. Description string `json:"description,omitempty"` // Indicates if this setting is required for configuration. Required bool `json:"required,omitempty"` // Indicates if this setting should be disabled Disabled bool `json:"disabled,omitempty"` Type SettingType `json:"type"` // A default value for the setting. DefaultValue string `json:"defaultValue,omitempty"` // The maximum inclusive value the number can be set to. Max int32 `json:"max,omitempty"` // The minumum inclusive value the number can be set to. Min int32 `json:"min,omitempty"` // The increment to step by. Step int32 `json:"step,omitempty"` // The way to style the number input. Style string `json:"style,omitempty"` // The image url. Image string `json:"image,omitempty"` // A string to be shown after the text input field. PostMessage string `json:"postMessage,omitempty"` }
NumberSetting Number Setting
type NumberSettingAllOf ¶
type NumberSettingAllOf struct { // A default value for the setting. DefaultValue string `json:"defaultValue,omitempty"` // The maximum inclusive value the number can be set to. Max int32 `json:"max,omitempty"` // The minumum inclusive value the number can be set to. Min int32 `json:"min,omitempty"` // The increment to step by. Step int32 `json:"step,omitempty"` // The way to style the number input. Style string `json:"style,omitempty"` // The image url. Image string `json:"image,omitempty"` // A string to be shown after the text input field. PostMessage string `json:"postMessage,omitempty"` }
NumberSettingAllOf struct for NumberSettingAllOf
type OAuthCallbackData ¶
type OAuthCallbackData struct { // The id of the installed app. InstalledAppId string `json:"installedAppId,omitempty"` // A relative URL containing all of the query string parameters as returned by the third party oauth system. A SmartApp can parse the `urlPath` property to extract any senstive auth codes/tokens which can then be used to access the third party system. UrlPath string `json:"urlPath,omitempty"` }
OAuthCallbackData Provides intergration with the result of a third party oauth attempt. This will only be available for executions of type \"OAUTH_CALLBACK\".
type OAuthSetting ¶
type OAuthSetting struct { // A developer defined configuration ID. Id string `json:"id,omitempty"` // Name of the setting to be configured. Name string `json:"name,omitempty"` // Description of the app to be configured. Description string `json:"description,omitempty"` // Indicates if this setting is required for configuration. Required bool `json:"required,omitempty"` // Indicates if this setting should be disabled Disabled bool `json:"disabled,omitempty"` Type SettingType `json:"type"` // A default value for the setting. DefaultValue string `json:"defaultValue,omitempty"` // The url to use for the OAuth service. Use __SmartThingsOAuthCallback__ in the template for the callback/redirect url you need to provide to the OAuth service. UrlTemplate string `json:"urlTemplate,omitempty"` Style StyleType `json:"style,omitempty"` }
OAuthSetting OAuth Setting
type OAuthSettingAllOf ¶
type OAuthSettingAllOf struct { // A default value for the setting. DefaultValue string `json:"defaultValue,omitempty"` // The url to use for the OAuth service. Use __SmartThingsOAuthCallback__ in the template for the callback/redirect url you need to provide to the OAuth service. UrlTemplate string `json:"urlTemplate,omitempty"` Style StyleType `json:"style,omitempty"` }
OAuthSettingAllOf struct for OAuthSettingAllOf
type Option ¶
type Option struct { // The unique ID for this option. Id string `json:"id,omitempty"` // The display name for this option. Name string `json:"name,omitempty"` }
Option struct for Option
type Page ¶
type Page struct { // Name of the page to be configured. Name string `json:"name,omitempty"` // A developer defined page ID. Must be URL safe characters. PageId string `json:"pageId,omitempty"` // A developer defined page ID for the next page in the configuration process. Must be URL safe characters. NextPageId string `json:"nextPageId,omitempty"` // A developer defined page ID for the previous page in the configuration process. Must be URL safe characters. PreviousPageId string `json:"previousPageId,omitempty"` // Indicates if this is the last page in the configuration process. Complete bool `json:"complete,omitempty"` // Change how the page is presented Style string `json:"style,omitempty"` // The text for the next button. Only applies if style is `SPLASH` NextText string `json:"nextText,omitempty"` // The display sections for user defined settings. Sections []Section `json:"sections,omitempty"` }
Page struct for Page
type PageSetting ¶
type PageSetting struct { // A developer defined configuration ID. Id string `json:"id,omitempty"` // Name of the setting to be configured. Name string `json:"name,omitempty"` // Description of the app to be configured. Description string `json:"description,omitempty"` // Indicates if this setting is required for configuration. Required bool `json:"required,omitempty"` // Indicates if this setting should be disabled Disabled bool `json:"disabled,omitempty"` Type SettingType `json:"type"` // A default value for the setting. DefaultValue string `json:"defaultValue,omitempty"` // The page to navigate to. Page string `json:"page,omitempty"` // The image url. Image string `json:"image,omitempty"` Style LinkStyleType `json:"style,omitempty"` }
PageSetting Jump to page Setting
type PageSettingAllOf ¶
type PageSettingAllOf struct { // A default value for the setting. DefaultValue string `json:"defaultValue,omitempty"` // The page to navigate to. Page string `json:"page,omitempty"` // The image url. Image string `json:"image,omitempty"` Style LinkStyleType `json:"style,omitempty"` }
PageSettingAllOf struct for PageSettingAllOf
type ParagraphSetting ¶
type ParagraphSetting struct { // A developer defined configuration ID. Id string `json:"id,omitempty"` // Name of the setting to be configured. Name string `json:"name,omitempty"` // Description of the app to be configured. Description string `json:"description,omitempty"` // Indicates if this setting is required for configuration. Required bool `json:"required,omitempty"` // Indicates if this setting should be disabled Disabled bool `json:"disabled,omitempty"` Type SettingType `json:"type"` // A default value for the setting. DefaultValue string `json:"defaultValue,omitempty"` // The image url. Image string `json:"image,omitempty"` }
ParagraphSetting Paragraph Setting
type PasswordSetting ¶
type PasswordSetting struct { // A developer defined configuration ID. Id string `json:"id,omitempty"` // Name of the setting to be configured. Name string `json:"name,omitempty"` // Description of the app to be configured. Description string `json:"description,omitempty"` // Indicates if this setting is required for configuration. Required bool `json:"required,omitempty"` // Indicates if this setting should be disabled Disabled bool `json:"disabled,omitempty"` Type SettingType `json:"type"` // A default value for the setting. DefaultValue string `json:"defaultValue,omitempty"` // The maximum length the password can have. MaxLength int32 `json:"maxLength,omitempty"` // The minimum length the password can have. MinLength int32 `json:"minLength,omitempty"` // The image url. Image string `json:"image,omitempty"` }
PasswordSetting Password Setting
type PasswordSettingAllOf ¶
type PasswordSettingAllOf struct { // A default value for the setting. DefaultValue string `json:"defaultValue,omitempty"` // The maximum length the password can have. MaxLength int32 `json:"maxLength,omitempty"` // The minimum length the password can have. MinLength int32 `json:"minLength,omitempty"` // The image url. Image string `json:"image,omitempty"` }
PasswordSettingAllOf struct for PasswordSettingAllOf
type PhoneSetting ¶
type PhoneSetting struct { // A developer defined configuration ID. Id string `json:"id,omitempty"` // Name of the setting to be configured. Name string `json:"name,omitempty"` // Description of the app to be configured. Description string `json:"description,omitempty"` // Indicates if this setting is required for configuration. Required bool `json:"required,omitempty"` // Indicates if this setting should be disabled Disabled bool `json:"disabled,omitempty"` Type SettingType `json:"type"` // A default value for the setting. DefaultValue string `json:"defaultValue,omitempty"` // The image url. Image string `json:"image,omitempty"` }
PhoneSetting Phone Setting
type PhoneSettingAllOf ¶
type PhoneSettingAllOf struct { // A default value for the setting. DefaultValue string `json:"defaultValue,omitempty"` // The image url. Image string `json:"image,omitempty"` }
PhoneSettingAllOf struct for PhoneSettingAllOf
type PingData ¶
type PingData struct { // A challenge phrase that the SmartApp must echo back to validate itself. Challenge string `json:"challenge"` }
PingData A request to ping a SmartApp to ensure connectivity.
type PingResponseData ¶
type PingResponseData struct { // An echo of the challenge that was provided on the request. Challenge string `json:"challenge,omitempty"` }
PingResponseData Expected response for a Ping lifecycle execution.
type SceneConfig ¶
type SceneConfig struct { // The ID of the scene. SceneId string `json:"sceneId,omitempty"` }
SceneConfig A scene configuration.
type SceneLifecycle ¶
type SceneLifecycle string
SceneLifecycle The scene lifecycle. The lifecycle will be one of: * CREATE - Invoked when a scene is created. * UPDATE - Invoked when a scene is updated. * DELETE - Invoked when a scene is deleted.
const ( SCENELIFECYCLE_CREATE SceneLifecycle = "CREATE" SCENELIFECYCLE_UPDATE SceneLifecycle = "UPDATE" SCENELIFECYCLE_DELETE SceneLifecycle = "DELETE" )
List of SceneLifecycle
type SceneLifecycleEvent ¶
type SceneLifecycleEvent struct { Lifecycle SceneLifecycle `json:"lifecycle,omitempty"` // The id of the event. EventId string `json:"eventId,omitempty"` // The id of the location in which the event was triggered. LocationId string `json:"locationId,omitempty"` // The id of the scene. SceneId string `json:"sceneId,omitempty"` // Create scene lifecycle. Create map[string]interface{} `json:"create,omitempty"` // Update scene lifecycle. Update map[string]interface{} `json:"update,omitempty"` // Delete scene lifecycle. Delete map[string]interface{} `json:"delete,omitempty"` }
SceneLifecycleEvent A scene lifecycle event.
type SceneSetting ¶
type SceneSetting struct { // A developer defined configuration ID. Id string `json:"id,omitempty"` // Name of the setting to be configured. Name string `json:"name,omitempty"` // Description of the app to be configured. Description string `json:"description,omitempty"` // Indicates if this setting is required for configuration. Required bool `json:"required,omitempty"` // Indicates if this setting should be disabled Disabled bool `json:"disabled,omitempty"` Type SettingType `json:"type"` // A default value for the setting. DefaultValue string `json:"defaultValue,omitempty"` // Indicates if this scene setting can have multiple values. Multiple bool `json:"multiple,omitempty"` // Indicates if this input should close on selection. CloseOnSelection bool `json:"closeOnSelection,omitempty"` // Indicates if this input should refresh configs after a change in value. SubmitOnChange bool `json:"submitOnChange,omitempty"` Style StyleType `json:"style,omitempty"` }
SceneSetting Scene Setting
type SceneSettingAllOf ¶
type SceneSettingAllOf struct { // A default value for the setting. DefaultValue string `json:"defaultValue,omitempty"` // Indicates if this scene setting can have multiple values. Multiple bool `json:"multiple,omitempty"` // Indicates if this input should close on selection. CloseOnSelection bool `json:"closeOnSelection,omitempty"` // Indicates if this input should refresh configs after a change in value. SubmitOnChange bool `json:"submitOnChange,omitempty"` Style StyleType `json:"style,omitempty"` }
SceneSettingAllOf struct for SceneSettingAllOf
type Section ¶
type Section struct { // Name of the section. Name string `json:"name,omitempty"` // Whether or not the section can be collapsed Hideable bool `json:"hideable,omitempty"` // If section can be collapsed, whether or not it defaults to hidden Hidden bool `json:"hidden,omitempty"` // Change how the section is presented Style string `json:"style,omitempty"` // Configuration settings represent the questions asked to the end user installing an integration the answers to which provide the configuration for which the integration will use when executing. Settings follow an inheritance pattern. The type field dictates the expected instance of setting that is provided. Settings []SectionSettingInterface `json:"settings,omitempty"` }
Section struct for Section
type SectionSetting ¶
type SectionSetting struct { // A developer defined configuration ID. Id string `json:"id,omitempty"` // Name of the setting to be configured. Name string `json:"name,omitempty"` // Description of the app to be configured. Description string `json:"description,omitempty"` // Indicates if this setting is required for configuration. Required bool `json:"required,omitempty"` // Indicates if this setting should be disabled Disabled bool `json:"disabled,omitempty"` Type SettingType `json:"type"` }
SectionSetting struct for SectionSetting
type SectionSettingAllOf ¶
type SectionSettingAllOf struct { // Indicates if this setting is required for configuration. Required bool `json:"required,omitempty"` // Indicates if this setting should be disabled Disabled bool `json:"disabled,omitempty"` Type SettingType `json:"type"` }
SectionSettingAllOf struct for SectionSettingAllOf
type SectionSettingInterface ¶
type SectionSettingInterface interface {
// contains filtered or unexported methods
}
type SecurityArmStateEvent ¶
type SecurityArmStateEvent struct { // The id of the event. EventId string `json:"eventId,omitempty"` // The id of the location in which the event was triggered. LocationId string `json:"locationId,omitempty"` // The arm state of a security system. ArmState string `json:"armState,omitempty"` // A set of key / value pairs useful for passing any optional arguments. OptionalArguments map[string]SimpleValue `json:"optionalArguments,omitempty"` }
SecurityArmStateEvent An event that represents a change in the arm state of a security system.
type ServerConfiguration ¶
type ServerConfiguration struct { Url string Description string Variables map[string]ServerVariable }
ServerConfiguration stores the information about a server
type ServerVariable ¶
ServerVariable stores the information about a server variable
type Setting ¶
type Setting struct { // A developer defined configuration ID. Id string `json:"id,omitempty"` // Name of the setting to be configured. Name string `json:"name,omitempty"` // Description of the app to be configured. Description string `json:"description,omitempty"` }
Setting struct for Setting
type SettingType ¶
type SettingType string
SettingType Denotes the type of setting.
const ( SETTINGTYPE_DEVICE SettingType = "DEVICE" SETTINGTYPE_DATE SettingType = "DATE" SETTINGTYPE_TEXT SettingType = "TEXT" SETTINGTYPE_PASSWORD SettingType = "PASSWORD" SETTINGTYPE_BOOLEAN SettingType = "BOOLEAN" SETTINGTYPE_ENUM SettingType = "ENUM" SETTINGTYPE_MODE SettingType = "MODE" SETTINGTYPE_SCENE SettingType = "SCENE" SETTINGTYPE_LINK SettingType = "LINK" SETTINGTYPE_PAGE SettingType = "PAGE" SETTINGTYPE_IMAGE SettingType = "IMAGE" SETTINGTYPE_IMAGES SettingType = "IMAGES" SETTINGTYPE_VIDEO SettingType = "VIDEO" SETTINGTYPE_TIME SettingType = "TIME" SETTINGTYPE_PARAGRAPH SettingType = "PARAGRAPH" SETTINGTYPE_EMAIL SettingType = "EMAIL" SETTINGTYPE_DECIMAL SettingType = "DECIMAL" SETTINGTYPE_NUMBER SettingType = "NUMBER" SETTINGTYPE_PHONE SettingType = "PHONE" SETTINGTYPE_OAUTH SettingType = "OAUTH" SETTINGTYPE_SOUND SettingType = "SOUND" SETTINGTYPE_COLOR SettingType = "COLOR" SETTINGTYPE_MESSAGE_GROUP SettingType = "MESSAGE_GROUP" )
List of SettingType
type SimpleValue ¶
type SimpleValue struct { // The type of the value. ValueType string `json:"valueType,omitempty"` IntValue int32 `json:"intValue,omitempty"` DoubleValue float64 `json:"doubleValue,omitempty"` StringValue string `json:"stringValue,omitempty"` BoolValue bool `json:"boolValue,omitempty"` }
SimpleValue A simple value.
type StringConfig ¶
type StringConfig struct { // A config value Value string `json:"value,omitempty"` }
StringConfig A simple string configuration.
type TextSetting ¶
type TextSetting struct { // A developer defined configuration ID. Id string `json:"id,omitempty"` // Name of the setting to be configured. Name string `json:"name,omitempty"` // Description of the app to be configured. Description string `json:"description,omitempty"` // Indicates if this setting is required for configuration. Required bool `json:"required,omitempty"` // Indicates if this setting should be disabled Disabled bool `json:"disabled,omitempty"` Type SettingType `json:"type"` // A default value for the setting. DefaultValue string `json:"defaultValue,omitempty"` // The maximum length the text can have. MaxLength int32 `json:"maxLength,omitempty"` // The minimum length the text can have. MinLength int32 `json:"minLength,omitempty"` // The image url. Image string `json:"image,omitempty"` // A string to be shown after the text input field. PostMessage string `json:"postMessage,omitempty"` }
TextSetting Text Setting
type TextSettingAllOf ¶
type TextSettingAllOf struct { // A default value for the setting. DefaultValue string `json:"defaultValue,omitempty"` // The maximum length the text can have. MaxLength int32 `json:"maxLength,omitempty"` // The minimum length the text can have. MinLength int32 `json:"minLength,omitempty"` // The image url. Image string `json:"image,omitempty"` // A string to be shown after the text input field. PostMessage string `json:"postMessage,omitempty"` }
TextSettingAllOf struct for TextSettingAllOf
type TimeSetting ¶
type TimeSetting struct { // A developer defined configuration ID. Id string `json:"id,omitempty"` // Name of the setting to be configured. Name string `json:"name,omitempty"` // Description of the app to be configured. Description string `json:"description,omitempty"` // Indicates if this setting is required for configuration. Required bool `json:"required,omitempty"` // Indicates if this setting should be disabled Disabled bool `json:"disabled,omitempty"` Type SettingType `json:"type"` // A default value for the setting. DefaultValue string `json:"defaultValue,omitempty"` // The image url. Image string `json:"image,omitempty"` // The maximum inclusive value the time can be set to (only the time will be used out of the date time). Max time.Time `json:"max,omitempty"` // The minimum inclusive value the time can be set to (only the time will be used out of the date time). Min time.Time `json:"min,omitempty"` // Indicates if this input should refresh configs after a change in value. SubmitOnChange bool `json:"submitOnChange,omitempty"` }
TimeSetting Time Setting
type TimeSettingAllOf ¶
type TimeSettingAllOf struct { // A default value for the setting. DefaultValue string `json:"defaultValue,omitempty"` // The image url. Image string `json:"image,omitempty"` // The maximum inclusive value the time can be set to (only the time will be used out of the date time). Max time.Time `json:"max,omitempty"` // The minimum inclusive value the time can be set to (only the time will be used out of the date time). Min time.Time `json:"min,omitempty"` // Indicates if this input should refresh configs after a change in value. SubmitOnChange bool `json:"submitOnChange,omitempty"` }
TimeSettingAllOf struct for TimeSettingAllOf
type TimerEvent ¶
type TimerEvent struct { // The ID of the event. EventId string `json:"eventId,omitempty"` // The name of the schedule that caused this event. Name string `json:"name,omitempty"` Type TimerType `json:"type,omitempty"` // The IS0-8601 date time strings in UTC that this event was scheduled for. Time time.Time `json:"time,omitempty"` // The CRON expression if the schedule was of type CRON. Expression string `json:"expression,omitempty"` }
TimerEvent An event that is caused by a schedule for this app being fired.
type UninstallData ¶
type UninstallData struct {
InstalledApp InstalledApp `json:"installedApp"`
}
UninstallData The data payload to an execution request with an AppLifecycle of UNINSTALL.
type UpdateData ¶
type UpdateData struct { // An OAuth token to use when calling into SmartThings API's. AuthToken string `json:"authToken"` // A refresh token which maybe used to obtain authorization to SmartThings API after expiration of the authToken. An integration will need to use this refreshToken to support calling the SmartThings API outside the context of an event. RefreshToken string `json:"refreshToken,omitempty"` InstalledApp InstalledApp `json:"installedApp"` // A map of configurations for an Installed App. The map 'key' is the configuration name and the 'value' is an array of strings. PreviousConfig map[string][]ConfigEntry `json:"previousConfig"` // A list of permissions associated with this execution. See `securityDefinitions` for more information. PreviousPermissions []string `json:"previousPermissions"` }
UpdateData The data payload to an execution request with an AppLifecycle of UPDATE.
type VideoSetting ¶
type VideoSetting struct { // A developer defined configuration ID. Id string `json:"id,omitempty"` // Name of the setting to be configured. Name string `json:"name,omitempty"` // Description of the app to be configured. Description string `json:"description,omitempty"` // Indicates if this setting is required for configuration. Required bool `json:"required,omitempty"` // Indicates if this setting should be disabled Disabled bool `json:"disabled,omitempty"` Type SettingType `json:"type"` // A default value for the setting. DefaultValue string `json:"defaultValue,omitempty"` // The video url. Video string `json:"video,omitempty"` // The image url. Image string `json:"image,omitempty"` }
VideoSetting Video Setting
type VideoSettingAllOf ¶
type VideoSettingAllOf struct { // A default value for the setting. DefaultValue string `json:"defaultValue,omitempty"` // The video url. Video string `json:"video,omitempty"` // The image url. Image string `json:"image,omitempty"` }
VideoSettingAllOf struct for VideoSettingAllOf
Source Files ¶
- api_default.go
- client.go
- configuration.go
- model_action.go
- model_action_type.go
- model_app_lifecycle.go
- model_basic_background_image.go
- model_basic_body.go
- model_basic_button.go
- model_basic_button_position.go
- model_basic_button_type.go
- model_basic_card.go
- model_basic_icon_button.go
- model_basic_image.go
- model_basic_image_position.go
- model_basic_text.go
- model_basic_text_button.go
- model_basic_v2_body.go
- model_basic_v2_button.go
- model_basic_v2_card.go
- model_basic_v2_icon_button.go
- model_basic_v2_image.go
- model_basic_v2_image_item.go
- model_basic_v2_item.go
- model_basic_v2_text.go
- model_basic_v2_text_button.go
- model_boolean_setting.go
- model_boolean_setting_all_of.go
- model_client_details.go
- model_config_entry.go
- model_configuration_data.go
- model_configuration_phase.go
- model_configuration_response_data.go
- model_confirmation_data.go
- model_dashboard_card.go
- model_dashboard_card_template.go
- model_dashboard_data.go
- model_dashboard_response_data.go
- model_decimal_setting.go
- model_decimal_setting_all_of.go
- model_device_commands_event.go
- model_device_commands_event_command.go
- model_device_config.go
- model_device_event.go
- model_device_health_event.go
- model_device_lifecycle.go
- model_device_lifecycle_event.go
- model_device_lifecycle_move.go
- model_device_setting.go
- model_device_setting_all_of.go
- model_email_setting.go
- model_enum_setting.go
- model_enum_setting_all_of.go
- model_enum_style_type.go
- model_event.go
- model_event_data.go
- model_event_type.go
- model_execute_action.go
- model_execute_data.go
- model_execution_request.go
- model_execution_response.go
- model_free_form_card.go
- model_grouped_option.go
- model_image_setting.go
- model_images_setting.go
- model_images_setting_all_of.go
- model_initialize_setting.go
- model_initialize_setting_all_of.go
- model_install_data.go
- model_installed_app.go
- model_launch_plugin_action.go
- model_link_setting.go
- model_link_setting_all_of.go
- model_link_style_type.go
- model_message_config.go
- model_mode_config.go
- model_mode_event.go
- model_mode_setting.go
- model_mode_setting_all_of.go
- model_number_setting.go
- model_number_setting_all_of.go
- model_o_auth_callback_data.go
- model_o_auth_setting.go
- model_o_auth_setting_all_of.go
- model_option.go
- model_page.go
- model_page_setting.go
- model_page_setting_all_of.go
- model_paragraph_setting.go
- model_password_setting.go
- model_password_setting_all_of.go
- model_phone_setting.go
- model_phone_setting_all_of.go
- model_ping_data.go
- model_ping_response_data.go
- model_scene_config.go
- model_scene_lifecycle.go
- model_scene_lifecycle_event.go
- model_scene_setting.go
- model_scene_setting_all_of.go
- model_section.go
- model_section_setting.go
- model_section_setting_all_of.go
- model_security_arm_state_event.go
- model_setting.go
- model_setting_type.go
- model_simple_value.go
- model_string_config.go
- model_style_type.go
- model_text_setting.go
- model_text_setting_all_of.go
- model_time_setting.go
- model_time_setting_all_of.go
- model_timer_event.go
- model_timer_type.go
- model_uninstall_data.go
- model_update_data.go
- model_video_setting.go
- model_video_setting_all_of.go
- response.go
- section_interface.go