diff --git a/const.go b/const.go index 15137a6..8586436 100644 --- a/const.go +++ b/const.go @@ -34,6 +34,7 @@ const ( PropertyConfigStatus PropertyConfigType = "status" PropertyConfigUniqueID PropertyConfigType = "unique_id" PropertyConfigVerification PropertyConfigType = "verification" + PropertyConfigButton PropertyConfigType = "button" ) const ( diff --git a/property_config.go b/property_config.go index f3cfc5a..9a3f674 100644 --- a/property_config.go +++ b/property_config.go @@ -380,6 +380,20 @@ func (p VerificationPropertyConfig) GetID() PropertyID { return p.ID } +type ButtonPropertyConfig struct { + ID PropertyID `json:"id"` + Type PropertyConfigType `json:"type"` + Button struct{} `json:"button"` +} + +func (p ButtonPropertyConfig) GetType() PropertyConfigType { + return p.Type +} + +func (p ButtonPropertyConfig) GetID() PropertyID { + return p.ID +} + type PropertyConfigs map[string]PropertyConfig func (p *PropertyConfigs) UnmarshalJSON(data []byte) error { @@ -447,6 +461,8 @@ func parsePropertyConfigs(raw map[string]interface{}) (PropertyConfigs, error) { p = &UniqueIDPropertyConfig{} case PropertyConfigVerification: p = &VerificationPropertyConfig{} + case PropertyConfigButton: + p = &ButtonPropertyConfig{} default: return nil, fmt.Errorf("unsupported property type: %s", rawProperty["type"].(string))