-
Notifications
You must be signed in to change notification settings - Fork 1
/
types.go
47 lines (40 loc) · 2.34 KB
/
types.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
package banana
import "encoding/json"
// This package defines the entirety of what data can be accepted on the inbound Post requests
// InStartV4 Defines the acceptable payload into the task/start/v4 endpoint
type inStartV4 struct {
ID string `json:"id" xml:"id" form:"id"`
Created int64 `json:"created" xml:"created" form:"created"`
APIKey string `json:"apiKey" xml:"apiKey" form:"apiKey"`
ModelKey string `json:"modelKey" xml:"modelKey" form:"modelKey"`
StartOnly bool `json:"startOnly" xml:"startOnly" form:"startOnly"`
ModelInputs json.RawMessage `json:"modelInputs" xml:"modelInputs" form:"modelInputs"` // Keeps the dynamic substruct as raw bytes
}
// OutStartV4 defines the payload to be returned by the task/start/v4 endpoint
type outStartV4 struct {
ID string `json:"id" xml:"id" form:"id"`
Message string `json:"message" xml:"message" form:"message"`
Created int64 `json:"created" xml:"created" form:"created"`
APIVersion string `json:"apiVersion" xml:"apiVersion" form:"apiVersion"`
CallID string `json:"callID" xml:"callID" form:"callID"`
Finished bool `json:"finished" xml:"finished" form:"finished"`
ModelOutputs json.RawMessage `json:"modelOutputs" xml:"modelOutputs" form:"modelOutputs"`
}
// InCheckV4 Defines the acceptable payload into the task/check/v4 endpoint
type inCheckV4 struct {
ID string `json:"id" xml:"id" form:"id"`
Created int64 `json:"created" xml:"created" form:"created"`
APIKey string `json:"apiKey" xml:"apiKey" form:"apiKey"`
LongPoll bool `json:"longPoll" xml:"longPoll" form:"longPoll"`
CallID string `json:"callID" xml:"callID" form:"callID"`
}
// OutCheckV4 defines the payload to be returned by the task/check/v4 endpoint
type outCheckV4 struct {
ID string `json:"id" xml:"id" form:"id"`
Message string `json:"message" xml:"message" form:"message"`
Created int64 `json:"created" xml:"created" form:"created"`
APIVersion string `json:"apiVersion" xml:"apiVersion" form:"apiVersion"`
ModelOutputs json.RawMessage `json:"modelOutputs" xml:"modelOutputs" form:"modelOutputs"`
}
// Export Result, aliased from outCheckV4, which is the return of banana.Run and banana.Check
type Result outCheckV4