Skip to content

Commit e0543f9

Browse files
author
marcel corso gonzalez
authored
Merge pull request #56 from zeddee/export-links-field
Export links field to address #55
2 parents 1dbb310 + de3b425 commit e0543f9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

voice/recording.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ type Recording struct {
5252

5353
// A hash with HATEOAS links related to the object. This includes the file
5454
// link that has the URI for downloading the wave file of the recording.
55-
links map[string]string
55+
Links map[string]string
5656
}
5757

5858
type jsonRecording struct {
@@ -88,7 +88,7 @@ func (rec *Recording) UnmarshalJSON(data []byte) error {
8888
Duration: time.Second * time.Duration(raw.Duration),
8989
CreatedAt: createdAt,
9090
UpdatedAt: updatedAt,
91-
links: raw.Links,
91+
Links: raw.Links,
9292
}
9393
return nil
9494
}
@@ -101,7 +101,7 @@ func (rec *Recording) Transcriptions(client *messagebird.Client, callID string)
101101

102102
// DownloadFile streams the recorded WAV file.
103103
func (rec *Recording) DownloadFile(client *messagebird.Client) (io.ReadCloser, error) {
104-
req, err := http.NewRequest(http.MethodGet, apiRoot+rec.links["file"], nil)
104+
req, err := http.NewRequest(http.MethodGet, apiRoot+rec.Links["file"], nil)
105105
if err != nil {
106106
return nil, err
107107
}

voice/recording_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ func TestRecordingGetFile(t *testing.T) {
1313

1414
rec := &Recording{
1515
ID: "1337",
16-
links: map[string]string{
16+
Links: map[string]string{
1717
"file": "/yolo/swag.wav",
1818
},
1919
}

0 commit comments

Comments
 (0)