From 33eec36ff0ef077d1922d9f324c7d838002633ed Mon Sep 17 00:00:00 2001 From: Gerald O Date: Fri, 20 Apr 2018 23:53:46 -0400 Subject: [PATCH 1/2] rebuild --- swagger.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/swagger.yml b/swagger.yml index 7afe1b40..89fa70e7 100644 --- a/swagger.yml +++ b/swagger.yml @@ -1182,6 +1182,37 @@ paths: $ref: "#/definitions/auditLog" default: $ref: "#/responses/error" + + # begin submission + /submissions/{submission_id}: + parameters: + - name: submission_id + type: string + in: path + required: true + get: + operationId: listFormSubmission + parameters: + - name: query + type: string + in: query + responses: + '200': + description: OK + schema: + type: array + items: + $ref: "#/definitions/submission" + default: + $ref: "#/responses/error" + delete: + operationId: deleteSubmission + responses: + '204': + description: Deleted + default: + $ref: "#/responses/error" + # end submission definitions: site: type: object From f235199fc6382bd19eb588064eef73dcba1f7096 Mon Sep 17 00:00:00 2001 From: Gerald O Date: Fri, 20 Apr 2018 23:54:47 -0400 Subject: [PATCH 2/2] fixed previous build failure --- .../delete_submission_parameters.go | 134 ++++++++++++++ .../operations/delete_submission_responses.go | 104 +++++++++++ .../list_form_submission_parameters.go | 163 ++++++++++++++++++ .../list_form_submission_responses.go | 110 ++++++++++++ go/plumbing/operations/operations_client.go | 58 +++++++ ui/swagger.json | 45 +++++ 6 files changed, 614 insertions(+) create mode 100644 go/plumbing/operations/delete_submission_parameters.go create mode 100644 go/plumbing/operations/delete_submission_responses.go create mode 100644 go/plumbing/operations/list_form_submission_parameters.go create mode 100644 go/plumbing/operations/list_form_submission_responses.go diff --git a/go/plumbing/operations/delete_submission_parameters.go b/go/plumbing/operations/delete_submission_parameters.go new file mode 100644 index 00000000..3807d247 --- /dev/null +++ b/go/plumbing/operations/delete_submission_parameters.go @@ -0,0 +1,134 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the 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" +) + +// NewDeleteSubmissionParams creates a new DeleteSubmissionParams object +// with the default values initialized. +func NewDeleteSubmissionParams() *DeleteSubmissionParams { + var () + return &DeleteSubmissionParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteSubmissionParamsWithTimeout creates a new DeleteSubmissionParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteSubmissionParamsWithTimeout(timeout time.Duration) *DeleteSubmissionParams { + var () + return &DeleteSubmissionParams{ + + timeout: timeout, + } +} + +// NewDeleteSubmissionParamsWithContext creates a new DeleteSubmissionParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteSubmissionParamsWithContext(ctx context.Context) *DeleteSubmissionParams { + var () + return &DeleteSubmissionParams{ + + Context: ctx, + } +} + +// NewDeleteSubmissionParamsWithHTTPClient creates a new DeleteSubmissionParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteSubmissionParamsWithHTTPClient(client *http.Client) *DeleteSubmissionParams { + var () + return &DeleteSubmissionParams{ + HTTPClient: client, + } +} + +/*DeleteSubmissionParams contains all the parameters to send to the API endpoint +for the delete submission operation typically these are written to a http.Request +*/ +type DeleteSubmissionParams struct { + + /*SubmissionID*/ + SubmissionID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete submission params +func (o *DeleteSubmissionParams) WithTimeout(timeout time.Duration) *DeleteSubmissionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete submission params +func (o *DeleteSubmissionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete submission params +func (o *DeleteSubmissionParams) WithContext(ctx context.Context) *DeleteSubmissionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete submission params +func (o *DeleteSubmissionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete submission params +func (o *DeleteSubmissionParams) WithHTTPClient(client *http.Client) *DeleteSubmissionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete submission params +func (o *DeleteSubmissionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithSubmissionID adds the submissionID to the delete submission params +func (o *DeleteSubmissionParams) WithSubmissionID(submissionID string) *DeleteSubmissionParams { + o.SetSubmissionID(submissionID) + return o +} + +// SetSubmissionID adds the submissionId to the delete submission params +func (o *DeleteSubmissionParams) SetSubmissionID(submissionID string) { + o.SubmissionID = submissionID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteSubmissionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param submission_id + if err := r.SetPathParam("submission_id", o.SubmissionID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/plumbing/operations/delete_submission_responses.go b/go/plumbing/operations/delete_submission_responses.go new file mode 100644 index 00000000..625732b3 --- /dev/null +++ b/go/plumbing/operations/delete_submission_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/netlify/open-api/go/models" +) + +// DeleteSubmissionReader is a Reader for the DeleteSubmission structure. +type DeleteSubmissionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteSubmissionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDeleteSubmissionNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + result := NewDeleteSubmissionDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewDeleteSubmissionNoContent creates a DeleteSubmissionNoContent with default headers values +func NewDeleteSubmissionNoContent() *DeleteSubmissionNoContent { + return &DeleteSubmissionNoContent{} +} + +/*DeleteSubmissionNoContent handles this case with default header values. + +Deleted +*/ +type DeleteSubmissionNoContent struct { +} + +func (o *DeleteSubmissionNoContent) Error() string { + return fmt.Sprintf("[DELETE /submissions/{submission_id}][%d] deleteSubmissionNoContent ", 204) +} + +func (o *DeleteSubmissionNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteSubmissionDefault creates a DeleteSubmissionDefault with default headers values +func NewDeleteSubmissionDefault(code int) *DeleteSubmissionDefault { + return &DeleteSubmissionDefault{ + _statusCode: code, + } +} + +/*DeleteSubmissionDefault handles this case with default header values. + +error +*/ +type DeleteSubmissionDefault struct { + _statusCode int + + Payload *models.Error +} + +// Code gets the status code for the delete submission default response +func (o *DeleteSubmissionDefault) Code() int { + return o._statusCode +} + +func (o *DeleteSubmissionDefault) Error() string { + return fmt.Sprintf("[DELETE /submissions/{submission_id}][%d] deleteSubmission default %+v", o._statusCode, o.Payload) +} + +func (o *DeleteSubmissionDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/plumbing/operations/list_form_submission_parameters.go b/go/plumbing/operations/list_form_submission_parameters.go new file mode 100644 index 00000000..5c3d0c31 --- /dev/null +++ b/go/plumbing/operations/list_form_submission_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the 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" +) + +// NewListFormSubmissionParams creates a new ListFormSubmissionParams object +// with the default values initialized. +func NewListFormSubmissionParams() *ListFormSubmissionParams { + var () + return &ListFormSubmissionParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewListFormSubmissionParamsWithTimeout creates a new ListFormSubmissionParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewListFormSubmissionParamsWithTimeout(timeout time.Duration) *ListFormSubmissionParams { + var () + return &ListFormSubmissionParams{ + + timeout: timeout, + } +} + +// NewListFormSubmissionParamsWithContext creates a new ListFormSubmissionParams object +// with the default values initialized, and the ability to set a context for a request +func NewListFormSubmissionParamsWithContext(ctx context.Context) *ListFormSubmissionParams { + var () + return &ListFormSubmissionParams{ + + Context: ctx, + } +} + +// NewListFormSubmissionParamsWithHTTPClient creates a new ListFormSubmissionParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewListFormSubmissionParamsWithHTTPClient(client *http.Client) *ListFormSubmissionParams { + var () + return &ListFormSubmissionParams{ + HTTPClient: client, + } +} + +/*ListFormSubmissionParams contains all the parameters to send to the API endpoint +for the list form submission operation typically these are written to a http.Request +*/ +type ListFormSubmissionParams struct { + + /*Query*/ + Query *string + /*SubmissionID*/ + SubmissionID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the list form submission params +func (o *ListFormSubmissionParams) WithTimeout(timeout time.Duration) *ListFormSubmissionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list form submission params +func (o *ListFormSubmissionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list form submission params +func (o *ListFormSubmissionParams) WithContext(ctx context.Context) *ListFormSubmissionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list form submission params +func (o *ListFormSubmissionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list form submission params +func (o *ListFormSubmissionParams) WithHTTPClient(client *http.Client) *ListFormSubmissionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list form submission params +func (o *ListFormSubmissionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithQuery adds the query to the list form submission params +func (o *ListFormSubmissionParams) WithQuery(query *string) *ListFormSubmissionParams { + o.SetQuery(query) + return o +} + +// SetQuery adds the query to the list form submission params +func (o *ListFormSubmissionParams) SetQuery(query *string) { + o.Query = query +} + +// WithSubmissionID adds the submissionID to the list form submission params +func (o *ListFormSubmissionParams) WithSubmissionID(submissionID string) *ListFormSubmissionParams { + o.SetSubmissionID(submissionID) + return o +} + +// SetSubmissionID adds the submissionId to the list form submission params +func (o *ListFormSubmissionParams) SetSubmissionID(submissionID string) { + o.SubmissionID = submissionID +} + +// WriteToRequest writes these params to a swagger request +func (o *ListFormSubmissionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Query != nil { + + // query param query + var qrQuery string + if o.Query != nil { + qrQuery = *o.Query + } + qQuery := qrQuery + if qQuery != "" { + if err := r.SetQueryParam("query", qQuery); err != nil { + return err + } + } + + } + + // path param submission_id + if err := r.SetPathParam("submission_id", o.SubmissionID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/plumbing/operations/list_form_submission_responses.go b/go/plumbing/operations/list_form_submission_responses.go new file mode 100644 index 00000000..3a8a7291 --- /dev/null +++ b/go/plumbing/operations/list_form_submission_responses.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/netlify/open-api/go/models" +) + +// ListFormSubmissionReader is a Reader for the ListFormSubmission structure. +type ListFormSubmissionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListFormSubmissionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewListFormSubmissionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + result := NewListFormSubmissionDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewListFormSubmissionOK creates a ListFormSubmissionOK with default headers values +func NewListFormSubmissionOK() *ListFormSubmissionOK { + return &ListFormSubmissionOK{} +} + +/*ListFormSubmissionOK handles this case with default header values. + +OK +*/ +type ListFormSubmissionOK struct { + Payload []*models.Submission +} + +func (o *ListFormSubmissionOK) Error() string { + return fmt.Sprintf("[GET /submissions/{submission_id}][%d] listFormSubmissionOK %+v", 200, o.Payload) +} + +func (o *ListFormSubmissionOK) 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 +} + +// NewListFormSubmissionDefault creates a ListFormSubmissionDefault with default headers values +func NewListFormSubmissionDefault(code int) *ListFormSubmissionDefault { + return &ListFormSubmissionDefault{ + _statusCode: code, + } +} + +/*ListFormSubmissionDefault handles this case with default header values. + +error +*/ +type ListFormSubmissionDefault struct { + _statusCode int + + Payload *models.Error +} + +// Code gets the status code for the list form submission default response +func (o *ListFormSubmissionDefault) Code() int { + return o._statusCode +} + +func (o *ListFormSubmissionDefault) Error() string { + return fmt.Sprintf("[GET /submissions/{submission_id}][%d] listFormSubmission default %+v", o._statusCode, o.Payload) +} + +func (o *ListFormSubmissionDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/plumbing/operations/operations_client.go b/go/plumbing/operations/operations_client.go index 503cb737..70e30563 100644 --- a/go/plumbing/operations/operations_client.go +++ b/go/plumbing/operations/operations_client.go @@ -546,6 +546,35 @@ func (a *Client) DeleteSiteSnippet(params *DeleteSiteSnippetParams, authInfo run } +/* +DeleteSubmission delete submission API +*/ +func (a *Client) DeleteSubmission(params *DeleteSubmissionParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteSubmissionNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteSubmissionParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "deleteSubmission", + Method: "DELETE", + PathPattern: "/submissions/{submission_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DeleteSubmissionReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DeleteSubmissionNoContent), nil + +} + /* EnableHook enable hook API */ @@ -1097,6 +1126,35 @@ func (a *Client) ListDeployKeys(params *ListDeployKeysParams, authInfo runtime.C } +/* +ListFormSubmission list form submission API +*/ +func (a *Client) ListFormSubmission(params *ListFormSubmissionParams, authInfo runtime.ClientAuthInfoWriter) (*ListFormSubmissionOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListFormSubmissionParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "listFormSubmission", + Method: "GET", + PathPattern: "/submissions/{submission_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ListFormSubmissionReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ListFormSubmissionOK), nil + +} + /* ListFormSubmissions list form submissions API */ diff --git a/ui/swagger.json b/ui/swagger.json index b9c2a8e5..40a5cc52 100644 --- a/ui/swagger.json +++ b/ui/swagger.json @@ -1765,6 +1765,51 @@ } } }, + "/submissions/{submission_id}": { + "get": { + "operationId": "listFormSubmission", + "parameters": [ + { + "type": "string", + "name": "query", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/submission" + } + } + }, + "default": { + "$ref": "#/responses/error" + } + } + }, + "delete": { + "operationId": "deleteSubmission", + "responses": { + "204": { + "description": "Deleted" + }, + "default": { + "$ref": "#/responses/error" + } + } + }, + "parameters": [ + { + "type": "string", + "name": "submission_id", + "in": "path", + "required": true + } + ] + }, "/{account_slug}/members": { "get": { "operationId": "listMembersForAccount",