diff --git a/cmd/wfcli/admin.go b/cmd/wfcli/admin.go index aea085c5..8113154a 100644 --- a/cmd/wfcli/admin.go +++ b/cmd/wfcli/admin.go @@ -1,8 +1,10 @@ package main import ( - "github.com/fission/fission-workflows/cmd/wfcli/swagger-client/client/admin_api" - "github.com/go-openapi/strfmt" + "context" + "net/http" + + "github.com/fission/fission-workflows/pkg/apiserver/httpclient" "github.com/urfave/cli" ) @@ -16,10 +18,10 @@ var cmdAdmin = cli.Command{ Name: "halt", Usage: "Stop the workflow engine from evaluating anything", Action: func(c *cli.Context) error { - u := parseUrl(c.GlobalString("url")) - client := createTransportClient(u) - adminApi := admin_api.New(client, strfmt.Default) - _, err := adminApi.Halt(admin_api.NewHaltParams()) + ctx := context.TODO() + url := parseUrl(c.GlobalString("url")) + admin := httpclient.NewAdminApi(url.String(), http.Client{}) + err := admin.Halt(ctx) if err != nil { panic(err) } @@ -30,10 +32,10 @@ var cmdAdmin = cli.Command{ Name: "resume", Usage: "Resume the workflow engine evaluations", Action: func(c *cli.Context) error { - u := parseUrl(c.GlobalString("url")) - client := createTransportClient(u) - adminApi := admin_api.New(client, strfmt.Default) - _, err := adminApi.Resume(admin_api.NewResumeParams()) + ctx := context.TODO() + url := parseUrl(c.GlobalString("url")) + admin := httpclient.NewAdminApi(url.String(), http.Client{}) + err := admin.Resume(ctx) if err != nil { panic(err) } diff --git a/cmd/wfcli/invocation.go b/cmd/wfcli/invocation.go index 4b50a2ed..a1104c41 100644 --- a/cmd/wfcli/invocation.go +++ b/cmd/wfcli/invocation.go @@ -1,18 +1,17 @@ package main import ( + "context" "fmt" "io" + "net/http" "os" "sort" "time" - "github.com/fission/fission-workflows/cmd/wfcli/swagger-client/client/workflow_api" - "github.com/fission/fission-workflows/cmd/wfcli/swagger-client/client/workflow_invocation_api" - "github.com/fission/fission-workflows/cmd/wfcli/swagger-client/models" + "github.com/fission/fission-workflows/pkg/apiserver/httpclient" "github.com/fission/fission-workflows/pkg/parse/yaml" "github.com/fission/fission-workflows/pkg/types" - "github.com/go-openapi/strfmt" "github.com/urfave/cli" ) @@ -32,9 +31,12 @@ var cmdInvocation = cli.Command{ }, }, Action: func(c *cli.Context) error { - u := parseUrl(c.GlobalString("url")) - client := createTransportClient(u) - wfiApi := workflow_invocation_api.New(client, strfmt.Default) + //u := parseUrl(c.GlobalString("url")) + //client := createTransportClient(u) + //wfiApi := workflow_invocation_api.New(client, strfmt.Default) + ctx := context.TODO() + url := parseUrl(c.GlobalString("url")) + wfiApi := httpclient.NewInvocationApi(url.String(), http.Client{}) switch c.NArg() { case 0: since := c.Duration("history") @@ -42,11 +44,10 @@ var cmdInvocation = cli.Command{ case 1: // Get Workflow invocation wfiId := c.Args().Get(0) - resp, err := wfiApi.WfiGet(workflow_invocation_api.NewWfiGetParams().WithID(wfiId)) + wfi, err := wfiApi.Get(ctx, wfiId) if err != nil { panic(err) } - wfi := resp.Payload b, err := yaml.Marshal(wfi) if err != nil { panic(err) @@ -57,11 +58,10 @@ var cmdInvocation = cli.Command{ default: wfiId := c.Args().Get(0) taskId := c.Args().Get(1) - resp, err := wfiApi.WfiGet(workflow_invocation_api.NewWfiGetParams().WithID(wfiId)) + wfi, err := wfiApi.Get(ctx, wfiId) if err != nil { panic(err) } - wfi := resp.Payload ti, ok := wfi.Status.Tasks[taskId] if !ok { fmt.Println("Task invocation not found.") @@ -82,14 +82,16 @@ var cmdInvocation = cli.Command{ Usage: "cancel ", Action: func(c *cli.Context) error { wfiId := c.Args().Get(0) - u := parseUrl(c.GlobalString("url")) - client := createTransportClient(u) - wfiApi := workflow_invocation_api.New(client, strfmt.Default) - resp, err := wfiApi.Cancel(workflow_invocation_api.NewCancelParams().WithID(wfiId)) + //u := parseUrl(c.GlobalString("url")) + //client := createTransportClient(u) + //wfiApi := workflow_invocation_api.New(client, strfmt.Default) + ctx := context.TODO() + url := parseUrl(c.GlobalString("url")) + wfiApi := httpclient.NewInvocationApi(url.String(), http.Client{}) + err := wfiApi.Cancel(ctx, wfiId) if err != nil { panic(err) } - fmt.Println(resp) return nil }, }, @@ -109,31 +111,32 @@ var cmdInvocation = cli.Command{ }, Action: func(c *cli.Context) error { wfId := c.Args().Get(0) - u := parseUrl(c.GlobalString("url")) - client := createTransportClient(u) - wfiApi := workflow_invocation_api.New(client, strfmt.Default) - body := &models.WorkflowInvocationSpec{ - WorkflowID: wfId, - Inputs: map[string]models.TypedValue{}, + //u := parseUrl(c.GlobalString("url")) + //client := createTransportClient(u) + //wfiApi := workflow_invocation_api.New(client, strfmt.Default) + ctx := context.TODO() + url := parseUrl(c.GlobalString("url")) + wfiApi := httpclient.NewInvocationApi(url.String(), http.Client{}) + spec := &types.WorkflowInvocationSpec{ + WorkflowId: wfId, + Inputs: map[string]*types.TypedValue{}, } if c.Bool("sync") { - params := workflow_invocation_api.NewInvokeSyncParams().WithBody(body) - resp, err := wfiApi.InvokeSync(params) + resp, err := wfiApi.InvokeSync(ctx, spec) if err != nil { panic(err) } - bs, err := yaml.Marshal(resp.Payload) + bs, err := yaml.Marshal(resp) if err != nil { panic(err) } fmt.Println(string(bs)) } else { - params := workflow_invocation_api.NewInvokeParams().WithBody(body) - resp, err := wfiApi.Invoke(params) + resp, err := wfiApi.Invoke(ctx, spec) if err != nil { panic(err) } - fmt.Println(resp.Payload.ID) + fmt.Println(resp.Id) } return nil }, @@ -147,28 +150,30 @@ var cmdInvocation = cli.Command{ return nil } wfiId := c.Args().Get(0) - u := parseUrl(c.GlobalString("url")) - client := createTransportClient(u) - wfApi := workflow_api.New(client, strfmt.Default) - wfiApi := workflow_invocation_api.New(client, strfmt.Default) - - wfiResp, err := wfiApi.WfiGet(workflow_invocation_api.NewWfiGetParams().WithID(wfiId)) + //u := parseUrl(c.GlobalString("url")) + //client := createTransportClient(u) + //wfApi := workflow_api.New(client, strfmt.Default) + //wfiApi := workflow_invocation_api.New(client, strfmt.Default) + ctx := context.TODO() + url := parseUrl(c.GlobalString("url")) + wfiApi := httpclient.NewInvocationApi(url.String(), http.Client{}) + wfApi := httpclient.NewWorkflowApi(url.String(), http.Client{}) + + wfi, err := wfiApi.Get(ctx, wfiId) if err != nil { panic(err) } - wfi := wfiResp.Payload - wfResp, err := wfApi.WfGet(workflow_api.NewWfGetParams().WithID(wfi.Spec.WorkflowID)) + wf, err := wfApi.Get(ctx, wfi.Spec.WorkflowId) if err != nil { panic(err) } - wf := wfResp.Payload wfiUpdated := wfi.Status.UpdatedAt.String() wfiCreated := wfi.Metadata.CreatedAt.String() table(os.Stdout, nil, [][]string{ - {"ID", wfi.Metadata.ID}, - {"WORKFLOW_ID", wfi.Spec.WorkflowID}, + {"ID", wfi.Metadata.Id}, + {"WORKFLOW_ID", wfi.Spec.WorkflowId}, {"CREATED", wfiCreated}, {"UPDATED", wfiUpdated}, {"STATUS", string(wfi.Status.Status)}, @@ -177,9 +182,9 @@ var cmdInvocation = cli.Command{ var rows [][]string rows = collectStatus(wf.Spec.Tasks, wfi.Status.Tasks, rows) - dynamicTaskSpecs := map[string]models.TaskSpec{} + dynamicTaskSpecs := map[string]*types.TaskSpec{} for k, v := range wfi.Status.DynamicTasks { - dynamicTaskSpecs[k] = *v.Spec + dynamicTaskSpecs[k] = v.Spec } rows = collectStatus(dynamicTaskSpecs, wfi.Status.Tasks, rows) @@ -190,30 +195,27 @@ var cmdInvocation = cli.Command{ }, } -func invocationsList(out io.Writer, wfiApi *workflow_invocation_api.Client, since time.Time) { +func invocationsList(out io.Writer, wfiApi *httpclient.InvocationApi, since time.Time) { // List workflows invocations - resp, err := wfiApi.WfiList(workflow_invocation_api.NewWfiListParams()) + ctx := context.TODO() + wis, err := wfiApi.List(ctx) if err != nil { panic(err) } - wis := resp.Payload sort.Strings(wis.Invocations) var rows [][]string for _, wfiId := range wis.Invocations { - resp, err := wfiApi.WfiGet(workflow_invocation_api.NewWfiGetParams().WithID(wfiId)) + wi, err := wfiApi.Get(ctx, wfiId) if err != nil { panic(err) } - wi := resp.Payload updated := wi.Status.UpdatedAt.String() created := wi.Metadata.CreatedAt.String() // TODO add filter params to endpoint instead - if isCompleted(wi.Status.Status) && since.Before(time.Time(wi.Status.UpdatedAt)) { - continue - } + // TODO filter old invocations and system invocations - rows = append(rows, []string{wfiId, wi.Spec.WorkflowID, string(wi.Status.Status), + rows = append(rows, []string{wfiId, wi.Spec.WorkflowId, string(wi.Status.Status), created, updated}) } @@ -221,7 +223,7 @@ func invocationsList(out io.Writer, wfiApi *workflow_invocation_api.Client, sinc } -func collectStatus(tasks map[string]models.TaskSpec, taskStatus map[string]models.TaskInvocation, +func collectStatus(tasks map[string]*types.TaskSpec, taskStatus map[string]*types.TaskInvocation, rows [][]string) [][]string { var ids []string for id := range tasks { @@ -245,9 +247,3 @@ func collectStatus(tasks map[string]models.TaskSpec, taskStatus map[string]model } return rows } - -func isCompleted(status models.WorkflowInvocationStatusStatus) bool { - return status == models.WorkflowInvocationStatusStatusSUCCEEDED || - status == models.WorkflowInvocationStatusStatusABORTED || - status == models.WorkflowInvocationStatusStatusFAILED -} diff --git a/cmd/wfcli/main.go b/cmd/wfcli/main.go index 972ca703..85312105 100644 --- a/cmd/wfcli/main.go +++ b/cmd/wfcli/main.go @@ -8,7 +8,6 @@ import ( "strings" "text/tabwriter" - httptransport "github.com/go-openapi/runtime/client" "github.com/urfave/cli" ) @@ -61,9 +60,9 @@ func table(writer io.Writer, headings []string, rows [][]string) { } } -func createTransportClient(baseUrl *url.URL) *httptransport.Runtime { - return httptransport.New(baseUrl.Host, "/proxy/workflows-apiserver/", []string{baseUrl.Scheme}) -} +//func createTransportClient(baseUrl *url.URL) *httptransport.Runtime { +// return httptransport.New(baseUrl.Host, "/proxy/workflows-apiserver/", []string{baseUrl.Scheme}) +//} func fail(msg ...interface{}) { for _, line := range msg { diff --git a/cmd/wfcli/status.go b/cmd/wfcli/status.go index 36f029c5..866abd50 100644 --- a/cmd/wfcli/status.go +++ b/cmd/wfcli/status.go @@ -1,10 +1,11 @@ package main import ( + "context" "fmt" + "net/http" - "github.com/fission/fission-workflows/cmd/wfcli/swagger-client/client/admin_api" - "github.com/go-openapi/strfmt" + "github.com/fission/fission-workflows/pkg/apiserver/httpclient" "github.com/urfave/cli" ) @@ -13,15 +14,15 @@ var cmdStatus = cli.Command{ Aliases: []string{"s"}, Usage: "Check cluster status", Action: func(c *cli.Context) error { - u := parseUrl(c.GlobalString("url")) - client := createTransportClient(u) - adminApi := admin_api.New(client, strfmt.Default) + ctx := context.TODO() + url := parseUrl(c.GlobalString("url")) + admin := httpclient.NewAdminApi(url.String(), http.Client{}) - resp, err := adminApi.Status(admin_api.NewStatusParams()) + resp, err := admin.Status(ctx) if err != nil { panic(err) } - fmt.Printf(resp.Payload.Status) + fmt.Printf(resp.Status) return nil }, diff --git a/cmd/wfcli/swagger-client/client/admin_api/admin_api_client.go b/cmd/wfcli/swagger-client/client/admin_api/admin_api_client.go deleted file mode 100644 index 05c047f7..00000000 --- a/cmd/wfcli/swagger-client/client/admin_api/admin_api_client.go +++ /dev/null @@ -1,142 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package admin_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" -) - -// New creates a new admin api API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { - return &Client{transport: transport, formats: formats} -} - -/* -Client for admin api API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -/* -Halt halt API -*/ -func (a *Client) Halt(params *HaltParams) (*HaltOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewHaltParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "Halt", - Method: "GET", - PathPattern: "/halt", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &HaltReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*HaltOK), nil - -} - -/* -Resume resume API -*/ -func (a *Client) Resume(params *ResumeParams) (*ResumeOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewResumeParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "Resume", - Method: "GET", - PathPattern: "/resume", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ResumeReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*ResumeOK), nil - -} - -/* -Status status API -*/ -func (a *Client) Status(params *StatusParams) (*StatusOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewStatusParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "Status", - Method: "GET", - PathPattern: "/status", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &StatusReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*StatusOK), nil - -} - -/* -Version version API -*/ -func (a *Client) Version(params *VersionParams) (*VersionOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewVersionParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "Version", - Method: "GET", - PathPattern: "/version", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &VersionReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*VersionOK), nil - -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/cmd/wfcli/swagger-client/client/admin_api/halt_parameters.go b/cmd/wfcli/swagger-client/client/admin_api/halt_parameters.go deleted file mode 100644 index b0682cb8..00000000 --- a/cmd/wfcli/swagger-client/client/admin_api/halt_parameters.go +++ /dev/null @@ -1,114 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package admin_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - "time" - - "golang.org/x/net/context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" -) - -// NewHaltParams creates a new HaltParams object -// with the default values initialized. -func NewHaltParams() *HaltParams { - - return &HaltParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewHaltParamsWithTimeout creates a new HaltParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewHaltParamsWithTimeout(timeout time.Duration) *HaltParams { - - return &HaltParams{ - - timeout: timeout, - } -} - -// NewHaltParamsWithContext creates a new HaltParams object -// with the default values initialized, and the ability to set a context for a request -func NewHaltParamsWithContext(ctx context.Context) *HaltParams { - - return &HaltParams{ - - Context: ctx, - } -} - -// NewHaltParamsWithHTTPClient creates a new HaltParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewHaltParamsWithHTTPClient(client *http.Client) *HaltParams { - - return &HaltParams{ - HTTPClient: client, - } -} - -/*HaltParams contains all the parameters to send to the API endpoint -for the halt operation typically these are written to a http.Request -*/ -type HaltParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the halt params -func (o *HaltParams) WithTimeout(timeout time.Duration) *HaltParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the halt params -func (o *HaltParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the halt params -func (o *HaltParams) WithContext(ctx context.Context) *HaltParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the halt params -func (o *HaltParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the halt params -func (o *HaltParams) WithHTTPClient(client *http.Client) *HaltParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the halt params -func (o *HaltParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *HaltParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/cmd/wfcli/swagger-client/client/admin_api/halt_responses.go b/cmd/wfcli/swagger-client/client/admin_api/halt_responses.go deleted file mode 100644 index 101500e5..00000000 --- a/cmd/wfcli/swagger-client/client/admin_api/halt_responses.go +++ /dev/null @@ -1,65 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package admin_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/fission/fission-workflows/cmd/wfcli/swagger-client/models" -) - -// HaltReader is a Reader for the Halt structure. -type HaltReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *HaltReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - - case 200: - result := NewHaltOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewHaltOK creates a HaltOK with default headers values -func NewHaltOK() *HaltOK { - return &HaltOK{} -} - -/*HaltOK handles this case with default header values. - -HaltOK halt o k -*/ -type HaltOK struct { - Payload models.ProtobufEmpty -} - -func (o *HaltOK) Error() string { - return fmt.Sprintf("[GET /halt][%d] haltOK %+v", 200, o.Payload) -} - -func (o *HaltOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/cmd/wfcli/swagger-client/client/admin_api/resume_parameters.go b/cmd/wfcli/swagger-client/client/admin_api/resume_parameters.go deleted file mode 100644 index 89d1e115..00000000 --- a/cmd/wfcli/swagger-client/client/admin_api/resume_parameters.go +++ /dev/null @@ -1,114 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package admin_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - "time" - - "golang.org/x/net/context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" -) - -// NewResumeParams creates a new ResumeParams object -// with the default values initialized. -func NewResumeParams() *ResumeParams { - - return &ResumeParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewResumeParamsWithTimeout creates a new ResumeParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewResumeParamsWithTimeout(timeout time.Duration) *ResumeParams { - - return &ResumeParams{ - - timeout: timeout, - } -} - -// NewResumeParamsWithContext creates a new ResumeParams object -// with the default values initialized, and the ability to set a context for a request -func NewResumeParamsWithContext(ctx context.Context) *ResumeParams { - - return &ResumeParams{ - - Context: ctx, - } -} - -// NewResumeParamsWithHTTPClient creates a new ResumeParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewResumeParamsWithHTTPClient(client *http.Client) *ResumeParams { - - return &ResumeParams{ - HTTPClient: client, - } -} - -/*ResumeParams contains all the parameters to send to the API endpoint -for the resume operation typically these are written to a http.Request -*/ -type ResumeParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the resume params -func (o *ResumeParams) WithTimeout(timeout time.Duration) *ResumeParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the resume params -func (o *ResumeParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the resume params -func (o *ResumeParams) WithContext(ctx context.Context) *ResumeParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the resume params -func (o *ResumeParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the resume params -func (o *ResumeParams) WithHTTPClient(client *http.Client) *ResumeParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the resume params -func (o *ResumeParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *ResumeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/cmd/wfcli/swagger-client/client/admin_api/resume_responses.go b/cmd/wfcli/swagger-client/client/admin_api/resume_responses.go deleted file mode 100644 index 420a60a0..00000000 --- a/cmd/wfcli/swagger-client/client/admin_api/resume_responses.go +++ /dev/null @@ -1,65 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package admin_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/fission/fission-workflows/cmd/wfcli/swagger-client/models" -) - -// ResumeReader is a Reader for the Resume structure. -type ResumeReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ResumeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - - case 200: - result := NewResumeOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewResumeOK creates a ResumeOK with default headers values -func NewResumeOK() *ResumeOK { - return &ResumeOK{} -} - -/*ResumeOK handles this case with default header values. - -ResumeOK resume o k -*/ -type ResumeOK struct { - Payload models.ProtobufEmpty -} - -func (o *ResumeOK) Error() string { - return fmt.Sprintf("[GET /resume][%d] resumeOK %+v", 200, o.Payload) -} - -func (o *ResumeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/cmd/wfcli/swagger-client/client/admin_api/status_parameters.go b/cmd/wfcli/swagger-client/client/admin_api/status_parameters.go deleted file mode 100644 index 36de8709..00000000 --- a/cmd/wfcli/swagger-client/client/admin_api/status_parameters.go +++ /dev/null @@ -1,114 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package admin_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - "time" - - "golang.org/x/net/context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" -) - -// NewStatusParams creates a new StatusParams object -// with the default values initialized. -func NewStatusParams() *StatusParams { - - return &StatusParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewStatusParamsWithTimeout creates a new StatusParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewStatusParamsWithTimeout(timeout time.Duration) *StatusParams { - - return &StatusParams{ - - timeout: timeout, - } -} - -// NewStatusParamsWithContext creates a new StatusParams object -// with the default values initialized, and the ability to set a context for a request -func NewStatusParamsWithContext(ctx context.Context) *StatusParams { - - return &StatusParams{ - - Context: ctx, - } -} - -// NewStatusParamsWithHTTPClient creates a new StatusParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewStatusParamsWithHTTPClient(client *http.Client) *StatusParams { - - return &StatusParams{ - HTTPClient: client, - } -} - -/*StatusParams contains all the parameters to send to the API endpoint -for the status operation typically these are written to a http.Request -*/ -type StatusParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the status params -func (o *StatusParams) WithTimeout(timeout time.Duration) *StatusParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the status params -func (o *StatusParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the status params -func (o *StatusParams) WithContext(ctx context.Context) *StatusParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the status params -func (o *StatusParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the status params -func (o *StatusParams) WithHTTPClient(client *http.Client) *StatusParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the status params -func (o *StatusParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *StatusParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/cmd/wfcli/swagger-client/client/admin_api/status_responses.go b/cmd/wfcli/swagger-client/client/admin_api/status_responses.go deleted file mode 100644 index 5bd56e68..00000000 --- a/cmd/wfcli/swagger-client/client/admin_api/status_responses.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package admin_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/fission/fission-workflows/cmd/wfcli/swagger-client/models" -) - -// StatusReader is a Reader for the Status structure. -type StatusReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *StatusReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - - case 200: - result := NewStatusOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewStatusOK creates a StatusOK with default headers values -func NewStatusOK() *StatusOK { - return &StatusOK{} -} - -/*StatusOK handles this case with default header values. - -StatusOK status o k -*/ -type StatusOK struct { - Payload *models.ApiserverHealth -} - -func (o *StatusOK) Error() string { - return fmt.Sprintf("[GET /status][%d] statusOK %+v", 200, o.Payload) -} - -func (o *StatusOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ApiserverHealth) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/cmd/wfcli/swagger-client/client/admin_api/version_parameters.go b/cmd/wfcli/swagger-client/client/admin_api/version_parameters.go deleted file mode 100644 index 3e730fcc..00000000 --- a/cmd/wfcli/swagger-client/client/admin_api/version_parameters.go +++ /dev/null @@ -1,114 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package admin_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - "time" - - "golang.org/x/net/context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" -) - -// NewVersionParams creates a new VersionParams object -// with the default values initialized. -func NewVersionParams() *VersionParams { - - return &VersionParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewVersionParamsWithTimeout creates a new VersionParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewVersionParamsWithTimeout(timeout time.Duration) *VersionParams { - - return &VersionParams{ - - timeout: timeout, - } -} - -// NewVersionParamsWithContext creates a new VersionParams object -// with the default values initialized, and the ability to set a context for a request -func NewVersionParamsWithContext(ctx context.Context) *VersionParams { - - return &VersionParams{ - - Context: ctx, - } -} - -// NewVersionParamsWithHTTPClient creates a new VersionParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewVersionParamsWithHTTPClient(client *http.Client) *VersionParams { - - return &VersionParams{ - HTTPClient: client, - } -} - -/*VersionParams contains all the parameters to send to the API endpoint -for the version operation typically these are written to a http.Request -*/ -type VersionParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the version params -func (o *VersionParams) WithTimeout(timeout time.Duration) *VersionParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the version params -func (o *VersionParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the version params -func (o *VersionParams) WithContext(ctx context.Context) *VersionParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the version params -func (o *VersionParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the version params -func (o *VersionParams) WithHTTPClient(client *http.Client) *VersionParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the version params -func (o *VersionParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *VersionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/cmd/wfcli/swagger-client/client/admin_api/version_responses.go b/cmd/wfcli/swagger-client/client/admin_api/version_responses.go deleted file mode 100644 index 738d4b61..00000000 --- a/cmd/wfcli/swagger-client/client/admin_api/version_responses.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package admin_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/fission/fission-workflows/cmd/wfcli/swagger-client/models" -) - -// VersionReader is a Reader for the Version structure. -type VersionReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *VersionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - - case 200: - result := NewVersionOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewVersionOK creates a VersionOK with default headers values -func NewVersionOK() *VersionOK { - return &VersionOK{} -} - -/*VersionOK handles this case with default header values. - -VersionOK version o k -*/ -type VersionOK struct { - Payload *models.ApiserverVersionResp -} - -func (o *VersionOK) Error() string { - return fmt.Sprintf("[GET /version][%d] versionOK %+v", 200, o.Payload) -} - -func (o *VersionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ApiserverVersionResp) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/cmd/wfcli/swagger-client/client/pkg_apiserver_apiserver_proto_client.go b/cmd/wfcli/swagger-client/client/pkg_apiserver_apiserver_proto_client.go deleted file mode 100644 index 2c9aba5a..00000000 --- a/cmd/wfcli/swagger-client/client/pkg_apiserver_apiserver_proto_client.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/fission/fission-workflows/cmd/wfcli/swagger-client/client/admin_api" - "github.com/fission/fission-workflows/cmd/wfcli/swagger-client/client/workflow_api" - "github.com/fission/fission-workflows/cmd/wfcli/swagger-client/client/workflow_invocation_api" -) - -// Default pkg apiserver apiserver proto HTTP client. -var Default = NewHTTPClient(nil) - -const ( - // DefaultHost is the default Host - // found in Meta (info) section of spec file - DefaultHost string = "localhost" - // DefaultBasePath is the default BasePath - // found in Meta (info) section of spec file - DefaultBasePath string = "/" -) - -// DefaultSchemes are the default schemes found in Meta (info) section of spec file -var DefaultSchemes = []string{"http", "https"} - -// NewHTTPClient creates a new pkg apiserver apiserver proto HTTP client. -func NewHTTPClient(formats strfmt.Registry) *PkgApiserverApiserverProto { - return NewHTTPClientWithConfig(formats, nil) -} - -// NewHTTPClientWithConfig creates a new pkg apiserver apiserver proto HTTP client, -// using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PkgApiserverApiserverProto { - // ensure nullable parameters have default - if formats == nil { - formats = strfmt.Default - } - if cfg == nil { - cfg = DefaultTransportConfig() - } - - // create transport and client - transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) - return New(transport, formats) -} - -// New creates a new pkg apiserver apiserver proto client -func New(transport runtime.ClientTransport, formats strfmt.Registry) *PkgApiserverApiserverProto { - cli := new(PkgApiserverApiserverProto) - cli.Transport = transport - - cli.AdminAPI = admin_api.New(transport, formats) - - cli.WorkflowAPI = workflow_api.New(transport, formats) - - cli.WorkflowInvocationAPI = workflow_invocation_api.New(transport, formats) - - return cli -} - -// DefaultTransportConfig creates a TransportConfig with the -// default settings taken from the meta section of the spec file. -func DefaultTransportConfig() *TransportConfig { - return &TransportConfig{ - Host: DefaultHost, - BasePath: DefaultBasePath, - Schemes: DefaultSchemes, - } -} - -// TransportConfig contains the transport related info, -// found in the meta section of the spec file. -type TransportConfig struct { - Host string - BasePath string - Schemes []string -} - -// WithHost overrides the default host, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithHost(host string) *TransportConfig { - cfg.Host = host - return cfg -} - -// WithBasePath overrides the default basePath, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { - cfg.BasePath = basePath - return cfg -} - -// WithSchemes overrides the default schemes, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { - cfg.Schemes = schemes - return cfg -} - -// PkgApiserverApiserverProto is a client for pkg apiserver apiserver proto -type PkgApiserverApiserverProto struct { - AdminAPI *admin_api.Client - - WorkflowAPI *workflow_api.Client - - WorkflowInvocationAPI *workflow_invocation_api.Client - - Transport runtime.ClientTransport -} - -// SetTransport changes the transport on the client and all its subresources -func (c *PkgApiserverApiserverProto) SetTransport(transport runtime.ClientTransport) { - c.Transport = transport - - c.AdminAPI.SetTransport(transport) - - c.WorkflowAPI.SetTransport(transport) - - c.WorkflowInvocationAPI.SetTransport(transport) - -} diff --git a/cmd/wfcli/swagger-client/client/workflow_api/create_parameters.go b/cmd/wfcli/swagger-client/client/workflow_api/create_parameters.go deleted file mode 100644 index a67cd2b2..00000000 --- a/cmd/wfcli/swagger-client/client/workflow_api/create_parameters.go +++ /dev/null @@ -1,137 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package workflow_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - "time" - - "golang.org/x/net/context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/fission/fission-workflows/cmd/wfcli/swagger-client/models" -) - -// NewCreateParams creates a new CreateParams object -// with the default values initialized. -func NewCreateParams() *CreateParams { - var () - return &CreateParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewCreateParamsWithTimeout creates a new CreateParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewCreateParamsWithTimeout(timeout time.Duration) *CreateParams { - var () - return &CreateParams{ - - timeout: timeout, - } -} - -// NewCreateParamsWithContext creates a new CreateParams object -// with the default values initialized, and the ability to set a context for a request -func NewCreateParamsWithContext(ctx context.Context) *CreateParams { - var () - return &CreateParams{ - - Context: ctx, - } -} - -// NewCreateParamsWithHTTPClient creates a new CreateParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewCreateParamsWithHTTPClient(client *http.Client) *CreateParams { - var () - return &CreateParams{ - HTTPClient: client, - } -} - -/*CreateParams contains all the parameters to send to the API endpoint -for the create operation typically these are written to a http.Request -*/ -type CreateParams struct { - - /*Body*/ - Body *models.WorkflowSpec - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the create params -func (o *CreateParams) WithTimeout(timeout time.Duration) *CreateParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create params -func (o *CreateParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create params -func (o *CreateParams) WithContext(ctx context.Context) *CreateParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create params -func (o *CreateParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create params -func (o *CreateParams) WithHTTPClient(client *http.Client) *CreateParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create params -func (o *CreateParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the create params -func (o *CreateParams) WithBody(body *models.WorkflowSpec) *CreateParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the create params -func (o *CreateParams) SetBody(body *models.WorkflowSpec) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/cmd/wfcli/swagger-client/client/workflow_api/create_responses.go b/cmd/wfcli/swagger-client/client/workflow_api/create_responses.go deleted file mode 100644 index 98c7557a..00000000 --- a/cmd/wfcli/swagger-client/client/workflow_api/create_responses.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package workflow_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/fission/fission-workflows/cmd/wfcli/swagger-client/models" -) - -// CreateReader is a Reader for the Create structure. -type CreateReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - - case 200: - result := NewCreateOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewCreateOK creates a CreateOK with default headers values -func NewCreateOK() *CreateOK { - return &CreateOK{} -} - -/*CreateOK handles this case with default header values. - -CreateOK create o k -*/ -type CreateOK struct { - Payload *models.ApiserverWorkflowIdentifier -} - -func (o *CreateOK) Error() string { - return fmt.Sprintf("[POST /workflow][%d] createOK %+v", 200, o.Payload) -} - -func (o *CreateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ApiserverWorkflowIdentifier) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/cmd/wfcli/swagger-client/client/workflow_api/delete_parameters.go b/cmd/wfcli/swagger-client/client/workflow_api/delete_parameters.go deleted file mode 100644 index 675a8101..00000000 --- a/cmd/wfcli/swagger-client/client/workflow_api/delete_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package workflow_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - "time" - - "golang.org/x/net/context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" -) - -// NewDeleteParams creates a new DeleteParams object -// with the default values initialized. -func NewDeleteParams() *DeleteParams { - var () - return &DeleteParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteParamsWithTimeout creates a new DeleteParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewDeleteParamsWithTimeout(timeout time.Duration) *DeleteParams { - var () - return &DeleteParams{ - - timeout: timeout, - } -} - -// NewDeleteParamsWithContext creates a new DeleteParams object -// with the default values initialized, and the ability to set a context for a request -func NewDeleteParamsWithContext(ctx context.Context) *DeleteParams { - var () - return &DeleteParams{ - - Context: ctx, - } -} - -// NewDeleteParamsWithHTTPClient creates a new DeleteParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewDeleteParamsWithHTTPClient(client *http.Client) *DeleteParams { - var () - return &DeleteParams{ - HTTPClient: client, - } -} - -/*DeleteParams contains all the parameters to send to the API endpoint -for the delete operation typically these are written to a http.Request -*/ -type DeleteParams struct { - - /*ID*/ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the delete params -func (o *DeleteParams) WithTimeout(timeout time.Duration) *DeleteParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete params -func (o *DeleteParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete params -func (o *DeleteParams) WithContext(ctx context.Context) *DeleteParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete params -func (o *DeleteParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete params -func (o *DeleteParams) WithHTTPClient(client *http.Client) *DeleteParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete params -func (o *DeleteParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the delete params -func (o *DeleteParams) WithID(id string) *DeleteParams { - o.SetID(id) - return o -} - -// SetID adds the id to the delete params -func (o *DeleteParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/cmd/wfcli/swagger-client/client/workflow_api/delete_responses.go b/cmd/wfcli/swagger-client/client/workflow_api/delete_responses.go deleted file mode 100644 index 70816f55..00000000 --- a/cmd/wfcli/swagger-client/client/workflow_api/delete_responses.go +++ /dev/null @@ -1,65 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package workflow_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/fission/fission-workflows/cmd/wfcli/swagger-client/models" -) - -// DeleteReader is a Reader for the Delete structure. -type DeleteReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - - case 200: - result := NewDeleteOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewDeleteOK creates a DeleteOK with default headers values -func NewDeleteOK() *DeleteOK { - return &DeleteOK{} -} - -/*DeleteOK handles this case with default header values. - -DeleteOK delete o k -*/ -type DeleteOK struct { - Payload models.ProtobufEmpty -} - -func (o *DeleteOK) Error() string { - return fmt.Sprintf("[DELETE /workflow/{id}][%d] deleteOK %+v", 200, o.Payload) -} - -func (o *DeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/cmd/wfcli/swagger-client/client/workflow_api/get0_parameters.go b/cmd/wfcli/swagger-client/client/workflow_api/get0_parameters.go deleted file mode 100644 index e418f7f4..00000000 --- a/cmd/wfcli/swagger-client/client/workflow_api/get0_parameters.go +++ /dev/null @@ -1,108 +0,0 @@ -package workflow_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "time" - - "golang.org/x/net/context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" -) - -// NewGet0Params creates a new Get0Params object -// with the default values initialized. -func NewGet0Params() *Get0Params { - var () - return &Get0Params{ - - timeout: cr.DefaultTimeout, - } -} - -// NewGet0ParamsWithTimeout creates a new Get0Params object -// with the default values initialized, and the ability to set a timeout on a request -func NewGet0ParamsWithTimeout(timeout time.Duration) *Get0Params { - var () - return &Get0Params{ - - timeout: timeout, - } -} - -// NewGet0ParamsWithContext creates a new Get0Params object -// with the default values initialized, and the ability to set a context for a request -func NewGet0ParamsWithContext(ctx context.Context) *Get0Params { - var () - return &Get0Params{ - - Context: ctx, - } -} - -/*Get0Params contains all the parameters to send to the API endpoint -for the get 0 operation typically these are written to a http.Request -*/ -type Get0Params struct { - - /*ID*/ - ID string - - timeout time.Duration - Context context.Context -} - -// WithTimeout adds the timeout to the get 0 params -func (o *Get0Params) WithTimeout(timeout time.Duration) *Get0Params { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get 0 params -func (o *Get0Params) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get 0 params -func (o *Get0Params) WithContext(ctx context.Context) *Get0Params { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get 0 params -func (o *Get0Params) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithID adds the id to the get 0 params -func (o *Get0Params) WithID(id string) *Get0Params { - o.SetID(id) - return o -} - -// SetID adds the id to the get 0 params -func (o *Get0Params) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *Get0Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - r.SetTimeout(o.timeout) - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/cmd/wfcli/swagger-client/client/workflow_api/get0_responses.go b/cmd/wfcli/swagger-client/client/workflow_api/get0_responses.go deleted file mode 100644 index bdcf363c..00000000 --- a/cmd/wfcli/swagger-client/client/workflow_api/get0_responses.go +++ /dev/null @@ -1,65 +0,0 @@ -package workflow_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/fission/fission-workflows/cmd/wfcli/swagger-client/models" -) - -// Get0Reader is a Reader for the Get0 structure. -type Get0Reader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *Get0Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - - case 200: - result := NewGet0OK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewGet0OK creates a Get0OK with default headers values -func NewGet0OK() *Get0OK { - return &Get0OK{} -} - -/*Get0OK handles this case with default header values. - -Get0OK get0 o k -*/ -type Get0OK struct { - Payload *models.Workflow -} - -func (o *Get0OK) Error() string { - return fmt.Sprintf("[GET /workflow/{id}][%d] get0OK %+v", 200, o.Payload) -} - -func (o *Get0OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Workflow) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/cmd/wfcli/swagger-client/client/workflow_api/list0_parameters.go b/cmd/wfcli/swagger-client/client/workflow_api/list0_parameters.go deleted file mode 100644 index 8d0235b6..00000000 --- a/cmd/wfcli/swagger-client/client/workflow_api/list0_parameters.go +++ /dev/null @@ -1,88 +0,0 @@ -package workflow_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "time" - - "golang.org/x/net/context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" -) - -// NewList0Params creates a new List0Params object -// with the default values initialized. -func NewList0Params() *List0Params { - - return &List0Params{ - - timeout: cr.DefaultTimeout, - } -} - -// NewList0ParamsWithTimeout creates a new List0Params object -// with the default values initialized, and the ability to set a timeout on a request -func NewList0ParamsWithTimeout(timeout time.Duration) *List0Params { - - return &List0Params{ - - timeout: timeout, - } -} - -// NewList0ParamsWithContext creates a new List0Params object -// with the default values initialized, and the ability to set a context for a request -func NewList0ParamsWithContext(ctx context.Context) *List0Params { - - return &List0Params{ - - Context: ctx, - } -} - -/*List0Params contains all the parameters to send to the API endpoint -for the list 0 operation typically these are written to a http.Request -*/ -type List0Params struct { - timeout time.Duration - Context context.Context -} - -// WithTimeout adds the timeout to the list 0 params -func (o *List0Params) WithTimeout(timeout time.Duration) *List0Params { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list 0 params -func (o *List0Params) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list 0 params -func (o *List0Params) WithContext(ctx context.Context) *List0Params { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list 0 params -func (o *List0Params) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WriteToRequest writes these params to a swagger request -func (o *List0Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - r.SetTimeout(o.timeout) - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/cmd/wfcli/swagger-client/client/workflow_api/list0_responses.go b/cmd/wfcli/swagger-client/client/workflow_api/list0_responses.go deleted file mode 100644 index 44c3f9f3..00000000 --- a/cmd/wfcli/swagger-client/client/workflow_api/list0_responses.go +++ /dev/null @@ -1,65 +0,0 @@ -package workflow_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/fission/fission-workflows/cmd/wfcli/swagger-client/models" -) - -// List0Reader is a Reader for the List0 structure. -type List0Reader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *List0Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - - case 200: - result := NewList0OK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewList0OK creates a List0OK with default headers values -func NewList0OK() *List0OK { - return &List0OK{} -} - -/*List0OK handles this case with default header values. - -List0OK list0 o k -*/ -type List0OK struct { - Payload *models.ApiserverSearchWorkflowResponse -} - -func (o *List0OK) Error() string { - return fmt.Sprintf("[GET /workflow][%d] list0OK %+v", 200, o.Payload) -} - -func (o *List0OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ApiserverSearchWorkflowResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/cmd/wfcli/swagger-client/client/workflow_api/validate_parameters.go b/cmd/wfcli/swagger-client/client/workflow_api/validate_parameters.go deleted file mode 100644 index 08aec52e..00000000 --- a/cmd/wfcli/swagger-client/client/workflow_api/validate_parameters.go +++ /dev/null @@ -1,113 +0,0 @@ -package workflow_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "time" - - "golang.org/x/net/context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/fission/fission-workflows/cmd/wfcli/swagger-client/models" -) - -// NewValidateParams creates a new ValidateParams object -// with the default values initialized. -func NewValidateParams() *ValidateParams { - var () - return &ValidateParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewValidateParamsWithTimeout creates a new ValidateParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewValidateParamsWithTimeout(timeout time.Duration) *ValidateParams { - var () - return &ValidateParams{ - - timeout: timeout, - } -} - -// NewValidateParamsWithContext creates a new ValidateParams object -// with the default values initialized, and the ability to set a context for a request -func NewValidateParamsWithContext(ctx context.Context) *ValidateParams { - var () - return &ValidateParams{ - - Context: ctx, - } -} - -/*ValidateParams contains all the parameters to send to the API endpoint -for the validate operation typically these are written to a http.Request -*/ -type ValidateParams struct { - - /*Body*/ - Body *models.WorkflowSpec - - timeout time.Duration - Context context.Context -} - -// WithTimeout adds the timeout to the validate params -func (o *ValidateParams) WithTimeout(timeout time.Duration) *ValidateParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the validate params -func (o *ValidateParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the validate params -func (o *ValidateParams) WithContext(ctx context.Context) *ValidateParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the validate params -func (o *ValidateParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithBody adds the body to the validate params -func (o *ValidateParams) WithBody(body *models.WorkflowSpec) *ValidateParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the validate params -func (o *ValidateParams) SetBody(body *models.WorkflowSpec) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *ValidateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - r.SetTimeout(o.timeout) - var res []error - - if o.Body == nil { - o.Body = new(models.WorkflowSpec) - } - - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/cmd/wfcli/swagger-client/client/workflow_api/validate_responses.go b/cmd/wfcli/swagger-client/client/workflow_api/validate_responses.go deleted file mode 100644 index fe7dbf8f..00000000 --- a/cmd/wfcli/swagger-client/client/workflow_api/validate_responses.go +++ /dev/null @@ -1,63 +0,0 @@ -package workflow_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/fission/fission-workflows/cmd/wfcli/swagger-client/models" -) - -// ValidateReader is a Reader for the Validate structure. -type ValidateReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ValidateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - - case 200: - result := NewValidateOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewValidateOK creates a ValidateOK with default headers values -func NewValidateOK() *ValidateOK { - return &ValidateOK{} -} - -/*ValidateOK handles this case with default header values. - -ValidateOK validate o k -*/ -type ValidateOK struct { - Payload models.ProtobufEmpty -} - -func (o *ValidateOK) Error() string { - return fmt.Sprintf("[POST /workflow/validate][%d] validateOK %+v", 200, o.Payload) -} - -func (o *ValidateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/cmd/wfcli/swagger-client/client/workflow_api/wf_get_parameters.go b/cmd/wfcli/swagger-client/client/workflow_api/wf_get_parameters.go deleted file mode 100644 index 807076da..00000000 --- a/cmd/wfcli/swagger-client/client/workflow_api/wf_get_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package workflow_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - "time" - - "golang.org/x/net/context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" -) - -// NewWfGetParams creates a new WfGetParams object -// with the default values initialized. -func NewWfGetParams() *WfGetParams { - var () - return &WfGetParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewWfGetParamsWithTimeout creates a new WfGetParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewWfGetParamsWithTimeout(timeout time.Duration) *WfGetParams { - var () - return &WfGetParams{ - - timeout: timeout, - } -} - -// NewWfGetParamsWithContext creates a new WfGetParams object -// with the default values initialized, and the ability to set a context for a request -func NewWfGetParamsWithContext(ctx context.Context) *WfGetParams { - var () - return &WfGetParams{ - - Context: ctx, - } -} - -// NewWfGetParamsWithHTTPClient creates a new WfGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewWfGetParamsWithHTTPClient(client *http.Client) *WfGetParams { - var () - return &WfGetParams{ - HTTPClient: client, - } -} - -/*WfGetParams contains all the parameters to send to the API endpoint -for the wf get operation typically these are written to a http.Request -*/ -type WfGetParams struct { - - /*ID*/ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the wf get params -func (o *WfGetParams) WithTimeout(timeout time.Duration) *WfGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the wf get params -func (o *WfGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the wf get params -func (o *WfGetParams) WithContext(ctx context.Context) *WfGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the wf get params -func (o *WfGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the wf get params -func (o *WfGetParams) WithHTTPClient(client *http.Client) *WfGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the wf get params -func (o *WfGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the wf get params -func (o *WfGetParams) WithID(id string) *WfGetParams { - o.SetID(id) - return o -} - -// SetID adds the id to the wf get params -func (o *WfGetParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *WfGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/cmd/wfcli/swagger-client/client/workflow_api/wf_get_responses.go b/cmd/wfcli/swagger-client/client/workflow_api/wf_get_responses.go deleted file mode 100644 index 1e94ec7e..00000000 --- a/cmd/wfcli/swagger-client/client/workflow_api/wf_get_responses.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package workflow_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/fission/fission-workflows/cmd/wfcli/swagger-client/models" -) - -// WfGetReader is a Reader for the WfGet structure. -type WfGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *WfGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - - case 200: - result := NewWfGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewWfGetOK creates a WfGetOK with default headers values -func NewWfGetOK() *WfGetOK { - return &WfGetOK{} -} - -/*WfGetOK handles this case with default header values. - -WfGetOK wf get o k -*/ -type WfGetOK struct { - Payload *models.Workflow -} - -func (o *WfGetOK) Error() string { - return fmt.Sprintf("[GET /workflow/{id}][%d] wfGetOK %+v", 200, o.Payload) -} - -func (o *WfGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Workflow) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/cmd/wfcli/swagger-client/client/workflow_api/wf_list_parameters.go b/cmd/wfcli/swagger-client/client/workflow_api/wf_list_parameters.go deleted file mode 100644 index 8cc0e165..00000000 --- a/cmd/wfcli/swagger-client/client/workflow_api/wf_list_parameters.go +++ /dev/null @@ -1,114 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package workflow_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - "time" - - "golang.org/x/net/context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" -) - -// NewWfListParams creates a new WfListParams object -// with the default values initialized. -func NewWfListParams() *WfListParams { - - return &WfListParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewWfListParamsWithTimeout creates a new WfListParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewWfListParamsWithTimeout(timeout time.Duration) *WfListParams { - - return &WfListParams{ - - timeout: timeout, - } -} - -// NewWfListParamsWithContext creates a new WfListParams object -// with the default values initialized, and the ability to set a context for a request -func NewWfListParamsWithContext(ctx context.Context) *WfListParams { - - return &WfListParams{ - - Context: ctx, - } -} - -// NewWfListParamsWithHTTPClient creates a new WfListParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewWfListParamsWithHTTPClient(client *http.Client) *WfListParams { - - return &WfListParams{ - HTTPClient: client, - } -} - -/*WfListParams contains all the parameters to send to the API endpoint -for the wf list operation typically these are written to a http.Request -*/ -type WfListParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the wf list params -func (o *WfListParams) WithTimeout(timeout time.Duration) *WfListParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the wf list params -func (o *WfListParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the wf list params -func (o *WfListParams) WithContext(ctx context.Context) *WfListParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the wf list params -func (o *WfListParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the wf list params -func (o *WfListParams) WithHTTPClient(client *http.Client) *WfListParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the wf list params -func (o *WfListParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *WfListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/cmd/wfcli/swagger-client/client/workflow_api/wf_list_responses.go b/cmd/wfcli/swagger-client/client/workflow_api/wf_list_responses.go deleted file mode 100644 index d72f923a..00000000 --- a/cmd/wfcli/swagger-client/client/workflow_api/wf_list_responses.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package workflow_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/fission/fission-workflows/cmd/wfcli/swagger-client/models" -) - -// WfListReader is a Reader for the WfList structure. -type WfListReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *WfListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - - case 200: - result := NewWfListOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewWfListOK creates a WfListOK with default headers values -func NewWfListOK() *WfListOK { - return &WfListOK{} -} - -/*WfListOK handles this case with default header values. - -WfListOK wf list o k -*/ -type WfListOK struct { - Payload *models.ApiserverSearchWorkflowResponse -} - -func (o *WfListOK) Error() string { - return fmt.Sprintf("[GET /workflow][%d] wfListOK %+v", 200, o.Payload) -} - -func (o *WfListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ApiserverSearchWorkflowResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/cmd/wfcli/swagger-client/client/workflow_api/wf_validate_parameters.go b/cmd/wfcli/swagger-client/client/workflow_api/wf_validate_parameters.go deleted file mode 100644 index cfcf98f1..00000000 --- a/cmd/wfcli/swagger-client/client/workflow_api/wf_validate_parameters.go +++ /dev/null @@ -1,137 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package workflow_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - "time" - - "golang.org/x/net/context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/fission/fission-workflows/cmd/wfcli/swagger-client/models" -) - -// NewWfValidateParams creates a new WfValidateParams object -// with the default values initialized. -func NewWfValidateParams() *WfValidateParams { - var () - return &WfValidateParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewWfValidateParamsWithTimeout creates a new WfValidateParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewWfValidateParamsWithTimeout(timeout time.Duration) *WfValidateParams { - var () - return &WfValidateParams{ - - timeout: timeout, - } -} - -// NewWfValidateParamsWithContext creates a new WfValidateParams object -// with the default values initialized, and the ability to set a context for a request -func NewWfValidateParamsWithContext(ctx context.Context) *WfValidateParams { - var () - return &WfValidateParams{ - - Context: ctx, - } -} - -// NewWfValidateParamsWithHTTPClient creates a new WfValidateParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewWfValidateParamsWithHTTPClient(client *http.Client) *WfValidateParams { - var () - return &WfValidateParams{ - HTTPClient: client, - } -} - -/*WfValidateParams contains all the parameters to send to the API endpoint -for the wf validate operation typically these are written to a http.Request -*/ -type WfValidateParams struct { - - /*Body*/ - Body *models.WorkflowSpec - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the wf validate params -func (o *WfValidateParams) WithTimeout(timeout time.Duration) *WfValidateParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the wf validate params -func (o *WfValidateParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the wf validate params -func (o *WfValidateParams) WithContext(ctx context.Context) *WfValidateParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the wf validate params -func (o *WfValidateParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the wf validate params -func (o *WfValidateParams) WithHTTPClient(client *http.Client) *WfValidateParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the wf validate params -func (o *WfValidateParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the wf validate params -func (o *WfValidateParams) WithBody(body *models.WorkflowSpec) *WfValidateParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the wf validate params -func (o *WfValidateParams) SetBody(body *models.WorkflowSpec) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *WfValidateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/cmd/wfcli/swagger-client/client/workflow_api/wf_validate_responses.go b/cmd/wfcli/swagger-client/client/workflow_api/wf_validate_responses.go deleted file mode 100644 index e867fcc3..00000000 --- a/cmd/wfcli/swagger-client/client/workflow_api/wf_validate_responses.go +++ /dev/null @@ -1,65 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package workflow_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/fission/fission-workflows/cmd/wfcli/swagger-client/models" -) - -// WfValidateReader is a Reader for the WfValidate structure. -type WfValidateReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *WfValidateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - - case 200: - result := NewWfValidateOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewWfValidateOK creates a WfValidateOK with default headers values -func NewWfValidateOK() *WfValidateOK { - return &WfValidateOK{} -} - -/*WfValidateOK handles this case with default header values. - -WfValidateOK wf validate o k -*/ -type WfValidateOK struct { - Payload models.ProtobufEmpty -} - -func (o *WfValidateOK) Error() string { - return fmt.Sprintf("[POST /workflow/validate][%d] wfValidateOK %+v", 200, o.Payload) -} - -func (o *WfValidateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/cmd/wfcli/swagger-client/client/workflow_api/workflow_api_client.go b/cmd/wfcli/swagger-client/client/workflow_api/workflow_api_client.go deleted file mode 100644 index 44f30d90..00000000 --- a/cmd/wfcli/swagger-client/client/workflow_api/workflow_api_client.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package workflow_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" -) - -// New creates a new workflow api API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { - return &Client{transport: transport, formats: formats} -} - -/* -Client for workflow api API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -/* -Create create API -*/ -func (a *Client) Create(params *CreateParams) (*CreateOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "Create", - Method: "POST", - PathPattern: "/workflow", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &CreateReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*CreateOK), nil - -} - -/* -Delete delete API -*/ -func (a *Client) Delete(params *DeleteParams) (*DeleteOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "Delete", - Method: "DELETE", - PathPattern: "/workflow/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &DeleteReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*DeleteOK), nil - -} - -/* -WfGet wf get API -*/ -func (a *Client) WfGet(params *WfGetParams) (*WfGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewWfGetParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "WfGet", - Method: "GET", - PathPattern: "/workflow/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &WfGetReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*WfGetOK), nil - -} - -/* -WfList wf list API -*/ -func (a *Client) WfList(params *WfListParams) (*WfListOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewWfListParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "WfList", - Method: "GET", - PathPattern: "/workflow", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &WfListReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*WfListOK), nil - -} - -/* -WfValidate wf validate API -*/ -func (a *Client) WfValidate(params *WfValidateParams) (*WfValidateOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewWfValidateParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "WfValidate", - Method: "POST", - PathPattern: "/workflow/validate", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &WfValidateReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*WfValidateOK), nil - -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/cmd/wfcli/swagger-client/client/workflow_invocation_api/cancel_parameters.go b/cmd/wfcli/swagger-client/client/workflow_invocation_api/cancel_parameters.go deleted file mode 100644 index 2e58ad42..00000000 --- a/cmd/wfcli/swagger-client/client/workflow_invocation_api/cancel_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package workflow_invocation_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - "time" - - "golang.org/x/net/context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" -) - -// NewCancelParams creates a new CancelParams object -// with the default values initialized. -func NewCancelParams() *CancelParams { - var () - return &CancelParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewCancelParamsWithTimeout creates a new CancelParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewCancelParamsWithTimeout(timeout time.Duration) *CancelParams { - var () - return &CancelParams{ - - timeout: timeout, - } -} - -// NewCancelParamsWithContext creates a new CancelParams object -// with the default values initialized, and the ability to set a context for a request -func NewCancelParamsWithContext(ctx context.Context) *CancelParams { - var () - return &CancelParams{ - - Context: ctx, - } -} - -// NewCancelParamsWithHTTPClient creates a new CancelParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewCancelParamsWithHTTPClient(client *http.Client) *CancelParams { - var () - return &CancelParams{ - HTTPClient: client, - } -} - -/*CancelParams contains all the parameters to send to the API endpoint -for the cancel operation typically these are written to a http.Request -*/ -type CancelParams struct { - - /*ID*/ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the cancel params -func (o *CancelParams) WithTimeout(timeout time.Duration) *CancelParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the cancel params -func (o *CancelParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the cancel params -func (o *CancelParams) WithContext(ctx context.Context) *CancelParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the cancel params -func (o *CancelParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the cancel params -func (o *CancelParams) WithHTTPClient(client *http.Client) *CancelParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the cancel params -func (o *CancelParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the cancel params -func (o *CancelParams) WithID(id string) *CancelParams { - o.SetID(id) - return o -} - -// SetID adds the id to the cancel params -func (o *CancelParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *CancelParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/cmd/wfcli/swagger-client/client/workflow_invocation_api/cancel_responses.go b/cmd/wfcli/swagger-client/client/workflow_invocation_api/cancel_responses.go deleted file mode 100644 index eb2c51f1..00000000 --- a/cmd/wfcli/swagger-client/client/workflow_invocation_api/cancel_responses.go +++ /dev/null @@ -1,65 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package workflow_invocation_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/fission/fission-workflows/cmd/wfcli/swagger-client/models" -) - -// CancelReader is a Reader for the Cancel structure. -type CancelReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CancelReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - - case 200: - result := NewCancelOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewCancelOK creates a CancelOK with default headers values -func NewCancelOK() *CancelOK { - return &CancelOK{} -} - -/*CancelOK handles this case with default header values. - -CancelOK cancel o k -*/ -type CancelOK struct { - Payload models.ProtobufEmpty -} - -func (o *CancelOK) Error() string { - return fmt.Sprintf("[DELETE /invocation/{id}][%d] cancelOK %+v", 200, o.Payload) -} - -func (o *CancelOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/cmd/wfcli/swagger-client/client/workflow_invocation_api/get_parameters.go b/cmd/wfcli/swagger-client/client/workflow_invocation_api/get_parameters.go deleted file mode 100644 index 7e84e852..00000000 --- a/cmd/wfcli/swagger-client/client/workflow_invocation_api/get_parameters.go +++ /dev/null @@ -1,108 +0,0 @@ -package workflow_invocation_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "time" - - "golang.org/x/net/context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" -) - -// NewGetParams creates a new GetParams object -// with the default values initialized. -func NewGetParams() *GetParams { - var () - return &GetParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewGetParamsWithTimeout creates a new GetParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewGetParamsWithTimeout(timeout time.Duration) *GetParams { - var () - return &GetParams{ - - timeout: timeout, - } -} - -// NewGetParamsWithContext creates a new GetParams object -// with the default values initialized, and the ability to set a context for a request -func NewGetParamsWithContext(ctx context.Context) *GetParams { - var () - return &GetParams{ - - Context: ctx, - } -} - -/*GetParams contains all the parameters to send to the API endpoint -for the get operation typically these are written to a http.Request -*/ -type GetParams struct { - - /*ID*/ - ID string - - timeout time.Duration - Context context.Context -} - -// WithTimeout adds the timeout to the get params -func (o *GetParams) WithTimeout(timeout time.Duration) *GetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get params -func (o *GetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get params -func (o *GetParams) WithContext(ctx context.Context) *GetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get params -func (o *GetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithID adds the id to the get params -func (o *GetParams) WithID(id string) *GetParams { - o.SetID(id) - return o -} - -// SetID adds the id to the get params -func (o *GetParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *GetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - r.SetTimeout(o.timeout) - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/cmd/wfcli/swagger-client/client/workflow_invocation_api/get_responses.go b/cmd/wfcli/swagger-client/client/workflow_invocation_api/get_responses.go deleted file mode 100644 index 0ea64fc5..00000000 --- a/cmd/wfcli/swagger-client/client/workflow_invocation_api/get_responses.go +++ /dev/null @@ -1,65 +0,0 @@ -package workflow_invocation_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/fission/fission-workflows/cmd/wfcli/swagger-client/models" -) - -// GetReader is a Reader for the Get structure. -type GetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - - case 200: - result := NewGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewGetOK creates a GetOK with default headers values -func NewGetOK() *GetOK { - return &GetOK{} -} - -/*GetOK handles this case with default header values. - -GetOK get o k -*/ -type GetOK struct { - Payload *models.WorkflowInvocation -} - -func (o *GetOK) Error() string { - return fmt.Sprintf("[GET /invocation/{id}][%d] getOK %+v", 200, o.Payload) -} - -func (o *GetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.WorkflowInvocation) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/cmd/wfcli/swagger-client/client/workflow_invocation_api/invoke_parameters.go b/cmd/wfcli/swagger-client/client/workflow_invocation_api/invoke_parameters.go deleted file mode 100644 index a5bdaee8..00000000 --- a/cmd/wfcli/swagger-client/client/workflow_invocation_api/invoke_parameters.go +++ /dev/null @@ -1,137 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package workflow_invocation_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - "time" - - "golang.org/x/net/context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/fission/fission-workflows/cmd/wfcli/swagger-client/models" -) - -// NewInvokeParams creates a new InvokeParams object -// with the default values initialized. -func NewInvokeParams() *InvokeParams { - var () - return &InvokeParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewInvokeParamsWithTimeout creates a new InvokeParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewInvokeParamsWithTimeout(timeout time.Duration) *InvokeParams { - var () - return &InvokeParams{ - - timeout: timeout, - } -} - -// NewInvokeParamsWithContext creates a new InvokeParams object -// with the default values initialized, and the ability to set a context for a request -func NewInvokeParamsWithContext(ctx context.Context) *InvokeParams { - var () - return &InvokeParams{ - - Context: ctx, - } -} - -// NewInvokeParamsWithHTTPClient creates a new InvokeParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewInvokeParamsWithHTTPClient(client *http.Client) *InvokeParams { - var () - return &InvokeParams{ - HTTPClient: client, - } -} - -/*InvokeParams contains all the parameters to send to the API endpoint -for the invoke operation typically these are written to a http.Request -*/ -type InvokeParams struct { - - /*Body*/ - Body *models.WorkflowInvocationSpec - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the invoke params -func (o *InvokeParams) WithTimeout(timeout time.Duration) *InvokeParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the invoke params -func (o *InvokeParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the invoke params -func (o *InvokeParams) WithContext(ctx context.Context) *InvokeParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the invoke params -func (o *InvokeParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the invoke params -func (o *InvokeParams) WithHTTPClient(client *http.Client) *InvokeParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the invoke params -func (o *InvokeParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the invoke params -func (o *InvokeParams) WithBody(body *models.WorkflowInvocationSpec) *InvokeParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the invoke params -func (o *InvokeParams) SetBody(body *models.WorkflowInvocationSpec) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *InvokeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/cmd/wfcli/swagger-client/client/workflow_invocation_api/invoke_responses.go b/cmd/wfcli/swagger-client/client/workflow_invocation_api/invoke_responses.go deleted file mode 100644 index f46e6ef8..00000000 --- a/cmd/wfcli/swagger-client/client/workflow_invocation_api/invoke_responses.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package workflow_invocation_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/fission/fission-workflows/cmd/wfcli/swagger-client/models" -) - -// InvokeReader is a Reader for the Invoke structure. -type InvokeReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *InvokeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - - case 200: - result := NewInvokeOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewInvokeOK creates a InvokeOK with default headers values -func NewInvokeOK() *InvokeOK { - return &InvokeOK{} -} - -/*InvokeOK handles this case with default header values. - -InvokeOK invoke o k -*/ -type InvokeOK struct { - Payload *models.ApiserverWorkflowInvocationIdentifier -} - -func (o *InvokeOK) Error() string { - return fmt.Sprintf("[POST /invocation][%d] invokeOK %+v", 200, o.Payload) -} - -func (o *InvokeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ApiserverWorkflowInvocationIdentifier) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/cmd/wfcli/swagger-client/client/workflow_invocation_api/invoke_sync0_parameters.go b/cmd/wfcli/swagger-client/client/workflow_invocation_api/invoke_sync0_parameters.go deleted file mode 100644 index 08e4f58e..00000000 --- a/cmd/wfcli/swagger-client/client/workflow_invocation_api/invoke_sync0_parameters.go +++ /dev/null @@ -1,119 +0,0 @@ -package workflow_invocation_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "time" - - "golang.org/x/net/context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" -) - -// NewInvokeSync0Params creates a new InvokeSync0Params object -// with the default values initialized. -func NewInvokeSync0Params() *InvokeSync0Params { - var () - return &InvokeSync0Params{ - - timeout: cr.DefaultTimeout, - } -} - -// NewInvokeSync0ParamsWithTimeout creates a new InvokeSync0Params object -// with the default values initialized, and the ability to set a timeout on a request -func NewInvokeSync0ParamsWithTimeout(timeout time.Duration) *InvokeSync0Params { - var () - return &InvokeSync0Params{ - - timeout: timeout, - } -} - -// NewInvokeSync0ParamsWithContext creates a new InvokeSync0Params object -// with the default values initialized, and the ability to set a context for a request -func NewInvokeSync0ParamsWithContext(ctx context.Context) *InvokeSync0Params { - var () - return &InvokeSync0Params{ - - Context: ctx, - } -} - -/*InvokeSync0Params contains all the parameters to send to the API endpoint -for the invoke sync 0 operation typically these are written to a http.Request -*/ -type InvokeSync0Params struct { - - /*WorkflowID*/ - WorkflowID *string - - timeout time.Duration - Context context.Context -} - -// WithTimeout adds the timeout to the invoke sync 0 params -func (o *InvokeSync0Params) WithTimeout(timeout time.Duration) *InvokeSync0Params { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the invoke sync 0 params -func (o *InvokeSync0Params) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the invoke sync 0 params -func (o *InvokeSync0Params) WithContext(ctx context.Context) *InvokeSync0Params { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the invoke sync 0 params -func (o *InvokeSync0Params) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithWorkflowID adds the workflowID to the invoke sync 0 params -func (o *InvokeSync0Params) WithWorkflowID(workflowID *string) *InvokeSync0Params { - o.SetWorkflowID(workflowID) - return o -} - -// SetWorkflowID adds the workflowId to the invoke sync 0 params -func (o *InvokeSync0Params) SetWorkflowID(workflowID *string) { - o.WorkflowID = workflowID -} - -// WriteToRequest writes these params to a swagger request -func (o *InvokeSync0Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - r.SetTimeout(o.timeout) - var res []error - - if o.WorkflowID != nil { - - // query param workflowId - var qrWorkflowID string - if o.WorkflowID != nil { - qrWorkflowID = *o.WorkflowID - } - qWorkflowID := qrWorkflowID - if qWorkflowID != "" { - if err := r.SetQueryParam("workflowId", qWorkflowID); err != nil { - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/cmd/wfcli/swagger-client/client/workflow_invocation_api/invoke_sync0_responses.go b/cmd/wfcli/swagger-client/client/workflow_invocation_api/invoke_sync0_responses.go deleted file mode 100644 index b2a46885..00000000 --- a/cmd/wfcli/swagger-client/client/workflow_invocation_api/invoke_sync0_responses.go +++ /dev/null @@ -1,65 +0,0 @@ -package workflow_invocation_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/fission/fission-workflows/cmd/wfcli/swagger-client/models" -) - -// InvokeSync0Reader is a Reader for the InvokeSync0 structure. -type InvokeSync0Reader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *InvokeSync0Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - - case 200: - result := NewInvokeSync0OK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewInvokeSync0OK creates a InvokeSync0OK with default headers values -func NewInvokeSync0OK() *InvokeSync0OK { - return &InvokeSync0OK{} -} - -/*InvokeSync0OK handles this case with default header values. - -InvokeSync0OK invoke sync0 o k -*/ -type InvokeSync0OK struct { - Payload *models.WorkflowInvocation -} - -func (o *InvokeSync0OK) Error() string { - return fmt.Sprintf("[GET /invocation/sync][%d] invokeSync0OK %+v", 200, o.Payload) -} - -func (o *InvokeSync0OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.WorkflowInvocation) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/cmd/wfcli/swagger-client/client/workflow_invocation_api/invoke_sync2_parameters.go b/cmd/wfcli/swagger-client/client/workflow_invocation_api/invoke_sync2_parameters.go deleted file mode 100644 index f0599a73..00000000 --- a/cmd/wfcli/swagger-client/client/workflow_invocation_api/invoke_sync2_parameters.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package workflow_invocation_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - "time" - - "golang.org/x/net/context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" -) - -// NewInvokeSync2Params creates a new InvokeSync2Params object -// with the default values initialized. -func NewInvokeSync2Params() *InvokeSync2Params { - var () - return &InvokeSync2Params{ - - timeout: cr.DefaultTimeout, - } -} - -// NewInvokeSync2ParamsWithTimeout creates a new InvokeSync2Params object -// with the default values initialized, and the ability to set a timeout on a request -func NewInvokeSync2ParamsWithTimeout(timeout time.Duration) *InvokeSync2Params { - var () - return &InvokeSync2Params{ - - timeout: timeout, - } -} - -// NewInvokeSync2ParamsWithContext creates a new InvokeSync2Params object -// with the default values initialized, and the ability to set a context for a request -func NewInvokeSync2ParamsWithContext(ctx context.Context) *InvokeSync2Params { - var () - return &InvokeSync2Params{ - - Context: ctx, - } -} - -// NewInvokeSync2ParamsWithHTTPClient creates a new InvokeSync2Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewInvokeSync2ParamsWithHTTPClient(client *http.Client) *InvokeSync2Params { - var () - return &InvokeSync2Params{ - HTTPClient: client, - } -} - -/*InvokeSync2Params contains all the parameters to send to the API endpoint -for the invoke sync2 operation typically these are written to a http.Request -*/ -type InvokeSync2Params struct { - - /*ParentID - ParentId contains the id of the encapsulating workflow invocation. - - This used within the workflow engine; for user-provided workflow invocations the parentId is ignored. - - */ - ParentID *string - /*WorkflowID*/ - WorkflowID *string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the invoke sync2 params -func (o *InvokeSync2Params) WithTimeout(timeout time.Duration) *InvokeSync2Params { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the invoke sync2 params -func (o *InvokeSync2Params) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the invoke sync2 params -func (o *InvokeSync2Params) WithContext(ctx context.Context) *InvokeSync2Params { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the invoke sync2 params -func (o *InvokeSync2Params) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the invoke sync2 params -func (o *InvokeSync2Params) WithHTTPClient(client *http.Client) *InvokeSync2Params { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the invoke sync2 params -func (o *InvokeSync2Params) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithParentID adds the parentID to the invoke sync2 params -func (o *InvokeSync2Params) WithParentID(parentID *string) *InvokeSync2Params { - o.SetParentID(parentID) - return o -} - -// SetParentID adds the parentId to the invoke sync2 params -func (o *InvokeSync2Params) SetParentID(parentID *string) { - o.ParentID = parentID -} - -// WithWorkflowID adds the workflowID to the invoke sync2 params -func (o *InvokeSync2Params) WithWorkflowID(workflowID *string) *InvokeSync2Params { - o.SetWorkflowID(workflowID) - return o -} - -// SetWorkflowID adds the workflowId to the invoke sync2 params -func (o *InvokeSync2Params) SetWorkflowID(workflowID *string) { - o.WorkflowID = workflowID -} - -// WriteToRequest writes these params to a swagger request -func (o *InvokeSync2Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.ParentID != nil { - - // query param parentId - var qrParentID string - if o.ParentID != nil { - qrParentID = *o.ParentID - } - qParentID := qrParentID - if qParentID != "" { - if err := r.SetQueryParam("parentId", qParentID); err != nil { - return err - } - } - - } - - if o.WorkflowID != nil { - - // query param workflowId - var qrWorkflowID string - if o.WorkflowID != nil { - qrWorkflowID = *o.WorkflowID - } - qWorkflowID := qrWorkflowID - if qWorkflowID != "" { - if err := r.SetQueryParam("workflowId", qWorkflowID); err != nil { - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/cmd/wfcli/swagger-client/client/workflow_invocation_api/invoke_sync2_responses.go b/cmd/wfcli/swagger-client/client/workflow_invocation_api/invoke_sync2_responses.go deleted file mode 100644 index 94b71071..00000000 --- a/cmd/wfcli/swagger-client/client/workflow_invocation_api/invoke_sync2_responses.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package workflow_invocation_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/fission/fission-workflows/cmd/wfcli/swagger-client/models" -) - -// InvokeSync2Reader is a Reader for the InvokeSync2 structure. -type InvokeSync2Reader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *InvokeSync2Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - - case 200: - result := NewInvokeSync2OK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewInvokeSync2OK creates a InvokeSync2OK with default headers values -func NewInvokeSync2OK() *InvokeSync2OK { - return &InvokeSync2OK{} -} - -/*InvokeSync2OK handles this case with default header values. - -InvokeSync2OK invoke sync2 o k -*/ -type InvokeSync2OK struct { - Payload *models.WorkflowInvocation -} - -func (o *InvokeSync2OK) Error() string { - return fmt.Sprintf("[GET /invocation/sync][%d] invokeSync2OK %+v", 200, o.Payload) -} - -func (o *InvokeSync2OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.WorkflowInvocation) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/cmd/wfcli/swagger-client/client/workflow_invocation_api/invoke_sync_parameters.go b/cmd/wfcli/swagger-client/client/workflow_invocation_api/invoke_sync_parameters.go deleted file mode 100644 index 3cf01829..00000000 --- a/cmd/wfcli/swagger-client/client/workflow_invocation_api/invoke_sync_parameters.go +++ /dev/null @@ -1,137 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package workflow_invocation_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - "time" - - "golang.org/x/net/context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/fission/fission-workflows/cmd/wfcli/swagger-client/models" -) - -// NewInvokeSyncParams creates a new InvokeSyncParams object -// with the default values initialized. -func NewInvokeSyncParams() *InvokeSyncParams { - var () - return &InvokeSyncParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewInvokeSyncParamsWithTimeout creates a new InvokeSyncParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewInvokeSyncParamsWithTimeout(timeout time.Duration) *InvokeSyncParams { - var () - return &InvokeSyncParams{ - - timeout: timeout, - } -} - -// NewInvokeSyncParamsWithContext creates a new InvokeSyncParams object -// with the default values initialized, and the ability to set a context for a request -func NewInvokeSyncParamsWithContext(ctx context.Context) *InvokeSyncParams { - var () - return &InvokeSyncParams{ - - Context: ctx, - } -} - -// NewInvokeSyncParamsWithHTTPClient creates a new InvokeSyncParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewInvokeSyncParamsWithHTTPClient(client *http.Client) *InvokeSyncParams { - var () - return &InvokeSyncParams{ - HTTPClient: client, - } -} - -/*InvokeSyncParams contains all the parameters to send to the API endpoint -for the invoke sync operation typically these are written to a http.Request -*/ -type InvokeSyncParams struct { - - /*Body*/ - Body *models.WorkflowInvocationSpec - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the invoke sync params -func (o *InvokeSyncParams) WithTimeout(timeout time.Duration) *InvokeSyncParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the invoke sync params -func (o *InvokeSyncParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the invoke sync params -func (o *InvokeSyncParams) WithContext(ctx context.Context) *InvokeSyncParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the invoke sync params -func (o *InvokeSyncParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the invoke sync params -func (o *InvokeSyncParams) WithHTTPClient(client *http.Client) *InvokeSyncParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the invoke sync params -func (o *InvokeSyncParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the invoke sync params -func (o *InvokeSyncParams) WithBody(body *models.WorkflowInvocationSpec) *InvokeSyncParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the invoke sync params -func (o *InvokeSyncParams) SetBody(body *models.WorkflowInvocationSpec) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *InvokeSyncParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/cmd/wfcli/swagger-client/client/workflow_invocation_api/invoke_sync_responses.go b/cmd/wfcli/swagger-client/client/workflow_invocation_api/invoke_sync_responses.go deleted file mode 100644 index b33f1861..00000000 --- a/cmd/wfcli/swagger-client/client/workflow_invocation_api/invoke_sync_responses.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package workflow_invocation_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/fission/fission-workflows/cmd/wfcli/swagger-client/models" -) - -// InvokeSyncReader is a Reader for the InvokeSync structure. -type InvokeSyncReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *InvokeSyncReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - - case 200: - result := NewInvokeSyncOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewInvokeSyncOK creates a InvokeSyncOK with default headers values -func NewInvokeSyncOK() *InvokeSyncOK { - return &InvokeSyncOK{} -} - -/*InvokeSyncOK handles this case with default header values. - -InvokeSyncOK invoke sync o k -*/ -type InvokeSyncOK struct { - Payload *models.WorkflowInvocation -} - -func (o *InvokeSyncOK) Error() string { - return fmt.Sprintf("[POST /invocation/sync][%d] invokeSyncOK %+v", 200, o.Payload) -} - -func (o *InvokeSyncOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.WorkflowInvocation) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/cmd/wfcli/swagger-client/client/workflow_invocation_api/list_parameters.go b/cmd/wfcli/swagger-client/client/workflow_invocation_api/list_parameters.go deleted file mode 100644 index f6fe4f59..00000000 --- a/cmd/wfcli/swagger-client/client/workflow_invocation_api/list_parameters.go +++ /dev/null @@ -1,88 +0,0 @@ -package workflow_invocation_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "time" - - "golang.org/x/net/context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" -) - -// NewListParams creates a new ListParams object -// with the default values initialized. -func NewListParams() *ListParams { - - return &ListParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewListParamsWithTimeout creates a new ListParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewListParamsWithTimeout(timeout time.Duration) *ListParams { - - return &ListParams{ - - timeout: timeout, - } -} - -// NewListParamsWithContext creates a new ListParams object -// with the default values initialized, and the ability to set a context for a request -func NewListParamsWithContext(ctx context.Context) *ListParams { - - return &ListParams{ - - Context: ctx, - } -} - -/*ListParams contains all the parameters to send to the API endpoint -for the list operation typically these are written to a http.Request -*/ -type ListParams struct { - timeout time.Duration - Context context.Context -} - -// WithTimeout adds the timeout to the list params -func (o *ListParams) WithTimeout(timeout time.Duration) *ListParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list params -func (o *ListParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list params -func (o *ListParams) WithContext(ctx context.Context) *ListParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list params -func (o *ListParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WriteToRequest writes these params to a swagger request -func (o *ListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - r.SetTimeout(o.timeout) - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/cmd/wfcli/swagger-client/client/workflow_invocation_api/list_responses.go b/cmd/wfcli/swagger-client/client/workflow_invocation_api/list_responses.go deleted file mode 100644 index b1a74be4..00000000 --- a/cmd/wfcli/swagger-client/client/workflow_invocation_api/list_responses.go +++ /dev/null @@ -1,65 +0,0 @@ -package workflow_invocation_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/fission/fission-workflows/cmd/wfcli/swagger-client/models" -) - -// ListReader is a Reader for the List structure. -type ListReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - - case 200: - result := NewListOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewListOK creates a ListOK with default headers values -func NewListOK() *ListOK { - return &ListOK{} -} - -/*ListOK handles this case with default header values. - -ListOK list o k -*/ -type ListOK struct { - Payload *models.ApiserverWorkflowInvocationList -} - -func (o *ListOK) Error() string { - return fmt.Sprintf("[GET /invocation][%d] listOK %+v", 200, o.Payload) -} - -func (o *ListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ApiserverWorkflowInvocationList) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/cmd/wfcli/swagger-client/client/workflow_invocation_api/wfi_get_parameters.go b/cmd/wfcli/swagger-client/client/workflow_invocation_api/wfi_get_parameters.go deleted file mode 100644 index ed5ad6c6..00000000 --- a/cmd/wfcli/swagger-client/client/workflow_invocation_api/wfi_get_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package workflow_invocation_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - "time" - - "golang.org/x/net/context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" -) - -// NewWfiGetParams creates a new WfiGetParams object -// with the default values initialized. -func NewWfiGetParams() *WfiGetParams { - var () - return &WfiGetParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewWfiGetParamsWithTimeout creates a new WfiGetParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewWfiGetParamsWithTimeout(timeout time.Duration) *WfiGetParams { - var () - return &WfiGetParams{ - - timeout: timeout, - } -} - -// NewWfiGetParamsWithContext creates a new WfiGetParams object -// with the default values initialized, and the ability to set a context for a request -func NewWfiGetParamsWithContext(ctx context.Context) *WfiGetParams { - var () - return &WfiGetParams{ - - Context: ctx, - } -} - -// NewWfiGetParamsWithHTTPClient creates a new WfiGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewWfiGetParamsWithHTTPClient(client *http.Client) *WfiGetParams { - var () - return &WfiGetParams{ - HTTPClient: client, - } -} - -/*WfiGetParams contains all the parameters to send to the API endpoint -for the wfi get operation typically these are written to a http.Request -*/ -type WfiGetParams struct { - - /*ID*/ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the wfi get params -func (o *WfiGetParams) WithTimeout(timeout time.Duration) *WfiGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the wfi get params -func (o *WfiGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the wfi get params -func (o *WfiGetParams) WithContext(ctx context.Context) *WfiGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the wfi get params -func (o *WfiGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the wfi get params -func (o *WfiGetParams) WithHTTPClient(client *http.Client) *WfiGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the wfi get params -func (o *WfiGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the wfi get params -func (o *WfiGetParams) WithID(id string) *WfiGetParams { - o.SetID(id) - return o -} - -// SetID adds the id to the wfi get params -func (o *WfiGetParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *WfiGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/cmd/wfcli/swagger-client/client/workflow_invocation_api/wfi_get_responses.go b/cmd/wfcli/swagger-client/client/workflow_invocation_api/wfi_get_responses.go deleted file mode 100644 index c593f778..00000000 --- a/cmd/wfcli/swagger-client/client/workflow_invocation_api/wfi_get_responses.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package workflow_invocation_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/fission/fission-workflows/cmd/wfcli/swagger-client/models" -) - -// WfiGetReader is a Reader for the WfiGet structure. -type WfiGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *WfiGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - - case 200: - result := NewWfiGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewWfiGetOK creates a WfiGetOK with default headers values -func NewWfiGetOK() *WfiGetOK { - return &WfiGetOK{} -} - -/*WfiGetOK handles this case with default header values. - -WfiGetOK wfi get o k -*/ -type WfiGetOK struct { - Payload *models.WorkflowInvocation -} - -func (o *WfiGetOK) Error() string { - return fmt.Sprintf("[GET /invocation/{id}][%d] wfiGetOK %+v", 200, o.Payload) -} - -func (o *WfiGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.WorkflowInvocation) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/cmd/wfcli/swagger-client/client/workflow_invocation_api/wfi_list_parameters.go b/cmd/wfcli/swagger-client/client/workflow_invocation_api/wfi_list_parameters.go deleted file mode 100644 index c95ba283..00000000 --- a/cmd/wfcli/swagger-client/client/workflow_invocation_api/wfi_list_parameters.go +++ /dev/null @@ -1,114 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package workflow_invocation_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - "time" - - "golang.org/x/net/context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" -) - -// NewWfiListParams creates a new WfiListParams object -// with the default values initialized. -func NewWfiListParams() *WfiListParams { - - return &WfiListParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewWfiListParamsWithTimeout creates a new WfiListParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewWfiListParamsWithTimeout(timeout time.Duration) *WfiListParams { - - return &WfiListParams{ - - timeout: timeout, - } -} - -// NewWfiListParamsWithContext creates a new WfiListParams object -// with the default values initialized, and the ability to set a context for a request -func NewWfiListParamsWithContext(ctx context.Context) *WfiListParams { - - return &WfiListParams{ - - Context: ctx, - } -} - -// NewWfiListParamsWithHTTPClient creates a new WfiListParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewWfiListParamsWithHTTPClient(client *http.Client) *WfiListParams { - - return &WfiListParams{ - HTTPClient: client, - } -} - -/*WfiListParams contains all the parameters to send to the API endpoint -for the wfi list operation typically these are written to a http.Request -*/ -type WfiListParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the wfi list params -func (o *WfiListParams) WithTimeout(timeout time.Duration) *WfiListParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the wfi list params -func (o *WfiListParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the wfi list params -func (o *WfiListParams) WithContext(ctx context.Context) *WfiListParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the wfi list params -func (o *WfiListParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the wfi list params -func (o *WfiListParams) WithHTTPClient(client *http.Client) *WfiListParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the wfi list params -func (o *WfiListParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *WfiListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/cmd/wfcli/swagger-client/client/workflow_invocation_api/wfi_list_responses.go b/cmd/wfcli/swagger-client/client/workflow_invocation_api/wfi_list_responses.go deleted file mode 100644 index 788b09a5..00000000 --- a/cmd/wfcli/swagger-client/client/workflow_invocation_api/wfi_list_responses.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package workflow_invocation_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/fission/fission-workflows/cmd/wfcli/swagger-client/models" -) - -// WfiListReader is a Reader for the WfiList structure. -type WfiListReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *WfiListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - - case 200: - result := NewWfiListOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewWfiListOK creates a WfiListOK with default headers values -func NewWfiListOK() *WfiListOK { - return &WfiListOK{} -} - -/*WfiListOK handles this case with default header values. - -WfiListOK wfi list o k -*/ -type WfiListOK struct { - Payload *models.ApiserverWorkflowInvocationList -} - -func (o *WfiListOK) Error() string { - return fmt.Sprintf("[GET /invocation][%d] wfiListOK %+v", 200, o.Payload) -} - -func (o *WfiListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ApiserverWorkflowInvocationList) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/cmd/wfcli/swagger-client/client/workflow_invocation_api/wfi_validate_parameters.go b/cmd/wfcli/swagger-client/client/workflow_invocation_api/wfi_validate_parameters.go deleted file mode 100644 index 91bf56df..00000000 --- a/cmd/wfcli/swagger-client/client/workflow_invocation_api/wfi_validate_parameters.go +++ /dev/null @@ -1,137 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package workflow_invocation_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - "time" - - "golang.org/x/net/context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/fission/fission-workflows/cmd/wfcli/swagger-client/models" -) - -// NewWfiValidateParams creates a new WfiValidateParams object -// with the default values initialized. -func NewWfiValidateParams() *WfiValidateParams { - var () - return &WfiValidateParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewWfiValidateParamsWithTimeout creates a new WfiValidateParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewWfiValidateParamsWithTimeout(timeout time.Duration) *WfiValidateParams { - var () - return &WfiValidateParams{ - - timeout: timeout, - } -} - -// NewWfiValidateParamsWithContext creates a new WfiValidateParams object -// with the default values initialized, and the ability to set a context for a request -func NewWfiValidateParamsWithContext(ctx context.Context) *WfiValidateParams { - var () - return &WfiValidateParams{ - - Context: ctx, - } -} - -// NewWfiValidateParamsWithHTTPClient creates a new WfiValidateParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewWfiValidateParamsWithHTTPClient(client *http.Client) *WfiValidateParams { - var () - return &WfiValidateParams{ - HTTPClient: client, - } -} - -/*WfiValidateParams contains all the parameters to send to the API endpoint -for the wfi validate operation typically these are written to a http.Request -*/ -type WfiValidateParams struct { - - /*Body*/ - Body *models.WorkflowInvocationSpec - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the wfi validate params -func (o *WfiValidateParams) WithTimeout(timeout time.Duration) *WfiValidateParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the wfi validate params -func (o *WfiValidateParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the wfi validate params -func (o *WfiValidateParams) WithContext(ctx context.Context) *WfiValidateParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the wfi validate params -func (o *WfiValidateParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the wfi validate params -func (o *WfiValidateParams) WithHTTPClient(client *http.Client) *WfiValidateParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the wfi validate params -func (o *WfiValidateParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the wfi validate params -func (o *WfiValidateParams) WithBody(body *models.WorkflowInvocationSpec) *WfiValidateParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the wfi validate params -func (o *WfiValidateParams) SetBody(body *models.WorkflowInvocationSpec) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *WfiValidateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/cmd/wfcli/swagger-client/client/workflow_invocation_api/wfi_validate_responses.go b/cmd/wfcli/swagger-client/client/workflow_invocation_api/wfi_validate_responses.go deleted file mode 100644 index 54f1a1fe..00000000 --- a/cmd/wfcli/swagger-client/client/workflow_invocation_api/wfi_validate_responses.go +++ /dev/null @@ -1,65 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package workflow_invocation_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/fission/fission-workflows/cmd/wfcli/swagger-client/models" -) - -// WfiValidateReader is a Reader for the WfiValidate structure. -type WfiValidateReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *WfiValidateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - - case 200: - result := NewWfiValidateOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewWfiValidateOK creates a WfiValidateOK with default headers values -func NewWfiValidateOK() *WfiValidateOK { - return &WfiValidateOK{} -} - -/*WfiValidateOK handles this case with default header values. - -WfiValidateOK wfi validate o k -*/ -type WfiValidateOK struct { - Payload models.ProtobufEmpty -} - -func (o *WfiValidateOK) Error() string { - return fmt.Sprintf("[POST /invocation/validate][%d] wfiValidateOK %+v", 200, o.Payload) -} - -func (o *WfiValidateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/cmd/wfcli/swagger-client/client/workflow_invocation_api/workflow_invocation_api_client.go b/cmd/wfcli/swagger-client/client/workflow_invocation_api/workflow_invocation_api_client.go deleted file mode 100644 index 8ebc6a5f..00000000 --- a/cmd/wfcli/swagger-client/client/workflow_invocation_api/workflow_invocation_api_client.go +++ /dev/null @@ -1,235 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package workflow_invocation_api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" -) - -// New creates a new workflow invocation api API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { - return &Client{transport: transport, formats: formats} -} - -/* -Client for workflow invocation api API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -/* -Cancel cancels a workflow invocation - -This action is irreverisble. A canceled invocation cannot be resumed or restarted. -In case that an invocation already is canceled, has failed or has completed, nothing happens. -In case that an invocation does not exist a HTTP 404 error status is returned. -*/ -func (a *Client) Cancel(params *CancelParams) (*CancelOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCancelParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "Cancel", - Method: "DELETE", - PathPattern: "/invocation/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &CancelReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*CancelOK), nil - -} - -/* -Invoke creates a new workflow invocation - -In case the invocation specification is missing fields or contains invalid fields, a HTTP 400 is returned. -*/ -func (a *Client) Invoke(params *InvokeParams) (*InvokeOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewInvokeParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "Invoke", - Method: "POST", - PathPattern: "/invocation", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &InvokeReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*InvokeOK), nil - -} - -/* -InvokeSync invoke sync API -*/ -func (a *Client) InvokeSync(params *InvokeSyncParams) (*InvokeSyncOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewInvokeSyncParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "InvokeSync", - Method: "POST", - PathPattern: "/invocation/sync", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &InvokeSyncReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*InvokeSyncOK), nil - -} - -/* -InvokeSync2 invoke sync2 API -*/ -func (a *Client) InvokeSync2(params *InvokeSync2Params) (*InvokeSync2OK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewInvokeSync2Params() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "InvokeSync2", - Method: "GET", - PathPattern: "/invocation/sync", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &InvokeSync2Reader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*InvokeSync2OK), nil - -} - -/* -WfiGet gets the specification and status of a workflow invocation - -Get returns three different aspects of the workflow invocation, namely the spec (specification), status and logs. -To lighten the request load, consider using a more specific request. -*/ -func (a *Client) WfiGet(params *WfiGetParams) (*WfiGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewWfiGetParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "WfiGet", - Method: "GET", - PathPattern: "/invocation/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &WfiGetReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*WfiGetOK), nil - -} - -/* -WfiList wfi list API -*/ -func (a *Client) WfiList(params *WfiListParams) (*WfiListOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewWfiListParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "WfiList", - Method: "GET", - PathPattern: "/invocation", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &WfiListReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*WfiListOK), nil - -} - -/* -WfiValidate wfi validate API -*/ -func (a *Client) WfiValidate(params *WfiValidateParams) (*WfiValidateOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewWfiValidateParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "WfiValidate", - Method: "POST", - PathPattern: "/invocation/validate", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &WfiValidateReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*WfiValidateOK), nil - -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/cmd/wfcli/swagger-client/models/apiserver_health.go b/cmd/wfcli/swagger-client/models/apiserver_health.go deleted file mode 100644 index cb3bd11a..00000000 --- a/cmd/wfcli/swagger-client/models/apiserver_health.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// ApiserverHealth apiserver health -// swagger:model apiserverHealth -type ApiserverHealth struct { - - // status - Status string `json:"status,omitempty"` -} - -// Validate validates this apiserver health -func (m *ApiserverHealth) Validate(formats strfmt.Registry) error { - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *ApiserverHealth) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ApiserverHealth) UnmarshalBinary(b []byte) error { - var res ApiserverHealth - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/cmd/wfcli/swagger-client/models/apiserver_search_workflow_response.go b/cmd/wfcli/swagger-client/models/apiserver_search_workflow_response.go deleted file mode 100644 index 91bacd11..00000000 --- a/cmd/wfcli/swagger-client/models/apiserver_search_workflow_response.go +++ /dev/null @@ -1,63 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// ApiserverSearchWorkflowResponse apiserver search workflow response -// swagger:model apiserverSearchWorkflowResponse -type ApiserverSearchWorkflowResponse struct { - - // workflows - Workflows []string `json:"workflows"` -} - -// Validate validates this apiserver search workflow response -func (m *ApiserverSearchWorkflowResponse) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateWorkflows(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ApiserverSearchWorkflowResponse) validateWorkflows(formats strfmt.Registry) error { - - if swag.IsZero(m.Workflows) { // not required - return nil - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ApiserverSearchWorkflowResponse) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ApiserverSearchWorkflowResponse) UnmarshalBinary(b []byte) error { - var res ApiserverSearchWorkflowResponse - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/cmd/wfcli/swagger-client/models/apiserver_version_resp.go b/cmd/wfcli/swagger-client/models/apiserver_version_resp.go deleted file mode 100644 index 0e4ac3f9..00000000 --- a/cmd/wfcli/swagger-client/models/apiserver_version_resp.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// ApiserverVersionResp apiserver version resp -// swagger:model apiserverVersionResp -type ApiserverVersionResp struct { - - // version - Version string `json:"version,omitempty"` -} - -// Validate validates this apiserver version resp -func (m *ApiserverVersionResp) Validate(formats strfmt.Registry) error { - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *ApiserverVersionResp) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ApiserverVersionResp) UnmarshalBinary(b []byte) error { - var res ApiserverVersionResp - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/cmd/wfcli/swagger-client/models/apiserver_workflow_identifier.go b/cmd/wfcli/swagger-client/models/apiserver_workflow_identifier.go deleted file mode 100644 index d7d119f0..00000000 --- a/cmd/wfcli/swagger-client/models/apiserver_workflow_identifier.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// ApiserverWorkflowIdentifier apiserver workflow identifier -// swagger:model apiserverWorkflowIdentifier -type ApiserverWorkflowIdentifier struct { - - // id - ID string `json:"id,omitempty"` -} - -// Validate validates this apiserver workflow identifier -func (m *ApiserverWorkflowIdentifier) Validate(formats strfmt.Registry) error { - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *ApiserverWorkflowIdentifier) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ApiserverWorkflowIdentifier) UnmarshalBinary(b []byte) error { - var res ApiserverWorkflowIdentifier - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/cmd/wfcli/swagger-client/models/apiserver_workflow_invocation_identifier.go b/cmd/wfcli/swagger-client/models/apiserver_workflow_invocation_identifier.go deleted file mode 100644 index f04c0b3d..00000000 --- a/cmd/wfcli/swagger-client/models/apiserver_workflow_invocation_identifier.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// ApiserverWorkflowInvocationIdentifier apiserver workflow invocation identifier -// swagger:model apiserverWorkflowInvocationIdentifier -type ApiserverWorkflowInvocationIdentifier struct { - - // id - ID string `json:"id,omitempty"` -} - -// Validate validates this apiserver workflow invocation identifier -func (m *ApiserverWorkflowInvocationIdentifier) Validate(formats strfmt.Registry) error { - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *ApiserverWorkflowInvocationIdentifier) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ApiserverWorkflowInvocationIdentifier) UnmarshalBinary(b []byte) error { - var res ApiserverWorkflowInvocationIdentifier - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/cmd/wfcli/swagger-client/models/apiserver_workflow_invocation_list.go b/cmd/wfcli/swagger-client/models/apiserver_workflow_invocation_list.go deleted file mode 100644 index 7d3b61f8..00000000 --- a/cmd/wfcli/swagger-client/models/apiserver_workflow_invocation_list.go +++ /dev/null @@ -1,63 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// ApiserverWorkflowInvocationList apiserver workflow invocation list -// swagger:model apiserverWorkflowInvocationList -type ApiserverWorkflowInvocationList struct { - - // invocations - Invocations []string `json:"invocations"` -} - -// Validate validates this apiserver workflow invocation list -func (m *ApiserverWorkflowInvocationList) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateInvocations(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ApiserverWorkflowInvocationList) validateInvocations(formats strfmt.Registry) error { - - if swag.IsZero(m.Invocations) { // not required - return nil - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ApiserverWorkflowInvocationList) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ApiserverWorkflowInvocationList) UnmarshalBinary(b []byte) error { - var res ApiserverWorkflowInvocationList - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/cmd/wfcli/swagger-client/models/error.go b/cmd/wfcli/swagger-client/models/error.go deleted file mode 100644 index c6b96971..00000000 --- a/cmd/wfcli/swagger-client/models/error.go +++ /dev/null @@ -1,52 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// Error error -// swagger:model Error -type Error struct { - - // code - Code string `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` -} - -// Validate validates this error -func (m *Error) Validate(formats strfmt.Registry) error { - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *Error) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Error) UnmarshalBinary(b []byte) error { - var res Error - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/cmd/wfcli/swagger-client/models/fn_ref.go b/cmd/wfcli/swagger-client/models/fn_ref.go deleted file mode 100644 index 51d7bb02..00000000 --- a/cmd/wfcli/swagger-client/models/fn_ref.go +++ /dev/null @@ -1,54 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// FnRef FnRef is an immutable, unique reference to a function on a specific function runtime environment. -// -// The string representation (via String or Format): runtime://runtimeId -// swagger:model FnRef -type FnRef struct { - - // Runtime is the Function Runtime environment (fnenv) that was used to resolve the function. - Runtime string `json:"runtime,omitempty"` - - // RuntimeId is the runtime-specific identifier of the function. - RuntimeID string `json:"runtimeId,omitempty"` -} - -// Validate validates this fn ref -func (m *FnRef) Validate(formats strfmt.Registry) error { - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *FnRef) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *FnRef) UnmarshalBinary(b []byte) error { - var res FnRef - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/cmd/wfcli/swagger-client/models/object_metadata.go b/cmd/wfcli/swagger-client/models/object_metadata.go deleted file mode 100644 index b07f1f05..00000000 --- a/cmd/wfcli/swagger-client/models/object_metadata.go +++ /dev/null @@ -1,52 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// ObjectMetadata Common -// swagger:model ObjectMetadata -type ObjectMetadata struct { - - // created at - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // id - ID string `json:"id,omitempty"` -} - -// Validate validates this object metadata -func (m *ObjectMetadata) Validate(formats strfmt.Registry) error { - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *ObjectMetadata) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ObjectMetadata) UnmarshalBinary(b []byte) error { - var res ObjectMetadata - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/cmd/wfcli/swagger-client/models/protobuf_empty.go b/cmd/wfcli/swagger-client/models/protobuf_empty.go deleted file mode 100644 index d55bba8e..00000000 --- a/cmd/wfcli/swagger-client/models/protobuf_empty.go +++ /dev/null @@ -1,18 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -// ProtobufEmpty A generic empty message that you can re-use to avoid defining duplicated -// empty messages in your APIs. A typical example is to use it as the request -// or the response type of an API method. For instance: -// -// service Foo { -// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); -// } -// -// The JSON representation for `Empty` is empty JSON object `{}`. -// swagger:model protobufEmpty -type ProtobufEmpty interface{} diff --git a/cmd/wfcli/swagger-client/models/task.go b/cmd/wfcli/swagger-client/models/task.go deleted file mode 100644 index 60abeb70..00000000 --- a/cmd/wfcli/swagger-client/models/task.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// Task Task Model -// swagger:model Task -type Task struct { - - // metadata - Metadata *ObjectMetadata `json:"metadata,omitempty"` - - // spec - Spec *TaskSpec `json:"spec,omitempty"` - - // status - Status *TaskStatus `json:"status,omitempty"` -} - -// Validate validates this task -func (m *Task) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateMetadata(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateSpec(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Task) validateMetadata(formats strfmt.Registry) error { - - if swag.IsZero(m.Metadata) { // not required - return nil - } - - if m.Metadata != nil { - - if err := m.Metadata.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("metadata") - } - return err - } - } - - return nil -} - -func (m *Task) validateSpec(formats strfmt.Registry) error { - - if swag.IsZero(m.Spec) { // not required - return nil - } - - if m.Spec != nil { - - if err := m.Spec.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("spec") - } - return err - } - } - - return nil -} - -func (m *Task) validateStatus(formats strfmt.Registry) error { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if m.Status != nil { - - if err := m.Status.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Task) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Task) UnmarshalBinary(b []byte) error { - var res Task - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/cmd/wfcli/swagger-client/models/task_dependency_parameters.go b/cmd/wfcli/swagger-client/models/task_dependency_parameters.go deleted file mode 100644 index 9fea9127..00000000 --- a/cmd/wfcli/swagger-client/models/task_dependency_parameters.go +++ /dev/null @@ -1,73 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// TaskDependencyParameters task dependency parameters -// swagger:model TaskDependencyParameters -type TaskDependencyParameters struct { - - // alias - Alias string `json:"alias,omitempty"` - - // type - Type TaskDependencyParametersDependencyType `json:"type,omitempty"` -} - -// Validate validates this task dependency parameters -func (m *TaskDependencyParameters) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateType(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TaskDependencyParameters) validateType(formats strfmt.Registry) error { - - if swag.IsZero(m.Type) { // not required - return nil - } - - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *TaskDependencyParameters) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *TaskDependencyParameters) UnmarshalBinary(b []byte) error { - var res TaskDependencyParameters - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/cmd/wfcli/swagger-client/models/task_dependency_parameters_dependency_type.go b/cmd/wfcli/swagger-client/models/task_dependency_parameters_dependency_type.go deleted file mode 100644 index d90904cd..00000000 --- a/cmd/wfcli/swagger-client/models/task_dependency_parameters_dependency_type.go +++ /dev/null @@ -1,63 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/validate" -) - -// TaskDependencyParametersDependencyType task dependency parameters dependency type -// swagger:model TaskDependencyParametersDependencyType -type TaskDependencyParametersDependencyType string - -const ( - // TaskDependencyParametersDependencyTypeDATA captures enum value "DATA" - TaskDependencyParametersDependencyTypeDATA TaskDependencyParametersDependencyType = "DATA" - // TaskDependencyParametersDependencyTypeCONTROL captures enum value "CONTROL" - TaskDependencyParametersDependencyTypeCONTROL TaskDependencyParametersDependencyType = "CONTROL" - // TaskDependencyParametersDependencyTypeDYNAMICOUTPUT captures enum value "DYNAMIC_OUTPUT" - TaskDependencyParametersDependencyTypeDYNAMICOUTPUT TaskDependencyParametersDependencyType = "DYNAMIC_OUTPUT" -) - -// for schema -var taskDependencyParametersDependencyTypeEnum []interface{} - -func init() { - var res []TaskDependencyParametersDependencyType - if err := json.Unmarshal([]byte(`["DATA","CONTROL","DYNAMIC_OUTPUT"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - taskDependencyParametersDependencyTypeEnum = append(taskDependencyParametersDependencyTypeEnum, v) - } -} - -func (m TaskDependencyParametersDependencyType) validateTaskDependencyParametersDependencyTypeEnum(path, location string, value TaskDependencyParametersDependencyType) error { - if err := validate.Enum(path, location, value, taskDependencyParametersDependencyTypeEnum); err != nil { - return err - } - return nil -} - -// Validate validates this task dependency parameters dependency type -func (m TaskDependencyParametersDependencyType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateTaskDependencyParametersDependencyTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/cmd/wfcli/swagger-client/models/task_invocation.go b/cmd/wfcli/swagger-client/models/task_invocation.go deleted file mode 100644 index 54bea4e7..00000000 --- a/cmd/wfcli/swagger-client/models/task_invocation.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// TaskInvocation Task Invocation Model -// swagger:model TaskInvocation -type TaskInvocation struct { - - // metadata - Metadata *ObjectMetadata `json:"metadata,omitempty"` - - // spec - Spec *TaskInvocationSpec `json:"spec,omitempty"` - - // status - Status *TaskInvocationStatus `json:"status,omitempty"` -} - -// Validate validates this task invocation -func (m *TaskInvocation) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateMetadata(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateSpec(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TaskInvocation) validateMetadata(formats strfmt.Registry) error { - - if swag.IsZero(m.Metadata) { // not required - return nil - } - - if m.Metadata != nil { - - if err := m.Metadata.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("metadata") - } - return err - } - } - - return nil -} - -func (m *TaskInvocation) validateSpec(formats strfmt.Registry) error { - - if swag.IsZero(m.Spec) { // not required - return nil - } - - if m.Spec != nil { - - if err := m.Spec.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("spec") - } - return err - } - } - - return nil -} - -func (m *TaskInvocation) validateStatus(formats strfmt.Registry) error { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if m.Status != nil { - - if err := m.Status.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *TaskInvocation) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *TaskInvocation) UnmarshalBinary(b []byte) error { - var res TaskInvocation - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/cmd/wfcli/swagger-client/models/task_invocation_spec.go b/cmd/wfcli/swagger-client/models/task_invocation_spec.go deleted file mode 100644 index a3d2a857..00000000 --- a/cmd/wfcli/swagger-client/models/task_invocation_spec.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// TaskInvocationSpec task invocation spec -// swagger:model TaskInvocationSpec -type TaskInvocationSpec struct { - - // Id of the task to be invoked (no ambiguatity at this point - FnRef *FnRef `json:"fnRef,omitempty"` - - // inputs - Inputs TaskInvocationSpecInputs `json:"inputs,omitempty"` - - // invocation Id - InvocationID string `json:"invocationId,omitempty"` - - // TaskId is the id of the task within the workflow - TaskID string `json:"taskId,omitempty"` -} - -// Validate validates this task invocation spec -func (m *TaskInvocationSpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateFnRef(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TaskInvocationSpec) validateFnRef(formats strfmt.Registry) error { - - if swag.IsZero(m.FnRef) { // not required - return nil - } - - if m.FnRef != nil { - - if err := m.FnRef.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("fnRef") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *TaskInvocationSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *TaskInvocationSpec) UnmarshalBinary(b []byte) error { - var res TaskInvocationSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/cmd/wfcli/swagger-client/models/task_invocation_spec_inputs.go b/cmd/wfcli/swagger-client/models/task_invocation_spec_inputs.go deleted file mode 100644 index c311f727..00000000 --- a/cmd/wfcli/swagger-client/models/task_invocation_spec_inputs.go +++ /dev/null @@ -1,31 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/validate" -) - -// TaskInvocationSpecInputs Inputs contain all inputs to the task invocation -// swagger:model taskInvocationSpecInputs -type TaskInvocationSpecInputs map[string]TypedValue - -// Validate validates this task invocation spec inputs -func (m TaskInvocationSpecInputs) Validate(formats strfmt.Registry) error { - var res []error - - if err := validate.Required("", "body", TaskInvocationSpecInputs(m)); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/cmd/wfcli/swagger-client/models/task_invocation_status.go b/cmd/wfcli/swagger-client/models/task_invocation_status.go deleted file mode 100644 index 67cfcea0..00000000 --- a/cmd/wfcli/swagger-client/models/task_invocation_status.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// TaskInvocationStatus task invocation status -// swagger:model TaskInvocationStatus -type TaskInvocationStatus struct { - - // error - Error *Error `json:"error,omitempty"` - - // output - Output *TypedValue `json:"output,omitempty"` - - // status - Status TaskInvocationStatusStatus `json:"status,omitempty"` - - // updated at - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// Validate validates this task invocation status -func (m *TaskInvocationStatus) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateError(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateOutput(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TaskInvocationStatus) validateError(formats strfmt.Registry) error { - - if swag.IsZero(m.Error) { // not required - return nil - } - - if m.Error != nil { - - if err := m.Error.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("error") - } - return err - } - } - - return nil -} - -func (m *TaskInvocationStatus) validateOutput(formats strfmt.Registry) error { - - if swag.IsZero(m.Output) { // not required - return nil - } - - if m.Output != nil { - - if err := m.Output.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("output") - } - return err - } - } - - return nil -} - -func (m *TaskInvocationStatus) validateStatus(formats strfmt.Registry) error { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *TaskInvocationStatus) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *TaskInvocationStatus) UnmarshalBinary(b []byte) error { - var res TaskInvocationStatus - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/cmd/wfcli/swagger-client/models/task_invocation_status_status.go b/cmd/wfcli/swagger-client/models/task_invocation_status_status.go deleted file mode 100644 index e3bf80b2..00000000 --- a/cmd/wfcli/swagger-client/models/task_invocation_status_status.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/validate" -) - -// TaskInvocationStatusStatus task invocation status status -// swagger:model TaskInvocationStatusStatus -type TaskInvocationStatusStatus string - -const ( - // TaskInvocationStatusStatusUNKNOWN captures enum value "UNKNOWN" - TaskInvocationStatusStatusUNKNOWN TaskInvocationStatusStatus = "UNKNOWN" - // TaskInvocationStatusStatusSCHEDULED captures enum value "SCHEDULED" - TaskInvocationStatusStatusSCHEDULED TaskInvocationStatusStatus = "SCHEDULED" - // TaskInvocationStatusStatusINPROGRESS captures enum value "IN_PROGRESS" - TaskInvocationStatusStatusINPROGRESS TaskInvocationStatusStatus = "IN_PROGRESS" - // TaskInvocationStatusStatusSUCCEEDED captures enum value "SUCCEEDED" - TaskInvocationStatusStatusSUCCEEDED TaskInvocationStatusStatus = "SUCCEEDED" - // TaskInvocationStatusStatusFAILED captures enum value "FAILED" - TaskInvocationStatusStatusFAILED TaskInvocationStatusStatus = "FAILED" - // TaskInvocationStatusStatusABORTED captures enum value "ABORTED" - TaskInvocationStatusStatusABORTED TaskInvocationStatusStatus = "ABORTED" - // TaskInvocationStatusStatusSKIPPED captures enum value "SKIPPED" - TaskInvocationStatusStatusSKIPPED TaskInvocationStatusStatus = "SKIPPED" -) - -// for schema -var taskInvocationStatusStatusEnum []interface{} - -func init() { - var res []TaskInvocationStatusStatus - if err := json.Unmarshal([]byte(`["UNKNOWN","SCHEDULED","IN_PROGRESS","SUCCEEDED","FAILED","ABORTED","SKIPPED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - taskInvocationStatusStatusEnum = append(taskInvocationStatusStatusEnum, v) - } -} - -func (m TaskInvocationStatusStatus) validateTaskInvocationStatusStatusEnum(path, location string, value TaskInvocationStatusStatus) error { - if err := validate.Enum(path, location, value, taskInvocationStatusStatusEnum); err != nil { - return err - } - return nil -} - -// Validate validates this task invocation status status -func (m TaskInvocationStatusStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateTaskInvocationStatusStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/cmd/wfcli/swagger-client/models/task_spec.go b/cmd/wfcli/swagger-client/models/task_spec.go deleted file mode 100644 index 375b6d55..00000000 --- a/cmd/wfcli/swagger-client/models/task_spec.go +++ /dev/null @@ -1,88 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// TaskSpec A task is the primitive unit of a workflow, representing an action that needs to be performed in order to continue. -// -// A task as a number of inputs and exactly two outputs -// Id is specified outside of TaskSpec -// swagger:model TaskSpec -type TaskSpec struct { - - // Number of dependencies to wait for - Await int32 `json:"await,omitempty"` - - // Name/identifier of the function - FunctionRef string `json:"functionRef,omitempty"` - - // inputs - Inputs TaskSpecInputs `json:"inputs,omitempty"` - - // Transform the output, or override the output with a literal - Output *TypedValue `json:"output,omitempty"` - - // requires - Requires TaskSpecRequires `json:"requires,omitempty"` -} - -// Validate validates this task spec -func (m *TaskSpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateOutput(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TaskSpec) validateOutput(formats strfmt.Registry) error { - - if swag.IsZero(m.Output) { // not required - return nil - } - - if m.Output != nil { - - if err := m.Output.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("output") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *TaskSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *TaskSpec) UnmarshalBinary(b []byte) error { - var res TaskSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/cmd/wfcli/swagger-client/models/task_spec_inputs.go b/cmd/wfcli/swagger-client/models/task_spec_inputs.go deleted file mode 100644 index 79f67006..00000000 --- a/cmd/wfcli/swagger-client/models/task_spec_inputs.go +++ /dev/null @@ -1,31 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/validate" -) - -// TaskSpecInputs task spec inputs -// swagger:model taskSpecInputs -type TaskSpecInputs map[string]TypedValue - -// Validate validates this task spec inputs -func (m TaskSpecInputs) Validate(formats strfmt.Registry) error { - var res []error - - if err := validate.Required("", "body", TaskSpecInputs(m)); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/cmd/wfcli/swagger-client/models/task_spec_requires.go b/cmd/wfcli/swagger-client/models/task_spec_requires.go deleted file mode 100644 index 9263b263..00000000 --- a/cmd/wfcli/swagger-client/models/task_spec_requires.go +++ /dev/null @@ -1,31 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/validate" -) - -// TaskSpecRequires Dependencies for this task to execute -// swagger:model taskSpecRequires -type TaskSpecRequires map[string]TaskDependencyParameters - -// Validate validates this task spec requires -func (m TaskSpecRequires) Validate(formats strfmt.Registry) error { - var res []error - - if err := validate.Required("", "body", TaskSpecRequires(m)); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/cmd/wfcli/swagger-client/models/task_status.go b/cmd/wfcli/swagger-client/models/task_status.go deleted file mode 100644 index 0c3aa3c8..00000000 --- a/cmd/wfcli/swagger-client/models/task_status.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// TaskStatus task status -// swagger:model TaskStatus -type TaskStatus struct { - - // error - Error *Error `json:"error,omitempty"` - - // fn ref - FnRef *FnRef `json:"fnRef,omitempty"` - - // status - Status TaskStatusStatus `json:"status,omitempty"` - - // updated at - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// Validate validates this task status -func (m *TaskStatus) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateError(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateFnRef(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TaskStatus) validateError(formats strfmt.Registry) error { - - if swag.IsZero(m.Error) { // not required - return nil - } - - if m.Error != nil { - - if err := m.Error.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("error") - } - return err - } - } - - return nil -} - -func (m *TaskStatus) validateFnRef(formats strfmt.Registry) error { - - if swag.IsZero(m.FnRef) { // not required - return nil - } - - if m.FnRef != nil { - - if err := m.FnRef.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("fnRef") - } - return err - } - } - - return nil -} - -func (m *TaskStatus) validateStatus(formats strfmt.Registry) error { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *TaskStatus) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *TaskStatus) UnmarshalBinary(b []byte) error { - var res TaskStatus - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/cmd/wfcli/swagger-client/models/task_status_status.go b/cmd/wfcli/swagger-client/models/task_status_status.go deleted file mode 100644 index 91300ded..00000000 --- a/cmd/wfcli/swagger-client/models/task_status_status.go +++ /dev/null @@ -1,63 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/validate" -) - -// TaskStatusStatus task status status -// swagger:model TaskStatusStatus -type TaskStatusStatus string - -const ( - // TaskStatusStatusSTARTED captures enum value "STARTED" - TaskStatusStatusSTARTED TaskStatusStatus = "STARTED" - // TaskStatusStatusREADY captures enum value "READY" - TaskStatusStatusREADY TaskStatusStatus = "READY" - // TaskStatusStatusFAILED captures enum value "FAILED" - TaskStatusStatusFAILED TaskStatusStatus = "FAILED" -) - -// for schema -var taskStatusStatusEnum []interface{} - -func init() { - var res []TaskStatusStatus - if err := json.Unmarshal([]byte(`["STARTED","READY","FAILED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - taskStatusStatusEnum = append(taskStatusStatusEnum, v) - } -} - -func (m TaskStatusStatus) validateTaskStatusStatusEnum(path, location string, value TaskStatusStatus) error { - if err := validate.Enum(path, location, value, taskStatusStatusEnum); err != nil { - return err - } - return nil -} - -// Validate validates this task status status -func (m TaskStatusStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateTaskStatusStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/cmd/wfcli/swagger-client/models/task_type_def.go b/cmd/wfcli/swagger-client/models/task_type_def.go deleted file mode 100644 index 5e92ec67..00000000 --- a/cmd/wfcli/swagger-client/models/task_type_def.go +++ /dev/null @@ -1,34 +0,0 @@ -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" -) - -// TaskTypeDef task type def -// swagger:model TaskTypeDef -type TaskTypeDef struct { - - // resolved - Resolved string `json:"resolved,omitempty"` - - // runtime - Runtime string `json:"runtime,omitempty"` - - // src - Src string `json:"src,omitempty"` -} - -// Validate validates this task type def -func (m *TaskTypeDef) Validate(formats strfmt.Registry) error { - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/cmd/wfcli/swagger-client/models/typed_value.go b/cmd/wfcli/swagger-client/models/typed_value.go deleted file mode 100644 index 53e9535b..00000000 --- a/cmd/wfcli/swagger-client/models/typed_value.go +++ /dev/null @@ -1,52 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// TypedValue Copy of protobuf's Any, to avoid protobuf requirement of a protobuf-based type. -// swagger:model TypedValue -type TypedValue struct { - - // type - Type string `json:"type,omitempty"` - - // value - Value strfmt.Base64 `json:"value,omitempty"` -} - -// Validate validates this typed value -func (m *TypedValue) Validate(formats strfmt.Registry) error { - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *TypedValue) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *TypedValue) UnmarshalBinary(b []byte) error { - var res TypedValue - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/cmd/wfcli/swagger-client/models/workflow.go b/cmd/wfcli/swagger-client/models/workflow.go deleted file mode 100644 index b43a5212..00000000 --- a/cmd/wfcli/swagger-client/models/workflow.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// Workflow Workflow Model -// swagger:model Workflow -type Workflow struct { - - // metadata - Metadata *ObjectMetadata `json:"metadata,omitempty"` - - // spec - Spec *WorkflowSpec `json:"spec,omitempty"` - - // status - Status *WorkflowStatus `json:"status,omitempty"` -} - -// Validate validates this workflow -func (m *Workflow) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateMetadata(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateSpec(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Workflow) validateMetadata(formats strfmt.Registry) error { - - if swag.IsZero(m.Metadata) { // not required - return nil - } - - if m.Metadata != nil { - - if err := m.Metadata.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("metadata") - } - return err - } - } - - return nil -} - -func (m *Workflow) validateSpec(formats strfmt.Registry) error { - - if swag.IsZero(m.Spec) { // not required - return nil - } - - if m.Spec != nil { - - if err := m.Spec.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("spec") - } - return err - } - } - - return nil -} - -func (m *Workflow) validateStatus(formats strfmt.Registry) error { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if m.Status != nil { - - if err := m.Status.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Workflow) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Workflow) UnmarshalBinary(b []byte) error { - var res Workflow - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/cmd/wfcli/swagger-client/models/workflow_invocation.go b/cmd/wfcli/swagger-client/models/workflow_invocation.go deleted file mode 100644 index 2538b682..00000000 --- a/cmd/wfcli/swagger-client/models/workflow_invocation.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// WorkflowInvocation Workflow Invocation Model -// swagger:model WorkflowInvocation -type WorkflowInvocation struct { - - // metadata - Metadata *ObjectMetadata `json:"metadata,omitempty"` - - // spec - Spec *WorkflowInvocationSpec `json:"spec,omitempty"` - - // status - Status *WorkflowInvocationStatus `json:"status,omitempty"` -} - -// Validate validates this workflow invocation -func (m *WorkflowInvocation) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateMetadata(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateSpec(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *WorkflowInvocation) validateMetadata(formats strfmt.Registry) error { - - if swag.IsZero(m.Metadata) { // not required - return nil - } - - if m.Metadata != nil { - - if err := m.Metadata.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("metadata") - } - return err - } - } - - return nil -} - -func (m *WorkflowInvocation) validateSpec(formats strfmt.Registry) error { - - if swag.IsZero(m.Spec) { // not required - return nil - } - - if m.Spec != nil { - - if err := m.Spec.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("spec") - } - return err - } - } - - return nil -} - -func (m *WorkflowInvocation) validateStatus(formats strfmt.Registry) error { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if m.Status != nil { - - if err := m.Status.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *WorkflowInvocation) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *WorkflowInvocation) UnmarshalBinary(b []byte) error { - var res WorkflowInvocation - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/cmd/wfcli/swagger-client/models/workflow_invocation_spec.go b/cmd/wfcli/swagger-client/models/workflow_invocation_spec.go deleted file mode 100644 index 402129ea..00000000 --- a/cmd/wfcli/swagger-client/models/workflow_invocation_spec.go +++ /dev/null @@ -1,57 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// WorkflowInvocationSpec Workflow Invocation Model -// swagger:model WorkflowInvocationSpec -type WorkflowInvocationSpec struct { - - // inputs - Inputs WorkflowInvocationSpecInputs `json:"inputs,omitempty"` - - // ParentId contains the id of the encapsulating workflow invocation. - // - // This used within the workflow engine; for user-provided workflow invocations the parentId is ignored. - ParentID string `json:"parentId,omitempty"` - - // workflow Id - WorkflowID string `json:"workflowId,omitempty"` -} - -// Validate validates this workflow invocation spec -func (m *WorkflowInvocationSpec) Validate(formats strfmt.Registry) error { - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *WorkflowInvocationSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *WorkflowInvocationSpec) UnmarshalBinary(b []byte) error { - var res WorkflowInvocationSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/cmd/wfcli/swagger-client/models/workflow_invocation_spec_inputs.go b/cmd/wfcli/swagger-client/models/workflow_invocation_spec_inputs.go deleted file mode 100644 index 3dad8180..00000000 --- a/cmd/wfcli/swagger-client/models/workflow_invocation_spec_inputs.go +++ /dev/null @@ -1,31 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/validate" -) - -// WorkflowInvocationSpecInputs workflow invocation spec inputs -// swagger:model workflowInvocationSpecInputs -type WorkflowInvocationSpecInputs map[string]TypedValue - -// Validate validates this workflow invocation spec inputs -func (m WorkflowInvocationSpecInputs) Validate(formats strfmt.Registry) error { - var res []error - - if err := validate.Required("", "body", WorkflowInvocationSpecInputs(m)); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/cmd/wfcli/swagger-client/models/workflow_invocation_status.go b/cmd/wfcli/swagger-client/models/workflow_invocation_status.go deleted file mode 100644 index d7c51724..00000000 --- a/cmd/wfcli/swagger-client/models/workflow_invocation_status.go +++ /dev/null @@ -1,133 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// WorkflowInvocationStatus workflow invocation status -// swagger:model WorkflowInvocationStatus -type WorkflowInvocationStatus struct { - - // dynamic tasks - DynamicTasks WorkflowInvocationStatusDynamicTasks `json:"dynamicTasks,omitempty"` - - // error - Error *Error `json:"error,omitempty"` - - // output - Output *TypedValue `json:"output,omitempty"` - - // status - Status WorkflowInvocationStatusStatus `json:"status,omitempty"` - - // tasks - Tasks WorkflowInvocationStatusTasks `json:"tasks,omitempty"` - - // updated at - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// Validate validates this workflow invocation status -func (m *WorkflowInvocationStatus) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateError(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateOutput(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *WorkflowInvocationStatus) validateError(formats strfmt.Registry) error { - - if swag.IsZero(m.Error) { // not required - return nil - } - - if m.Error != nil { - - if err := m.Error.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("error") - } - return err - } - } - - return nil -} - -func (m *WorkflowInvocationStatus) validateOutput(formats strfmt.Registry) error { - - if swag.IsZero(m.Output) { // not required - return nil - } - - if m.Output != nil { - - if err := m.Output.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("output") - } - return err - } - } - - return nil -} - -func (m *WorkflowInvocationStatus) validateStatus(formats strfmt.Registry) error { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *WorkflowInvocationStatus) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *WorkflowInvocationStatus) UnmarshalBinary(b []byte) error { - var res WorkflowInvocationStatus - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/cmd/wfcli/swagger-client/models/workflow_invocation_status_dynamic_tasks.go b/cmd/wfcli/swagger-client/models/workflow_invocation_status_dynamic_tasks.go deleted file mode 100644 index c833b036..00000000 --- a/cmd/wfcli/swagger-client/models/workflow_invocation_status_dynamic_tasks.go +++ /dev/null @@ -1,32 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/validate" -) - -// WorkflowInvocationStatusDynamicTasks In case the task ID also exists in the workflow spec, the dynamic task will be -// used as an overlay over the static task. -// swagger:model workflowInvocationStatusDynamicTasks -type WorkflowInvocationStatusDynamicTasks map[string]Task - -// Validate validates this workflow invocation status dynamic tasks -func (m WorkflowInvocationStatusDynamicTasks) Validate(formats strfmt.Registry) error { - var res []error - - if err := validate.Required("", "body", WorkflowInvocationStatusDynamicTasks(m)); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/cmd/wfcli/swagger-client/models/workflow_invocation_status_status.go b/cmd/wfcli/swagger-client/models/workflow_invocation_status_status.go deleted file mode 100644 index 4ca46c16..00000000 --- a/cmd/wfcli/swagger-client/models/workflow_invocation_status_status.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/validate" -) - -// WorkflowInvocationStatusStatus workflow invocation status status -// swagger:model WorkflowInvocationStatusStatus -type WorkflowInvocationStatusStatus string - -const ( - // WorkflowInvocationStatusStatusUNKNOWN captures enum value "UNKNOWN" - WorkflowInvocationStatusStatusUNKNOWN WorkflowInvocationStatusStatus = "UNKNOWN" - // WorkflowInvocationStatusStatusSCHEDULED captures enum value "SCHEDULED" - WorkflowInvocationStatusStatusSCHEDULED WorkflowInvocationStatusStatus = "SCHEDULED" - // WorkflowInvocationStatusStatusINPROGRESS captures enum value "IN_PROGRESS" - WorkflowInvocationStatusStatusINPROGRESS WorkflowInvocationStatusStatus = "IN_PROGRESS" - // WorkflowInvocationStatusStatusSUCCEEDED captures enum value "SUCCEEDED" - WorkflowInvocationStatusStatusSUCCEEDED WorkflowInvocationStatusStatus = "SUCCEEDED" - // WorkflowInvocationStatusStatusFAILED captures enum value "FAILED" - WorkflowInvocationStatusStatusFAILED WorkflowInvocationStatusStatus = "FAILED" - // WorkflowInvocationStatusStatusABORTED captures enum value "ABORTED" - WorkflowInvocationStatusStatusABORTED WorkflowInvocationStatusStatus = "ABORTED" -) - -// for schema -var workflowInvocationStatusStatusEnum []interface{} - -func init() { - var res []WorkflowInvocationStatusStatus - if err := json.Unmarshal([]byte(`["UNKNOWN","SCHEDULED","IN_PROGRESS","SUCCEEDED","FAILED","ABORTED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - workflowInvocationStatusStatusEnum = append(workflowInvocationStatusStatusEnum, v) - } -} - -func (m WorkflowInvocationStatusStatus) validateWorkflowInvocationStatusStatusEnum(path, location string, value WorkflowInvocationStatusStatus) error { - if err := validate.Enum(path, location, value, workflowInvocationStatusStatusEnum); err != nil { - return err - } - return nil -} - -// Validate validates this workflow invocation status status -func (m WorkflowInvocationStatusStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateWorkflowInvocationStatusStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/cmd/wfcli/swagger-client/models/workflow_invocation_status_tasks.go b/cmd/wfcli/swagger-client/models/workflow_invocation_status_tasks.go deleted file mode 100644 index ffd2194b..00000000 --- a/cmd/wfcli/swagger-client/models/workflow_invocation_status_tasks.go +++ /dev/null @@ -1,31 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/validate" -) - -// WorkflowInvocationStatusTasks workflow invocation status tasks -// swagger:model workflowInvocationStatusTasks -type WorkflowInvocationStatusTasks map[string]TaskInvocation - -// Validate validates this workflow invocation status tasks -func (m WorkflowInvocationStatusTasks) Validate(formats strfmt.Registry) error { - var res []error - - if err := validate.Required("", "body", WorkflowInvocationStatusTasks(m)); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/cmd/wfcli/swagger-client/models/workflow_spec.go b/cmd/wfcli/swagger-client/models/workflow_spec.go deleted file mode 100644 index a2785f51..00000000 --- a/cmd/wfcli/swagger-client/models/workflow_spec.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// WorkflowSpec Workflow Definition -// -// The workflowDefinition contains the definition of a workflow. -// -// Ideally the source code (json, yaml) can be converted directly to this message. -// Naming, triggers and versioning of the workflow itself is out of the scope of this data structure, which is delegated -// to the user/system upon the creation of a workflow. -// swagger:model WorkflowSpec -type WorkflowSpec struct { - - // apiVersion describes what version is of the workflow definition. - // By default the workflow engine will assume the latest version to be used. - APIVersion string `json:"apiVersion,omitempty"` - - // description - Description string `json:"description,omitempty"` - - // The UID that the workflow should have. Only use this in case you want to force a specific UID. - ForceID string `json:"forceId,omitempty"` - - // Internal indicates whether is a workflow should be visible to a human (default) or not. - Internal bool `json:"internal,omitempty"` - - // Name is solely for human-readablity - Name string `json:"name,omitempty"` - - // From which task should the workflow return the output? Future: multiple? Implicit? - OutputTask string `json:"outputTask,omitempty"` - - // tasks - Tasks WorkflowSpecTasks `json:"tasks,omitempty"` -} - -// Validate validates this workflow spec -func (m *WorkflowSpec) Validate(formats strfmt.Registry) error { - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *WorkflowSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *WorkflowSpec) UnmarshalBinary(b []byte) error { - var res WorkflowSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/cmd/wfcli/swagger-client/models/workflow_spec_tasks.go b/cmd/wfcli/swagger-client/models/workflow_spec_tasks.go deleted file mode 100644 index e787b21e..00000000 --- a/cmd/wfcli/swagger-client/models/workflow_spec_tasks.go +++ /dev/null @@ -1,33 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/validate" -) - -// WorkflowSpecTasks Tasks contains the specs of the tasks, with the key being the task id. -// -// Note: Dependency graph is build into the tasks. -// swagger:model workflowSpecTasks -type WorkflowSpecTasks map[string]TaskSpec - -// Validate validates this workflow spec tasks -func (m WorkflowSpecTasks) Validate(formats strfmt.Registry) error { - var res []error - - if err := validate.Required("", "body", WorkflowSpecTasks(m)); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/cmd/wfcli/swagger-client/models/workflow_status.go b/cmd/wfcli/swagger-client/models/workflow_status.go deleted file mode 100644 index 905e6269..00000000 --- a/cmd/wfcli/swagger-client/models/workflow_status.go +++ /dev/null @@ -1,103 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// WorkflowStatus workflow status -// swagger:model WorkflowStatus -type WorkflowStatus struct { - - // error - Error *Error `json:"error,omitempty"` - - // status - Status WorkflowStatusStatus `json:"status,omitempty"` - - // tasks - Tasks WorkflowStatusTasks `json:"tasks,omitempty"` - - // updated at - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// Validate validates this workflow status -func (m *WorkflowStatus) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateError(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *WorkflowStatus) validateError(formats strfmt.Registry) error { - - if swag.IsZero(m.Error) { // not required - return nil - } - - if m.Error != nil { - - if err := m.Error.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("error") - } - return err - } - } - - return nil -} - -func (m *WorkflowStatus) validateStatus(formats strfmt.Registry) error { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *WorkflowStatus) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *WorkflowStatus) UnmarshalBinary(b []byte) error { - var res WorkflowStatus - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/cmd/wfcli/swagger-client/models/workflow_status_status.go b/cmd/wfcli/swagger-client/models/workflow_status_status.go deleted file mode 100644 index 0bbd6ab3..00000000 --- a/cmd/wfcli/swagger-client/models/workflow_status_status.go +++ /dev/null @@ -1,65 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/validate" -) - -// WorkflowStatusStatus - READY: PARSING = 1; // During validation/parsing -// swagger:model WorkflowStatusStatus -type WorkflowStatusStatus string - -const ( - // WorkflowStatusStatusPENDING captures enum value "PENDING" - WorkflowStatusStatusPENDING WorkflowStatusStatus = "PENDING" - // WorkflowStatusStatusREADY captures enum value "READY" - WorkflowStatusStatusREADY WorkflowStatusStatus = "READY" - // WorkflowStatusStatusFAILED captures enum value "FAILED" - WorkflowStatusStatusFAILED WorkflowStatusStatus = "FAILED" - // WorkflowStatusStatusDELETED captures enum value "DELETED" - WorkflowStatusStatusDELETED WorkflowStatusStatus = "DELETED" -) - -// for schema -var workflowStatusStatusEnum []interface{} - -func init() { - var res []WorkflowStatusStatus - if err := json.Unmarshal([]byte(`["PENDING","READY","FAILED","DELETED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - workflowStatusStatusEnum = append(workflowStatusStatusEnum, v) - } -} - -func (m WorkflowStatusStatus) validateWorkflowStatusStatusEnum(path, location string, value WorkflowStatusStatus) error { - if err := validate.Enum(path, location, value, workflowStatusStatusEnum); err != nil { - return err - } - return nil -} - -// Validate validates this workflow status status -func (m WorkflowStatusStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateWorkflowStatusStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/cmd/wfcli/swagger-client/models/workflow_status_tasks.go b/cmd/wfcli/swagger-client/models/workflow_status_tasks.go deleted file mode 100644 index 4e9fbae8..00000000 --- a/cmd/wfcli/swagger-client/models/workflow_status_tasks.go +++ /dev/null @@ -1,31 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/validate" -) - -// WorkflowStatusTasks Tasks contains the status of the tasks, with the key being the task id. -// swagger:model workflowStatusTasks -type WorkflowStatusTasks map[string]TaskStatus - -// Validate validates this workflow status tasks -func (m WorkflowStatusTasks) Validate(formats strfmt.Registry) error { - var res []error - - if err := validate.Required("", "body", WorkflowStatusTasks(m)); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/cmd/wfcli/version.go b/cmd/wfcli/version.go index 8c352ddf..2c8dc182 100644 --- a/cmd/wfcli/version.go +++ b/cmd/wfcli/version.go @@ -1,25 +1,28 @@ package main import ( + "context" "fmt" + "net/http" - "github.com/fission/fission-workflows/cmd/wfcli/swagger-client/client/admin_api" + "github.com/fission/fission-workflows/pkg/apiserver/httpclient" "github.com/fission/fission-workflows/pkg/version" - "github.com/go-openapi/strfmt" "github.com/urfave/cli" ) var versionPrinter = func(c *cli.Context) error { + // Print client version fmt.Printf("client: %s\n", version.VERSION) - u := parseUrl(c.GlobalString("url")) - client := createTransportClient(u) - adminApi := admin_api.New(client, strfmt.Default) - resp, err := adminApi.Version(admin_api.NewVersionParams()) + // Print server version + ctx := context.TODO() + url := parseUrl(c.GlobalString("url")) + admin := httpclient.NewAdminApi(url.String(), http.Client{}) + resp, err := admin.Version(ctx) if err != nil { fmt.Printf("server: failed to get version (%v)\n", err) } else { - fmt.Printf("server: %s\n", resp.Payload.Version) + fmt.Printf("server: %s\n", resp.Version) } return nil } diff --git a/cmd/wfcli/workflow.go b/cmd/wfcli/workflow.go index da76ec27..dd6b5eab 100644 --- a/cmd/wfcli/workflow.go +++ b/cmd/wfcli/workflow.go @@ -1,13 +1,14 @@ package main import ( + "context" "fmt" + "net/http" "os" "sort" - "github.com/fission/fission-workflows/cmd/wfcli/swagger-client/client/workflow_api" + "github.com/fission/fission-workflows/pkg/apiserver/httpclient" "github.com/fission/fission-workflows/pkg/parse/yaml" - "github.com/go-openapi/strfmt" "github.com/urfave/cli" ) @@ -20,25 +21,29 @@ var cmdWorkflow = cli.Command{ Name: "get", Usage: "get ", Action: func(c *cli.Context) error { - u := parseUrl(c.GlobalString("url")) - client := createTransportClient(u) - wfApi := workflow_api.New(client, strfmt.Default) + //u := parseUrl(c.GlobalString("url")) + //client := createTransportClient(u) + //wfApi := workflow_api.New(client, strfmt.Default) + ctx := context.TODO() + url := parseUrl(c.GlobalString("url")) + wfApi := httpclient.NewWorkflowApi(url.String(), http.Client{}) + switch c.NArg() { case 0: // List workflows - resp, err := wfApi.WfList(workflow_api.NewWfListParams()) + resp, err := wfApi.List(ctx) + //resp, err := wf.(workflow_api.NewWfListParams()) if err != nil { panic(err) } - wfs := resp.Payload.Workflows + wfs := resp.Workflows sort.Strings(wfs) var rows [][]string for _, wfId := range wfs { - resp, err := wfApi.WfGet(workflow_api.NewWfGetParams().WithID(wfId)) + wf, err := wfApi.Get(ctx, wfId) if err != nil { panic(err) } - wf := resp.Payload updated := wf.Status.UpdatedAt.String() created := wf.Metadata.CreatedAt.String() @@ -50,11 +55,11 @@ var cmdWorkflow = cli.Command{ // Get Workflow wfId := c.Args().Get(0) println(wfId) - resp, err := wfApi.WfGet(workflow_api.NewWfGetParams().WithID(wfId)) + wf, err := wfApi.Get(ctx, wfId) if err != nil { panic(err) } - b, err := yaml.Marshal(resp.Payload) + b, err := yaml.Marshal(wf) if err != nil { panic(err) } @@ -65,11 +70,10 @@ var cmdWorkflow = cli.Command{ default: wfId := c.Args().Get(0) taskId := c.Args().Get(1) - resp, err := wfApi.WfGet(workflow_api.NewWfGetParams().WithID(wfId)) + wf, err := wfApi.Get(ctx, wfId) if err != nil { panic(err) } - wf := resp.Payload task, ok := wf.Spec.Tasks[taskId] if !ok { fmt.Println("Task not found.") diff --git a/glide.lock b/glide.lock index a75ef377..393f9f18 100644 --- a/glide.lock +++ b/glide.lock @@ -1,13 +1,11 @@ -hash: b9ec998ab73dd238a9e49987eee099c27bf8975385fa1ee2379c9fa98e5a0cf4 -updated: 2018-03-16T16:24:48.132614+01:00 +hash: c2526512cec799628d8bad5da28aba3ca9a1d42f2778bae5cc1c7503cd5da0b3 +updated: 2018-03-22T01:16:29.753386+01:00 imports: - name: cloud.google.com/go version: 3b1ae45394a234c385be014e9a488f2bb6eef821 subpackages: - compute/metadata - internal -- name: github.com/asaskevich/govalidator - version: ccb8e960c48f04d6935e72476ae4a51028f9e22f - name: github.com/Azure/go-autorest version: d4e6b95c12a08b4de2d48b45d5b4d594e5d32fab subpackages: @@ -45,27 +43,15 @@ imports: - name: github.com/go-openapi/analysis version: 7222828b8ce19afee3c595aef6643b9e42150120 - name: github.com/go-openapi/errors - version: c25e181e61688ebe4e2a1fa6161a6ad4f6177e82 + version: 49fe8b3a0e0d32a617d8d50c67f856ad6e45b28b - name: github.com/go-openapi/jsonpointer - version: 779f45308c19820f1a69e9a4cd965f496e0da10f + version: 46af16f9f7b149af66e5d1bd010e3574dc06de98 - name: github.com/go-openapi/jsonreference version: 13c6e3589ad90f49bd3e3bbe2c2cb3d7a4142272 - name: github.com/go-openapi/loads version: 315567415dfd74b651f7a62cabfc82a57ed7b9ad -- name: github.com/go-openapi/runtime - version: b1db76181cbf53cf97a98980762a2bbf7cca8a0f - subpackages: - - client - - logger - - middleware - - middleware/denco - - middleware/header - - middleware/untyped - - security - name: github.com/go-openapi/spec version: d8000b5bfbd1147255710505a27c735b6b2ae2ac -- name: github.com/go-openapi/strfmt - version: 6d1a47fad79c81e8cd732889cb80e91123951860 - name: github.com/go-openapi/swag version: 3b6d86cd965820f968760d5d419cb4add096bdd7 - name: github.com/go-openapi/validate @@ -123,8 +109,6 @@ imports: - buffer - jlexer - jwriter -- name: github.com/mitchellh/mapstructure - version: 00c29f56e2386353d58c599509e8dc3801b0d716 - name: github.com/nats-io/go-nats version: d66cb54e6b7bdd93f0b28afc8450d84c780dfb68 subpackages: @@ -163,7 +147,7 @@ imports: - name: github.com/urfave/cli version: 0bdeddeeb0f650497d603c4ad7b20cfe685682f6 - name: golang.org/x/crypto - version: b4956d363a8b14623cc81db401707679605930a3 + version: 80db560fac1fb3e6ac81dbc7f8ae4c061f5257bd subpackages: - ssh/terminal - name: golang.org/x/net @@ -190,7 +174,7 @@ imports: - semaphore - syncmap - name: golang.org/x/sys - version: cc7307a45468e49eaf2997c890f14aa03a26917b + version: c488ab1dd8481ef762f96a79a9577c27825be697 subpackages: - unix - windows @@ -276,11 +260,6 @@ imports: - transport - name: gopkg.in/inf.v0 version: 3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4 -- name: gopkg.in/mgo.v2 - version: 3f83fa5005286a7fe593b055f0d7771a7dce4655 - subpackages: - - bson - - internal/json - name: gopkg.in/sourcemap.v1 version: 6e83acea0053641eff084973fee085f0c193c61a subpackages: @@ -288,7 +267,7 @@ imports: - name: gopkg.in/yaml.v2 version: 7f97868eec74b32b0982dd158a51a446d1da7eb5 - name: k8s.io/apiextensions-apiserver - version: fe88520b48a5daf72bc874786850afc7ac1f402d + version: d2a827762e85b433a8f34b819aef90fd68fc69d9 subpackages: - pkg/apis/apiextensions - pkg/apis/apiextensions/v1beta1 diff --git a/glide.yaml b/glide.yaml index 920b367c..043af409 100644 --- a/glide.yaml +++ b/glide.yaml @@ -57,6 +57,8 @@ import: version: 2c997e169d705fe1e4235c9c1d62a7e704a84290 - package: github.com/go-openapi/swag version: 3b6d86cd965820f968760d5d419cb4add096bdd7 +- package: github.com/go-openapi/spec + version: d8000b5bfbd1147255710505a27c735b6b2ae2ac testImport: - package: github.com/stretchr/testify version: 1.1.4 diff --git a/pkg/apiserver/httpclient/admin.go b/pkg/apiserver/httpclient/admin.go new file mode 100644 index 00000000..46fa1e81 --- /dev/null +++ b/pkg/apiserver/httpclient/admin.go @@ -0,0 +1,43 @@ +package httpclient + +import ( + "context" + "net/http" + + "github.com/fission/fission-workflows/pkg/apiserver" +) + +type AdminApi struct { + BaseApi +} + +func NewAdminApi(endpoint string, client http.Client) *AdminApi { + return &AdminApi{ + BaseApi: BaseApi{ + endpoint: endpoint, + client: client, + }, + } +} + +func (api *AdminApi) Status(ctx context.Context) (*apiserver.Health, error) { + result := &apiserver.Health{} + err := call(http.MethodGet, api.formatUrl("/status"), nil, result) + return result, err +} + +func (api *AdminApi) Version(ctx context.Context) (*apiserver.VersionResp, error) { + result := &apiserver.VersionResp{} + err := call(http.MethodGet, api.formatUrl("/version"), nil, result) + return result, err +} + +func (api *AdminApi) Resume(ctx context.Context) error { + err := call(http.MethodGet, api.formatUrl("/resume"), nil, nil) + return err +} + +func (api *AdminApi) Halt(ctx context.Context) error { + err := call(http.MethodGet, api.formatUrl("/halt"), nil, nil) + return err +} diff --git a/pkg/apiserver/httpclient/httpclient.go b/pkg/apiserver/httpclient/httpclient.go new file mode 100644 index 00000000..b2e7d712 --- /dev/null +++ b/pkg/apiserver/httpclient/httpclient.go @@ -0,0 +1,71 @@ +// Package httpclient is a lightweight implementation of the HTTP gateway. +package httpclient + +import ( + "bytes" + "fmt" + "io" + "io/ioutil" + "net/http" + "strings" + + "github.com/golang/protobuf/jsonpb" + "github.com/golang/protobuf/proto" +) + +var defaultHttpClient = http.Client{} +var defaultJsonPbMarshaller = jsonpb.Marshaler{} + +func toJson(dst io.Writer, m proto.Message) error { + return defaultJsonPbMarshaller.Marshal(dst, m) +} + +func fromJson(src io.Reader, dst proto.Message) error { + return jsonpb.Unmarshal(src, dst) +} + +func call(method string, url string, in proto.Message, out proto.Message) error { + buf := bytes.NewBuffer(nil) + if in != nil { + err := toJson(buf, in) + if err != nil { + return err + } + } + req, err := http.NewRequest(method, url, buf) + if err != nil { + return err + } + req.Header.Set("Content-Type", "application/json") + resp, err := defaultHttpClient.Do(req) + if err != nil { + return err + } + if resp.StatusCode >= 400 { + data, _ := ioutil.ReadAll(resp.Body) + resp.Body.Close() + return fmt.Errorf("request failed - %s: %s", resp.Status, strings.TrimSpace(string(data))) + } + + if out != nil { + err = fromJson(resp.Body, out) + if err != nil { + return err + } + err = resp.Body.Close() + if err != nil { + return err + } + } + return nil +} + +type BaseApi struct { + endpoint string + client http.Client +} + +// TODO remove hard-coded proxy +func (api *BaseApi) formatUrl(path string) string { + return api.endpoint + "/proxy/workflows-apiserver" + path +} diff --git a/pkg/apiserver/httpclient/invocation.go b/pkg/apiserver/httpclient/invocation.go new file mode 100644 index 00000000..45421b2e --- /dev/null +++ b/pkg/apiserver/httpclient/invocation.go @@ -0,0 +1,56 @@ +package httpclient + +import ( + "context" + "net/http" + + "github.com/fission/fission-workflows/pkg/apiserver" + "github.com/fission/fission-workflows/pkg/types" +) + +type InvocationApi struct { + BaseApi +} + +func NewInvocationApi(endpoint string, client http.Client) *InvocationApi { + return &InvocationApi{ + BaseApi: BaseApi{ + endpoint: endpoint, + client: client, + }, + } +} + +func (api *InvocationApi) Invoke(ctx context.Context, spec *types.WorkflowInvocationSpec) (*apiserver. + WorkflowInvocationIdentifier, error) { + result := &apiserver.WorkflowInvocationIdentifier{} + err := call(http.MethodPost, api.formatUrl("/invocation"), spec, result) + return result, err +} + +func (api *InvocationApi) InvokeSync(ctx context.Context, spec *types.WorkflowInvocationSpec) (*types. + WorkflowInvocation, error) { + result := &types.WorkflowInvocation{} + err := call(http.MethodPost, api.formatUrl("/invocation/sync"), spec, result) + return result, err +} + +func (api *InvocationApi) Cancel(ctx context.Context, id string) error { + return call(http.MethodDelete, api.formatUrl("/invocation/"+id), nil, nil) +} + +func (api *InvocationApi) List(ctx context.Context) (*apiserver.WorkflowInvocationList, error) { + result := &apiserver.WorkflowInvocationList{} + err := call(http.MethodGet, api.formatUrl("/invocation"), nil, result) + return result, err +} + +func (api *InvocationApi) Get(ctx context.Context, id string) (*types.WorkflowInvocation, error) { + result := &types.WorkflowInvocation{} + err := call(http.MethodGet, api.formatUrl("/invocation/"+id), nil, result) + return result, err +} + +func (api *InvocationApi) Validate(ctx context.Context, spec *types.WorkflowInvocationSpec) error { + return call(http.MethodPost, api.formatUrl("/invocation/validate"), spec, nil) +} diff --git a/pkg/apiserver/httpclient/workflow.go b/pkg/apiserver/httpclient/workflow.go new file mode 100644 index 00000000..4096d194 --- /dev/null +++ b/pkg/apiserver/httpclient/workflow.go @@ -0,0 +1,45 @@ +package httpclient + +import ( + "context" + "net/http" + + "github.com/fission/fission-workflows/pkg/apiserver" + "github.com/fission/fission-workflows/pkg/types" +) + +type WorkflowApi struct { + BaseApi +} + +func NewWorkflowApi(endpoint string, client http.Client) *WorkflowApi { + return &WorkflowApi{ + BaseApi: BaseApi{ + endpoint: endpoint, + client: client, + }, + } +} + +func (api *WorkflowApi) Create(ctx context.Context, spec *types.WorkflowSpec) (*apiserver.WorkflowIdentifier, error) { + result := &apiserver.WorkflowIdentifier{} + err := call(http.MethodPost, api.formatUrl("/workflow"), spec, result) + return result, err +} + +func (api *WorkflowApi) List(ctx context.Context) (*apiserver.SearchWorkflowResponse, error) { + result := &apiserver.SearchWorkflowResponse{} + err := call(http.MethodGet, api.formatUrl("/workflow"), nil, result) + return result, err +} + +func (api *WorkflowApi) Get(ctx context.Context, id string) (*types.Workflow, error) { + result := &types.Workflow{} + err := call(http.MethodGet, api.formatUrl("/workflow/"+id), nil, result) + return result, err +} + +func (api *WorkflowApi) Delete(ctx context.Context, id string) error { + err := call(http.MethodDelete, api.formatUrl("/workflow/"+id), nil, nil) + return err +} diff --git a/test/e2e/travis-kube-setup.sh b/test/e2e/travis-kube-setup.sh index 454cf79c..f628a445 100755 --- a/test/e2e/travis-kube-setup.sh +++ b/test/e2e/travis-kube-setup.sh @@ -40,11 +40,9 @@ if ! command -v helm >/dev/null 2>&1 ; then fi # Get Fission binary -if ! command -v fission >/dev/null 2>&1 ; then - curl -sLo fission https://github.com/fission/fission/releases/download/0.4.1/fission-cli-linux - chmod +x fission - mv fission ${BIN_DIR}/fission -fi +curl -sLo fission https://github.com/fission/fission/releases/download/0.4.1/fission-cli-linux +chmod +x fission +mv -f fission ${BIN_DIR}/fission # get gcloud credentials gcloud auth activate-service-account --key-file <(echo ${FISSION_WORKFLOWS_CI_SERVICE_ACCOUNT} | base64 -d)