-
Notifications
You must be signed in to change notification settings - Fork 18
/
svc_queuedprocesses.go
67 lines (53 loc) · 2.71 KB
/
svc_queuedprocesses.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
56
57
58
59
60
61
62
63
64
65
66
67
package lokalise
import (
"fmt"
)
const (
pathQueuedProcesses = "processes"
)
type QueuedProcessService struct {
BaseService
}
// ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
// Service entity objects
// _____________________________________________________________________________________________________________________
type QueuedProcess struct {
ID string `json:"process_id"`
Type string `json:"type"`
Status string `json:"status"`
Message string `json:"message"`
Details interface{} `json:"details"`
WithCreationUser
WithCreationTime
}
// ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
// Service request/response objects
// _____________________________________________________________________________________________________________________
type QueuedProcessesResponse struct {
WithProjectID
Processes []QueuedProcess `json:"processes"`
}
type QueuedProcessResponse struct {
WithProjectID
Process QueuedProcess `json:"process"`
}
// ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
// Service methods
// _____________________________________________________________________________________________________________________
func (c *QueuedProcessService) List(projectID string) (r QueuedProcessesResponse, err error) {
resp, err := c.get(c.Ctx(), fmt.Sprintf("%s/%s/%s", pathProjects, projectID, pathQueuedProcesses), &r)
if err != nil {
return
}
return r, apiError(resp)
}
func (c *QueuedProcessService) Retrieve(projectID string, processID string) (r QueuedProcessResponse, err error) {
resp, err := c.get(c.Ctx(), pathQueuedProcessById(projectID, processID), &r)
if err != nil {
return
}
return r, apiError(resp)
}
func pathQueuedProcessById(projectID string, processID string) string {
return fmt.Sprintf("%s/%s/%s/%s", pathProjects, projectID, pathQueuedProcesses, processID)
}