Skip to content

Commit 411698f

Browse files
committed
Fix support for Go <1.6
1 parent 9fa6d81 commit 411698f

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

client.go

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ func (c *Client) request(v interface{}, method, path string, data interface{}) e
137137
// with the access key.
138138
func (c *Client) Balance() (*Balance, error) {
139139
balance := &Balance{}
140-
if err := c.request(balance, http.MethodGet, "balance", nil); err != nil {
140+
if err := c.request(balance, "GET", "balance", nil); err != nil {
141141
if err == ErrResponse {
142142
return balance, err
143143
}
@@ -152,7 +152,7 @@ func (c *Client) Balance() (*Balance, error) {
152152
// created by the NewHLR function.
153153
func (c *Client) HLR(id string) (*HLR, error) {
154154
hlr := &HLR{}
155-
if err := c.request(hlr, http.MethodGet, HLRPath+"/"+id, nil); err != nil {
155+
if err := c.request(hlr, "GET", HLRPath+"/"+id, nil); err != nil {
156156
if err == ErrResponse {
157157
return hlr, err
158158
}
@@ -167,7 +167,7 @@ func (c *Client) HLR(id string) (*HLR, error) {
167167
// function.
168168
func (c *Client) HLRs() (*HLRList, error) {
169169
hlrList := &HLRList{}
170-
if err := c.request(hlrList, http.MethodGet, HLRPath, nil); err != nil {
170+
if err := c.request(hlrList, "GET", HLRPath, nil); err != nil {
171171
if err == ErrResponse {
172172
return hlrList, err
173173
}
@@ -187,7 +187,7 @@ func (c *Client) NewHLR(msisdn string, reference string) (*HLR, error) {
187187

188188
hlr := &HLR{}
189189

190-
if err := c.request(hlr, http.MethodPost, HLRPath, requestData); err != nil {
190+
if err := c.request(hlr, "POST", HLRPath, requestData); err != nil {
191191
if err == ErrResponse {
192192
return hlr, err
193193
}
@@ -201,7 +201,7 @@ func (c *Client) NewHLR(msisdn string, reference string) (*HLR, error) {
201201
// Message retrieves the information of an existing Message.
202202
func (c *Client) Message(id string) (*Message, error) {
203203
message := &Message{}
204-
if err := c.request(message, http.MethodGet, MessagePath+"/"+id, nil); err != nil {
204+
if err := c.request(message, "GET", MessagePath+"/"+id, nil); err != nil {
205205
if err == ErrResponse {
206206
return message, err
207207
}
@@ -220,7 +220,7 @@ func (c *Client) Messages(msgListParams *MessageListParams) (*MessageList, error
220220
return messageList, err
221221
}
222222

223-
if err := c.request(messageList, http.MethodGet, MessagePath+"?"+params.Encode(), nil); err != nil {
223+
if err := c.request(messageList, "GET", MessagePath+"?"+params.Encode(), nil); err != nil {
224224
if err == ErrResponse {
225225
return messageList, err
226226
}
@@ -239,7 +239,7 @@ func (c *Client) NewMessage(originator string, recipients []string, body string,
239239
}
240240

241241
message := &Message{}
242-
if err := c.request(message, http.MethodPost, MessagePath, requestData); err != nil {
242+
if err := c.request(message, "POST", MessagePath, requestData); err != nil {
243243
if err == ErrResponse {
244244
return message, err
245245
}
@@ -253,7 +253,7 @@ func (c *Client) NewMessage(originator string, recipients []string, body string,
253253
// MMSMessage retrieves the information of an existing MmsMessage.
254254
func (c *Client) MMSMessage(id string) (*MMSMessage, error) {
255255
mmsMessage := &MMSMessage{}
256-
if err := c.request(mmsMessage, http.MethodGet, MMSPath+"/"+id, nil); err != nil {
256+
if err := c.request(mmsMessage, "GET", MMSPath+"/"+id, nil); err != nil {
257257
if err == ErrResponse {
258258
return mmsMessage, err
259259
}
@@ -275,7 +275,7 @@ func (c *Client) NewMMSMessage(originator string, recipients []string, msgParams
275275
params.Set("recipients", strings.Join(recipients, ","))
276276

277277
mmsMessage := &MMSMessage{}
278-
if err := c.request(mmsMessage, http.MethodPost, MMSPath, params); err != nil {
278+
if err := c.request(mmsMessage, "POST", MMSPath, params); err != nil {
279279
if err == ErrResponse {
280280
return mmsMessage, err
281281
}
@@ -289,7 +289,7 @@ func (c *Client) NewMMSMessage(originator string, recipients []string, msgParams
289289
// VoiceMessage retrieves the information of an existing VoiceMessage.
290290
func (c *Client) VoiceMessage(id string) (*VoiceMessage, error) {
291291
message := &VoiceMessage{}
292-
if err := c.request(message, http.MethodGet, VoiceMessagePath+"/"+id, nil); err != nil {
292+
if err := c.request(message, "GET", VoiceMessagePath+"/"+id, nil); err != nil {
293293
if err == ErrResponse {
294294
return message, err
295295
}
@@ -303,7 +303,7 @@ func (c *Client) VoiceMessage(id string) (*VoiceMessage, error) {
303303
// VoiceMessages retrieves all VoiceMessages of the user.
304304
func (c *Client) VoiceMessages() (*VoiceMessageList, error) {
305305
messageList := &VoiceMessageList{}
306-
if err := c.request(messageList, http.MethodGet, VoiceMessagePath, nil); err != nil {
306+
if err := c.request(messageList, "GET", VoiceMessagePath, nil); err != nil {
307307
if err == ErrResponse {
308308
return messageList, err
309309
}
@@ -322,7 +322,7 @@ func (c *Client) NewVoiceMessage(recipients []string, body string, params *Voice
322322
}
323323

324324
message := &VoiceMessage{}
325-
if err := c.request(message, http.MethodPost, VoiceMessagePath, requestData); err != nil {
325+
if err := c.request(message, "POST", VoiceMessagePath, requestData); err != nil {
326326
if err == ErrResponse {
327327
return message, err
328328
}
@@ -341,7 +341,7 @@ func (c *Client) NewVerify(recipient string, params *VerifyParams) (*Verify, err
341341
}
342342

343343
verify := &Verify{}
344-
if err := c.request(verify, http.MethodPost, VerifyPath, requestData); err != nil {
344+
if err := c.request(verify, "POST", VerifyPath, requestData); err != nil {
345345
if err == ErrResponse {
346346
return verify, err
347347
}
@@ -360,7 +360,7 @@ func (c *Client) VerifyToken(id, token string) (*Verify, error) {
360360
path := VerifyPath + "/" + id + "?" + params.Encode()
361361

362362
verify := &Verify{}
363-
if err := c.request(verify, http.MethodGet, path, nil); err != nil {
363+
if err := c.request(verify, "GET", path, nil); err != nil {
364364
if err == ErrResponse {
365365
return verify, err
366366
}
@@ -377,7 +377,7 @@ func (c *Client) Lookup(phoneNumber string, params *LookupParams) (*Lookup, erro
377377
path := LookupPath + "/" + phoneNumber + "?" + urlParams.Encode()
378378

379379
lookup := &Lookup{}
380-
if err := c.request(lookup, http.MethodPost, path, nil); err != nil {
380+
if err := c.request(lookup, "POST", path, nil); err != nil {
381381
if err == ErrResponse {
382382
return lookup, err
383383
}
@@ -394,7 +394,7 @@ func (c *Client) NewLookupHLR(phoneNumber string, params *LookupParams) (*HLR, e
394394
path := LookupPath + "/" + phoneNumber + "/" + HLRPath
395395

396396
hlr := &HLR{}
397-
if err := c.request(hlr, http.MethodPost, path, requestData); err != nil {
397+
if err := c.request(hlr, "POST", path, requestData); err != nil {
398398
if err == ErrResponse {
399399
return hlr, err
400400
}
@@ -411,7 +411,7 @@ func (c *Client) LookupHLR(phoneNumber string, params *LookupParams) (*HLR, erro
411411
path := LookupPath + "/" + phoneNumber + "/" + HLRPath + "?" + urlParams.Encode()
412412

413413
hlr := &HLR{}
414-
if err := c.request(hlr, http.MethodGet, path, nil); err != nil {
414+
if err := c.request(hlr, "GET", path, nil); err != nil {
415415
if err == ErrResponse {
416416
return hlr, err
417417
}

0 commit comments

Comments
 (0)