Skip to content

Commit

Permalink
string key interface values
Browse files Browse the repository at this point in the history
  • Loading branch information
Sjeanpierre committed Oct 19, 2020
1 parent 8ed5cfb commit 43b8770
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions change_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ type ChangeEvent struct {
// Payload ChangeEvent Payload
// https://developer.pagerduty.com/docs/events-api-v2/send-change-events/#example-request-payload
type Payload struct {
Source string `json:"source"`
Summary string `json:"summary"`
Timestamp string `json:"timestamp"`
CustomDetails interface{} `json:"custom_details"`
Source string `json:"source"`
Summary string `json:"summary"`
Timestamp string `json:"timestamp"`
CustomDetails map[string]interface{} `json:"custom_details"`
}

// Link represents a single link in a ChangeEvent
Expand Down
4 changes: 2 additions & 2 deletions change_events_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestChangeEvent_Create(t *testing.T) {
Message: "Change event processed",
}

eventDetails := map[string]string{"DetailKey1": "DetailValue1", "DetailKey2": "DetailValue2"}
eventDetails := map[string]interface{}{"DetailKey1": "DetailValue1", "DetailKey2": "DetailValue2"}
ce := ChangeEvent{
RoutingKey: "a0000000aa0000a0a000aa0a0a0aa000",
Payload: Payload{
Expand Down Expand Up @@ -89,7 +89,7 @@ func TestChangeEvent_CreateWithPayloadVerification(t *testing.T) {
HTTPClient: defaultHTTPClient,
}

eventDetails := map[string]string{"DetailKey1": "DetailValue1", "DetailKey2": "DetailValue2"}
eventDetails := map[string]interface{}{"DetailKey1": "DetailValue1", "DetailKey2": "DetailValue2"}
ce := ChangeEvent{
RoutingKey: "a0000000aa0000a0a000aa0a0a0aa000",
Payload: Payload{
Expand Down

0 comments on commit 43b8770

Please sign in to comment.