-
Notifications
You must be signed in to change notification settings - Fork 132
/
get_job_run_error.go
154 lines (123 loc) · 4.01 KB
/
get_job_run_error.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
// Code generated by go-swagger; DO NOT EDIT.
package operations
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the generate command
import (
"context"
"net/http"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// GetJobRunErrorHandlerFunc turns a function with the right signature into a get job run error handler
type GetJobRunErrorHandlerFunc func(GetJobRunErrorParams) middleware.Responder
// Handle executing the request and returning a response
func (fn GetJobRunErrorHandlerFunc) Handle(params GetJobRunErrorParams) middleware.Responder {
return fn(params)
}
// GetJobRunErrorHandler interface for that can handle valid get job run error params
type GetJobRunErrorHandler interface {
Handle(GetJobRunErrorParams) middleware.Responder
}
// NewGetJobRunError creates a new http.Handler for the get job run error operation
func NewGetJobRunError(ctx *middleware.Context, handler GetJobRunErrorHandler) *GetJobRunError {
return &GetJobRunError{Context: ctx, Handler: handler}
}
/* GetJobRunError swagger:route POST /api/v1/jobRunError getJobRunError
GetJobRunError get job run error API
*/
type GetJobRunError struct {
Context *middleware.Context
Handler GetJobRunErrorHandler
}
func (o *GetJobRunError) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
route, rCtx, _ := o.Context.RouteInfo(r)
if rCtx != nil {
*r = *rCtx
}
var Params = NewGetJobRunErrorParams()
if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
res := o.Handler.Handle(Params) // actually handle the request
o.Context.Respond(rw, r, route.Produces, route, res)
}
// GetJobRunErrorBody get job run error body
//
// swagger:model GetJobRunErrorBody
type GetJobRunErrorBody struct {
// run Id
// Required: true
RunID string `json:"runId"`
}
// Validate validates this get job run error body
func (o *GetJobRunErrorBody) Validate(formats strfmt.Registry) error {
var res []error
if err := o.validateRunID(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (o *GetJobRunErrorBody) validateRunID(formats strfmt.Registry) error {
if err := validate.RequiredString("getJobRunErrorRequest"+"."+"runId", "body", o.RunID); err != nil {
return err
}
return nil
}
// ContextValidate validates this get job run error body based on context it is used
func (o *GetJobRunErrorBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (o *GetJobRunErrorBody) MarshalBinary() ([]byte, error) {
if o == nil {
return nil, nil
}
return swag.WriteJSON(o)
}
// UnmarshalBinary interface implementation
func (o *GetJobRunErrorBody) UnmarshalBinary(b []byte) error {
var res GetJobRunErrorBody
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*o = res
return nil
}
// GetJobRunErrorOKBody get job run error o k body
//
// swagger:model GetJobRunErrorOKBody
type GetJobRunErrorOKBody struct {
// Error for individual job run
ErrorString string `json:"errorString,omitempty"`
}
// Validate validates this get job run error o k body
func (o *GetJobRunErrorOKBody) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this get job run error o k body based on context it is used
func (o *GetJobRunErrorOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (o *GetJobRunErrorOKBody) MarshalBinary() ([]byte, error) {
if o == nil {
return nil, nil
}
return swag.WriteJSON(o)
}
// UnmarshalBinary interface implementation
func (o *GetJobRunErrorOKBody) UnmarshalBinary(b []byte) error {
var res GetJobRunErrorOKBody
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*o = res
return nil
}