-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from incident-io/rob/add-attachments-on-incidents
Add attachments, and incident updates onto incidents stream
- Loading branch information
Showing
4 changed files
with
139 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package model | ||
|
||
import "github.com/incident-io/singer-tap/client" | ||
|
||
type externalResourceV1 struct{} | ||
|
||
var ExternalResourceV1 externalResourceV1 | ||
|
||
func (externalResourceV1) Schema() Property { | ||
return Property{ | ||
Types: []string{"object"}, | ||
Properties: map[string]Property{ | ||
"external_id": { | ||
Types: []string{"string"}, | ||
}, | ||
"permalink": { | ||
Types: []string{"string"}, | ||
}, | ||
"resource_type": { | ||
Types: []string{"string"}, | ||
}, | ||
"title": { | ||
Types: []string{"string"}, | ||
}, | ||
}, | ||
} | ||
} | ||
|
||
func (externalResourceV1) Serialize(input client.ExternalResourceV1) map[string]any { | ||
return DumpToMap(input) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package model | ||
|
||
import "github.com/incident-io/singer-tap/client" | ||
|
||
type incidentAttachmentV1 struct{} | ||
|
||
var IncidentAttachmentV1 incidentAttachmentV1 | ||
|
||
func (incidentAttachmentV1) Schema() Property { | ||
return Property{ | ||
Types: []string{"object"}, | ||
Properties: map[string]Property{ | ||
"id": { | ||
Types: []string{"string"}, | ||
}, | ||
"incident_id": { | ||
Types: []string{"string"}, | ||
}, | ||
"resource": ExternalResourceV1.Schema(), | ||
}, | ||
} | ||
} | ||
|
||
func (incidentAttachmentV1) Serialize(input client.IncidentAttachmentV1) map[string]any { | ||
return map[string]any{ | ||
"id": input.Id, | ||
"incident_id": input.IncidentId, | ||
"resource": ExternalResourceV1.Serialize(input.Resource), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters