Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cmd/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ func buildFmeFlowRequest(endpoint string, method string, body io.Reader) (http.R
}

// since the JSON for published parameters has subtypes, we need to implement this ourselves
func (f *JobRequest) UnmarshalJSON(b []byte) error {
type job JobRequest
func (f *JobRequestV3) UnmarshalJSON(b []byte) error {
type job JobRequestV3
err := json.Unmarshal(b, (*job)(f))
if err != nil {
return err
Expand Down Expand Up @@ -85,9 +85,9 @@ func (f *JobRequest) UnmarshalJSON(b []byte) error {
return nil
}

func (f *JobRequest) MarshalJSON() ([]byte, error) {
func (f *JobRequestV3) MarshalJSON() ([]byte, error) {

type job JobRequest
type job JobRequestV3
if f.PublishedParameters != nil {
for _, v := range f.PublishedParameters {
b, err := json.Marshal(v)
Expand Down
44 changes: 22 additions & 22 deletions cmd/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,28 +41,28 @@ type JobStatusV4 struct {
}

type JobStatusV3 struct {
Request JobRequest `json:"request"`
TimeDelivered time.Time `json:"timeDelivered"`
Workspace string `json:"workspace"`
NumErrors int `json:"numErrors"`
NumLines int `json:"numLines"`
EngineHost string `json:"engineHost"`
TimeQueued time.Time `json:"timeQueued"`
CPUPct float64 `json:"cpuPct"`
Description string `json:"description"`
TimeStarted time.Time `json:"timeStarted"`
Repository string `json:"repository"`
UserName string `json:"userName"`
Result JobResult `json:"result"`
CPUTime int `json:"cpuTime"`
ID int `json:"id"`
TimeFinished time.Time `json:"timeFinished"`
EngineName string `json:"engineName"`
NumWarnings int `json:"numWarnings"`
TimeSubmitted time.Time `json:"timeSubmitted"`
ElapsedTime int `json:"elapsedTime"`
PeakMemUsage int `json:"peakMemUsage"`
Status string `json:"status"`
Request JobRequestV3 `json:"request"`
TimeDelivered time.Time `json:"timeDelivered"`
Workspace string `json:"workspace"`
NumErrors int `json:"numErrors"`
NumLines int `json:"numLines"`
EngineHost string `json:"engineHost"`
TimeQueued time.Time `json:"timeQueued"`
CPUPct float64 `json:"cpuPct"`
Description string `json:"description"`
TimeStarted time.Time `json:"timeStarted"`
Repository string `json:"repository"`
UserName string `json:"userName"`
Result JobResultV3 `json:"result"`
CPUTime int `json:"cpuTime"`
ID int `json:"id"`
TimeFinished time.Time `json:"timeFinished"`
EngineName string `json:"engineName"`
NumWarnings int `json:"numWarnings"`
TimeSubmitted time.Time `json:"timeSubmitted"`
ElapsedTime int `json:"elapsedTime"`
PeakMemUsage int `json:"peakMemUsage"`
Status string `json:"status"`
}

type JobsV4 struct {
Expand Down
Loading