diff --git a/go/plumbing/operations/mark_dev_server_activity_parameters.go b/go/plumbing/operations/mark_dev_server_activity_parameters.go new file mode 100644 index 00000000..13227544 --- /dev/null +++ b/go/plumbing/operations/mark_dev_server_activity_parameters.go @@ -0,0 +1,151 @@ +// 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 ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewMarkDevServerActivityParams creates a new MarkDevServerActivityParams object +// with the default values initialized. +func NewMarkDevServerActivityParams() *MarkDevServerActivityParams { + var () + return &MarkDevServerActivityParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewMarkDevServerActivityParamsWithTimeout creates a new MarkDevServerActivityParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewMarkDevServerActivityParamsWithTimeout(timeout time.Duration) *MarkDevServerActivityParams { + var () + return &MarkDevServerActivityParams{ + + timeout: timeout, + } +} + +// NewMarkDevServerActivityParamsWithContext creates a new MarkDevServerActivityParams object +// with the default values initialized, and the ability to set a context for a request +func NewMarkDevServerActivityParamsWithContext(ctx context.Context) *MarkDevServerActivityParams { + var () + return &MarkDevServerActivityParams{ + + Context: ctx, + } +} + +// NewMarkDevServerActivityParamsWithHTTPClient creates a new MarkDevServerActivityParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewMarkDevServerActivityParamsWithHTTPClient(client *http.Client) *MarkDevServerActivityParams { + var () + return &MarkDevServerActivityParams{ + HTTPClient: client, + } +} + +/* +MarkDevServerActivityParams contains all the parameters to send to the API endpoint +for the mark dev server activity operation typically these are written to a http.Request +*/ +type MarkDevServerActivityParams struct { + + /*DevServerID*/ + DevServerID string + /*SiteID*/ + SiteID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the mark dev server activity params +func (o *MarkDevServerActivityParams) WithTimeout(timeout time.Duration) *MarkDevServerActivityParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the mark dev server activity params +func (o *MarkDevServerActivityParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the mark dev server activity params +func (o *MarkDevServerActivityParams) WithContext(ctx context.Context) *MarkDevServerActivityParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the mark dev server activity params +func (o *MarkDevServerActivityParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the mark dev server activity params +func (o *MarkDevServerActivityParams) WithHTTPClient(client *http.Client) *MarkDevServerActivityParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the mark dev server activity params +func (o *MarkDevServerActivityParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDevServerID adds the devServerID to the mark dev server activity params +func (o *MarkDevServerActivityParams) WithDevServerID(devServerID string) *MarkDevServerActivityParams { + o.SetDevServerID(devServerID) + return o +} + +// SetDevServerID adds the devServerId to the mark dev server activity params +func (o *MarkDevServerActivityParams) SetDevServerID(devServerID string) { + o.DevServerID = devServerID +} + +// WithSiteID adds the siteID to the mark dev server activity params +func (o *MarkDevServerActivityParams) WithSiteID(siteID string) *MarkDevServerActivityParams { + o.SetSiteID(siteID) + return o +} + +// SetSiteID adds the siteId to the mark dev server activity params +func (o *MarkDevServerActivityParams) SetSiteID(siteID string) { + o.SiteID = siteID +} + +// WriteToRequest writes these params to a swagger request +func (o *MarkDevServerActivityParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param dev_server_id + if err := r.SetPathParam("dev_server_id", o.DevServerID); err != nil { + return err + } + + // path param site_id + if err := r.SetPathParam("site_id", o.SiteID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/plumbing/operations/mark_dev_server_activity_responses.go b/go/plumbing/operations/mark_dev_server_activity_responses.go new file mode 100644 index 00000000..c3db9fe2 --- /dev/null +++ b/go/plumbing/operations/mark_dev_server_activity_responses.go @@ -0,0 +1,55 @@ +// 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" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// MarkDevServerActivityReader is a Reader for the MarkDevServerActivity structure. +type MarkDevServerActivityReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *MarkDevServerActivityReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewMarkDevServerActivityOK() + 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()) + } +} + +// NewMarkDevServerActivityOK creates a MarkDevServerActivityOK with default headers values +func NewMarkDevServerActivityOK() *MarkDevServerActivityOK { + return &MarkDevServerActivityOK{} +} + +/* +MarkDevServerActivityOK handles this case with default header values. + +OK +*/ +type MarkDevServerActivityOK struct { +} + +func (o *MarkDevServerActivityOK) Error() string { + return fmt.Sprintf("[POST /sites/{site_id}/dev_servers/{dev_server_id}/activity][%d] markDevServerActivityOK ", 200) +} + +func (o *MarkDevServerActivityOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/go/plumbing/operations/operations_client.go b/go/plumbing/operations/operations_client.go index 32d747d6..a02e7c00 100644 --- a/go/plumbing/operations/operations_client.go +++ b/go/plumbing/operations/operations_client.go @@ -225,6 +225,8 @@ type ClientService interface { LockDeploy(params *LockDeployParams, authInfo runtime.ClientAuthInfoWriter) (*LockDeployOK, error) + MarkDevServerActivity(params *MarkDevServerActivityParams, authInfo runtime.ClientAuthInfoWriter) (*MarkDevServerActivityOK, error) + NotifyBuildStart(params *NotifyBuildStartParams, authInfo runtime.ClientAuthInfoWriter) (*NotifyBuildStartNoContent, error) ProvisionSiteTLSCertificate(params *ProvisionSiteTLSCertificateParams, authInfo runtime.ClientAuthInfoWriter) (*ProvisionSiteTLSCertificateOK, error) @@ -3662,6 +3664,41 @@ func (a *Client) LockDeploy(params *LockDeployParams, authInfo runtime.ClientAut return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +MarkDevServerActivity mark dev server activity API +*/ +func (a *Client) MarkDevServerActivity(params *MarkDevServerActivityParams, authInfo runtime.ClientAuthInfoWriter) (*MarkDevServerActivityOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewMarkDevServerActivityParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "markDevServerActivity", + Method: "POST", + PathPattern: "/sites/{site_id}/dev_servers/{dev_server_id}/activity", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &MarkDevServerActivityReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*MarkDevServerActivityOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for markDevServerActivity: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* NotifyBuildStart notify build start API */ diff --git a/swagger.yml b/swagger.yml index b30cfae0..81469dfa 100644 --- a/swagger.yml +++ b/swagger.yml @@ -2607,6 +2607,25 @@ paths: schema: $ref: '#/definitions/devServer' # end sites/{site_id}/dev_servers/{dev_server_id} + # begin sites/{site_id}/dev_servers/{dev_server_id}/activity + /sites/{site_id}/dev_servers/{dev_server_id}/activity: + parameters: + - name: site_id + type: string + in: path + required: true + - name: dev_server_id + type: string + in: path + required: true + post: + x-internal: true + operationId: markDevServerActivity + tags: [devServer] + responses: + '200': + description: OK + # end sites/{site_id}/dev_servers/{dev_server_id}/activity /sites/{site_id}/dev_server_hooks: parameters: - name: site_id