-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathendpoint.go
41 lines (35 loc) · 923 Bytes
/
endpoint.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
package slip
import "context"
// Endpoint is the slip endpoint
type Endpoint interface {
Create(context.Context, *CreateRequest) (*CreateResponse, error)
FindByID(context.Context, *FindByIDRequest) (*FindByIDResponse, error)
}
// Create
type (
// CreateRequest is the request for create endpoint
CreateRequest struct {
DocNumber string `json:"doc_number"`
RefNumber string `json:"ref_number"`
Title string `json:"title"`
DocDate string `json:"doc_date"`
SlipLines []Line
AccessToken string `json:"access_token"`
}
// CreateResponse is the response for create endpoint
CreateResponse struct {
ID string `json:"id"`
URL string `json:"url"`
}
)
// Find
type (
// FindRequest is the request for find endpoint
FindByIDRequest struct {
ID string `json:"id"`
}
// FindByIDRespose is the response for find by id endpoint
FindByIDResponse struct {
URL string `json:"id"`
}
)