diff --git a/go/plumbing/operations/create_deploy_key_responses.go b/go/plumbing/operations/create_deploy_key_responses.go index 684a681a..536e9edf 100644 --- a/go/plumbing/operations/create_deploy_key_responses.go +++ b/go/plumbing/operations/create_deploy_key_responses.go @@ -25,8 +25,8 @@ type CreateDeployKeyReader struct { func (o *CreateDeployKeyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: - result := NewCreateDeployKeyOK() + case 201: + result := NewCreateDeployKeyCreated() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } @@ -44,24 +44,24 @@ func (o *CreateDeployKeyReader) ReadResponse(response runtime.ClientResponse, co } } -// NewCreateDeployKeyOK creates a CreateDeployKeyOK with default headers values -func NewCreateDeployKeyOK() *CreateDeployKeyOK { - return &CreateDeployKeyOK{} +// NewCreateDeployKeyCreated creates a CreateDeployKeyCreated with default headers values +func NewCreateDeployKeyCreated() *CreateDeployKeyCreated { + return &CreateDeployKeyCreated{} } -/*CreateDeployKeyOK handles this case with default header values. +/*CreateDeployKeyCreated handles this case with default header values. -OK +Created */ -type CreateDeployKeyOK struct { +type CreateDeployKeyCreated struct { Payload *models.DeployKey } -func (o *CreateDeployKeyOK) Error() string { - return fmt.Sprintf("[POST /deploy_keys][%d] createDeployKeyOK %+v", 200, o.Payload) +func (o *CreateDeployKeyCreated) Error() string { + return fmt.Sprintf("[POST /deploy_keys][%d] createDeployKeyCreated %+v", 201, o.Payload) } -func (o *CreateDeployKeyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *CreateDeployKeyCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(models.DeployKey) diff --git a/go/plumbing/operations/delete_deploy_key_parameters.go b/go/plumbing/operations/delete_deploy_key_parameters.go new file mode 100644 index 00000000..9041d5b7 --- /dev/null +++ b/go/plumbing/operations/delete_deploy_key_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" +) + +// NewDeleteDeployKeyParams creates a new DeleteDeployKeyParams object +// with the default values initialized. +func NewDeleteDeployKeyParams() *DeleteDeployKeyParams { + var () + return &DeleteDeployKeyParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteDeployKeyParamsWithTimeout creates a new DeleteDeployKeyParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteDeployKeyParamsWithTimeout(timeout time.Duration) *DeleteDeployKeyParams { + var () + return &DeleteDeployKeyParams{ + + timeout: timeout, + } +} + +// NewDeleteDeployKeyParamsWithContext creates a new DeleteDeployKeyParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteDeployKeyParamsWithContext(ctx context.Context) *DeleteDeployKeyParams { + var () + return &DeleteDeployKeyParams{ + + Context: ctx, + } +} + +// NewDeleteDeployKeyParamsWithHTTPClient creates a new DeleteDeployKeyParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteDeployKeyParamsWithHTTPClient(client *http.Client) *DeleteDeployKeyParams { + var () + return &DeleteDeployKeyParams{ + HTTPClient: client, + } +} + +/*DeleteDeployKeyParams contains all the parameters to send to the API endpoint +for the delete deploy key operation typically these are written to a http.Request +*/ +type DeleteDeployKeyParams struct { + + /*KeyID*/ + KeyID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete deploy key params +func (o *DeleteDeployKeyParams) WithTimeout(timeout time.Duration) *DeleteDeployKeyParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete deploy key params +func (o *DeleteDeployKeyParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete deploy key params +func (o *DeleteDeployKeyParams) WithContext(ctx context.Context) *DeleteDeployKeyParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete deploy key params +func (o *DeleteDeployKeyParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete deploy key params +func (o *DeleteDeployKeyParams) WithHTTPClient(client *http.Client) *DeleteDeployKeyParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete deploy key params +func (o *DeleteDeployKeyParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithKeyID adds the keyID to the delete deploy key params +func (o *DeleteDeployKeyParams) WithKeyID(keyID string) *DeleteDeployKeyParams { + o.SetKeyID(keyID) + return o +} + +// SetKeyID adds the keyId to the delete deploy key params +func (o *DeleteDeployKeyParams) SetKeyID(keyID string) { + o.KeyID = keyID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteDeployKeyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param key_id + if err := r.SetPathParam("key_id", o.KeyID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/plumbing/operations/delete_deploy_key_responses.go b/go/plumbing/operations/delete_deploy_key_responses.go new file mode 100644 index 00000000..5655b9f0 --- /dev/null +++ b/go/plumbing/operations/delete_deploy_key_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" +) + +// DeleteDeployKeyReader is a Reader for the DeleteDeployKey structure. +type DeleteDeployKeyReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteDeployKeyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDeleteDeployKeyNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + result := NewDeleteDeployKeyDefault(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 + } +} + +// NewDeleteDeployKeyNoContent creates a DeleteDeployKeyNoContent with default headers values +func NewDeleteDeployKeyNoContent() *DeleteDeployKeyNoContent { + return &DeleteDeployKeyNoContent{} +} + +/*DeleteDeployKeyNoContent handles this case with default header values. + +Not Content +*/ +type DeleteDeployKeyNoContent struct { +} + +func (o *DeleteDeployKeyNoContent) Error() string { + return fmt.Sprintf("[DELETE /deploy_keys/{key_id}][%d] deleteDeployKeyNoContent ", 204) +} + +func (o *DeleteDeployKeyNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteDeployKeyDefault creates a DeleteDeployKeyDefault with default headers values +func NewDeleteDeployKeyDefault(code int) *DeleteDeployKeyDefault { + return &DeleteDeployKeyDefault{ + _statusCode: code, + } +} + +/*DeleteDeployKeyDefault handles this case with default header values. + +error +*/ +type DeleteDeployKeyDefault struct { + _statusCode int + + Payload *models.Error +} + +// Code gets the status code for the delete deploy key default response +func (o *DeleteDeployKeyDefault) Code() int { + return o._statusCode +} + +func (o *DeleteDeployKeyDefault) Error() string { + return fmt.Sprintf("[DELETE /deploy_keys/{key_id}][%d] deleteDeployKey default %+v", o._statusCode, o.Payload) +} + +func (o *DeleteDeployKeyDefault) 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/get_deploy_key_parameters.go b/go/plumbing/operations/get_deploy_key_parameters.go new file mode 100644 index 00000000..3bfbcac7 --- /dev/null +++ b/go/plumbing/operations/get_deploy_key_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" +) + +// NewGetDeployKeyParams creates a new GetDeployKeyParams object +// with the default values initialized. +func NewGetDeployKeyParams() *GetDeployKeyParams { + var () + return &GetDeployKeyParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetDeployKeyParamsWithTimeout creates a new GetDeployKeyParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetDeployKeyParamsWithTimeout(timeout time.Duration) *GetDeployKeyParams { + var () + return &GetDeployKeyParams{ + + timeout: timeout, + } +} + +// NewGetDeployKeyParamsWithContext creates a new GetDeployKeyParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetDeployKeyParamsWithContext(ctx context.Context) *GetDeployKeyParams { + var () + return &GetDeployKeyParams{ + + Context: ctx, + } +} + +// NewGetDeployKeyParamsWithHTTPClient creates a new GetDeployKeyParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetDeployKeyParamsWithHTTPClient(client *http.Client) *GetDeployKeyParams { + var () + return &GetDeployKeyParams{ + HTTPClient: client, + } +} + +/*GetDeployKeyParams contains all the parameters to send to the API endpoint +for the get deploy key operation typically these are written to a http.Request +*/ +type GetDeployKeyParams struct { + + /*KeyID*/ + KeyID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get deploy key params +func (o *GetDeployKeyParams) WithTimeout(timeout time.Duration) *GetDeployKeyParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get deploy key params +func (o *GetDeployKeyParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get deploy key params +func (o *GetDeployKeyParams) WithContext(ctx context.Context) *GetDeployKeyParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get deploy key params +func (o *GetDeployKeyParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get deploy key params +func (o *GetDeployKeyParams) WithHTTPClient(client *http.Client) *GetDeployKeyParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get deploy key params +func (o *GetDeployKeyParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithKeyID adds the keyID to the get deploy key params +func (o *GetDeployKeyParams) WithKeyID(keyID string) *GetDeployKeyParams { + o.SetKeyID(keyID) + return o +} + +// SetKeyID adds the keyId to the get deploy key params +func (o *GetDeployKeyParams) SetKeyID(keyID string) { + o.KeyID = keyID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetDeployKeyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param key_id + if err := r.SetPathParam("key_id", o.KeyID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/plumbing/operations/get_deploy_key_responses.go b/go/plumbing/operations/get_deploy_key_responses.go new file mode 100644 index 00000000..638374f2 --- /dev/null +++ b/go/plumbing/operations/get_deploy_key_responses.go @@ -0,0 +1,112 @@ +// 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" +) + +// GetDeployKeyReader is a Reader for the GetDeployKey structure. +type GetDeployKeyReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetDeployKeyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewGetDeployKeyOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + result := NewGetDeployKeyDefault(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 + } +} + +// NewGetDeployKeyOK creates a GetDeployKeyOK with default headers values +func NewGetDeployKeyOK() *GetDeployKeyOK { + return &GetDeployKeyOK{} +} + +/*GetDeployKeyOK handles this case with default header values. + +OK +*/ +type GetDeployKeyOK struct { + Payload *models.DeployKey +} + +func (o *GetDeployKeyOK) Error() string { + return fmt.Sprintf("[GET /deploy_keys/{key_id}][%d] getDeployKeyOK %+v", 200, o.Payload) +} + +func (o *GetDeployKeyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DeployKey) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDeployKeyDefault creates a GetDeployKeyDefault with default headers values +func NewGetDeployKeyDefault(code int) *GetDeployKeyDefault { + return &GetDeployKeyDefault{ + _statusCode: code, + } +} + +/*GetDeployKeyDefault handles this case with default header values. + +error +*/ +type GetDeployKeyDefault struct { + _statusCode int + + Payload *models.Error +} + +// Code gets the status code for the get deploy key default response +func (o *GetDeployKeyDefault) Code() int { + return o._statusCode +} + +func (o *GetDeployKeyDefault) Error() string { + return fmt.Sprintf("[GET /deploy_keys/{key_id}][%d] getDeployKey default %+v", o._statusCode, o.Payload) +} + +func (o *GetDeployKeyDefault) 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_deploy_keys_parameters.go b/go/plumbing/operations/list_deploy_keys_parameters.go new file mode 100644 index 00000000..9f42b7d7 --- /dev/null +++ b/go/plumbing/operations/list_deploy_keys_parameters.go @@ -0,0 +1,114 @@ +// 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" +) + +// NewListDeployKeysParams creates a new ListDeployKeysParams object +// with the default values initialized. +func NewListDeployKeysParams() *ListDeployKeysParams { + + return &ListDeployKeysParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewListDeployKeysParamsWithTimeout creates a new ListDeployKeysParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewListDeployKeysParamsWithTimeout(timeout time.Duration) *ListDeployKeysParams { + + return &ListDeployKeysParams{ + + timeout: timeout, + } +} + +// NewListDeployKeysParamsWithContext creates a new ListDeployKeysParams object +// with the default values initialized, and the ability to set a context for a request +func NewListDeployKeysParamsWithContext(ctx context.Context) *ListDeployKeysParams { + + return &ListDeployKeysParams{ + + Context: ctx, + } +} + +// NewListDeployKeysParamsWithHTTPClient creates a new ListDeployKeysParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewListDeployKeysParamsWithHTTPClient(client *http.Client) *ListDeployKeysParams { + + return &ListDeployKeysParams{ + HTTPClient: client, + } +} + +/*ListDeployKeysParams contains all the parameters to send to the API endpoint +for the list deploy keys operation typically these are written to a http.Request +*/ +type ListDeployKeysParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the list deploy keys params +func (o *ListDeployKeysParams) WithTimeout(timeout time.Duration) *ListDeployKeysParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list deploy keys params +func (o *ListDeployKeysParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list deploy keys params +func (o *ListDeployKeysParams) WithContext(ctx context.Context) *ListDeployKeysParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list deploy keys params +func (o *ListDeployKeysParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list deploy keys params +func (o *ListDeployKeysParams) WithHTTPClient(client *http.Client) *ListDeployKeysParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list deploy keys params +func (o *ListDeployKeysParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ListDeployKeysParams) 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/go/plumbing/operations/list_deploy_keys_responses.go b/go/plumbing/operations/list_deploy_keys_responses.go new file mode 100644 index 00000000..3bcf16b8 --- /dev/null +++ b/go/plumbing/operations/list_deploy_keys_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" +) + +// ListDeployKeysReader is a Reader for the ListDeployKeys structure. +type ListDeployKeysReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListDeployKeysReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewListDeployKeysOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + result := NewListDeployKeysDefault(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 + } +} + +// NewListDeployKeysOK creates a ListDeployKeysOK with default headers values +func NewListDeployKeysOK() *ListDeployKeysOK { + return &ListDeployKeysOK{} +} + +/*ListDeployKeysOK handles this case with default header values. + +OK +*/ +type ListDeployKeysOK struct { + Payload []*models.DeployKey +} + +func (o *ListDeployKeysOK) Error() string { + return fmt.Sprintf("[GET /deploy_keys][%d] listDeployKeysOK %+v", 200, o.Payload) +} + +func (o *ListDeployKeysOK) 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 +} + +// NewListDeployKeysDefault creates a ListDeployKeysDefault with default headers values +func NewListDeployKeysDefault(code int) *ListDeployKeysDefault { + return &ListDeployKeysDefault{ + _statusCode: code, + } +} + +/*ListDeployKeysDefault handles this case with default header values. + +error +*/ +type ListDeployKeysDefault struct { + _statusCode int + + Payload *models.Error +} + +// Code gets the status code for the list deploy keys default response +func (o *ListDeployKeysDefault) Code() int { + return o._statusCode +} + +func (o *ListDeployKeysDefault) Error() string { + return fmt.Sprintf("[GET /deploy_keys][%d] listDeployKeys default %+v", o._statusCode, o.Payload) +} + +func (o *ListDeployKeysDefault) 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 d588c0ef..29d513c1 100644 --- a/go/plumbing/operations/operations_client.go +++ b/go/plumbing/operations/operations_client.go @@ -143,7 +143,7 @@ func (a *Client) CreateAccount(params *CreateAccountParams, authInfo runtime.Cli /* CreateDeployKey create deploy key API */ -func (a *Client) CreateDeployKey(params *CreateDeployKeyParams, authInfo runtime.ClientAuthInfoWriter) (*CreateDeployKeyOK, error) { +func (a *Client) CreateDeployKey(params *CreateDeployKeyParams, authInfo runtime.ClientAuthInfoWriter) (*CreateDeployKeyCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateDeployKeyParams() @@ -165,7 +165,7 @@ func (a *Client) CreateDeployKey(params *CreateDeployKeyParams, authInfo runtime if err != nil { return nil, err } - return result.(*CreateDeployKeyOK), nil + return result.(*CreateDeployKeyCreated), nil } @@ -343,6 +343,35 @@ func (a *Client) CreateTicket(params *CreateTicketParams, authInfo runtime.Clien } +/* +DeleteDeployKey delete deploy key API +*/ +func (a *Client) DeleteDeployKey(params *DeleteDeployKeyParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteDeployKeyNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteDeployKeyParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "deleteDeployKey", + Method: "DELETE", + PathPattern: "/deploy_keys/{key_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DeleteDeployKeyReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DeleteDeployKeyNoContent), nil + +} + /* DeleteHookBySiteID delete hook by site Id API */ @@ -546,6 +575,35 @@ func (a *Client) GetDeploy(params *GetDeployParams, authInfo runtime.ClientAuthI } +/* +GetDeployKey get deploy key API +*/ +func (a *Client) GetDeployKey(params *GetDeployKeyParams, authInfo runtime.ClientAuthInfoWriter) (*GetDeployKeyOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetDeployKeyParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getDeployKey", + Method: "GET", + PathPattern: "/deploy_keys/{key_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetDeployKeyReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*GetDeployKeyOK), nil + +} + /* GetSite get site API */ @@ -865,6 +923,35 @@ func (a *Client) ListAccountsForUser(params *ListAccountsForUserParams, authInfo } +/* +ListDeployKeys list deploy keys API +*/ +func (a *Client) ListDeployKeys(params *ListDeployKeysParams, authInfo runtime.ClientAuthInfoWriter) (*ListDeployKeysOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListDeployKeysParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "listDeployKeys", + Method: "GET", + PathPattern: "/deploy_keys", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ListDeployKeysReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ListDeployKeysOK), nil + +} + /* ListFormSubmissions list form submissions API */ diff --git a/swagger.yml b/swagger.yml index 302cef56..08e5bc07 100644 --- a/swagger.yml +++ b/swagger.yml @@ -963,10 +963,40 @@ paths: schema: $ref: "#/definitions/error" /deploy_keys: + get: + operationId: listDeployKeys + responses: + '200': + description: OK + schema: + type: array + items: + $ref: "#/definitions/deployKey" + default: + description: error + schema: + $ref: "#/definitions/error" post: operationId: createDeployKey consumes: - application/json + responses: + '201': + description: Created + schema: + $ref: "#/definitions/deployKey" + default: + description: error + schema: + $ref: "#/definitions/error" + /deploy_keys/{key_id}: + parameters: + - name: key_id + type: string + in: path + required: true + get: + operationId: getDeployKey responses: '200': description: OK @@ -976,6 +1006,15 @@ paths: description: error schema: $ref: "#/definitions/error" + delete: + operationId: deleteDeployKey + responses: + '204': + description: Not Content + default: + description: error + schema: + $ref: "#/definitions/error" /{account_slug}/sites: get: operationId: listSitesForAccount # an account represents a team or a user diff --git a/ui/swagger.json b/ui/swagger.json index 64542c7f..8f87cb17 100644 --- a/ui/swagger.json +++ b/ui/swagger.json @@ -261,11 +261,50 @@ ] }, "/deploy_keys": { + "get": { + "operationId": "listDeployKeys", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/deployKey" + } + } + }, + "default": { + "description": "error", + "schema": { + "$ref": "#/definitions/error" + } + } + } + }, "post": { "consumes": [ "application/json" ], "operationId": "createDeployKey", + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/deployKey" + } + }, + "default": { + "description": "error", + "schema": { + "$ref": "#/definitions/error" + } + } + } + } + }, + "/deploy_keys/{key_id}": { + "get": { + "operationId": "getDeployKey", "responses": { "200": { "description": "OK", @@ -280,7 +319,29 @@ } } } - } + }, + "delete": { + "operationId": "deleteDeployKey", + "responses": { + "204": { + "description": "Not Content" + }, + "default": { + "description": "error", + "schema": { + "$ref": "#/definitions/error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "name": "key_id", + "in": "path", + "required": true + } + ] }, "/deploys/{deploy_id}": { "get": {