-
Notifications
You must be signed in to change notification settings - Fork 1
/
courier.go
43 lines (37 loc) · 1.33 KB
/
courier.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package biteship
import (
"fmt"
"net/http"
)
const (
CourierProviderGrab CourierProvider = "grab"
CourierProviderGojek CourierProvider = "gojek"
CourierProviderJNE CourierProvider = "jne"
CourierProviderTIKI CourierProvider = "tiki"
CourierProviderJET CourierProvider = "jet"
CourierProviderJNT CourierProvider = "jnt"
CourierProviderSicepat CourierProvider = "sicepat"
CourierProviderWahana CourierProvider = "wahana"
CourierProviderPos CourierProvider = "pos"
CourierProviderLion CourierProvider = "lion"
CourierProviderNinja CourierProvider = "ninja"
CourierProviderAnteraja CourierProvider = "anteraja"
CourierProviderRPX CourierProvider = "rpx"
CourierProviderPaxel CourierProvider = "paxel"
CourierProviderMrSpeedy CourierProvider = "mrspeedy"
CourierProviderLalamove CourierProvider = "lalamove"
CourierProviderDeliveree CourierProvider = "deliveree"
CourierProviderSAP CourierProvider = "sap"
)
type CourierProvider string
func (client *Client) GetCouriers() (*ResponseListCourier, *Error) {
resp := &ResponseListCourier{}
var url = fmt.Sprintf("%s/v1/couriers", client.
BiteshipUrl)
errRequest := client.HttpRequest.Call(http.MethodGet, url, client.
SecretKey, nil, resp)
if errRequest != nil {
return resp, errRequest
}
return resp, nil
}