@@ -33,6 +33,8 @@ const (
33
33
HLRPath = "hlr"
34
34
// MessagePath represents the path to the Message resource.
35
35
MessagePath = "messages"
36
+ // MMSPath represents the path to the MMS resource.
37
+ MMSPath = "mms"
36
38
// VoiceMessagePath represents the path to the VoiceMessage resource.
37
39
VoiceMessagePath = "voicemessages"
38
40
// VerifyPath represents the path to the Verify resource.
@@ -220,7 +222,7 @@ func (c *Client) Messages(msgListParams *MessageListParams) (*MessageList, error
220
222
return messageList , err
221
223
}
222
224
223
- if err := c .request (messageList , "messages ?"+ params .Encode (), nil ); err != nil {
225
+ if err := c .request (messageList , MessagePath + " ?"+ params .Encode (), nil ); err != nil {
224
226
if err == ErrResponse {
225
227
return messageList , err
226
228
}
@@ -257,7 +259,7 @@ func (c *Client) NewMessage(originator string, recipients []string, body string,
257
259
// MMSMessage retrieves the information of an existing MmsMessage.
258
260
func (c * Client ) MMSMessage (id string ) (* MMSMessage , error ) {
259
261
mmsMessage := & MMSMessage {}
260
- if err := c .request (mmsMessage , "mms /"+ id , nil ); err != nil {
262
+ if err := c .request (mmsMessage , MMSPath + " /"+ id , nil ); err != nil {
261
263
if err == ErrResponse {
262
264
return mmsMessage , err
263
265
}
@@ -279,7 +281,7 @@ func (c *Client) NewMMSMessage(originator string, recipients []string, msgParams
279
281
params .Set ("recipients" , strings .Join (recipients , "," ))
280
282
281
283
mmsMessage := & MMSMessage {}
282
- if err := c .request (mmsMessage , "mms" , params ); err != nil {
284
+ if err := c .request (mmsMessage , MMSPath , params ); err != nil {
283
285
if err == ErrResponse {
284
286
return mmsMessage , err
285
287
}
@@ -392,7 +394,7 @@ func (c *Client) Lookup(phoneNumber string, params *LookupParams) (*Lookup, erro
392
394
// NewLookupHLR creates a new HLR lookup for the specified number.
393
395
func (c * Client ) NewLookupHLR (phoneNumber string , params * LookupParams ) (* HLR , error ) {
394
396
urlParams := paramsForLookup (params )
395
- path := LookupPath + "/" + phoneNumber + "/hlr"
397
+ path := LookupPath + "/" + phoneNumber + "/" + HLRPath
396
398
397
399
hlr := & HLR {}
398
400
if err := c .request (hlr , path , urlParams ); err != nil {
@@ -409,7 +411,7 @@ func (c *Client) NewLookupHLR(phoneNumber string, params *LookupParams) (*HLR, e
409
411
// LookupHLR performs a HLR lookup for the specified number.
410
412
func (c * Client ) LookupHLR (phoneNumber string , params * LookupParams ) (* HLR , error ) {
411
413
urlParams := paramsForLookup (params )
412
- path := LookupPath + "/" + phoneNumber + "/hlr ?" + urlParams .Encode ()
414
+ path := LookupPath + "/" + phoneNumber + "/" + HLRPath + " ?" + urlParams .Encode ()
413
415
414
416
hlr := & HLR {}
415
417
if err := c .request (hlr , path , nil ); err != nil {
0 commit comments