Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
20 changes: 14 additions & 6 deletions models/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 11 additions & 11 deletions services/console_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Loading