-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.go
55 lines (50 loc) · 1.77 KB
/
init.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
44
45
46
47
48
49
50
51
52
53
54
55
package yandexdelivery
import (
"log"
"net/url"
)
const (
methodBase = "b2b/cargo/integration/v2/"
methodDeliveryMethods = "delivery-methods"
methodCheckPrice = "check-price"
methodTariffs = "tariffs"
methodOffersCalculate = "offers/calculate"
methodCreate = "claims/create"
methodAccept = "claims/accept"
methodSearch = "claims/search"
methodInfo = "claims/info"
methodCancelInfo = "claims/cancel-info"
methodCancel = "claims/cancel"
methodReturn = "claims/return"
methodCourierPhone = "driver-voiceforwarding"
methodCourierPosition = "claims/performer-position"
methodTrackingLinks = "claims/tracking-links"
methodConfirmationCode = "claims/confirmation_code"
methodDocument = "claims/document"
methodBulkInfo = "claims/bulk_info"
methodJournal = "claims/journal"
methodPointsEta = "claims/points-eta"
methodEdit = "claims/edit"
methodApplyChanges = "claims/apply-changes/request"
methodApplyChangesResult = "claims/apply-changes/result"
methodRobotCheckAvailability = "claims/robot/check-availability"
methodRobotOpen = "claims/robot/open-request"
methodPhotosPoint = "claims/photos_by_point"
methodProofDelivery = "claims/proof-of-delivery/info"
)
type YandexClient struct {
debugMode bool
url string
token string
}
func NewYandexClient(urlBase, token string, debugMode bool) *YandexClient {
u, err := url.JoinPath(urlBase, methodBase)
if err != nil {
log.Fatal(err)
}
return &YandexClient{
url: u,
debugMode: debugMode,
token: token,
}
}