diff --git a/go/models/agent_runner.go b/go/models/agent_runner.go new file mode 100644 index 00000000..55f33158 --- /dev/null +++ b/go/models/agent_runner.go @@ -0,0 +1,152 @@ +// 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 ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AgentRunner agent runner +// +// swagger:model agentRunner +type AgentRunner struct { + + // active session created at + ActiveSessionCreatedAt string `json:"active_session_created_at,omitempty"` + + // attached file keys + AttachedFileKeys []string `json:"attached_file_keys"` + + // base deploy id + BaseDeployID string `json:"base_deploy_id,omitempty"` + + // branch + Branch string `json:"branch,omitempty"` + + // created at + CreatedAt string `json:"created_at,omitempty"` + + // current task + CurrentTask string `json:"current_task,omitempty"` + + // done at + DoneAt string `json:"done_at,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // latest session deploy id + LatestSessionDeployID string `json:"latest_session_deploy_id,omitempty"` + + // latest session deploy url + LatestSessionDeployURL string `json:"latest_session_deploy_url,omitempty"` + + // merge commit error + MergeCommitError string `json:"merge_commit_error,omitempty"` + + // merge commit is being created + MergeCommitIsBeingCreated bool `json:"merge_commit_is_being_created,omitempty"` + + // merge commit sha + MergeCommitSha string `json:"merge_commit_sha,omitempty"` + + // parent agent runner id + ParentAgentRunnerID string `json:"parent_agent_runner_id,omitempty"` + + // pr branch + PrBranch string `json:"pr_branch,omitempty"` + + // pr error + PrError string `json:"pr_error,omitempty"` + + // pr is being created + PrIsBeingCreated bool `json:"pr_is_being_created,omitempty"` + + // pr number + PrNumber int64 `json:"pr_number,omitempty"` + + // pr state + PrState string `json:"pr_state,omitempty"` + + // pr url + PrURL string `json:"pr_url,omitempty"` + + // result branch + ResultBranch string `json:"result_branch,omitempty"` + + // result diff + ResultDiff string `json:"result_diff,omitempty"` + + // sha + Sha string `json:"sha,omitempty"` + + // site id + SiteID string `json:"site_id,omitempty"` + + // state + State string `json:"state,omitempty"` + + // title + Title string `json:"title,omitempty"` + + // updated at + UpdatedAt string `json:"updated_at,omitempty"` + + // user + User *AgentRunnerUser `json:"user,omitempty"` +} + +// Validate validates this agent runner +func (m *AgentRunner) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateUser(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AgentRunner) validateUser(formats strfmt.Registry) error { + + if swag.IsZero(m.User) { // not required + return nil + } + + if m.User != nil { + if err := m.User.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("user") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *AgentRunner) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AgentRunner) UnmarshalBinary(b []byte) error { + var res AgentRunner + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/models/agent_runner_session.go b/go/models/agent_runner_session.go new file mode 100644 index 00000000..5295f98c --- /dev/null +++ b/go/models/agent_runner_session.go @@ -0,0 +1,184 @@ +// 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 ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AgentRunnerSession agent runner session +// +// swagger:model agentRunnerSession +type AgentRunnerSession struct { + + // agent config + AgentConfig *AgentRunnerSessionConfig `json:"agent_config,omitempty"` + + // agent runner id + AgentRunnerID string `json:"agent_runner_id,omitempty"` + + // attached file keys + AttachedFileKeys []string `json:"attached_file_keys"` + + // commit sha + CommitSha string `json:"commit_sha,omitempty"` + + // created at + CreatedAt string `json:"created_at,omitempty"` + + // deploy id + DeployID string `json:"deploy_id,omitempty"` + + // deploy url + DeployURL string `json:"deploy_url,omitempty"` + + // dev server id + DevServerID string `json:"dev_server_id,omitempty"` + + // done at + DoneAt string `json:"done_at,omitempty"` + + // duration + Duration int64 `json:"duration,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // is published + IsPublished bool `json:"is_published,omitempty"` + + // prompt + Prompt string `json:"prompt,omitempty"` + + // result + Result string `json:"result,omitempty"` + + // result diff + ResultDiff string `json:"result_diff,omitempty"` + + // result zip file name + ResultZipFileName string `json:"result_zip_file_name,omitempty"` + + // state + State string `json:"state,omitempty"` + + // steps + Steps []*AgentRunnerSessionStep `json:"steps"` + + // title + Title string `json:"title,omitempty"` + + // updated at + UpdatedAt string `json:"updated_at,omitempty"` + + // user + User *AgentRunnerUser `json:"user,omitempty"` +} + +// Validate validates this agent runner session +func (m *AgentRunnerSession) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAgentConfig(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSteps(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUser(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AgentRunnerSession) validateAgentConfig(formats strfmt.Registry) error { + + if swag.IsZero(m.AgentConfig) { // not required + return nil + } + + if m.AgentConfig != nil { + if err := m.AgentConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("agent_config") + } + return err + } + } + + return nil +} + +func (m *AgentRunnerSession) validateSteps(formats strfmt.Registry) error { + + if swag.IsZero(m.Steps) { // not required + return nil + } + + for i := 0; i < len(m.Steps); i++ { + if swag.IsZero(m.Steps[i]) { // not required + continue + } + + if m.Steps[i] != nil { + if err := m.Steps[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("steps" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *AgentRunnerSession) validateUser(formats strfmt.Registry) error { + + if swag.IsZero(m.User) { // not required + return nil + } + + if m.User != nil { + if err := m.User.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("user") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *AgentRunnerSession) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AgentRunnerSession) UnmarshalBinary(b []byte) error { + var res AgentRunnerSession + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/models/agent_runner_session_config.go b/go/models/agent_runner_session_config.go new file mode 100644 index 00000000..da5dafd7 --- /dev/null +++ b/go/models/agent_runner_session_config.go @@ -0,0 +1,46 @@ +// 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 ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AgentRunnerSessionConfig agent runner session config +// +// swagger:model agentRunnerSessionConfig +type AgentRunnerSessionConfig struct { + + // agent + Agent string `json:"agent,omitempty"` + + // model + Model string `json:"model,omitempty"` +} + +// Validate validates this agent runner session config +func (m *AgentRunnerSessionConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *AgentRunnerSessionConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AgentRunnerSessionConfig) UnmarshalBinary(b []byte) error { + var res AgentRunnerSessionConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/models/agent_runner_session_step.go b/go/models/agent_runner_session_step.go new file mode 100644 index 00000000..ba53938e --- /dev/null +++ b/go/models/agent_runner_session_step.go @@ -0,0 +1,46 @@ +// 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 ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AgentRunnerSessionStep agent runner session step +// +// swagger:model agentRunnerSessionStep +type AgentRunnerSessionStep struct { + + // message + Message string `json:"message,omitempty"` + + // title + Title string `json:"title,omitempty"` +} + +// Validate validates this agent runner session step +func (m *AgentRunnerSessionStep) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *AgentRunnerSessionStep) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AgentRunnerSessionStep) UnmarshalBinary(b []byte) error { + var res AgentRunnerSessionStep + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/models/agent_runner_user.go b/go/models/agent_runner_user.go new file mode 100644 index 00000000..345895f0 --- /dev/null +++ b/go/models/agent_runner_user.go @@ -0,0 +1,52 @@ +// 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 ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AgentRunnerUser agent runner user +// +// swagger:model agentRunnerUser +type AgentRunnerUser struct { + + // avatar url + AvatarURL string `json:"avatar_url,omitempty"` + + // email + Email string `json:"email,omitempty"` + + // full name + FullName string `json:"full_name,omitempty"` + + // id + ID string `json:"id,omitempty"` +} + +// Validate validates this agent runner user +func (m *AgentRunnerUser) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *AgentRunnerUser) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AgentRunnerUser) UnmarshalBinary(b []byte) error { + var res AgentRunnerUser + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/plumbing/operations/agent_runner_commit_to_branch_parameters.go b/go/plumbing/operations/agent_runner_commit_to_branch_parameters.go new file mode 100644 index 00000000..3649f2ed --- /dev/null +++ b/go/plumbing/operations/agent_runner_commit_to_branch_parameters.go @@ -0,0 +1,155 @@ +// 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" +) + +// NewAgentRunnerCommitToBranchParams creates a new AgentRunnerCommitToBranchParams object +// with the default values initialized. +func NewAgentRunnerCommitToBranchParams() *AgentRunnerCommitToBranchParams { + var () + return &AgentRunnerCommitToBranchParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewAgentRunnerCommitToBranchParamsWithTimeout creates a new AgentRunnerCommitToBranchParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewAgentRunnerCommitToBranchParamsWithTimeout(timeout time.Duration) *AgentRunnerCommitToBranchParams { + var () + return &AgentRunnerCommitToBranchParams{ + + timeout: timeout, + } +} + +// NewAgentRunnerCommitToBranchParamsWithContext creates a new AgentRunnerCommitToBranchParams object +// with the default values initialized, and the ability to set a context for a request +func NewAgentRunnerCommitToBranchParamsWithContext(ctx context.Context) *AgentRunnerCommitToBranchParams { + var () + return &AgentRunnerCommitToBranchParams{ + + Context: ctx, + } +} + +// NewAgentRunnerCommitToBranchParamsWithHTTPClient creates a new AgentRunnerCommitToBranchParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewAgentRunnerCommitToBranchParamsWithHTTPClient(client *http.Client) *AgentRunnerCommitToBranchParams { + var () + return &AgentRunnerCommitToBranchParams{ + HTTPClient: client, + } +} + +/* +AgentRunnerCommitToBranchParams contains all the parameters to send to the API endpoint +for the agent runner commit to branch operation typically these are written to a http.Request +*/ +type AgentRunnerCommitToBranchParams struct { + + /*AgentRunnerID*/ + AgentRunnerID string + /*TargetBranch*/ + TargetBranch string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the agent runner commit to branch params +func (o *AgentRunnerCommitToBranchParams) WithTimeout(timeout time.Duration) *AgentRunnerCommitToBranchParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the agent runner commit to branch params +func (o *AgentRunnerCommitToBranchParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the agent runner commit to branch params +func (o *AgentRunnerCommitToBranchParams) WithContext(ctx context.Context) *AgentRunnerCommitToBranchParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the agent runner commit to branch params +func (o *AgentRunnerCommitToBranchParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the agent runner commit to branch params +func (o *AgentRunnerCommitToBranchParams) WithHTTPClient(client *http.Client) *AgentRunnerCommitToBranchParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the agent runner commit to branch params +func (o *AgentRunnerCommitToBranchParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAgentRunnerID adds the agentRunnerID to the agent runner commit to branch params +func (o *AgentRunnerCommitToBranchParams) WithAgentRunnerID(agentRunnerID string) *AgentRunnerCommitToBranchParams { + o.SetAgentRunnerID(agentRunnerID) + return o +} + +// SetAgentRunnerID adds the agentRunnerId to the agent runner commit to branch params +func (o *AgentRunnerCommitToBranchParams) SetAgentRunnerID(agentRunnerID string) { + o.AgentRunnerID = agentRunnerID +} + +// WithTargetBranch adds the targetBranch to the agent runner commit to branch params +func (o *AgentRunnerCommitToBranchParams) WithTargetBranch(targetBranch string) *AgentRunnerCommitToBranchParams { + o.SetTargetBranch(targetBranch) + return o +} + +// SetTargetBranch adds the targetBranch to the agent runner commit to branch params +func (o *AgentRunnerCommitToBranchParams) SetTargetBranch(targetBranch string) { + o.TargetBranch = targetBranch +} + +// WriteToRequest writes these params to a swagger request +func (o *AgentRunnerCommitToBranchParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param agent_runner_id + if err := r.SetPathParam("agent_runner_id", o.AgentRunnerID); err != nil { + return err + } + + // query param target_branch + qrTargetBranch := o.TargetBranch + qTargetBranch := qrTargetBranch + if qTargetBranch != "" { + if err := r.SetQueryParam("target_branch", qTargetBranch); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/plumbing/operations/agent_runner_commit_to_branch_responses.go b/go/plumbing/operations/agent_runner_commit_to_branch_responses.go new file mode 100644 index 00000000..764c2973 --- /dev/null +++ b/go/plumbing/operations/agent_runner_commit_to_branch_responses.go @@ -0,0 +1,191 @@ +// 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" + "github.com/go-openapi/strfmt" + + "github.com/netlify/open-api/v2/go/models" +) + +// AgentRunnerCommitToBranchReader is a Reader for the AgentRunnerCommitToBranch structure. +type AgentRunnerCommitToBranchReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *AgentRunnerCommitToBranchReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewAgentRunnerCommitToBranchOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewAgentRunnerCommitToBranchBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewAgentRunnerCommitToBranchConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewAgentRunnerCommitToBranchUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + result := NewAgentRunnerCommitToBranchDefault(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 + } +} + +// NewAgentRunnerCommitToBranchOK creates a AgentRunnerCommitToBranchOK with default headers values +func NewAgentRunnerCommitToBranchOK() *AgentRunnerCommitToBranchOK { + return &AgentRunnerCommitToBranchOK{} +} + +/* +AgentRunnerCommitToBranchOK handles this case with default header values. + +OK +*/ +type AgentRunnerCommitToBranchOK struct { +} + +func (o *AgentRunnerCommitToBranchOK) Error() string { + return fmt.Sprintf("[POST /agent_runners/{agent_runner_id}/commit][%d] agentRunnerCommitToBranchOK ", 200) +} + +func (o *AgentRunnerCommitToBranchOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewAgentRunnerCommitToBranchBadRequest creates a AgentRunnerCommitToBranchBadRequest with default headers values +func NewAgentRunnerCommitToBranchBadRequest() *AgentRunnerCommitToBranchBadRequest { + return &AgentRunnerCommitToBranchBadRequest{} +} + +/* +AgentRunnerCommitToBranchBadRequest handles this case with default header values. + +Bad Request +*/ +type AgentRunnerCommitToBranchBadRequest struct { +} + +func (o *AgentRunnerCommitToBranchBadRequest) Error() string { + return fmt.Sprintf("[POST /agent_runners/{agent_runner_id}/commit][%d] agentRunnerCommitToBranchBadRequest ", 400) +} + +func (o *AgentRunnerCommitToBranchBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewAgentRunnerCommitToBranchConflict creates a AgentRunnerCommitToBranchConflict with default headers values +func NewAgentRunnerCommitToBranchConflict() *AgentRunnerCommitToBranchConflict { + return &AgentRunnerCommitToBranchConflict{} +} + +/* +AgentRunnerCommitToBranchConflict handles this case with default header values. + +Conflict +*/ +type AgentRunnerCommitToBranchConflict struct { +} + +func (o *AgentRunnerCommitToBranchConflict) Error() string { + return fmt.Sprintf("[POST /agent_runners/{agent_runner_id}/commit][%d] agentRunnerCommitToBranchConflict ", 409) +} + +func (o *AgentRunnerCommitToBranchConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewAgentRunnerCommitToBranchUnprocessableEntity creates a AgentRunnerCommitToBranchUnprocessableEntity with default headers values +func NewAgentRunnerCommitToBranchUnprocessableEntity() *AgentRunnerCommitToBranchUnprocessableEntity { + return &AgentRunnerCommitToBranchUnprocessableEntity{} +} + +/* +AgentRunnerCommitToBranchUnprocessableEntity handles this case with default header values. + +Unprocessable Entity +*/ +type AgentRunnerCommitToBranchUnprocessableEntity struct { +} + +func (o *AgentRunnerCommitToBranchUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /agent_runners/{agent_runner_id}/commit][%d] agentRunnerCommitToBranchUnprocessableEntity ", 422) +} + +func (o *AgentRunnerCommitToBranchUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewAgentRunnerCommitToBranchDefault creates a AgentRunnerCommitToBranchDefault with default headers values +func NewAgentRunnerCommitToBranchDefault(code int) *AgentRunnerCommitToBranchDefault { + return &AgentRunnerCommitToBranchDefault{ + _statusCode: code, + } +} + +/* +AgentRunnerCommitToBranchDefault handles this case with default header values. + +error +*/ +type AgentRunnerCommitToBranchDefault struct { + _statusCode int + + Payload *models.Error +} + +// Code gets the status code for the agent runner commit to branch default response +func (o *AgentRunnerCommitToBranchDefault) Code() int { + return o._statusCode +} + +func (o *AgentRunnerCommitToBranchDefault) Error() string { + return fmt.Sprintf("[POST /agent_runners/{agent_runner_id}/commit][%d] agentRunnerCommitToBranch default %+v", o._statusCode, o.Payload) +} + +func (o *AgentRunnerCommitToBranchDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *AgentRunnerCommitToBranchDefault) 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/agent_runner_pull_request_parameters.go b/go/plumbing/operations/agent_runner_pull_request_parameters.go new file mode 100644 index 00000000..272a2e81 --- /dev/null +++ b/go/plumbing/operations/agent_runner_pull_request_parameters.go @@ -0,0 +1,133 @@ +// 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" +) + +// NewAgentRunnerPullRequestParams creates a new AgentRunnerPullRequestParams object +// with the default values initialized. +func NewAgentRunnerPullRequestParams() *AgentRunnerPullRequestParams { + var () + return &AgentRunnerPullRequestParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewAgentRunnerPullRequestParamsWithTimeout creates a new AgentRunnerPullRequestParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewAgentRunnerPullRequestParamsWithTimeout(timeout time.Duration) *AgentRunnerPullRequestParams { + var () + return &AgentRunnerPullRequestParams{ + + timeout: timeout, + } +} + +// NewAgentRunnerPullRequestParamsWithContext creates a new AgentRunnerPullRequestParams object +// with the default values initialized, and the ability to set a context for a request +func NewAgentRunnerPullRequestParamsWithContext(ctx context.Context) *AgentRunnerPullRequestParams { + var () + return &AgentRunnerPullRequestParams{ + + Context: ctx, + } +} + +// NewAgentRunnerPullRequestParamsWithHTTPClient creates a new AgentRunnerPullRequestParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewAgentRunnerPullRequestParamsWithHTTPClient(client *http.Client) *AgentRunnerPullRequestParams { + var () + return &AgentRunnerPullRequestParams{ + HTTPClient: client, + } +} + +/* +AgentRunnerPullRequestParams contains all the parameters to send to the API endpoint +for the agent runner pull request operation typically these are written to a http.Request +*/ +type AgentRunnerPullRequestParams struct { + + /*AgentRunnerID*/ + AgentRunnerID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the agent runner pull request params +func (o *AgentRunnerPullRequestParams) WithTimeout(timeout time.Duration) *AgentRunnerPullRequestParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the agent runner pull request params +func (o *AgentRunnerPullRequestParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the agent runner pull request params +func (o *AgentRunnerPullRequestParams) WithContext(ctx context.Context) *AgentRunnerPullRequestParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the agent runner pull request params +func (o *AgentRunnerPullRequestParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the agent runner pull request params +func (o *AgentRunnerPullRequestParams) WithHTTPClient(client *http.Client) *AgentRunnerPullRequestParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the agent runner pull request params +func (o *AgentRunnerPullRequestParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAgentRunnerID adds the agentRunnerID to the agent runner pull request params +func (o *AgentRunnerPullRequestParams) WithAgentRunnerID(agentRunnerID string) *AgentRunnerPullRequestParams { + o.SetAgentRunnerID(agentRunnerID) + return o +} + +// SetAgentRunnerID adds the agentRunnerId to the agent runner pull request params +func (o *AgentRunnerPullRequestParams) SetAgentRunnerID(agentRunnerID string) { + o.AgentRunnerID = agentRunnerID +} + +// WriteToRequest writes these params to a swagger request +func (o *AgentRunnerPullRequestParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param agent_runner_id + if err := r.SetPathParam("agent_runner_id", o.AgentRunnerID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/plumbing/operations/agent_runner_pull_request_responses.go b/go/plumbing/operations/agent_runner_pull_request_responses.go new file mode 100644 index 00000000..438dadf6 --- /dev/null +++ b/go/plumbing/operations/agent_runner_pull_request_responses.go @@ -0,0 +1,191 @@ +// 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" + "github.com/go-openapi/strfmt" + + "github.com/netlify/open-api/v2/go/models" +) + +// AgentRunnerPullRequestReader is a Reader for the AgentRunnerPullRequest structure. +type AgentRunnerPullRequestReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *AgentRunnerPullRequestReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewAgentRunnerPullRequestOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewAgentRunnerPullRequestBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewAgentRunnerPullRequestConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewAgentRunnerPullRequestUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + result := NewAgentRunnerPullRequestDefault(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 + } +} + +// NewAgentRunnerPullRequestOK creates a AgentRunnerPullRequestOK with default headers values +func NewAgentRunnerPullRequestOK() *AgentRunnerPullRequestOK { + return &AgentRunnerPullRequestOK{} +} + +/* +AgentRunnerPullRequestOK handles this case with default header values. + +OK +*/ +type AgentRunnerPullRequestOK struct { +} + +func (o *AgentRunnerPullRequestOK) Error() string { + return fmt.Sprintf("[POST /agent_runners/{agent_runner_id}/pull_request][%d] agentRunnerPullRequestOK ", 200) +} + +func (o *AgentRunnerPullRequestOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewAgentRunnerPullRequestBadRequest creates a AgentRunnerPullRequestBadRequest with default headers values +func NewAgentRunnerPullRequestBadRequest() *AgentRunnerPullRequestBadRequest { + return &AgentRunnerPullRequestBadRequest{} +} + +/* +AgentRunnerPullRequestBadRequest handles this case with default header values. + +Bad Request +*/ +type AgentRunnerPullRequestBadRequest struct { +} + +func (o *AgentRunnerPullRequestBadRequest) Error() string { + return fmt.Sprintf("[POST /agent_runners/{agent_runner_id}/pull_request][%d] agentRunnerPullRequestBadRequest ", 400) +} + +func (o *AgentRunnerPullRequestBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewAgentRunnerPullRequestConflict creates a AgentRunnerPullRequestConflict with default headers values +func NewAgentRunnerPullRequestConflict() *AgentRunnerPullRequestConflict { + return &AgentRunnerPullRequestConflict{} +} + +/* +AgentRunnerPullRequestConflict handles this case with default header values. + +Conflict +*/ +type AgentRunnerPullRequestConflict struct { +} + +func (o *AgentRunnerPullRequestConflict) Error() string { + return fmt.Sprintf("[POST /agent_runners/{agent_runner_id}/pull_request][%d] agentRunnerPullRequestConflict ", 409) +} + +func (o *AgentRunnerPullRequestConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewAgentRunnerPullRequestUnprocessableEntity creates a AgentRunnerPullRequestUnprocessableEntity with default headers values +func NewAgentRunnerPullRequestUnprocessableEntity() *AgentRunnerPullRequestUnprocessableEntity { + return &AgentRunnerPullRequestUnprocessableEntity{} +} + +/* +AgentRunnerPullRequestUnprocessableEntity handles this case with default header values. + +Unprocessable Entity +*/ +type AgentRunnerPullRequestUnprocessableEntity struct { +} + +func (o *AgentRunnerPullRequestUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /agent_runners/{agent_runner_id}/pull_request][%d] agentRunnerPullRequestUnprocessableEntity ", 422) +} + +func (o *AgentRunnerPullRequestUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewAgentRunnerPullRequestDefault creates a AgentRunnerPullRequestDefault with default headers values +func NewAgentRunnerPullRequestDefault(code int) *AgentRunnerPullRequestDefault { + return &AgentRunnerPullRequestDefault{ + _statusCode: code, + } +} + +/* +AgentRunnerPullRequestDefault handles this case with default header values. + +error +*/ +type AgentRunnerPullRequestDefault struct { + _statusCode int + + Payload *models.Error +} + +// Code gets the status code for the agent runner pull request default response +func (o *AgentRunnerPullRequestDefault) Code() int { + return o._statusCode +} + +func (o *AgentRunnerPullRequestDefault) Error() string { + return fmt.Sprintf("[POST /agent_runners/{agent_runner_id}/pull_request][%d] agentRunnerPullRequest default %+v", o._statusCode, o.Payload) +} + +func (o *AgentRunnerPullRequestDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *AgentRunnerPullRequestDefault) 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/archive_agent_runner_parameters.go b/go/plumbing/operations/archive_agent_runner_parameters.go new file mode 100644 index 00000000..17ea7802 --- /dev/null +++ b/go/plumbing/operations/archive_agent_runner_parameters.go @@ -0,0 +1,133 @@ +// 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" +) + +// NewArchiveAgentRunnerParams creates a new ArchiveAgentRunnerParams object +// with the default values initialized. +func NewArchiveAgentRunnerParams() *ArchiveAgentRunnerParams { + var () + return &ArchiveAgentRunnerParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewArchiveAgentRunnerParamsWithTimeout creates a new ArchiveAgentRunnerParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewArchiveAgentRunnerParamsWithTimeout(timeout time.Duration) *ArchiveAgentRunnerParams { + var () + return &ArchiveAgentRunnerParams{ + + timeout: timeout, + } +} + +// NewArchiveAgentRunnerParamsWithContext creates a new ArchiveAgentRunnerParams object +// with the default values initialized, and the ability to set a context for a request +func NewArchiveAgentRunnerParamsWithContext(ctx context.Context) *ArchiveAgentRunnerParams { + var () + return &ArchiveAgentRunnerParams{ + + Context: ctx, + } +} + +// NewArchiveAgentRunnerParamsWithHTTPClient creates a new ArchiveAgentRunnerParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewArchiveAgentRunnerParamsWithHTTPClient(client *http.Client) *ArchiveAgentRunnerParams { + var () + return &ArchiveAgentRunnerParams{ + HTTPClient: client, + } +} + +/* +ArchiveAgentRunnerParams contains all the parameters to send to the API endpoint +for the archive agent runner operation typically these are written to a http.Request +*/ +type ArchiveAgentRunnerParams struct { + + /*AgentRunnerID*/ + AgentRunnerID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the archive agent runner params +func (o *ArchiveAgentRunnerParams) WithTimeout(timeout time.Duration) *ArchiveAgentRunnerParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the archive agent runner params +func (o *ArchiveAgentRunnerParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the archive agent runner params +func (o *ArchiveAgentRunnerParams) WithContext(ctx context.Context) *ArchiveAgentRunnerParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the archive agent runner params +func (o *ArchiveAgentRunnerParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the archive agent runner params +func (o *ArchiveAgentRunnerParams) WithHTTPClient(client *http.Client) *ArchiveAgentRunnerParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the archive agent runner params +func (o *ArchiveAgentRunnerParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAgentRunnerID adds the agentRunnerID to the archive agent runner params +func (o *ArchiveAgentRunnerParams) WithAgentRunnerID(agentRunnerID string) *ArchiveAgentRunnerParams { + o.SetAgentRunnerID(agentRunnerID) + return o +} + +// SetAgentRunnerID adds the agentRunnerId to the archive agent runner params +func (o *ArchiveAgentRunnerParams) SetAgentRunnerID(agentRunnerID string) { + o.AgentRunnerID = agentRunnerID +} + +// WriteToRequest writes these params to a swagger request +func (o *ArchiveAgentRunnerParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param agent_runner_id + if err := r.SetPathParam("agent_runner_id", o.AgentRunnerID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/plumbing/operations/archive_agent_runner_responses.go b/go/plumbing/operations/archive_agent_runner_responses.go new file mode 100644 index 00000000..fae96947 --- /dev/null +++ b/go/plumbing/operations/archive_agent_runner_responses.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 ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/netlify/open-api/v2/go/models" +) + +// ArchiveAgentRunnerReader is a Reader for the ArchiveAgentRunner structure. +type ArchiveAgentRunnerReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ArchiveAgentRunnerReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 202: + result := NewArchiveAgentRunnerAccepted() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewArchiveAgentRunnerNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewArchiveAgentRunnerUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + result := NewArchiveAgentRunnerDefault(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 + } +} + +// NewArchiveAgentRunnerAccepted creates a ArchiveAgentRunnerAccepted with default headers values +func NewArchiveAgentRunnerAccepted() *ArchiveAgentRunnerAccepted { + return &ArchiveAgentRunnerAccepted{} +} + +/* +ArchiveAgentRunnerAccepted handles this case with default header values. + +Accepted +*/ +type ArchiveAgentRunnerAccepted struct { +} + +func (o *ArchiveAgentRunnerAccepted) Error() string { + return fmt.Sprintf("[POST /agent_runners/{agent_runner_id}/archive][%d] archiveAgentRunnerAccepted ", 202) +} + +func (o *ArchiveAgentRunnerAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewArchiveAgentRunnerNotFound creates a ArchiveAgentRunnerNotFound with default headers values +func NewArchiveAgentRunnerNotFound() *ArchiveAgentRunnerNotFound { + return &ArchiveAgentRunnerNotFound{} +} + +/* +ArchiveAgentRunnerNotFound handles this case with default header values. + +Not Found +*/ +type ArchiveAgentRunnerNotFound struct { +} + +func (o *ArchiveAgentRunnerNotFound) Error() string { + return fmt.Sprintf("[POST /agent_runners/{agent_runner_id}/archive][%d] archiveAgentRunnerNotFound ", 404) +} + +func (o *ArchiveAgentRunnerNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewArchiveAgentRunnerUnprocessableEntity creates a ArchiveAgentRunnerUnprocessableEntity with default headers values +func NewArchiveAgentRunnerUnprocessableEntity() *ArchiveAgentRunnerUnprocessableEntity { + return &ArchiveAgentRunnerUnprocessableEntity{} +} + +/* +ArchiveAgentRunnerUnprocessableEntity handles this case with default header values. + +Unprocessable Entity +*/ +type ArchiveAgentRunnerUnprocessableEntity struct { +} + +func (o *ArchiveAgentRunnerUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /agent_runners/{agent_runner_id}/archive][%d] archiveAgentRunnerUnprocessableEntity ", 422) +} + +func (o *ArchiveAgentRunnerUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewArchiveAgentRunnerDefault creates a ArchiveAgentRunnerDefault with default headers values +func NewArchiveAgentRunnerDefault(code int) *ArchiveAgentRunnerDefault { + return &ArchiveAgentRunnerDefault{ + _statusCode: code, + } +} + +/* +ArchiveAgentRunnerDefault handles this case with default header values. + +error +*/ +type ArchiveAgentRunnerDefault struct { + _statusCode int + + Payload *models.Error +} + +// Code gets the status code for the archive agent runner default response +func (o *ArchiveAgentRunnerDefault) Code() int { + return o._statusCode +} + +func (o *ArchiveAgentRunnerDefault) Error() string { + return fmt.Sprintf("[POST /agent_runners/{agent_runner_id}/archive][%d] archiveAgentRunner default %+v", o._statusCode, o.Payload) +} + +func (o *ArchiveAgentRunnerDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *ArchiveAgentRunnerDefault) 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/create_agent_runner_parameters.go b/go/plumbing/operations/create_agent_runner_parameters.go new file mode 100644 index 00000000..1cdd779b --- /dev/null +++ b/go/plumbing/operations/create_agent_runner_parameters.go @@ -0,0 +1,362 @@ +// 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" + "github.com/go-openapi/swag" +) + +// NewCreateAgentRunnerParams creates a new CreateAgentRunnerParams object +// with the default values initialized. +func NewCreateAgentRunnerParams() *CreateAgentRunnerParams { + var () + return &CreateAgentRunnerParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCreateAgentRunnerParamsWithTimeout creates a new CreateAgentRunnerParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCreateAgentRunnerParamsWithTimeout(timeout time.Duration) *CreateAgentRunnerParams { + var () + return &CreateAgentRunnerParams{ + + timeout: timeout, + } +} + +// NewCreateAgentRunnerParamsWithContext creates a new CreateAgentRunnerParams object +// with the default values initialized, and the ability to set a context for a request +func NewCreateAgentRunnerParamsWithContext(ctx context.Context) *CreateAgentRunnerParams { + var () + return &CreateAgentRunnerParams{ + + Context: ctx, + } +} + +// NewCreateAgentRunnerParamsWithHTTPClient creates a new CreateAgentRunnerParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCreateAgentRunnerParamsWithHTTPClient(client *http.Client) *CreateAgentRunnerParams { + var () + return &CreateAgentRunnerParams{ + HTTPClient: client, + } +} + +/* +CreateAgentRunnerParams contains all the parameters to send to the API endpoint +for the create agent runner operation typically these are written to a http.Request +*/ +type CreateAgentRunnerParams struct { + + /*Agent*/ + Agent *string + /*Branch*/ + Branch *string + /*DeployID*/ + DeployID *string + /*DevServerImage*/ + DevServerImage *string + /*FileKeys*/ + FileKeys []string + /*Model*/ + Model *string + /*ParentAgentRunnerID*/ + ParentAgentRunnerID *string + /*Prompt*/ + Prompt *string + /*SiteID*/ + SiteID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the create agent runner params +func (o *CreateAgentRunnerParams) WithTimeout(timeout time.Duration) *CreateAgentRunnerParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create agent runner params +func (o *CreateAgentRunnerParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create agent runner params +func (o *CreateAgentRunnerParams) WithContext(ctx context.Context) *CreateAgentRunnerParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create agent runner params +func (o *CreateAgentRunnerParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create agent runner params +func (o *CreateAgentRunnerParams) WithHTTPClient(client *http.Client) *CreateAgentRunnerParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create agent runner params +func (o *CreateAgentRunnerParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAgent adds the agent to the create agent runner params +func (o *CreateAgentRunnerParams) WithAgent(agent *string) *CreateAgentRunnerParams { + o.SetAgent(agent) + return o +} + +// SetAgent adds the agent to the create agent runner params +func (o *CreateAgentRunnerParams) SetAgent(agent *string) { + o.Agent = agent +} + +// WithBranch adds the branch to the create agent runner params +func (o *CreateAgentRunnerParams) WithBranch(branch *string) *CreateAgentRunnerParams { + o.SetBranch(branch) + return o +} + +// SetBranch adds the branch to the create agent runner params +func (o *CreateAgentRunnerParams) SetBranch(branch *string) { + o.Branch = branch +} + +// WithDeployID adds the deployID to the create agent runner params +func (o *CreateAgentRunnerParams) WithDeployID(deployID *string) *CreateAgentRunnerParams { + o.SetDeployID(deployID) + return o +} + +// SetDeployID adds the deployId to the create agent runner params +func (o *CreateAgentRunnerParams) SetDeployID(deployID *string) { + o.DeployID = deployID +} + +// WithDevServerImage adds the devServerImage to the create agent runner params +func (o *CreateAgentRunnerParams) WithDevServerImage(devServerImage *string) *CreateAgentRunnerParams { + o.SetDevServerImage(devServerImage) + return o +} + +// SetDevServerImage adds the devServerImage to the create agent runner params +func (o *CreateAgentRunnerParams) SetDevServerImage(devServerImage *string) { + o.DevServerImage = devServerImage +} + +// WithFileKeys adds the fileKeys to the create agent runner params +func (o *CreateAgentRunnerParams) WithFileKeys(fileKeys []string) *CreateAgentRunnerParams { + o.SetFileKeys(fileKeys) + return o +} + +// SetFileKeys adds the fileKeys to the create agent runner params +func (o *CreateAgentRunnerParams) SetFileKeys(fileKeys []string) { + o.FileKeys = fileKeys +} + +// WithModel adds the model to the create agent runner params +func (o *CreateAgentRunnerParams) WithModel(model *string) *CreateAgentRunnerParams { + o.SetModel(model) + return o +} + +// SetModel adds the model to the create agent runner params +func (o *CreateAgentRunnerParams) SetModel(model *string) { + o.Model = model +} + +// WithParentAgentRunnerID adds the parentAgentRunnerID to the create agent runner params +func (o *CreateAgentRunnerParams) WithParentAgentRunnerID(parentAgentRunnerID *string) *CreateAgentRunnerParams { + o.SetParentAgentRunnerID(parentAgentRunnerID) + return o +} + +// SetParentAgentRunnerID adds the parentAgentRunnerId to the create agent runner params +func (o *CreateAgentRunnerParams) SetParentAgentRunnerID(parentAgentRunnerID *string) { + o.ParentAgentRunnerID = parentAgentRunnerID +} + +// WithPrompt adds the prompt to the create agent runner params +func (o *CreateAgentRunnerParams) WithPrompt(prompt *string) *CreateAgentRunnerParams { + o.SetPrompt(prompt) + return o +} + +// SetPrompt adds the prompt to the create agent runner params +func (o *CreateAgentRunnerParams) SetPrompt(prompt *string) { + o.Prompt = prompt +} + +// WithSiteID adds the siteID to the create agent runner params +func (o *CreateAgentRunnerParams) WithSiteID(siteID string) *CreateAgentRunnerParams { + o.SetSiteID(siteID) + return o +} + +// SetSiteID adds the siteId to the create agent runner params +func (o *CreateAgentRunnerParams) SetSiteID(siteID string) { + o.SiteID = siteID +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateAgentRunnerParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Agent != nil { + + // query param agent + var qrAgent string + if o.Agent != nil { + qrAgent = *o.Agent + } + qAgent := qrAgent + if qAgent != "" { + if err := r.SetQueryParam("agent", qAgent); err != nil { + return err + } + } + + } + + if o.Branch != nil { + + // query param branch + var qrBranch string + if o.Branch != nil { + qrBranch = *o.Branch + } + qBranch := qrBranch + if qBranch != "" { + if err := r.SetQueryParam("branch", qBranch); err != nil { + return err + } + } + + } + + if o.DeployID != nil { + + // query param deploy_id + var qrDeployID string + if o.DeployID != nil { + qrDeployID = *o.DeployID + } + qDeployID := qrDeployID + if qDeployID != "" { + if err := r.SetQueryParam("deploy_id", qDeployID); err != nil { + return err + } + } + + } + + if o.DevServerImage != nil { + + // query param dev_server_image + var qrDevServerImage string + if o.DevServerImage != nil { + qrDevServerImage = *o.DevServerImage + } + qDevServerImage := qrDevServerImage + if qDevServerImage != "" { + if err := r.SetQueryParam("dev_server_image", qDevServerImage); err != nil { + return err + } + } + + } + + valuesFileKeys := o.FileKeys + + joinedFileKeys := swag.JoinByFormat(valuesFileKeys, "") + // query array param file_keys + if err := r.SetQueryParam("file_keys", joinedFileKeys...); err != nil { + return err + } + + if o.Model != nil { + + // query param model + var qrModel string + if o.Model != nil { + qrModel = *o.Model + } + qModel := qrModel + if qModel != "" { + if err := r.SetQueryParam("model", qModel); err != nil { + return err + } + } + + } + + if o.ParentAgentRunnerID != nil { + + // query param parent_agent_runner_id + var qrParentAgentRunnerID string + if o.ParentAgentRunnerID != nil { + qrParentAgentRunnerID = *o.ParentAgentRunnerID + } + qParentAgentRunnerID := qrParentAgentRunnerID + if qParentAgentRunnerID != "" { + if err := r.SetQueryParam("parent_agent_runner_id", qParentAgentRunnerID); err != nil { + return err + } + } + + } + + if o.Prompt != nil { + + // query param prompt + var qrPrompt string + if o.Prompt != nil { + qrPrompt = *o.Prompt + } + qPrompt := qrPrompt + if qPrompt != "" { + if err := r.SetQueryParam("prompt", qPrompt); err != nil { + return err + } + } + + } + + // query param site_id + qrSiteID := o.SiteID + qSiteID := qrSiteID + if qSiteID != "" { + if err := r.SetQueryParam("site_id", qSiteID); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/plumbing/operations/create_agent_runner_responses.go b/go/plumbing/operations/create_agent_runner_responses.go new file mode 100644 index 00000000..426a7cd8 --- /dev/null +++ b/go/plumbing/operations/create_agent_runner_responses.go @@ -0,0 +1,175 @@ +// 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" + "github.com/go-openapi/strfmt" + + "github.com/netlify/open-api/v2/go/models" +) + +// CreateAgentRunnerReader is a Reader for the CreateAgentRunner structure. +type CreateAgentRunnerReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateAgentRunnerReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCreateAgentRunnerOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewCreateAgentRunnerNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewCreateAgentRunnerUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + result := NewCreateAgentRunnerDefault(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 + } +} + +// NewCreateAgentRunnerOK creates a CreateAgentRunnerOK with default headers values +func NewCreateAgentRunnerOK() *CreateAgentRunnerOK { + return &CreateAgentRunnerOK{} +} + +/* +CreateAgentRunnerOK handles this case with default header values. + +OK +*/ +type CreateAgentRunnerOK struct { + Payload *models.AgentRunner +} + +func (o *CreateAgentRunnerOK) Error() string { + return fmt.Sprintf("[POST /agent_runners][%d] createAgentRunnerOK %+v", 200, o.Payload) +} + +func (o *CreateAgentRunnerOK) GetPayload() *models.AgentRunner { + return o.Payload +} + +func (o *CreateAgentRunnerOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AgentRunner) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateAgentRunnerNotFound creates a CreateAgentRunnerNotFound with default headers values +func NewCreateAgentRunnerNotFound() *CreateAgentRunnerNotFound { + return &CreateAgentRunnerNotFound{} +} + +/* +CreateAgentRunnerNotFound handles this case with default header values. + +Not Found +*/ +type CreateAgentRunnerNotFound struct { +} + +func (o *CreateAgentRunnerNotFound) Error() string { + return fmt.Sprintf("[POST /agent_runners][%d] createAgentRunnerNotFound ", 404) +} + +func (o *CreateAgentRunnerNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewCreateAgentRunnerUnprocessableEntity creates a CreateAgentRunnerUnprocessableEntity with default headers values +func NewCreateAgentRunnerUnprocessableEntity() *CreateAgentRunnerUnprocessableEntity { + return &CreateAgentRunnerUnprocessableEntity{} +} + +/* +CreateAgentRunnerUnprocessableEntity handles this case with default header values. + +Unprocessable Entity +*/ +type CreateAgentRunnerUnprocessableEntity struct { +} + +func (o *CreateAgentRunnerUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /agent_runners][%d] createAgentRunnerUnprocessableEntity ", 422) +} + +func (o *CreateAgentRunnerUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewCreateAgentRunnerDefault creates a CreateAgentRunnerDefault with default headers values +func NewCreateAgentRunnerDefault(code int) *CreateAgentRunnerDefault { + return &CreateAgentRunnerDefault{ + _statusCode: code, + } +} + +/* +CreateAgentRunnerDefault handles this case with default header values. + +error +*/ +type CreateAgentRunnerDefault struct { + _statusCode int + + Payload *models.Error +} + +// Code gets the status code for the create agent runner default response +func (o *CreateAgentRunnerDefault) Code() int { + return o._statusCode +} + +func (o *CreateAgentRunnerDefault) Error() string { + return fmt.Sprintf("[POST /agent_runners][%d] createAgentRunner default %+v", o._statusCode, o.Payload) +} + +func (o *CreateAgentRunnerDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *CreateAgentRunnerDefault) 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/create_agent_runner_session_parameters.go b/go/plumbing/operations/create_agent_runner_session_parameters.go new file mode 100644 index 00000000..e608f8be --- /dev/null +++ b/go/plumbing/operations/create_agent_runner_session_parameters.go @@ -0,0 +1,242 @@ +// 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" + "github.com/go-openapi/swag" +) + +// NewCreateAgentRunnerSessionParams creates a new CreateAgentRunnerSessionParams object +// with the default values initialized. +func NewCreateAgentRunnerSessionParams() *CreateAgentRunnerSessionParams { + var () + return &CreateAgentRunnerSessionParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCreateAgentRunnerSessionParamsWithTimeout creates a new CreateAgentRunnerSessionParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCreateAgentRunnerSessionParamsWithTimeout(timeout time.Duration) *CreateAgentRunnerSessionParams { + var () + return &CreateAgentRunnerSessionParams{ + + timeout: timeout, + } +} + +// NewCreateAgentRunnerSessionParamsWithContext creates a new CreateAgentRunnerSessionParams object +// with the default values initialized, and the ability to set a context for a request +func NewCreateAgentRunnerSessionParamsWithContext(ctx context.Context) *CreateAgentRunnerSessionParams { + var () + return &CreateAgentRunnerSessionParams{ + + Context: ctx, + } +} + +// NewCreateAgentRunnerSessionParamsWithHTTPClient creates a new CreateAgentRunnerSessionParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCreateAgentRunnerSessionParamsWithHTTPClient(client *http.Client) *CreateAgentRunnerSessionParams { + var () + return &CreateAgentRunnerSessionParams{ + HTTPClient: client, + } +} + +/* +CreateAgentRunnerSessionParams contains all the parameters to send to the API endpoint +for the create agent runner session operation typically these are written to a http.Request +*/ +type CreateAgentRunnerSessionParams struct { + + /*Agent*/ + Agent *string + /*AgentRunnerID*/ + AgentRunnerID string + /*FileKeys*/ + FileKeys []string + /*Model*/ + Model *string + /*Prompt*/ + Prompt *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the create agent runner session params +func (o *CreateAgentRunnerSessionParams) WithTimeout(timeout time.Duration) *CreateAgentRunnerSessionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create agent runner session params +func (o *CreateAgentRunnerSessionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create agent runner session params +func (o *CreateAgentRunnerSessionParams) WithContext(ctx context.Context) *CreateAgentRunnerSessionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create agent runner session params +func (o *CreateAgentRunnerSessionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create agent runner session params +func (o *CreateAgentRunnerSessionParams) WithHTTPClient(client *http.Client) *CreateAgentRunnerSessionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create agent runner session params +func (o *CreateAgentRunnerSessionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAgent adds the agent to the create agent runner session params +func (o *CreateAgentRunnerSessionParams) WithAgent(agent *string) *CreateAgentRunnerSessionParams { + o.SetAgent(agent) + return o +} + +// SetAgent adds the agent to the create agent runner session params +func (o *CreateAgentRunnerSessionParams) SetAgent(agent *string) { + o.Agent = agent +} + +// WithAgentRunnerID adds the agentRunnerID to the create agent runner session params +func (o *CreateAgentRunnerSessionParams) WithAgentRunnerID(agentRunnerID string) *CreateAgentRunnerSessionParams { + o.SetAgentRunnerID(agentRunnerID) + return o +} + +// SetAgentRunnerID adds the agentRunnerId to the create agent runner session params +func (o *CreateAgentRunnerSessionParams) SetAgentRunnerID(agentRunnerID string) { + o.AgentRunnerID = agentRunnerID +} + +// WithFileKeys adds the fileKeys to the create agent runner session params +func (o *CreateAgentRunnerSessionParams) WithFileKeys(fileKeys []string) *CreateAgentRunnerSessionParams { + o.SetFileKeys(fileKeys) + return o +} + +// SetFileKeys adds the fileKeys to the create agent runner session params +func (o *CreateAgentRunnerSessionParams) SetFileKeys(fileKeys []string) { + o.FileKeys = fileKeys +} + +// WithModel adds the model to the create agent runner session params +func (o *CreateAgentRunnerSessionParams) WithModel(model *string) *CreateAgentRunnerSessionParams { + o.SetModel(model) + return o +} + +// SetModel adds the model to the create agent runner session params +func (o *CreateAgentRunnerSessionParams) SetModel(model *string) { + o.Model = model +} + +// WithPrompt adds the prompt to the create agent runner session params +func (o *CreateAgentRunnerSessionParams) WithPrompt(prompt *string) *CreateAgentRunnerSessionParams { + o.SetPrompt(prompt) + return o +} + +// SetPrompt adds the prompt to the create agent runner session params +func (o *CreateAgentRunnerSessionParams) SetPrompt(prompt *string) { + o.Prompt = prompt +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateAgentRunnerSessionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Agent != nil { + + // query param agent + var qrAgent string + if o.Agent != nil { + qrAgent = *o.Agent + } + qAgent := qrAgent + if qAgent != "" { + if err := r.SetQueryParam("agent", qAgent); err != nil { + return err + } + } + + } + + // path param agent_runner_id + if err := r.SetPathParam("agent_runner_id", o.AgentRunnerID); err != nil { + return err + } + + valuesFileKeys := o.FileKeys + + joinedFileKeys := swag.JoinByFormat(valuesFileKeys, "") + // query array param file_keys + if err := r.SetQueryParam("file_keys", joinedFileKeys...); err != nil { + return err + } + + if o.Model != nil { + + // query param model + var qrModel string + if o.Model != nil { + qrModel = *o.Model + } + qModel := qrModel + if qModel != "" { + if err := r.SetQueryParam("model", qModel); err != nil { + return err + } + } + + } + + if o.Prompt != nil { + + // query param prompt + var qrPrompt string + if o.Prompt != nil { + qrPrompt = *o.Prompt + } + qPrompt := qrPrompt + if qPrompt != "" { + if err := r.SetQueryParam("prompt", qPrompt); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/plumbing/operations/create_agent_runner_session_responses.go b/go/plumbing/operations/create_agent_runner_session_responses.go new file mode 100644 index 00000000..c47271f1 --- /dev/null +++ b/go/plumbing/operations/create_agent_runner_session_responses.go @@ -0,0 +1,175 @@ +// 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" + "github.com/go-openapi/strfmt" + + "github.com/netlify/open-api/v2/go/models" +) + +// CreateAgentRunnerSessionReader is a Reader for the CreateAgentRunnerSession structure. +type CreateAgentRunnerSessionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateAgentRunnerSessionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCreateAgentRunnerSessionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewCreateAgentRunnerSessionNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewCreateAgentRunnerSessionUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + result := NewCreateAgentRunnerSessionDefault(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 + } +} + +// NewCreateAgentRunnerSessionOK creates a CreateAgentRunnerSessionOK with default headers values +func NewCreateAgentRunnerSessionOK() *CreateAgentRunnerSessionOK { + return &CreateAgentRunnerSessionOK{} +} + +/* +CreateAgentRunnerSessionOK handles this case with default header values. + +OK +*/ +type CreateAgentRunnerSessionOK struct { + Payload *models.AgentRunnerSession +} + +func (o *CreateAgentRunnerSessionOK) Error() string { + return fmt.Sprintf("[POST /agent_runners/{agent_runner_id}/sessions][%d] createAgentRunnerSessionOK %+v", 200, o.Payload) +} + +func (o *CreateAgentRunnerSessionOK) GetPayload() *models.AgentRunnerSession { + return o.Payload +} + +func (o *CreateAgentRunnerSessionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AgentRunnerSession) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateAgentRunnerSessionNotFound creates a CreateAgentRunnerSessionNotFound with default headers values +func NewCreateAgentRunnerSessionNotFound() *CreateAgentRunnerSessionNotFound { + return &CreateAgentRunnerSessionNotFound{} +} + +/* +CreateAgentRunnerSessionNotFound handles this case with default header values. + +Not Found +*/ +type CreateAgentRunnerSessionNotFound struct { +} + +func (o *CreateAgentRunnerSessionNotFound) Error() string { + return fmt.Sprintf("[POST /agent_runners/{agent_runner_id}/sessions][%d] createAgentRunnerSessionNotFound ", 404) +} + +func (o *CreateAgentRunnerSessionNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewCreateAgentRunnerSessionUnprocessableEntity creates a CreateAgentRunnerSessionUnprocessableEntity with default headers values +func NewCreateAgentRunnerSessionUnprocessableEntity() *CreateAgentRunnerSessionUnprocessableEntity { + return &CreateAgentRunnerSessionUnprocessableEntity{} +} + +/* +CreateAgentRunnerSessionUnprocessableEntity handles this case with default header values. + +Unprocessable Entity +*/ +type CreateAgentRunnerSessionUnprocessableEntity struct { +} + +func (o *CreateAgentRunnerSessionUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /agent_runners/{agent_runner_id}/sessions][%d] createAgentRunnerSessionUnprocessableEntity ", 422) +} + +func (o *CreateAgentRunnerSessionUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewCreateAgentRunnerSessionDefault creates a CreateAgentRunnerSessionDefault with default headers values +func NewCreateAgentRunnerSessionDefault(code int) *CreateAgentRunnerSessionDefault { + return &CreateAgentRunnerSessionDefault{ + _statusCode: code, + } +} + +/* +CreateAgentRunnerSessionDefault handles this case with default header values. + +error +*/ +type CreateAgentRunnerSessionDefault struct { + _statusCode int + + Payload *models.Error +} + +// Code gets the status code for the create agent runner session default response +func (o *CreateAgentRunnerSessionDefault) Code() int { + return o._statusCode +} + +func (o *CreateAgentRunnerSessionDefault) Error() string { + return fmt.Sprintf("[POST /agent_runners/{agent_runner_id}/sessions][%d] createAgentRunnerSession default %+v", o._statusCode, o.Payload) +} + +func (o *CreateAgentRunnerSessionDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *CreateAgentRunnerSessionDefault) 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/create_agent_runner_upload_url_parameters.go b/go/plumbing/operations/create_agent_runner_upload_url_parameters.go new file mode 100644 index 00000000..795d4988 --- /dev/null +++ b/go/plumbing/operations/create_agent_runner_upload_url_parameters.go @@ -0,0 +1,181 @@ +// 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" +) + +// NewCreateAgentRunnerUploadURLParams creates a new CreateAgentRunnerUploadURLParams object +// with the default values initialized. +func NewCreateAgentRunnerUploadURLParams() *CreateAgentRunnerUploadURLParams { + var () + return &CreateAgentRunnerUploadURLParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCreateAgentRunnerUploadURLParamsWithTimeout creates a new CreateAgentRunnerUploadURLParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCreateAgentRunnerUploadURLParamsWithTimeout(timeout time.Duration) *CreateAgentRunnerUploadURLParams { + var () + return &CreateAgentRunnerUploadURLParams{ + + timeout: timeout, + } +} + +// NewCreateAgentRunnerUploadURLParamsWithContext creates a new CreateAgentRunnerUploadURLParams object +// with the default values initialized, and the ability to set a context for a request +func NewCreateAgentRunnerUploadURLParamsWithContext(ctx context.Context) *CreateAgentRunnerUploadURLParams { + var () + return &CreateAgentRunnerUploadURLParams{ + + Context: ctx, + } +} + +// NewCreateAgentRunnerUploadURLParamsWithHTTPClient creates a new CreateAgentRunnerUploadURLParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCreateAgentRunnerUploadURLParamsWithHTTPClient(client *http.Client) *CreateAgentRunnerUploadURLParams { + var () + return &CreateAgentRunnerUploadURLParams{ + HTTPClient: client, + } +} + +/* +CreateAgentRunnerUploadURLParams contains all the parameters to send to the API endpoint +for the create agent runner upload Url operation typically these are written to a http.Request +*/ +type CreateAgentRunnerUploadURLParams struct { + + /*AccountID*/ + AccountID string + /*ContentType*/ + ContentType string + /*Filename*/ + Filename string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the create agent runner upload Url params +func (o *CreateAgentRunnerUploadURLParams) WithTimeout(timeout time.Duration) *CreateAgentRunnerUploadURLParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create agent runner upload Url params +func (o *CreateAgentRunnerUploadURLParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create agent runner upload Url params +func (o *CreateAgentRunnerUploadURLParams) WithContext(ctx context.Context) *CreateAgentRunnerUploadURLParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create agent runner upload Url params +func (o *CreateAgentRunnerUploadURLParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create agent runner upload Url params +func (o *CreateAgentRunnerUploadURLParams) WithHTTPClient(client *http.Client) *CreateAgentRunnerUploadURLParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create agent runner upload Url params +func (o *CreateAgentRunnerUploadURLParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the create agent runner upload Url params +func (o *CreateAgentRunnerUploadURLParams) WithAccountID(accountID string) *CreateAgentRunnerUploadURLParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the create agent runner upload Url params +func (o *CreateAgentRunnerUploadURLParams) SetAccountID(accountID string) { + o.AccountID = accountID +} + +// WithContentType adds the contentType to the create agent runner upload Url params +func (o *CreateAgentRunnerUploadURLParams) WithContentType(contentType string) *CreateAgentRunnerUploadURLParams { + o.SetContentType(contentType) + return o +} + +// SetContentType adds the contentType to the create agent runner upload Url params +func (o *CreateAgentRunnerUploadURLParams) SetContentType(contentType string) { + o.ContentType = contentType +} + +// WithFilename adds the filename to the create agent runner upload Url params +func (o *CreateAgentRunnerUploadURLParams) WithFilename(filename string) *CreateAgentRunnerUploadURLParams { + o.SetFilename(filename) + return o +} + +// SetFilename adds the filename to the create agent runner upload Url params +func (o *CreateAgentRunnerUploadURLParams) SetFilename(filename string) { + o.Filename = filename +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateAgentRunnerUploadURLParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param account_id + qrAccountID := o.AccountID + qAccountID := qrAccountID + if qAccountID != "" { + if err := r.SetQueryParam("account_id", qAccountID); err != nil { + return err + } + } + + // query param content_type + qrContentType := o.ContentType + qContentType := qrContentType + if qContentType != "" { + if err := r.SetQueryParam("content_type", qContentType); err != nil { + return err + } + } + + // query param filename + qrFilename := o.Filename + qFilename := qrFilename + if qFilename != "" { + if err := r.SetQueryParam("filename", qFilename); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/plumbing/operations/create_agent_runner_upload_url_responses.go b/go/plumbing/operations/create_agent_runner_upload_url_responses.go new file mode 100644 index 00000000..cec077a5 --- /dev/null +++ b/go/plumbing/operations/create_agent_runner_upload_url_responses.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 ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/netlify/open-api/v2/go/models" +) + +// CreateAgentRunnerUploadURLReader is a Reader for the CreateAgentRunnerUploadURL structure. +type CreateAgentRunnerUploadURLReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateAgentRunnerUploadURLReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCreateAgentRunnerUploadURLOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewCreateAgentRunnerUploadURLBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewCreateAgentRunnerUploadURLUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + result := NewCreateAgentRunnerUploadURLDefault(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 + } +} + +// NewCreateAgentRunnerUploadURLOK creates a CreateAgentRunnerUploadURLOK with default headers values +func NewCreateAgentRunnerUploadURLOK() *CreateAgentRunnerUploadURLOK { + return &CreateAgentRunnerUploadURLOK{} +} + +/* +CreateAgentRunnerUploadURLOK handles this case with default header values. + +OK +*/ +type CreateAgentRunnerUploadURLOK struct { +} + +func (o *CreateAgentRunnerUploadURLOK) Error() string { + return fmt.Sprintf("[POST /agent_runners/upload_url][%d] createAgentRunnerUploadUrlOK ", 200) +} + +func (o *CreateAgentRunnerUploadURLOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewCreateAgentRunnerUploadURLBadRequest creates a CreateAgentRunnerUploadURLBadRequest with default headers values +func NewCreateAgentRunnerUploadURLBadRequest() *CreateAgentRunnerUploadURLBadRequest { + return &CreateAgentRunnerUploadURLBadRequest{} +} + +/* +CreateAgentRunnerUploadURLBadRequest handles this case with default header values. + +Bad Request +*/ +type CreateAgentRunnerUploadURLBadRequest struct { +} + +func (o *CreateAgentRunnerUploadURLBadRequest) Error() string { + return fmt.Sprintf("[POST /agent_runners/upload_url][%d] createAgentRunnerUploadUrlBadRequest ", 400) +} + +func (o *CreateAgentRunnerUploadURLBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewCreateAgentRunnerUploadURLUnprocessableEntity creates a CreateAgentRunnerUploadURLUnprocessableEntity with default headers values +func NewCreateAgentRunnerUploadURLUnprocessableEntity() *CreateAgentRunnerUploadURLUnprocessableEntity { + return &CreateAgentRunnerUploadURLUnprocessableEntity{} +} + +/* +CreateAgentRunnerUploadURLUnprocessableEntity handles this case with default header values. + +Unprocessable Entity +*/ +type CreateAgentRunnerUploadURLUnprocessableEntity struct { +} + +func (o *CreateAgentRunnerUploadURLUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /agent_runners/upload_url][%d] createAgentRunnerUploadUrlUnprocessableEntity ", 422) +} + +func (o *CreateAgentRunnerUploadURLUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewCreateAgentRunnerUploadURLDefault creates a CreateAgentRunnerUploadURLDefault with default headers values +func NewCreateAgentRunnerUploadURLDefault(code int) *CreateAgentRunnerUploadURLDefault { + return &CreateAgentRunnerUploadURLDefault{ + _statusCode: code, + } +} + +/* +CreateAgentRunnerUploadURLDefault handles this case with default header values. + +error +*/ +type CreateAgentRunnerUploadURLDefault struct { + _statusCode int + + Payload *models.Error +} + +// Code gets the status code for the create agent runner upload Url default response +func (o *CreateAgentRunnerUploadURLDefault) Code() int { + return o._statusCode +} + +func (o *CreateAgentRunnerUploadURLDefault) Error() string { + return fmt.Sprintf("[POST /agent_runners/upload_url][%d] createAgentRunnerUploadUrl default %+v", o._statusCode, o.Payload) +} + +func (o *CreateAgentRunnerUploadURLDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *CreateAgentRunnerUploadURLDefault) 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/delete_agent_runner_parameters.go b/go/plumbing/operations/delete_agent_runner_parameters.go new file mode 100644 index 00000000..460a26e5 --- /dev/null +++ b/go/plumbing/operations/delete_agent_runner_parameters.go @@ -0,0 +1,133 @@ +// 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" +) + +// NewDeleteAgentRunnerParams creates a new DeleteAgentRunnerParams object +// with the default values initialized. +func NewDeleteAgentRunnerParams() *DeleteAgentRunnerParams { + var () + return &DeleteAgentRunnerParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteAgentRunnerParamsWithTimeout creates a new DeleteAgentRunnerParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteAgentRunnerParamsWithTimeout(timeout time.Duration) *DeleteAgentRunnerParams { + var () + return &DeleteAgentRunnerParams{ + + timeout: timeout, + } +} + +// NewDeleteAgentRunnerParamsWithContext creates a new DeleteAgentRunnerParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteAgentRunnerParamsWithContext(ctx context.Context) *DeleteAgentRunnerParams { + var () + return &DeleteAgentRunnerParams{ + + Context: ctx, + } +} + +// NewDeleteAgentRunnerParamsWithHTTPClient creates a new DeleteAgentRunnerParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteAgentRunnerParamsWithHTTPClient(client *http.Client) *DeleteAgentRunnerParams { + var () + return &DeleteAgentRunnerParams{ + HTTPClient: client, + } +} + +/* +DeleteAgentRunnerParams contains all the parameters to send to the API endpoint +for the delete agent runner operation typically these are written to a http.Request +*/ +type DeleteAgentRunnerParams struct { + + /*AgentRunnerID*/ + AgentRunnerID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete agent runner params +func (o *DeleteAgentRunnerParams) WithTimeout(timeout time.Duration) *DeleteAgentRunnerParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete agent runner params +func (o *DeleteAgentRunnerParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete agent runner params +func (o *DeleteAgentRunnerParams) WithContext(ctx context.Context) *DeleteAgentRunnerParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete agent runner params +func (o *DeleteAgentRunnerParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete agent runner params +func (o *DeleteAgentRunnerParams) WithHTTPClient(client *http.Client) *DeleteAgentRunnerParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete agent runner params +func (o *DeleteAgentRunnerParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAgentRunnerID adds the agentRunnerID to the delete agent runner params +func (o *DeleteAgentRunnerParams) WithAgentRunnerID(agentRunnerID string) *DeleteAgentRunnerParams { + o.SetAgentRunnerID(agentRunnerID) + return o +} + +// SetAgentRunnerID adds the agentRunnerId to the delete agent runner params +func (o *DeleteAgentRunnerParams) SetAgentRunnerID(agentRunnerID string) { + o.AgentRunnerID = agentRunnerID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteAgentRunnerParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param agent_runner_id + if err := r.SetPathParam("agent_runner_id", o.AgentRunnerID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/plumbing/operations/delete_agent_runner_responses.go b/go/plumbing/operations/delete_agent_runner_responses.go new file mode 100644 index 00000000..8db6e4d1 --- /dev/null +++ b/go/plumbing/operations/delete_agent_runner_responses.go @@ -0,0 +1,107 @@ +// 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" + "github.com/go-openapi/strfmt" + + "github.com/netlify/open-api/v2/go/models" +) + +// DeleteAgentRunnerReader is a Reader for the DeleteAgentRunner structure. +type DeleteAgentRunnerReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteAgentRunnerReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 202: + result := NewDeleteAgentRunnerAccepted() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewDeleteAgentRunnerDefault(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 + } +} + +// NewDeleteAgentRunnerAccepted creates a DeleteAgentRunnerAccepted with default headers values +func NewDeleteAgentRunnerAccepted() *DeleteAgentRunnerAccepted { + return &DeleteAgentRunnerAccepted{} +} + +/* +DeleteAgentRunnerAccepted handles this case with default header values. + +Accepted +*/ +type DeleteAgentRunnerAccepted struct { +} + +func (o *DeleteAgentRunnerAccepted) Error() string { + return fmt.Sprintf("[DELETE /agent_runners/{agent_runner_id}][%d] deleteAgentRunnerAccepted ", 202) +} + +func (o *DeleteAgentRunnerAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteAgentRunnerDefault creates a DeleteAgentRunnerDefault with default headers values +func NewDeleteAgentRunnerDefault(code int) *DeleteAgentRunnerDefault { + return &DeleteAgentRunnerDefault{ + _statusCode: code, + } +} + +/* +DeleteAgentRunnerDefault handles this case with default header values. + +error +*/ +type DeleteAgentRunnerDefault struct { + _statusCode int + + Payload *models.Error +} + +// Code gets the status code for the delete agent runner default response +func (o *DeleteAgentRunnerDefault) Code() int { + return o._statusCode +} + +func (o *DeleteAgentRunnerDefault) Error() string { + return fmt.Sprintf("[DELETE /agent_runners/{agent_runner_id}][%d] deleteAgentRunner default %+v", o._statusCode, o.Payload) +} + +func (o *DeleteAgentRunnerDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *DeleteAgentRunnerDefault) 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/delete_agent_runner_session_parameters.go b/go/plumbing/operations/delete_agent_runner_session_parameters.go new file mode 100644 index 00000000..f84cce87 --- /dev/null +++ b/go/plumbing/operations/delete_agent_runner_session_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" +) + +// NewDeleteAgentRunnerSessionParams creates a new DeleteAgentRunnerSessionParams object +// with the default values initialized. +func NewDeleteAgentRunnerSessionParams() *DeleteAgentRunnerSessionParams { + var () + return &DeleteAgentRunnerSessionParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteAgentRunnerSessionParamsWithTimeout creates a new DeleteAgentRunnerSessionParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteAgentRunnerSessionParamsWithTimeout(timeout time.Duration) *DeleteAgentRunnerSessionParams { + var () + return &DeleteAgentRunnerSessionParams{ + + timeout: timeout, + } +} + +// NewDeleteAgentRunnerSessionParamsWithContext creates a new DeleteAgentRunnerSessionParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteAgentRunnerSessionParamsWithContext(ctx context.Context) *DeleteAgentRunnerSessionParams { + var () + return &DeleteAgentRunnerSessionParams{ + + Context: ctx, + } +} + +// NewDeleteAgentRunnerSessionParamsWithHTTPClient creates a new DeleteAgentRunnerSessionParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteAgentRunnerSessionParamsWithHTTPClient(client *http.Client) *DeleteAgentRunnerSessionParams { + var () + return &DeleteAgentRunnerSessionParams{ + HTTPClient: client, + } +} + +/* +DeleteAgentRunnerSessionParams contains all the parameters to send to the API endpoint +for the delete agent runner session operation typically these are written to a http.Request +*/ +type DeleteAgentRunnerSessionParams struct { + + /*AgentRunnerID*/ + AgentRunnerID string + /*AgentRunnerSessionID*/ + AgentRunnerSessionID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete agent runner session params +func (o *DeleteAgentRunnerSessionParams) WithTimeout(timeout time.Duration) *DeleteAgentRunnerSessionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete agent runner session params +func (o *DeleteAgentRunnerSessionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete agent runner session params +func (o *DeleteAgentRunnerSessionParams) WithContext(ctx context.Context) *DeleteAgentRunnerSessionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete agent runner session params +func (o *DeleteAgentRunnerSessionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete agent runner session params +func (o *DeleteAgentRunnerSessionParams) WithHTTPClient(client *http.Client) *DeleteAgentRunnerSessionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete agent runner session params +func (o *DeleteAgentRunnerSessionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAgentRunnerID adds the agentRunnerID to the delete agent runner session params +func (o *DeleteAgentRunnerSessionParams) WithAgentRunnerID(agentRunnerID string) *DeleteAgentRunnerSessionParams { + o.SetAgentRunnerID(agentRunnerID) + return o +} + +// SetAgentRunnerID adds the agentRunnerId to the delete agent runner session params +func (o *DeleteAgentRunnerSessionParams) SetAgentRunnerID(agentRunnerID string) { + o.AgentRunnerID = agentRunnerID +} + +// WithAgentRunnerSessionID adds the agentRunnerSessionID to the delete agent runner session params +func (o *DeleteAgentRunnerSessionParams) WithAgentRunnerSessionID(agentRunnerSessionID string) *DeleteAgentRunnerSessionParams { + o.SetAgentRunnerSessionID(agentRunnerSessionID) + return o +} + +// SetAgentRunnerSessionID adds the agentRunnerSessionId to the delete agent runner session params +func (o *DeleteAgentRunnerSessionParams) SetAgentRunnerSessionID(agentRunnerSessionID string) { + o.AgentRunnerSessionID = agentRunnerSessionID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteAgentRunnerSessionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param agent_runner_id + if err := r.SetPathParam("agent_runner_id", o.AgentRunnerID); err != nil { + return err + } + + // path param agent_runner_session_id + if err := r.SetPathParam("agent_runner_session_id", o.AgentRunnerSessionID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/plumbing/operations/delete_agent_runner_session_responses.go b/go/plumbing/operations/delete_agent_runner_session_responses.go new file mode 100644 index 00000000..375f3072 --- /dev/null +++ b/go/plumbing/operations/delete_agent_runner_session_responses.go @@ -0,0 +1,107 @@ +// 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" + "github.com/go-openapi/strfmt" + + "github.com/netlify/open-api/v2/go/models" +) + +// DeleteAgentRunnerSessionReader is a Reader for the DeleteAgentRunnerSession structure. +type DeleteAgentRunnerSessionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteAgentRunnerSessionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 202: + result := NewDeleteAgentRunnerSessionAccepted() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewDeleteAgentRunnerSessionDefault(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 + } +} + +// NewDeleteAgentRunnerSessionAccepted creates a DeleteAgentRunnerSessionAccepted with default headers values +func NewDeleteAgentRunnerSessionAccepted() *DeleteAgentRunnerSessionAccepted { + return &DeleteAgentRunnerSessionAccepted{} +} + +/* +DeleteAgentRunnerSessionAccepted handles this case with default header values. + +Accepted +*/ +type DeleteAgentRunnerSessionAccepted struct { +} + +func (o *DeleteAgentRunnerSessionAccepted) Error() string { + return fmt.Sprintf("[DELETE /agent_runners/{agent_runner_id}/sessions/{agent_runner_session_id}][%d] deleteAgentRunnerSessionAccepted ", 202) +} + +func (o *DeleteAgentRunnerSessionAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteAgentRunnerSessionDefault creates a DeleteAgentRunnerSessionDefault with default headers values +func NewDeleteAgentRunnerSessionDefault(code int) *DeleteAgentRunnerSessionDefault { + return &DeleteAgentRunnerSessionDefault{ + _statusCode: code, + } +} + +/* +DeleteAgentRunnerSessionDefault handles this case with default header values. + +error +*/ +type DeleteAgentRunnerSessionDefault struct { + _statusCode int + + Payload *models.Error +} + +// Code gets the status code for the delete agent runner session default response +func (o *DeleteAgentRunnerSessionDefault) Code() int { + return o._statusCode +} + +func (o *DeleteAgentRunnerSessionDefault) Error() string { + return fmt.Sprintf("[DELETE /agent_runners/{agent_runner_id}/sessions/{agent_runner_session_id}][%d] deleteAgentRunnerSession default %+v", o._statusCode, o.Payload) +} + +func (o *DeleteAgentRunnerSessionDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *DeleteAgentRunnerSessionDefault) 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_agent_runner_parameters.go b/go/plumbing/operations/get_agent_runner_parameters.go new file mode 100644 index 00000000..dff92484 --- /dev/null +++ b/go/plumbing/operations/get_agent_runner_parameters.go @@ -0,0 +1,133 @@ +// 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" +) + +// NewGetAgentRunnerParams creates a new GetAgentRunnerParams object +// with the default values initialized. +func NewGetAgentRunnerParams() *GetAgentRunnerParams { + var () + return &GetAgentRunnerParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetAgentRunnerParamsWithTimeout creates a new GetAgentRunnerParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetAgentRunnerParamsWithTimeout(timeout time.Duration) *GetAgentRunnerParams { + var () + return &GetAgentRunnerParams{ + + timeout: timeout, + } +} + +// NewGetAgentRunnerParamsWithContext creates a new GetAgentRunnerParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetAgentRunnerParamsWithContext(ctx context.Context) *GetAgentRunnerParams { + var () + return &GetAgentRunnerParams{ + + Context: ctx, + } +} + +// NewGetAgentRunnerParamsWithHTTPClient creates a new GetAgentRunnerParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetAgentRunnerParamsWithHTTPClient(client *http.Client) *GetAgentRunnerParams { + var () + return &GetAgentRunnerParams{ + HTTPClient: client, + } +} + +/* +GetAgentRunnerParams contains all the parameters to send to the API endpoint +for the get agent runner operation typically these are written to a http.Request +*/ +type GetAgentRunnerParams struct { + + /*AgentRunnerID*/ + AgentRunnerID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get agent runner params +func (o *GetAgentRunnerParams) WithTimeout(timeout time.Duration) *GetAgentRunnerParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get agent runner params +func (o *GetAgentRunnerParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get agent runner params +func (o *GetAgentRunnerParams) WithContext(ctx context.Context) *GetAgentRunnerParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get agent runner params +func (o *GetAgentRunnerParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get agent runner params +func (o *GetAgentRunnerParams) WithHTTPClient(client *http.Client) *GetAgentRunnerParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get agent runner params +func (o *GetAgentRunnerParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAgentRunnerID adds the agentRunnerID to the get agent runner params +func (o *GetAgentRunnerParams) WithAgentRunnerID(agentRunnerID string) *GetAgentRunnerParams { + o.SetAgentRunnerID(agentRunnerID) + return o +} + +// SetAgentRunnerID adds the agentRunnerId to the get agent runner params +func (o *GetAgentRunnerParams) SetAgentRunnerID(agentRunnerID string) { + o.AgentRunnerID = agentRunnerID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAgentRunnerParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param agent_runner_id + if err := r.SetPathParam("agent_runner_id", o.AgentRunnerID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/plumbing/operations/get_agent_runner_responses.go b/go/plumbing/operations/get_agent_runner_responses.go new file mode 100644 index 00000000..4f904ea4 --- /dev/null +++ b/go/plumbing/operations/get_agent_runner_responses.go @@ -0,0 +1,119 @@ +// 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" + "github.com/go-openapi/strfmt" + + "github.com/netlify/open-api/v2/go/models" +) + +// GetAgentRunnerReader is a Reader for the GetAgentRunner structure. +type GetAgentRunnerReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAgentRunnerReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAgentRunnerOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetAgentRunnerDefault(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 + } +} + +// NewGetAgentRunnerOK creates a GetAgentRunnerOK with default headers values +func NewGetAgentRunnerOK() *GetAgentRunnerOK { + return &GetAgentRunnerOK{} +} + +/* +GetAgentRunnerOK handles this case with default header values. + +OK +*/ +type GetAgentRunnerOK struct { + Payload *models.AgentRunner +} + +func (o *GetAgentRunnerOK) Error() string { + return fmt.Sprintf("[GET /agent_runners/{agent_runner_id}][%d] getAgentRunnerOK %+v", 200, o.Payload) +} + +func (o *GetAgentRunnerOK) GetPayload() *models.AgentRunner { + return o.Payload +} + +func (o *GetAgentRunnerOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AgentRunner) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAgentRunnerDefault creates a GetAgentRunnerDefault with default headers values +func NewGetAgentRunnerDefault(code int) *GetAgentRunnerDefault { + return &GetAgentRunnerDefault{ + _statusCode: code, + } +} + +/* +GetAgentRunnerDefault handles this case with default header values. + +error +*/ +type GetAgentRunnerDefault struct { + _statusCode int + + Payload *models.Error +} + +// Code gets the status code for the get agent runner default response +func (o *GetAgentRunnerDefault) Code() int { + return o._statusCode +} + +func (o *GetAgentRunnerDefault) Error() string { + return fmt.Sprintf("[GET /agent_runners/{agent_runner_id}][%d] getAgentRunner default %+v", o._statusCode, o.Payload) +} + +func (o *GetAgentRunnerDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *GetAgentRunnerDefault) 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_agent_runner_session_parameters.go b/go/plumbing/operations/get_agent_runner_session_parameters.go new file mode 100644 index 00000000..3e990320 --- /dev/null +++ b/go/plumbing/operations/get_agent_runner_session_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" +) + +// NewGetAgentRunnerSessionParams creates a new GetAgentRunnerSessionParams object +// with the default values initialized. +func NewGetAgentRunnerSessionParams() *GetAgentRunnerSessionParams { + var () + return &GetAgentRunnerSessionParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetAgentRunnerSessionParamsWithTimeout creates a new GetAgentRunnerSessionParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetAgentRunnerSessionParamsWithTimeout(timeout time.Duration) *GetAgentRunnerSessionParams { + var () + return &GetAgentRunnerSessionParams{ + + timeout: timeout, + } +} + +// NewGetAgentRunnerSessionParamsWithContext creates a new GetAgentRunnerSessionParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetAgentRunnerSessionParamsWithContext(ctx context.Context) *GetAgentRunnerSessionParams { + var () + return &GetAgentRunnerSessionParams{ + + Context: ctx, + } +} + +// NewGetAgentRunnerSessionParamsWithHTTPClient creates a new GetAgentRunnerSessionParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetAgentRunnerSessionParamsWithHTTPClient(client *http.Client) *GetAgentRunnerSessionParams { + var () + return &GetAgentRunnerSessionParams{ + HTTPClient: client, + } +} + +/* +GetAgentRunnerSessionParams contains all the parameters to send to the API endpoint +for the get agent runner session operation typically these are written to a http.Request +*/ +type GetAgentRunnerSessionParams struct { + + /*AgentRunnerID*/ + AgentRunnerID string + /*AgentRunnerSessionID*/ + AgentRunnerSessionID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get agent runner session params +func (o *GetAgentRunnerSessionParams) WithTimeout(timeout time.Duration) *GetAgentRunnerSessionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get agent runner session params +func (o *GetAgentRunnerSessionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get agent runner session params +func (o *GetAgentRunnerSessionParams) WithContext(ctx context.Context) *GetAgentRunnerSessionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get agent runner session params +func (o *GetAgentRunnerSessionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get agent runner session params +func (o *GetAgentRunnerSessionParams) WithHTTPClient(client *http.Client) *GetAgentRunnerSessionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get agent runner session params +func (o *GetAgentRunnerSessionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAgentRunnerID adds the agentRunnerID to the get agent runner session params +func (o *GetAgentRunnerSessionParams) WithAgentRunnerID(agentRunnerID string) *GetAgentRunnerSessionParams { + o.SetAgentRunnerID(agentRunnerID) + return o +} + +// SetAgentRunnerID adds the agentRunnerId to the get agent runner session params +func (o *GetAgentRunnerSessionParams) SetAgentRunnerID(agentRunnerID string) { + o.AgentRunnerID = agentRunnerID +} + +// WithAgentRunnerSessionID adds the agentRunnerSessionID to the get agent runner session params +func (o *GetAgentRunnerSessionParams) WithAgentRunnerSessionID(agentRunnerSessionID string) *GetAgentRunnerSessionParams { + o.SetAgentRunnerSessionID(agentRunnerSessionID) + return o +} + +// SetAgentRunnerSessionID adds the agentRunnerSessionId to the get agent runner session params +func (o *GetAgentRunnerSessionParams) SetAgentRunnerSessionID(agentRunnerSessionID string) { + o.AgentRunnerSessionID = agentRunnerSessionID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAgentRunnerSessionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param agent_runner_id + if err := r.SetPathParam("agent_runner_id", o.AgentRunnerID); err != nil { + return err + } + + // path param agent_runner_session_id + if err := r.SetPathParam("agent_runner_session_id", o.AgentRunnerSessionID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/plumbing/operations/get_agent_runner_session_responses.go b/go/plumbing/operations/get_agent_runner_session_responses.go new file mode 100644 index 00000000..3d80b5ae --- /dev/null +++ b/go/plumbing/operations/get_agent_runner_session_responses.go @@ -0,0 +1,119 @@ +// 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" + "github.com/go-openapi/strfmt" + + "github.com/netlify/open-api/v2/go/models" +) + +// GetAgentRunnerSessionReader is a Reader for the GetAgentRunnerSession structure. +type GetAgentRunnerSessionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAgentRunnerSessionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAgentRunnerSessionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetAgentRunnerSessionDefault(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 + } +} + +// NewGetAgentRunnerSessionOK creates a GetAgentRunnerSessionOK with default headers values +func NewGetAgentRunnerSessionOK() *GetAgentRunnerSessionOK { + return &GetAgentRunnerSessionOK{} +} + +/* +GetAgentRunnerSessionOK handles this case with default header values. + +OK +*/ +type GetAgentRunnerSessionOK struct { + Payload *models.AgentRunnerSession +} + +func (o *GetAgentRunnerSessionOK) Error() string { + return fmt.Sprintf("[GET /agent_runners/{agent_runner_id}/sessions/{agent_runner_session_id}][%d] getAgentRunnerSessionOK %+v", 200, o.Payload) +} + +func (o *GetAgentRunnerSessionOK) GetPayload() *models.AgentRunnerSession { + return o.Payload +} + +func (o *GetAgentRunnerSessionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AgentRunnerSession) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAgentRunnerSessionDefault creates a GetAgentRunnerSessionDefault with default headers values +func NewGetAgentRunnerSessionDefault(code int) *GetAgentRunnerSessionDefault { + return &GetAgentRunnerSessionDefault{ + _statusCode: code, + } +} + +/* +GetAgentRunnerSessionDefault handles this case with default header values. + +error +*/ +type GetAgentRunnerSessionDefault struct { + _statusCode int + + Payload *models.Error +} + +// Code gets the status code for the get agent runner session default response +func (o *GetAgentRunnerSessionDefault) Code() int { + return o._statusCode +} + +func (o *GetAgentRunnerSessionDefault) Error() string { + return fmt.Sprintf("[GET /agent_runners/{agent_runner_id}/sessions/{agent_runner_session_id}][%d] getAgentRunnerSession default %+v", o._statusCode, o.Payload) +} + +func (o *GetAgentRunnerSessionDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *GetAgentRunnerSessionDefault) 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_agent_runner_sessions_parameters.go b/go/plumbing/operations/list_agent_runner_sessions_parameters.go new file mode 100644 index 00000000..64a5adc0 --- /dev/null +++ b/go/plumbing/operations/list_agent_runner_sessions_parameters.go @@ -0,0 +1,308 @@ +// 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" + "github.com/go-openapi/swag" +) + +// NewListAgentRunnerSessionsParams creates a new ListAgentRunnerSessionsParams object +// with the default values initialized. +func NewListAgentRunnerSessionsParams() *ListAgentRunnerSessionsParams { + var () + return &ListAgentRunnerSessionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewListAgentRunnerSessionsParamsWithTimeout creates a new ListAgentRunnerSessionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewListAgentRunnerSessionsParamsWithTimeout(timeout time.Duration) *ListAgentRunnerSessionsParams { + var () + return &ListAgentRunnerSessionsParams{ + + timeout: timeout, + } +} + +// NewListAgentRunnerSessionsParamsWithContext creates a new ListAgentRunnerSessionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewListAgentRunnerSessionsParamsWithContext(ctx context.Context) *ListAgentRunnerSessionsParams { + var () + return &ListAgentRunnerSessionsParams{ + + Context: ctx, + } +} + +// NewListAgentRunnerSessionsParamsWithHTTPClient creates a new ListAgentRunnerSessionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewListAgentRunnerSessionsParamsWithHTTPClient(client *http.Client) *ListAgentRunnerSessionsParams { + var () + return &ListAgentRunnerSessionsParams{ + HTTPClient: client, + } +} + +/* +ListAgentRunnerSessionsParams contains all the parameters to send to the API endpoint +for the list agent runner sessions operation typically these are written to a http.Request +*/ +type ListAgentRunnerSessionsParams struct { + + /*AgentRunnerID*/ + AgentRunnerID string + /*From*/ + From *int64 + /*OrderBy*/ + OrderBy *string + /*Page*/ + Page *int32 + /*PerPage*/ + PerPage *int32 + /*State*/ + State *string + /*To*/ + To *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the list agent runner sessions params +func (o *ListAgentRunnerSessionsParams) WithTimeout(timeout time.Duration) *ListAgentRunnerSessionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list agent runner sessions params +func (o *ListAgentRunnerSessionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list agent runner sessions params +func (o *ListAgentRunnerSessionsParams) WithContext(ctx context.Context) *ListAgentRunnerSessionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list agent runner sessions params +func (o *ListAgentRunnerSessionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list agent runner sessions params +func (o *ListAgentRunnerSessionsParams) WithHTTPClient(client *http.Client) *ListAgentRunnerSessionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list agent runner sessions params +func (o *ListAgentRunnerSessionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAgentRunnerID adds the agentRunnerID to the list agent runner sessions params +func (o *ListAgentRunnerSessionsParams) WithAgentRunnerID(agentRunnerID string) *ListAgentRunnerSessionsParams { + o.SetAgentRunnerID(agentRunnerID) + return o +} + +// SetAgentRunnerID adds the agentRunnerId to the list agent runner sessions params +func (o *ListAgentRunnerSessionsParams) SetAgentRunnerID(agentRunnerID string) { + o.AgentRunnerID = agentRunnerID +} + +// WithFrom adds the from to the list agent runner sessions params +func (o *ListAgentRunnerSessionsParams) WithFrom(from *int64) *ListAgentRunnerSessionsParams { + o.SetFrom(from) + return o +} + +// SetFrom adds the from to the list agent runner sessions params +func (o *ListAgentRunnerSessionsParams) SetFrom(from *int64) { + o.From = from +} + +// WithOrderBy adds the orderBy to the list agent runner sessions params +func (o *ListAgentRunnerSessionsParams) WithOrderBy(orderBy *string) *ListAgentRunnerSessionsParams { + o.SetOrderBy(orderBy) + return o +} + +// SetOrderBy adds the orderBy to the list agent runner sessions params +func (o *ListAgentRunnerSessionsParams) SetOrderBy(orderBy *string) { + o.OrderBy = orderBy +} + +// WithPage adds the page to the list agent runner sessions params +func (o *ListAgentRunnerSessionsParams) WithPage(page *int32) *ListAgentRunnerSessionsParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list agent runner sessions params +func (o *ListAgentRunnerSessionsParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list agent runner sessions params +func (o *ListAgentRunnerSessionsParams) WithPerPage(perPage *int32) *ListAgentRunnerSessionsParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list agent runner sessions params +func (o *ListAgentRunnerSessionsParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WithState adds the state to the list agent runner sessions params +func (o *ListAgentRunnerSessionsParams) WithState(state *string) *ListAgentRunnerSessionsParams { + o.SetState(state) + return o +} + +// SetState adds the state to the list agent runner sessions params +func (o *ListAgentRunnerSessionsParams) SetState(state *string) { + o.State = state +} + +// WithTo adds the to to the list agent runner sessions params +func (o *ListAgentRunnerSessionsParams) WithTo(to *int64) *ListAgentRunnerSessionsParams { + o.SetTo(to) + return o +} + +// SetTo adds the to to the list agent runner sessions params +func (o *ListAgentRunnerSessionsParams) SetTo(to *int64) { + o.To = to +} + +// WriteToRequest writes these params to a swagger request +func (o *ListAgentRunnerSessionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param agent_runner_id + if err := r.SetPathParam("agent_runner_id", o.AgentRunnerID); err != nil { + return err + } + + if o.From != nil { + + // query param from + var qrFrom int64 + if o.From != nil { + qrFrom = *o.From + } + qFrom := swag.FormatInt64(qrFrom) + if qFrom != "" { + if err := r.SetQueryParam("from", qFrom); err != nil { + return err + } + } + + } + + if o.OrderBy != nil { + + // query param order_by + var qrOrderBy string + if o.OrderBy != nil { + qrOrderBy = *o.OrderBy + } + qOrderBy := qrOrderBy + if qOrderBy != "" { + if err := r.SetQueryParam("order_by", qOrderBy); err != nil { + return err + } + } + + } + + if o.Page != nil { + + // query param page + var qrPage int32 + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + + } + + if o.State != nil { + + // query param state + var qrState string + if o.State != nil { + qrState = *o.State + } + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + } + + if o.To != nil { + + // query param to + var qrTo int64 + if o.To != nil { + qrTo = *o.To + } + qTo := swag.FormatInt64(qrTo) + if qTo != "" { + if err := r.SetQueryParam("to", qTo); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/plumbing/operations/list_agent_runner_sessions_responses.go b/go/plumbing/operations/list_agent_runner_sessions_responses.go new file mode 100644 index 00000000..50bfa1b8 --- /dev/null +++ b/go/plumbing/operations/list_agent_runner_sessions_responses.go @@ -0,0 +1,117 @@ +// 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" + "github.com/go-openapi/strfmt" + + "github.com/netlify/open-api/v2/go/models" +) + +// ListAgentRunnerSessionsReader is a Reader for the ListAgentRunnerSessions structure. +type ListAgentRunnerSessionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListAgentRunnerSessionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListAgentRunnerSessionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewListAgentRunnerSessionsDefault(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 + } +} + +// NewListAgentRunnerSessionsOK creates a ListAgentRunnerSessionsOK with default headers values +func NewListAgentRunnerSessionsOK() *ListAgentRunnerSessionsOK { + return &ListAgentRunnerSessionsOK{} +} + +/* +ListAgentRunnerSessionsOK handles this case with default header values. + +OK +*/ +type ListAgentRunnerSessionsOK struct { + Payload []*models.AgentRunnerSession +} + +func (o *ListAgentRunnerSessionsOK) Error() string { + return fmt.Sprintf("[GET /agent_runners/{agent_runner_id}/sessions][%d] listAgentRunnerSessionsOK %+v", 200, o.Payload) +} + +func (o *ListAgentRunnerSessionsOK) GetPayload() []*models.AgentRunnerSession { + return o.Payload +} + +func (o *ListAgentRunnerSessionsOK) 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 +} + +// NewListAgentRunnerSessionsDefault creates a ListAgentRunnerSessionsDefault with default headers values +func NewListAgentRunnerSessionsDefault(code int) *ListAgentRunnerSessionsDefault { + return &ListAgentRunnerSessionsDefault{ + _statusCode: code, + } +} + +/* +ListAgentRunnerSessionsDefault handles this case with default header values. + +error +*/ +type ListAgentRunnerSessionsDefault struct { + _statusCode int + + Payload *models.Error +} + +// Code gets the status code for the list agent runner sessions default response +func (o *ListAgentRunnerSessionsDefault) Code() int { + return o._statusCode +} + +func (o *ListAgentRunnerSessionsDefault) Error() string { + return fmt.Sprintf("[GET /agent_runners/{agent_runner_id}/sessions][%d] listAgentRunnerSessions default %+v", o._statusCode, o.Payload) +} + +func (o *ListAgentRunnerSessionsDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *ListAgentRunnerSessionsDefault) 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_agent_runners_parameters.go b/go/plumbing/operations/list_agent_runners_parameters.go new file mode 100644 index 00000000..d4ae51ae --- /dev/null +++ b/go/plumbing/operations/list_agent_runners_parameters.go @@ -0,0 +1,392 @@ +// 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" + "github.com/go-openapi/swag" +) + +// NewListAgentRunnersParams creates a new ListAgentRunnersParams object +// with the default values initialized. +func NewListAgentRunnersParams() *ListAgentRunnersParams { + var () + return &ListAgentRunnersParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewListAgentRunnersParamsWithTimeout creates a new ListAgentRunnersParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewListAgentRunnersParamsWithTimeout(timeout time.Duration) *ListAgentRunnersParams { + var () + return &ListAgentRunnersParams{ + + timeout: timeout, + } +} + +// NewListAgentRunnersParamsWithContext creates a new ListAgentRunnersParams object +// with the default values initialized, and the ability to set a context for a request +func NewListAgentRunnersParamsWithContext(ctx context.Context) *ListAgentRunnersParams { + var () + return &ListAgentRunnersParams{ + + Context: ctx, + } +} + +// NewListAgentRunnersParamsWithHTTPClient creates a new ListAgentRunnersParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewListAgentRunnersParamsWithHTTPClient(client *http.Client) *ListAgentRunnersParams { + var () + return &ListAgentRunnersParams{ + HTTPClient: client, + } +} + +/* +ListAgentRunnersParams contains all the parameters to send to the API endpoint +for the list agent runners operation typically these are written to a http.Request +*/ +type ListAgentRunnersParams struct { + + /*AccountID*/ + AccountID string + /*Branch*/ + Branch *string + /*From*/ + From *int64 + /*Page*/ + Page *int32 + /*PerPage*/ + PerPage *int32 + /*ResultBranch*/ + ResultBranch *string + /*SiteID*/ + SiteID string + /*State*/ + State *string + /*Title*/ + Title *string + /*To*/ + To *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the list agent runners params +func (o *ListAgentRunnersParams) WithTimeout(timeout time.Duration) *ListAgentRunnersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list agent runners params +func (o *ListAgentRunnersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list agent runners params +func (o *ListAgentRunnersParams) WithContext(ctx context.Context) *ListAgentRunnersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list agent runners params +func (o *ListAgentRunnersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list agent runners params +func (o *ListAgentRunnersParams) WithHTTPClient(client *http.Client) *ListAgentRunnersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list agent runners params +func (o *ListAgentRunnersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the list agent runners params +func (o *ListAgentRunnersParams) WithAccountID(accountID string) *ListAgentRunnersParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the list agent runners params +func (o *ListAgentRunnersParams) SetAccountID(accountID string) { + o.AccountID = accountID +} + +// WithBranch adds the branch to the list agent runners params +func (o *ListAgentRunnersParams) WithBranch(branch *string) *ListAgentRunnersParams { + o.SetBranch(branch) + return o +} + +// SetBranch adds the branch to the list agent runners params +func (o *ListAgentRunnersParams) SetBranch(branch *string) { + o.Branch = branch +} + +// WithFrom adds the from to the list agent runners params +func (o *ListAgentRunnersParams) WithFrom(from *int64) *ListAgentRunnersParams { + o.SetFrom(from) + return o +} + +// SetFrom adds the from to the list agent runners params +func (o *ListAgentRunnersParams) SetFrom(from *int64) { + o.From = from +} + +// WithPage adds the page to the list agent runners params +func (o *ListAgentRunnersParams) WithPage(page *int32) *ListAgentRunnersParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list agent runners params +func (o *ListAgentRunnersParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list agent runners params +func (o *ListAgentRunnersParams) WithPerPage(perPage *int32) *ListAgentRunnersParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list agent runners params +func (o *ListAgentRunnersParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WithResultBranch adds the resultBranch to the list agent runners params +func (o *ListAgentRunnersParams) WithResultBranch(resultBranch *string) *ListAgentRunnersParams { + o.SetResultBranch(resultBranch) + return o +} + +// SetResultBranch adds the resultBranch to the list agent runners params +func (o *ListAgentRunnersParams) SetResultBranch(resultBranch *string) { + o.ResultBranch = resultBranch +} + +// WithSiteID adds the siteID to the list agent runners params +func (o *ListAgentRunnersParams) WithSiteID(siteID string) *ListAgentRunnersParams { + o.SetSiteID(siteID) + return o +} + +// SetSiteID adds the siteId to the list agent runners params +func (o *ListAgentRunnersParams) SetSiteID(siteID string) { + o.SiteID = siteID +} + +// WithState adds the state to the list agent runners params +func (o *ListAgentRunnersParams) WithState(state *string) *ListAgentRunnersParams { + o.SetState(state) + return o +} + +// SetState adds the state to the list agent runners params +func (o *ListAgentRunnersParams) SetState(state *string) { + o.State = state +} + +// WithTitle adds the title to the list agent runners params +func (o *ListAgentRunnersParams) WithTitle(title *string) *ListAgentRunnersParams { + o.SetTitle(title) + return o +} + +// SetTitle adds the title to the list agent runners params +func (o *ListAgentRunnersParams) SetTitle(title *string) { + o.Title = title +} + +// WithTo adds the to to the list agent runners params +func (o *ListAgentRunnersParams) WithTo(to *int64) *ListAgentRunnersParams { + o.SetTo(to) + return o +} + +// SetTo adds the to to the list agent runners params +func (o *ListAgentRunnersParams) SetTo(to *int64) { + o.To = to +} + +// WriteToRequest writes these params to a swagger request +func (o *ListAgentRunnersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param account_id + qrAccountID := o.AccountID + qAccountID := qrAccountID + if qAccountID != "" { + if err := r.SetQueryParam("account_id", qAccountID); err != nil { + return err + } + } + + if o.Branch != nil { + + // query param branch + var qrBranch string + if o.Branch != nil { + qrBranch = *o.Branch + } + qBranch := qrBranch + if qBranch != "" { + if err := r.SetQueryParam("branch", qBranch); err != nil { + return err + } + } + + } + + if o.From != nil { + + // query param from + var qrFrom int64 + if o.From != nil { + qrFrom = *o.From + } + qFrom := swag.FormatInt64(qrFrom) + if qFrom != "" { + if err := r.SetQueryParam("from", qFrom); err != nil { + return err + } + } + + } + + if o.Page != nil { + + // query param page + var qrPage int32 + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + + } + + if o.ResultBranch != nil { + + // query param result_branch + var qrResultBranch string + if o.ResultBranch != nil { + qrResultBranch = *o.ResultBranch + } + qResultBranch := qrResultBranch + if qResultBranch != "" { + if err := r.SetQueryParam("result_branch", qResultBranch); err != nil { + return err + } + } + + } + + // query param site_id + qrSiteID := o.SiteID + qSiteID := qrSiteID + if qSiteID != "" { + if err := r.SetQueryParam("site_id", qSiteID); err != nil { + return err + } + } + + if o.State != nil { + + // query param state + var qrState string + if o.State != nil { + qrState = *o.State + } + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + } + + if o.Title != nil { + + // query param title + var qrTitle string + if o.Title != nil { + qrTitle = *o.Title + } + qTitle := qrTitle + if qTitle != "" { + if err := r.SetQueryParam("title", qTitle); err != nil { + return err + } + } + + } + + if o.To != nil { + + // query param to + var qrTo int64 + if o.To != nil { + qrTo = *o.To + } + qTo := swag.FormatInt64(qrTo) + if qTo != "" { + if err := r.SetQueryParam("to", qTo); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/plumbing/operations/list_agent_runners_responses.go b/go/plumbing/operations/list_agent_runners_responses.go new file mode 100644 index 00000000..d0ec2cc9 --- /dev/null +++ b/go/plumbing/operations/list_agent_runners_responses.go @@ -0,0 +1,117 @@ +// 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" + "github.com/go-openapi/strfmt" + + "github.com/netlify/open-api/v2/go/models" +) + +// ListAgentRunnersReader is a Reader for the ListAgentRunners structure. +type ListAgentRunnersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListAgentRunnersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListAgentRunnersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewListAgentRunnersDefault(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 + } +} + +// NewListAgentRunnersOK creates a ListAgentRunnersOK with default headers values +func NewListAgentRunnersOK() *ListAgentRunnersOK { + return &ListAgentRunnersOK{} +} + +/* +ListAgentRunnersOK handles this case with default header values. + +OK +*/ +type ListAgentRunnersOK struct { + Payload []*models.AgentRunner +} + +func (o *ListAgentRunnersOK) Error() string { + return fmt.Sprintf("[GET /agent_runners][%d] listAgentRunnersOK %+v", 200, o.Payload) +} + +func (o *ListAgentRunnersOK) GetPayload() []*models.AgentRunner { + return o.Payload +} + +func (o *ListAgentRunnersOK) 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 +} + +// NewListAgentRunnersDefault creates a ListAgentRunnersDefault with default headers values +func NewListAgentRunnersDefault(code int) *ListAgentRunnersDefault { + return &ListAgentRunnersDefault{ + _statusCode: code, + } +} + +/* +ListAgentRunnersDefault handles this case with default header values. + +error +*/ +type ListAgentRunnersDefault struct { + _statusCode int + + Payload *models.Error +} + +// Code gets the status code for the list agent runners default response +func (o *ListAgentRunnersDefault) Code() int { + return o._statusCode +} + +func (o *ListAgentRunnersDefault) Error() string { + return fmt.Sprintf("[GET /agent_runners][%d] listAgentRunners default %+v", o._statusCode, o.Payload) +} + +func (o *ListAgentRunnersDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *ListAgentRunnersDefault) 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 8685a2c7..fd208aab 100644 --- a/go/plumbing/operations/operations_client.go +++ b/go/plumbing/operations/operations_client.go @@ -31,6 +31,12 @@ type ClientService interface { AddMemberToAccount(params *AddMemberToAccountParams, authInfo runtime.ClientAuthInfoWriter) (*AddMemberToAccountOK, error) + AgentRunnerCommitToBranch(params *AgentRunnerCommitToBranchParams, authInfo runtime.ClientAuthInfoWriter) (*AgentRunnerCommitToBranchOK, error) + + AgentRunnerPullRequest(params *AgentRunnerPullRequestParams, authInfo runtime.ClientAuthInfoWriter) (*AgentRunnerPullRequestOK, error) + + ArchiveAgentRunner(params *ArchiveAgentRunnerParams, authInfo runtime.ClientAuthInfoWriter) (*ArchiveAgentRunnerAccepted, error) + CancelAccount(params *CancelAccountParams, authInfo runtime.ClientAuthInfoWriter) (*CancelAccountNoContent, error) CancelSiteDeploy(params *CancelSiteDeployParams, authInfo runtime.ClientAuthInfoWriter) (*CancelSiteDeployCreated, error) @@ -39,6 +45,12 @@ type ClientService interface { CreateAccount(params *CreateAccountParams, authInfo runtime.ClientAuthInfoWriter) (*CreateAccountCreated, error) + CreateAgentRunner(params *CreateAgentRunnerParams, authInfo runtime.ClientAuthInfoWriter) (*CreateAgentRunnerOK, error) + + CreateAgentRunnerSession(params *CreateAgentRunnerSessionParams, authInfo runtime.ClientAuthInfoWriter) (*CreateAgentRunnerSessionOK, error) + + CreateAgentRunnerUploadURL(params *CreateAgentRunnerUploadURLParams, authInfo runtime.ClientAuthInfoWriter) (*CreateAgentRunnerUploadURLOK, error) + CreateDeployKey(params *CreateDeployKeyParams, authInfo runtime.ClientAuthInfoWriter) (*CreateDeployKeyCreated, error) CreateDNSRecord(params *CreateDNSRecordParams, authInfo runtime.ClientAuthInfoWriter) (*CreateDNSRecordCreated, error) @@ -75,6 +87,10 @@ type ClientService interface { CreateTicket(params *CreateTicketParams, authInfo runtime.ClientAuthInfoWriter) (*CreateTicketCreated, error) + DeleteAgentRunner(params *DeleteAgentRunnerParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteAgentRunnerAccepted, error) + + DeleteAgentRunnerSession(params *DeleteAgentRunnerSessionParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteAgentRunnerSessionAccepted, error) + DeleteDeploy(params *DeleteDeployParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteDeployNoContent, error) DeleteDeployKey(params *DeleteDeployKeyParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteDeployKeyNoContent, error) @@ -123,6 +139,10 @@ type ClientService interface { GetAccountMember(params *GetAccountMemberParams, authInfo runtime.ClientAuthInfoWriter) (*GetAccountMemberOK, error) + GetAgentRunner(params *GetAgentRunnerParams, authInfo runtime.ClientAuthInfoWriter) (*GetAgentRunnerOK, error) + + GetAgentRunnerSession(params *GetAgentRunnerSessionParams, authInfo runtime.ClientAuthInfoWriter) (*GetAgentRunnerSessionOK, error) + GetAllCertificates(params *GetAllCertificatesParams, authInfo runtime.ClientAuthInfoWriter) (*GetAllCertificatesOK, error) GetCurrentUser(params *GetCurrentUserParams, authInfo runtime.ClientAuthInfoWriter) (*GetCurrentUserOK, error) @@ -185,6 +205,10 @@ type ClientService interface { ListAccountsForUser(params *ListAccountsForUserParams, authInfo runtime.ClientAuthInfoWriter) (*ListAccountsForUserOK, error) + ListAgentRunnerSessions(params *ListAgentRunnerSessionsParams, authInfo runtime.ClientAuthInfoWriter) (*ListAgentRunnerSessionsOK, error) + + ListAgentRunners(params *ListAgentRunnersParams, authInfo runtime.ClientAuthInfoWriter) (*ListAgentRunnersOK, error) + ListDeployKeys(params *ListDeployKeysParams, authInfo runtime.ClientAuthInfoWriter) (*ListDeployKeysOK, error) ListFormSubmission(params *ListFormSubmissionParams, authInfo runtime.ClientAuthInfoWriter) (*ListFormSubmissionOK, error) @@ -267,6 +291,10 @@ type ClientService interface { UpdateAccountMember(params *UpdateAccountMemberParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateAccountMemberOK, error) + UpdateAgentRunner(params *UpdateAgentRunnerParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateAgentRunnerOK, error) + + UpdateAgentRunnerSession(params *UpdateAgentRunnerSessionParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateAgentRunnerSessionOK, error) + UpdateDeployValidations(params *UpdateDeployValidationsParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateDeployValidationsOK, error) UpdateEnvVar(params *UpdateEnvVarParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateEnvVarOK, error) @@ -371,6 +399,108 @@ func (a *Client) AddMemberToAccount(params *AddMemberToAccountParams, authInfo r return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +AgentRunnerCommitToBranch agent runner commit to branch API +*/ +func (a *Client) AgentRunnerCommitToBranch(params *AgentRunnerCommitToBranchParams, authInfo runtime.ClientAuthInfoWriter) (*AgentRunnerCommitToBranchOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewAgentRunnerCommitToBranchParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "agentRunnerCommitToBranch", + Method: "POST", + PathPattern: "/agent_runners/{agent_runner_id}/commit", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &AgentRunnerCommitToBranchReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*AgentRunnerCommitToBranchOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*AgentRunnerCommitToBranchDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +AgentRunnerPullRequest agent runner pull request API +*/ +func (a *Client) AgentRunnerPullRequest(params *AgentRunnerPullRequestParams, authInfo runtime.ClientAuthInfoWriter) (*AgentRunnerPullRequestOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewAgentRunnerPullRequestParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "agentRunnerPullRequest", + Method: "POST", + PathPattern: "/agent_runners/{agent_runner_id}/pull_request", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &AgentRunnerPullRequestReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*AgentRunnerPullRequestOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*AgentRunnerPullRequestDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ArchiveAgentRunner archive agent runner API +*/ +func (a *Client) ArchiveAgentRunner(params *ArchiveAgentRunnerParams, authInfo runtime.ClientAuthInfoWriter) (*ArchiveAgentRunnerAccepted, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewArchiveAgentRunnerParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "archiveAgentRunner", + Method: "POST", + PathPattern: "/agent_runners/{agent_runner_id}/archive", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ArchiveAgentRunnerReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ArchiveAgentRunnerAccepted) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ArchiveAgentRunnerDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* CancelAccount cancel account API */ @@ -507,6 +637,108 @@ func (a *Client) CreateAccount(params *CreateAccountParams, authInfo runtime.Cli return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +CreateAgentRunner create agent runner API +*/ +func (a *Client) CreateAgentRunner(params *CreateAgentRunnerParams, authInfo runtime.ClientAuthInfoWriter) (*CreateAgentRunnerOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateAgentRunnerParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "createAgentRunner", + Method: "POST", + PathPattern: "/agent_runners", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &CreateAgentRunnerReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CreateAgentRunnerOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CreateAgentRunnerDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CreateAgentRunnerSession create agent runner session API +*/ +func (a *Client) CreateAgentRunnerSession(params *CreateAgentRunnerSessionParams, authInfo runtime.ClientAuthInfoWriter) (*CreateAgentRunnerSessionOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateAgentRunnerSessionParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "createAgentRunnerSession", + Method: "POST", + PathPattern: "/agent_runners/{agent_runner_id}/sessions", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &CreateAgentRunnerSessionReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CreateAgentRunnerSessionOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CreateAgentRunnerSessionDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CreateAgentRunnerUploadURL create agent runner upload Url API +*/ +func (a *Client) CreateAgentRunnerUploadURL(params *CreateAgentRunnerUploadURLParams, authInfo runtime.ClientAuthInfoWriter) (*CreateAgentRunnerUploadURLOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateAgentRunnerUploadURLParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "createAgentRunnerUploadUrl", + Method: "POST", + PathPattern: "/agent_runners/upload_url", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &CreateAgentRunnerUploadURLReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CreateAgentRunnerUploadURLOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CreateAgentRunnerUploadURLDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* CreateDeployKey create deploy key API */ @@ -1119,6 +1351,74 @@ func (a *Client) CreateTicket(params *CreateTicketParams, authInfo runtime.Clien return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +DeleteAgentRunner delete agent runner API +*/ +func (a *Client) DeleteAgentRunner(params *DeleteAgentRunnerParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteAgentRunnerAccepted, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteAgentRunnerParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "deleteAgentRunner", + Method: "DELETE", + PathPattern: "/agent_runners/{agent_runner_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DeleteAgentRunnerReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteAgentRunnerAccepted) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*DeleteAgentRunnerDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +DeleteAgentRunnerSession delete agent runner session API +*/ +func (a *Client) DeleteAgentRunnerSession(params *DeleteAgentRunnerSessionParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteAgentRunnerSessionAccepted, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteAgentRunnerSessionParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "deleteAgentRunnerSession", + Method: "DELETE", + PathPattern: "/agent_runners/{agent_runner_id}/sessions/{agent_runner_session_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DeleteAgentRunnerSessionReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteAgentRunnerSessionAccepted) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*DeleteAgentRunnerSessionDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* DeleteDeploy delete deploy API */ @@ -1936,6 +2236,74 @@ func (a *Client) GetAccountMember(params *GetAccountMemberParams, authInfo runti return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +GetAgentRunner get agent runner API +*/ +func (a *Client) GetAgentRunner(params *GetAgentRunnerParams, authInfo runtime.ClientAuthInfoWriter) (*GetAgentRunnerOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAgentRunnerParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getAgentRunner", + Method: "GET", + PathPattern: "/agent_runners/{agent_runner_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetAgentRunnerReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetAgentRunnerOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetAgentRunnerDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +GetAgentRunnerSession get agent runner session API +*/ +func (a *Client) GetAgentRunnerSession(params *GetAgentRunnerSessionParams, authInfo runtime.ClientAuthInfoWriter) (*GetAgentRunnerSessionOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAgentRunnerSessionParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getAgentRunnerSession", + Method: "GET", + PathPattern: "/agent_runners/{agent_runner_id}/sessions/{agent_runner_session_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetAgentRunnerSessionReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetAgentRunnerSessionOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetAgentRunnerSessionDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* GetAllCertificates get all certificates API */ @@ -2992,6 +3360,74 @@ func (a *Client) ListAccountsForUser(params *ListAccountsForUserParams, authInfo return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +ListAgentRunnerSessions list agent runner sessions API +*/ +func (a *Client) ListAgentRunnerSessions(params *ListAgentRunnerSessionsParams, authInfo runtime.ClientAuthInfoWriter) (*ListAgentRunnerSessionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListAgentRunnerSessionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "listAgentRunnerSessions", + Method: "GET", + PathPattern: "/agent_runners/{agent_runner_id}/sessions", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ListAgentRunnerSessionsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ListAgentRunnerSessionsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ListAgentRunnerSessionsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ListAgentRunners list agent runners API +*/ +func (a *Client) ListAgentRunners(params *ListAgentRunnersParams, authInfo runtime.ClientAuthInfoWriter) (*ListAgentRunnersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListAgentRunnersParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "listAgentRunners", + Method: "GET", + PathPattern: "/agent_runners", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ListAgentRunnersReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ListAgentRunnersOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ListAgentRunnersDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* ListDeployKeys list deploy keys API */ @@ -4394,6 +4830,74 @@ func (a *Client) UpdateAccountMember(params *UpdateAccountMemberParams, authInfo return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +UpdateAgentRunner update agent runner API +*/ +func (a *Client) UpdateAgentRunner(params *UpdateAgentRunnerParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateAgentRunnerOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateAgentRunnerParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "updateAgentRunner", + Method: "PATCH", + PathPattern: "/agent_runners/{agent_runner_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &UpdateAgentRunnerReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateAgentRunnerOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*UpdateAgentRunnerDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +UpdateAgentRunnerSession update agent runner session API +*/ +func (a *Client) UpdateAgentRunnerSession(params *UpdateAgentRunnerSessionParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateAgentRunnerSessionOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateAgentRunnerSessionParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "updateAgentRunnerSession", + Method: "PATCH", + PathPattern: "/agent_runners/{agent_runner_id}/sessions/{agent_runner_session_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &UpdateAgentRunnerSessionReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateAgentRunnerSessionOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*UpdateAgentRunnerSessionDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* UpdateDeployValidations Updates the deploy validations report for a deploy. */ diff --git a/go/plumbing/operations/update_agent_runner_parameters.go b/go/plumbing/operations/update_agent_runner_parameters.go new file mode 100644 index 00000000..2ab8f946 --- /dev/null +++ b/go/plumbing/operations/update_agent_runner_parameters.go @@ -0,0 +1,133 @@ +// 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" +) + +// NewUpdateAgentRunnerParams creates a new UpdateAgentRunnerParams object +// with the default values initialized. +func NewUpdateAgentRunnerParams() *UpdateAgentRunnerParams { + var () + return &UpdateAgentRunnerParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateAgentRunnerParamsWithTimeout creates a new UpdateAgentRunnerParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewUpdateAgentRunnerParamsWithTimeout(timeout time.Duration) *UpdateAgentRunnerParams { + var () + return &UpdateAgentRunnerParams{ + + timeout: timeout, + } +} + +// NewUpdateAgentRunnerParamsWithContext creates a new UpdateAgentRunnerParams object +// with the default values initialized, and the ability to set a context for a request +func NewUpdateAgentRunnerParamsWithContext(ctx context.Context) *UpdateAgentRunnerParams { + var () + return &UpdateAgentRunnerParams{ + + Context: ctx, + } +} + +// NewUpdateAgentRunnerParamsWithHTTPClient creates a new UpdateAgentRunnerParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewUpdateAgentRunnerParamsWithHTTPClient(client *http.Client) *UpdateAgentRunnerParams { + var () + return &UpdateAgentRunnerParams{ + HTTPClient: client, + } +} + +/* +UpdateAgentRunnerParams contains all the parameters to send to the API endpoint +for the update agent runner operation typically these are written to a http.Request +*/ +type UpdateAgentRunnerParams struct { + + /*AgentRunnerID*/ + AgentRunnerID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the update agent runner params +func (o *UpdateAgentRunnerParams) WithTimeout(timeout time.Duration) *UpdateAgentRunnerParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update agent runner params +func (o *UpdateAgentRunnerParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update agent runner params +func (o *UpdateAgentRunnerParams) WithContext(ctx context.Context) *UpdateAgentRunnerParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update agent runner params +func (o *UpdateAgentRunnerParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update agent runner params +func (o *UpdateAgentRunnerParams) WithHTTPClient(client *http.Client) *UpdateAgentRunnerParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update agent runner params +func (o *UpdateAgentRunnerParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAgentRunnerID adds the agentRunnerID to the update agent runner params +func (o *UpdateAgentRunnerParams) WithAgentRunnerID(agentRunnerID string) *UpdateAgentRunnerParams { + o.SetAgentRunnerID(agentRunnerID) + return o +} + +// SetAgentRunnerID adds the agentRunnerId to the update agent runner params +func (o *UpdateAgentRunnerParams) SetAgentRunnerID(agentRunnerID string) { + o.AgentRunnerID = agentRunnerID +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateAgentRunnerParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param agent_runner_id + if err := r.SetPathParam("agent_runner_id", o.AgentRunnerID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/plumbing/operations/update_agent_runner_responses.go b/go/plumbing/operations/update_agent_runner_responses.go new file mode 100644 index 00000000..270a1277 --- /dev/null +++ b/go/plumbing/operations/update_agent_runner_responses.go @@ -0,0 +1,119 @@ +// 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" + "github.com/go-openapi/strfmt" + + "github.com/netlify/open-api/v2/go/models" +) + +// UpdateAgentRunnerReader is a Reader for the UpdateAgentRunner structure. +type UpdateAgentRunnerReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateAgentRunnerReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateAgentRunnerOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewUpdateAgentRunnerDefault(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 + } +} + +// NewUpdateAgentRunnerOK creates a UpdateAgentRunnerOK with default headers values +func NewUpdateAgentRunnerOK() *UpdateAgentRunnerOK { + return &UpdateAgentRunnerOK{} +} + +/* +UpdateAgentRunnerOK handles this case with default header values. + +OK +*/ +type UpdateAgentRunnerOK struct { + Payload *models.AgentRunner +} + +func (o *UpdateAgentRunnerOK) Error() string { + return fmt.Sprintf("[PATCH /agent_runners/{agent_runner_id}][%d] updateAgentRunnerOK %+v", 200, o.Payload) +} + +func (o *UpdateAgentRunnerOK) GetPayload() *models.AgentRunner { + return o.Payload +} + +func (o *UpdateAgentRunnerOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AgentRunner) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateAgentRunnerDefault creates a UpdateAgentRunnerDefault with default headers values +func NewUpdateAgentRunnerDefault(code int) *UpdateAgentRunnerDefault { + return &UpdateAgentRunnerDefault{ + _statusCode: code, + } +} + +/* +UpdateAgentRunnerDefault handles this case with default header values. + +error +*/ +type UpdateAgentRunnerDefault struct { + _statusCode int + + Payload *models.Error +} + +// Code gets the status code for the update agent runner default response +func (o *UpdateAgentRunnerDefault) Code() int { + return o._statusCode +} + +func (o *UpdateAgentRunnerDefault) Error() string { + return fmt.Sprintf("[PATCH /agent_runners/{agent_runner_id}][%d] updateAgentRunner default %+v", o._statusCode, o.Payload) +} + +func (o *UpdateAgentRunnerDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *UpdateAgentRunnerDefault) 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/update_agent_runner_session_parameters.go b/go/plumbing/operations/update_agent_runner_session_parameters.go new file mode 100644 index 00000000..885a0778 --- /dev/null +++ b/go/plumbing/operations/update_agent_runner_session_parameters.go @@ -0,0 +1,181 @@ +// 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" + "github.com/go-openapi/swag" +) + +// NewUpdateAgentRunnerSessionParams creates a new UpdateAgentRunnerSessionParams object +// with the default values initialized. +func NewUpdateAgentRunnerSessionParams() *UpdateAgentRunnerSessionParams { + var () + return &UpdateAgentRunnerSessionParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateAgentRunnerSessionParamsWithTimeout creates a new UpdateAgentRunnerSessionParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewUpdateAgentRunnerSessionParamsWithTimeout(timeout time.Duration) *UpdateAgentRunnerSessionParams { + var () + return &UpdateAgentRunnerSessionParams{ + + timeout: timeout, + } +} + +// NewUpdateAgentRunnerSessionParamsWithContext creates a new UpdateAgentRunnerSessionParams object +// with the default values initialized, and the ability to set a context for a request +func NewUpdateAgentRunnerSessionParamsWithContext(ctx context.Context) *UpdateAgentRunnerSessionParams { + var () + return &UpdateAgentRunnerSessionParams{ + + Context: ctx, + } +} + +// NewUpdateAgentRunnerSessionParamsWithHTTPClient creates a new UpdateAgentRunnerSessionParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewUpdateAgentRunnerSessionParamsWithHTTPClient(client *http.Client) *UpdateAgentRunnerSessionParams { + var () + return &UpdateAgentRunnerSessionParams{ + HTTPClient: client, + } +} + +/* +UpdateAgentRunnerSessionParams contains all the parameters to send to the API endpoint +for the update agent runner session operation typically these are written to a http.Request +*/ +type UpdateAgentRunnerSessionParams struct { + + /*AgentRunnerID*/ + AgentRunnerID string + /*AgentRunnerSessionID*/ + AgentRunnerSessionID string + /*IsPublished*/ + IsPublished *bool + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the update agent runner session params +func (o *UpdateAgentRunnerSessionParams) WithTimeout(timeout time.Duration) *UpdateAgentRunnerSessionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update agent runner session params +func (o *UpdateAgentRunnerSessionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update agent runner session params +func (o *UpdateAgentRunnerSessionParams) WithContext(ctx context.Context) *UpdateAgentRunnerSessionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update agent runner session params +func (o *UpdateAgentRunnerSessionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update agent runner session params +func (o *UpdateAgentRunnerSessionParams) WithHTTPClient(client *http.Client) *UpdateAgentRunnerSessionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update agent runner session params +func (o *UpdateAgentRunnerSessionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAgentRunnerID adds the agentRunnerID to the update agent runner session params +func (o *UpdateAgentRunnerSessionParams) WithAgentRunnerID(agentRunnerID string) *UpdateAgentRunnerSessionParams { + o.SetAgentRunnerID(agentRunnerID) + return o +} + +// SetAgentRunnerID adds the agentRunnerId to the update agent runner session params +func (o *UpdateAgentRunnerSessionParams) SetAgentRunnerID(agentRunnerID string) { + o.AgentRunnerID = agentRunnerID +} + +// WithAgentRunnerSessionID adds the agentRunnerSessionID to the update agent runner session params +func (o *UpdateAgentRunnerSessionParams) WithAgentRunnerSessionID(agentRunnerSessionID string) *UpdateAgentRunnerSessionParams { + o.SetAgentRunnerSessionID(agentRunnerSessionID) + return o +} + +// SetAgentRunnerSessionID adds the agentRunnerSessionId to the update agent runner session params +func (o *UpdateAgentRunnerSessionParams) SetAgentRunnerSessionID(agentRunnerSessionID string) { + o.AgentRunnerSessionID = agentRunnerSessionID +} + +// WithIsPublished adds the isPublished to the update agent runner session params +func (o *UpdateAgentRunnerSessionParams) WithIsPublished(isPublished *bool) *UpdateAgentRunnerSessionParams { + o.SetIsPublished(isPublished) + return o +} + +// SetIsPublished adds the isPublished to the update agent runner session params +func (o *UpdateAgentRunnerSessionParams) SetIsPublished(isPublished *bool) { + o.IsPublished = isPublished +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateAgentRunnerSessionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param agent_runner_id + if err := r.SetPathParam("agent_runner_id", o.AgentRunnerID); err != nil { + return err + } + + // path param agent_runner_session_id + if err := r.SetPathParam("agent_runner_session_id", o.AgentRunnerSessionID); err != nil { + return err + } + + if o.IsPublished != nil { + + // query param is_published + var qrIsPublished bool + if o.IsPublished != nil { + qrIsPublished = *o.IsPublished + } + qIsPublished := swag.FormatBool(qrIsPublished) + if qIsPublished != "" { + if err := r.SetQueryParam("is_published", qIsPublished); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/plumbing/operations/update_agent_runner_session_responses.go b/go/plumbing/operations/update_agent_runner_session_responses.go new file mode 100644 index 00000000..b56fa1a9 --- /dev/null +++ b/go/plumbing/operations/update_agent_runner_session_responses.go @@ -0,0 +1,119 @@ +// 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" + "github.com/go-openapi/strfmt" + + "github.com/netlify/open-api/v2/go/models" +) + +// UpdateAgentRunnerSessionReader is a Reader for the UpdateAgentRunnerSession structure. +type UpdateAgentRunnerSessionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateAgentRunnerSessionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateAgentRunnerSessionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewUpdateAgentRunnerSessionDefault(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 + } +} + +// NewUpdateAgentRunnerSessionOK creates a UpdateAgentRunnerSessionOK with default headers values +func NewUpdateAgentRunnerSessionOK() *UpdateAgentRunnerSessionOK { + return &UpdateAgentRunnerSessionOK{} +} + +/* +UpdateAgentRunnerSessionOK handles this case with default header values. + +OK +*/ +type UpdateAgentRunnerSessionOK struct { + Payload *models.AgentRunnerSession +} + +func (o *UpdateAgentRunnerSessionOK) Error() string { + return fmt.Sprintf("[PATCH /agent_runners/{agent_runner_id}/sessions/{agent_runner_session_id}][%d] updateAgentRunnerSessionOK %+v", 200, o.Payload) +} + +func (o *UpdateAgentRunnerSessionOK) GetPayload() *models.AgentRunnerSession { + return o.Payload +} + +func (o *UpdateAgentRunnerSessionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AgentRunnerSession) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateAgentRunnerSessionDefault creates a UpdateAgentRunnerSessionDefault with default headers values +func NewUpdateAgentRunnerSessionDefault(code int) *UpdateAgentRunnerSessionDefault { + return &UpdateAgentRunnerSessionDefault{ + _statusCode: code, + } +} + +/* +UpdateAgentRunnerSessionDefault handles this case with default header values. + +error +*/ +type UpdateAgentRunnerSessionDefault struct { + _statusCode int + + Payload *models.Error +} + +// Code gets the status code for the update agent runner session default response +func (o *UpdateAgentRunnerSessionDefault) Code() int { + return o._statusCode +} + +func (o *UpdateAgentRunnerSessionDefault) Error() string { + return fmt.Sprintf("[PATCH /agent_runners/{agent_runner_id}/sessions/{agent_runner_session_id}][%d] updateAgentRunnerSession default %+v", o._statusCode, o.Payload) +} + +func (o *UpdateAgentRunnerSessionDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *UpdateAgentRunnerSessionDefault) 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/swagger.yml b/swagger.yml index 8bf7d9ff..74cf6012 100644 --- a/swagger.yml +++ b/swagger.yml @@ -2108,6 +2108,332 @@ paths: default: $ref: '#/responses/error' + # begin agent_runners + /agent_runners: + get: + operationId: listAgentRunners + tags: [agentRunner] + parameters: + - name: account_id + type: string + in: query + required: true + - name: site_id + type: string + in: query + required: true + - $ref: '#/parameters/page' + - $ref: '#/parameters/perPage' + - name: state + type: string + in: query + enum: ['live', 'error'] + - name: title + type: string + in: query + - name: branch + type: string + in: query + - name: result_branch + type: string + in: query + - name: from + type: integer + in: query + - name: to + type: integer + in: query + responses: + '200': + description: OK + schema: + type: array + items: + $ref: '#/definitions/agentRunner' + default: + $ref: '#/responses/error' + post: + operationId: createAgentRunner + tags: [agentRunner] + parameters: + - name: site_id + type: string + in: query + required: true + - name: deploy_id + type: string + in: query + - name: branch + type: string + in: query + - name: prompt + type: string + in: query + - name: agent + type: string + in: query + - name: model + type: string + in: query + - name: parent_agent_runner_id + type: string + in: query + - name: dev_server_image + type: string + in: query + - name: file_keys + type: array + in: query + items: + type: string + responses: + '200': + description: OK + schema: + $ref: '#/definitions/agentRunner' + '404': + description: Not Found + '422': + description: Unprocessable Entity + default: + $ref: '#/responses/error' + /agent_runners/upload_url: + post: + x-internal: true + operationId: createAgentRunnerUploadUrl + tags: [agentRunner] + parameters: + - name: account_id + type: string + in: query + required: true + - name: filename + type: string + in: query + required: true + - name: content_type + type: string + in: query + required: true + responses: + '200': + description: OK + '400': + description: Bad Request + '422': + description: Unprocessable Entity + default: + $ref: '#/responses/error' + /agent_runners/{agent_runner_id}: + parameters: + - name: agent_runner_id + type: string + in: path + required: true + get: + operationId: getAgentRunner + tags: [agentRunner] + responses: + '200': + description: OK + schema: + $ref: '#/definitions/agentRunner' + default: + $ref: '#/responses/error' + patch: + operationId: updateAgentRunner + tags: [agentRunner] + responses: + '200': + description: OK + schema: + $ref: '#/definitions/agentRunner' + default: + $ref: '#/responses/error' + delete: + operationId: deleteAgentRunner + tags: [agentRunner] + responses: + '202': + description: Accepted + default: + $ref: '#/responses/error' + /agent_runners/{agent_runner_id}/archive: + parameters: + - name: agent_runner_id + type: string + in: path + required: true + post: + operationId: archiveAgentRunner + tags: [agentRunner] + responses: + '202': + description: Accepted + '404': + description: Not Found + '422': + description: Unprocessable Entity + default: + $ref: '#/responses/error' + /agent_runners/{agent_runner_id}/pull_request: + parameters: + - name: agent_runner_id + type: string + in: path + required: true + post: + x-internal: true + operationId: agentRunnerPullRequest + tags: [agentRunner] + responses: + '200': + description: OK + '400': + description: Bad Request + '409': + description: Conflict + '422': + description: Unprocessable Entity + default: + $ref: '#/responses/error' + /agent_runners/{agent_runner_id}/commit: + parameters: + - name: agent_runner_id + type: string + in: path + required: true + post: + x-internal: true + operationId: agentRunnerCommitToBranch + tags: [agentRunner] + parameters: + - name: target_branch + type: string + in: query + required: true + responses: + '200': + description: OK + '400': + description: Bad Request + '409': + description: Conflict + '422': + description: Unprocessable Entity + default: + $ref: '#/responses/error' + # end agent_runners + + # begin agent_runner_sessions + /agent_runners/{agent_runner_id}/sessions: + parameters: + - name: agent_runner_id + type: string + in: path + required: true + get: + operationId: listAgentRunnerSessions + tags: [agentRunnerSession] + parameters: + - $ref: '#/parameters/page' + - $ref: '#/parameters/perPage' + - name: state + type: string + in: query + enum: ['live', 'error'] + - name: from + type: integer + in: query + - name: to + type: integer + in: query + - name: order_by + type: string + in: query + enum: ['asc', 'desc'] + responses: + '200': + description: OK + schema: + type: array + items: + $ref: '#/definitions/agentRunnerSession' + default: + $ref: '#/responses/error' + post: + operationId: createAgentRunnerSession + tags: [agentRunnerSession] + parameters: + - name: prompt + type: string + in: query + - name: agent + type: string + in: query + - name: model + type: string + in: query + - name: file_keys + type: array + in: query + items: + type: string + responses: + '200': + description: OK + schema: + $ref: '#/definitions/agentRunnerSession' + '404': + description: Not Found + '422': + description: Unprocessable Entity + default: + $ref: '#/responses/error' + /agent_runners/{agent_runner_id}/sessions/{agent_runner_session_id}: + parameters: + - name: agent_runner_id + type: string + in: path + required: true + - name: agent_runner_session_id + type: string + in: path + required: true + get: + operationId: getAgentRunnerSession + tags: [agentRunnerSession] + responses: + '200': + description: OK + schema: + $ref: '#/definitions/agentRunnerSession' + default: + $ref: '#/responses/error' + patch: + operationId: updateAgentRunnerSession + tags: [agentRunnerSession] + parameters: + - name: is_published + type: boolean + in: query + responses: + '200': + description: OK + schema: + $ref: '#/definitions/agentRunnerSession' + default: + $ref: '#/responses/error' + delete: + operationId: deleteAgentRunnerSession + tags: [agentRunnerSession] + responses: + '202': + description: Accepted + default: + $ref: '#/responses/error' + # end agent_runner_sessions + # begin submission /submissions/{submission_id}: parameters: @@ -3856,6 +4182,148 @@ definitions: type: string additionalProperties: type: object + agentRunner: + type: object + properties: + id: + type: string + site_id: + type: string + parent_agent_runner_id: + type: string + state: + type: string + created_at: + type: string + format: dateTime + updated_at: + type: string + format: dateTime + done_at: + type: string + format: dateTime + title: + type: string + branch: + type: string + result_branch: + type: string + pr_url: + type: string + pr_branch: + type: string + pr_state: + type: string + pr_number: + type: integer + pr_is_being_created: + type: boolean + pr_error: + type: string + current_task: + type: string + result_diff: + type: string + sha: + type: string + merge_commit_sha: + type: string + merge_commit_error: + type: string + merge_commit_is_being_created: + type: boolean + base_deploy_id: + type: string + attached_file_keys: + type: array + items: + type: string + active_session_created_at: + type: string + format: dateTime + latest_session_deploy_id: + type: string + latest_session_deploy_url: + type: string + user: + $ref: '#/definitions/agentRunnerUser' + agentRunnerSession: + type: object + properties: + id: + type: string + agent_runner_id: + type: string + dev_server_id: + type: string + state: + type: string + created_at: + type: string + format: dateTime + updated_at: + type: string + format: dateTime + done_at: + type: string + format: dateTime + title: + type: string + prompt: + type: string + agent_config: + $ref: '#/definitions/agentRunnerSessionConfig' + result: + type: string + result_diff: + type: string + commit_sha: + type: string + deploy_id: + type: string + deploy_url: + type: string + duration: + type: integer + steps: + type: array + items: + $ref: '#/definitions/agentRunnerSessionStep' + user: + $ref: '#/definitions/agentRunnerUser' + attached_file_keys: + type: array + items: + type: string + result_zip_file_name: + type: string + is_published: + type: boolean + agentRunnerSessionStep: + type: object + properties: + title: + type: string + message: + type: string + agentRunnerSessionConfig: + type: object + properties: + agent: + type: string + model: + type: string + agentRunnerUser: + type: object + properties: + id: + type: string + full_name: + type: string + email: + type: string + avatar_url: + type: string accountUsageCapability: type: object properties: