File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ import (
18
18
)
19
19
20
20
const (
21
- ClientVersion = "2.1.0 "
21
+ ClientVersion = "2.1.1 "
22
22
Endpoint = "https://rest.messagebird.com"
23
23
)
24
24
Original file line number Diff line number Diff line change 9
9
type VoiceMessage struct {
10
10
Id string
11
11
HRef string
12
+ Originator string
12
13
Body string
13
14
Reference string
14
15
Language string
@@ -22,6 +23,7 @@ type VoiceMessage struct {
22
23
}
23
24
24
25
type VoiceMessageParams struct {
26
+ Originator string
25
27
Reference string
26
28
Language string
27
29
Voice string
@@ -39,6 +41,9 @@ func paramsForVoiceMessage(params *VoiceMessageParams) *url.Values {
39
41
return urlParams
40
42
}
41
43
44
+ if params .Originator != "" {
45
+ urlParams .Set ("originator" , params .Originator )
46
+ }
42
47
if params .Reference != "" {
43
48
urlParams .Set ("reference" , params .Reference )
44
49
}
Original file line number Diff line number Diff line change 8
8
var voiceMessageObject []byte = []byte (`{
9
9
"id":"430c44a0354aab7ac9553f7a49907463",
10
10
"href":"https:\/\/rest.messagebird.com\/voicemessages\/430c44a0354aab7ac9553f7a49907463",
11
+ "originator":"MessageBird",
11
12
"body":"Hello World",
12
13
"reference":null,
13
14
"language":"en-gb",
@@ -47,6 +48,10 @@ func TestNewVoiceMessage(t *testing.T) {
47
48
t .Errorf ("Unexpected voice message href: %s" , message .HRef )
48
49
}
49
50
51
+ if message .Originator != "MessageBird" {
52
+ t .Errorf ("Unexpected voice message originator: %s" , message .Originator )
53
+ }
54
+
50
55
if message .Body != "Hello World" {
51
56
t .Errorf ("Unexpected voice message body: %s" , message .Body )
52
57
}
You can’t perform that action at this time.
0 commit comments