diff --git a/README.md b/README.md index 60352f8..21eab24 100644 --- a/README.md +++ b/README.md @@ -332,21 +332,21 @@ func main() { return } - supportInfo := accessgrid.SupportInfo{ - SupportURL: "https://help.yourcompany.com", - SupportPhoneNumber: "+1-555-123-4567", - SupportEmail: "support@yourcompany.com", - PrivacyPolicyURL: "https://yourcompany.com/privacy", - TermsAndConditionsURL: "https://yourcompany.com/terms", - } - + allowMulti := true params := accessgrid.UpdateTemplateParams{ - CardTemplateID: "0xd3adb00b5", - Name: "Updated Employee NFC key", - AllowOnMultipleDevices: true, - WatchCount: 2, - IPhoneCount: 3, - SupportInfo: supportInfo, + CardTemplateID: "0xd3adb00b5", + Name: "Updated Employee Access Pass", + AllowOnMultipleDevices: &allowMulti, + WatchCount: 2, + IPhoneCount: 3, + BackgroundColor: "#FFFFFF", + LabelColor: "#000000", + LabelSecondaryColor: "#333333", + SupportURL: "https://help.yourcompany.com", + SupportPhoneNumber: "+1-555-123-4567", + SupportEmail: "support@yourcompany.com", + PrivacyPolicyURL: "https://yourcompany.com/privacy", + TermsAndConditionsURL: "https://yourcompany.com/terms", } ctx := context.Background() diff --git a/models/models.go b/models/models.go index d278a66..c3fd09a 100644 --- a/models/models.go +++ b/models/models.go @@ -148,12 +148,20 @@ type CreateTemplateParams struct { // UpdateTemplateParams defines parameters for updating an existing template type UpdateTemplateParams struct { - CardTemplateID string `json:"card_template_id"` - Name string `json:"name,omitempty"` - WatchCount int `json:"watch_count,omitempty"` - IPhoneCount int `json:"iphone_count,omitempty"` - Design *TemplateDesign `json:"design,omitempty"` - SupportInfo *SupportInfo `json:"support_info,omitempty"` + CardTemplateID string `json:"card_template_id"` + Name string `json:"name,omitempty"` + AllowOnMultipleDevices *bool `json:"allow_on_multiple_devices,omitempty"` + WatchCount int `json:"watch_count,omitempty"` + IPhoneCount int `json:"iphone_count,omitempty"` + BackgroundColor string `json:"background_color,omitempty"` + LabelColor string `json:"label_color,omitempty"` + LabelSecondaryColor string `json:"label_secondary_color,omitempty"` + SupportURL string `json:"support_url,omitempty"` + SupportPhoneNumber string `json:"support_phone_number,omitempty"` + SupportEmail string `json:"support_email,omitempty"` + PrivacyPolicyURL string `json:"privacy_policy_url,omitempty"` + TermsAndConditionsURL string `json:"terms_and_conditions_url,omitempty"` + Metadata map[string]interface{} `json:"metadata,omitempty"` } // EventLogFilters defines parameters for filtering event logs diff --git a/services/console_test.go b/services/console_test.go index cc6eacc..6847477 100644 --- a/services/console_test.go +++ b/services/console_test.go @@ -203,18 +203,18 @@ func TestConsoleService_UpdateTemplate(t *testing.T) { server, service := setupConsoleTestServer() defer server.Close() - supportInfo := models.SupportInfo{ - SupportURL: "https://help.example.com", - SupportPhoneNumber: "+1-555-123-4567", - SupportEmail: "support@example.com", - } - + allowMulti := true params := models.UpdateTemplateParams{ - CardTemplateID: "0xd3adb00b5", - Name: "Updated Employee NFC key", - WatchCount: 2, - IPhoneCount: 3, - SupportInfo: &supportInfo, + CardTemplateID: "0xd3adb00b5", + Name: "Updated Employee NFC key", + AllowOnMultipleDevices: &allowMulti, + WatchCount: 2, + IPhoneCount: 3, + BackgroundColor: "#FFFFFF", + LabelColor: "#000000", + SupportURL: "https://help.example.com", + SupportPhoneNumber: "+1-555-123-4567", + SupportEmail: "support@example.com", } ctx := context.Background()