diff --git a/internal/client/projects/get_project_current_spend_parameters.go b/internal/client/projects/get_project_current_spend_parameters.go deleted file mode 100644 index 5c73d84..0000000 --- a/internal/client/projects/get_project_current_spend_parameters.go +++ /dev/null @@ -1,148 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package projects - -// 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" -) - -// NewGetProjectCurrentSpendParams creates a new GetProjectCurrentSpendParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetProjectCurrentSpendParams() *GetProjectCurrentSpendParams { - return &GetProjectCurrentSpendParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetProjectCurrentSpendParamsWithTimeout creates a new GetProjectCurrentSpendParams object -// with the ability to set a timeout on a request. -func NewGetProjectCurrentSpendParamsWithTimeout(timeout time.Duration) *GetProjectCurrentSpendParams { - return &GetProjectCurrentSpendParams{ - timeout: timeout, - } -} - -// NewGetProjectCurrentSpendParamsWithContext creates a new GetProjectCurrentSpendParams object -// with the ability to set a context for a request. -func NewGetProjectCurrentSpendParamsWithContext(ctx context.Context) *GetProjectCurrentSpendParams { - return &GetProjectCurrentSpendParams{ - Context: ctx, - } -} - -// NewGetProjectCurrentSpendParamsWithHTTPClient creates a new GetProjectCurrentSpendParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetProjectCurrentSpendParamsWithHTTPClient(client *http.Client) *GetProjectCurrentSpendParams { - return &GetProjectCurrentSpendParams{ - HTTPClient: client, - } -} - -/* -GetProjectCurrentSpendParams contains all the parameters to send to the API endpoint - - for the get project current spend operation. - - Typically these are written to a http.Request. -*/ -type GetProjectCurrentSpendParams struct { - - // ID. - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get project current spend params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetProjectCurrentSpendParams) WithDefaults() *GetProjectCurrentSpendParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get project current spend params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetProjectCurrentSpendParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get project current spend params -func (o *GetProjectCurrentSpendParams) WithTimeout(timeout time.Duration) *GetProjectCurrentSpendParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get project current spend params -func (o *GetProjectCurrentSpendParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get project current spend params -func (o *GetProjectCurrentSpendParams) WithContext(ctx context.Context) *GetProjectCurrentSpendParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get project current spend params -func (o *GetProjectCurrentSpendParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get project current spend params -func (o *GetProjectCurrentSpendParams) WithHTTPClient(client *http.Client) *GetProjectCurrentSpendParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get project current spend params -func (o *GetProjectCurrentSpendParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the get project current spend params -func (o *GetProjectCurrentSpendParams) WithID(id string) *GetProjectCurrentSpendParams { - o.SetID(id) - return o -} - -// SetID adds the id to the get project current spend params -func (o *GetProjectCurrentSpendParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *GetProjectCurrentSpendParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/internal/client/projects/get_project_current_spend_responses.go b/internal/client/projects/get_project_current_spend_responses.go deleted file mode 100644 index f4eb2bb..0000000 --- a/internal/client/projects/get_project_current_spend_responses.go +++ /dev/null @@ -1,182 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package projects - -// 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/CudoVentures/terraform-provider-cudo/internal/models" -) - -// GetProjectCurrentSpendReader is a Reader for the GetProjectCurrentSpend structure. -type GetProjectCurrentSpendReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetProjectCurrentSpendReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetProjectCurrentSpendOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewGetProjectCurrentSpendDefault(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 - } -} - -// NewGetProjectCurrentSpendOK creates a GetProjectCurrentSpendOK with default headers values -func NewGetProjectCurrentSpendOK() *GetProjectCurrentSpendOK { - return &GetProjectCurrentSpendOK{} -} - -/* -GetProjectCurrentSpendOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type GetProjectCurrentSpendOK struct { - Payload *models.ProjectSpend -} - -// IsSuccess returns true when this get project current spend o k response has a 2xx status code -func (o *GetProjectCurrentSpendOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this get project current spend o k response has a 3xx status code -func (o *GetProjectCurrentSpendOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get project current spend o k response has a 4xx status code -func (o *GetProjectCurrentSpendOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this get project current spend o k response has a 5xx status code -func (o *GetProjectCurrentSpendOK) IsServerError() bool { - return false -} - -// IsCode returns true when this get project current spend o k response a status code equal to that given -func (o *GetProjectCurrentSpendOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the get project current spend o k response -func (o *GetProjectCurrentSpendOK) Code() int { - return 200 -} - -func (o *GetProjectCurrentSpendOK) Error() string { - return fmt.Sprintf("[GET /v1/projects/{id}/spend/current][%d] getProjectCurrentSpendOK %+v", 200, o.Payload) -} - -func (o *GetProjectCurrentSpendOK) String() string { - return fmt.Sprintf("[GET /v1/projects/{id}/spend/current][%d] getProjectCurrentSpendOK %+v", 200, o.Payload) -} - -func (o *GetProjectCurrentSpendOK) GetPayload() *models.ProjectSpend { - return o.Payload -} - -func (o *GetProjectCurrentSpendOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ProjectSpend) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetProjectCurrentSpendDefault creates a GetProjectCurrentSpendDefault with default headers values -func NewGetProjectCurrentSpendDefault(code int) *GetProjectCurrentSpendDefault { - return &GetProjectCurrentSpendDefault{ - _statusCode: code, - } -} - -/* -GetProjectCurrentSpendDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type GetProjectCurrentSpendDefault struct { - _statusCode int - - Payload *models.Status -} - -// IsSuccess returns true when this get project current spend default response has a 2xx status code -func (o *GetProjectCurrentSpendDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this get project current spend default response has a 3xx status code -func (o *GetProjectCurrentSpendDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this get project current spend default response has a 4xx status code -func (o *GetProjectCurrentSpendDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this get project current spend default response has a 5xx status code -func (o *GetProjectCurrentSpendDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this get project current spend default response a status code equal to that given -func (o *GetProjectCurrentSpendDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the get project current spend default response -func (o *GetProjectCurrentSpendDefault) Code() int { - return o._statusCode -} - -func (o *GetProjectCurrentSpendDefault) Error() string { - return fmt.Sprintf("[GET /v1/projects/{id}/spend/current][%d] GetProjectCurrentSpend default %+v", o._statusCode, o.Payload) -} - -func (o *GetProjectCurrentSpendDefault) String() string { - return fmt.Sprintf("[GET /v1/projects/{id}/spend/current][%d] GetProjectCurrentSpend default %+v", o._statusCode, o.Payload) -} - -func (o *GetProjectCurrentSpendDefault) GetPayload() *models.Status { - return o.Payload -} - -func (o *GetProjectCurrentSpendDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Status) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/internal/client/projects/get_project_spend_details_parameters.go b/internal/client/projects/get_project_spend_details_parameters.go deleted file mode 100644 index 846cb04..0000000 --- a/internal/client/projects/get_project_spend_details_parameters.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package projects - -// 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" -) - -// NewGetProjectSpendDetailsParams creates a new GetProjectSpendDetailsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetProjectSpendDetailsParams() *GetProjectSpendDetailsParams { - return &GetProjectSpendDetailsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetProjectSpendDetailsParamsWithTimeout creates a new GetProjectSpendDetailsParams object -// with the ability to set a timeout on a request. -func NewGetProjectSpendDetailsParamsWithTimeout(timeout time.Duration) *GetProjectSpendDetailsParams { - return &GetProjectSpendDetailsParams{ - timeout: timeout, - } -} - -// NewGetProjectSpendDetailsParamsWithContext creates a new GetProjectSpendDetailsParams object -// with the ability to set a context for a request. -func NewGetProjectSpendDetailsParamsWithContext(ctx context.Context) *GetProjectSpendDetailsParams { - return &GetProjectSpendDetailsParams{ - Context: ctx, - } -} - -// NewGetProjectSpendDetailsParamsWithHTTPClient creates a new GetProjectSpendDetailsParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetProjectSpendDetailsParamsWithHTTPClient(client *http.Client) *GetProjectSpendDetailsParams { - return &GetProjectSpendDetailsParams{ - HTTPClient: client, - } -} - -/* -GetProjectSpendDetailsParams contains all the parameters to send to the API endpoint - - for the get project spend details operation. - - Typically these are written to a http.Request. -*/ -type GetProjectSpendDetailsParams struct { - - // ProjectID. - ProjectID string - - // SpendID. - SpendID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get project spend details params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetProjectSpendDetailsParams) WithDefaults() *GetProjectSpendDetailsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get project spend details params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetProjectSpendDetailsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get project spend details params -func (o *GetProjectSpendDetailsParams) WithTimeout(timeout time.Duration) *GetProjectSpendDetailsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get project spend details params -func (o *GetProjectSpendDetailsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get project spend details params -func (o *GetProjectSpendDetailsParams) WithContext(ctx context.Context) *GetProjectSpendDetailsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get project spend details params -func (o *GetProjectSpendDetailsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get project spend details params -func (o *GetProjectSpendDetailsParams) WithHTTPClient(client *http.Client) *GetProjectSpendDetailsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get project spend details params -func (o *GetProjectSpendDetailsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithProjectID adds the projectID to the get project spend details params -func (o *GetProjectSpendDetailsParams) WithProjectID(projectID string) *GetProjectSpendDetailsParams { - o.SetProjectID(projectID) - return o -} - -// SetProjectID adds the projectId to the get project spend details params -func (o *GetProjectSpendDetailsParams) SetProjectID(projectID string) { - o.ProjectID = projectID -} - -// WithSpendID adds the spendID to the get project spend details params -func (o *GetProjectSpendDetailsParams) WithSpendID(spendID string) *GetProjectSpendDetailsParams { - o.SetSpendID(spendID) - return o -} - -// SetSpendID adds the spendId to the get project spend details params -func (o *GetProjectSpendDetailsParams) SetSpendID(spendID string) { - o.SpendID = spendID -} - -// WriteToRequest writes these params to a swagger request -func (o *GetProjectSpendDetailsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param projectId - if err := r.SetPathParam("projectId", o.ProjectID); err != nil { - return err - } - - // path param spendId - if err := r.SetPathParam("spendId", o.SpendID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/internal/client/projects/get_project_spend_details_responses.go b/internal/client/projects/get_project_spend_details_responses.go deleted file mode 100644 index 77e77ff..0000000 --- a/internal/client/projects/get_project_spend_details_responses.go +++ /dev/null @@ -1,182 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package projects - -// 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/CudoVentures/terraform-provider-cudo/internal/models" -) - -// GetProjectSpendDetailsReader is a Reader for the GetProjectSpendDetails structure. -type GetProjectSpendDetailsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetProjectSpendDetailsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetProjectSpendDetailsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewGetProjectSpendDetailsDefault(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 - } -} - -// NewGetProjectSpendDetailsOK creates a GetProjectSpendDetailsOK with default headers values -func NewGetProjectSpendDetailsOK() *GetProjectSpendDetailsOK { - return &GetProjectSpendDetailsOK{} -} - -/* -GetProjectSpendDetailsOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type GetProjectSpendDetailsOK struct { - Payload *models.GetProjectSpendDetailsResponse -} - -// IsSuccess returns true when this get project spend details o k response has a 2xx status code -func (o *GetProjectSpendDetailsOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this get project spend details o k response has a 3xx status code -func (o *GetProjectSpendDetailsOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get project spend details o k response has a 4xx status code -func (o *GetProjectSpendDetailsOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this get project spend details o k response has a 5xx status code -func (o *GetProjectSpendDetailsOK) IsServerError() bool { - return false -} - -// IsCode returns true when this get project spend details o k response a status code equal to that given -func (o *GetProjectSpendDetailsOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the get project spend details o k response -func (o *GetProjectSpendDetailsOK) Code() int { - return 200 -} - -func (o *GetProjectSpendDetailsOK) Error() string { - return fmt.Sprintf("[GET /v1/projects/{projectId}/spend/{spendId}/details][%d] getProjectSpendDetailsOK %+v", 200, o.Payload) -} - -func (o *GetProjectSpendDetailsOK) String() string { - return fmt.Sprintf("[GET /v1/projects/{projectId}/spend/{spendId}/details][%d] getProjectSpendDetailsOK %+v", 200, o.Payload) -} - -func (o *GetProjectSpendDetailsOK) GetPayload() *models.GetProjectSpendDetailsResponse { - return o.Payload -} - -func (o *GetProjectSpendDetailsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.GetProjectSpendDetailsResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetProjectSpendDetailsDefault creates a GetProjectSpendDetailsDefault with default headers values -func NewGetProjectSpendDetailsDefault(code int) *GetProjectSpendDetailsDefault { - return &GetProjectSpendDetailsDefault{ - _statusCode: code, - } -} - -/* -GetProjectSpendDetailsDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type GetProjectSpendDetailsDefault struct { - _statusCode int - - Payload *models.Status -} - -// IsSuccess returns true when this get project spend details default response has a 2xx status code -func (o *GetProjectSpendDetailsDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this get project spend details default response has a 3xx status code -func (o *GetProjectSpendDetailsDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this get project spend details default response has a 4xx status code -func (o *GetProjectSpendDetailsDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this get project spend details default response has a 5xx status code -func (o *GetProjectSpendDetailsDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this get project spend details default response a status code equal to that given -func (o *GetProjectSpendDetailsDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the get project spend details default response -func (o *GetProjectSpendDetailsDefault) Code() int { - return o._statusCode -} - -func (o *GetProjectSpendDetailsDefault) Error() string { - return fmt.Sprintf("[GET /v1/projects/{projectId}/spend/{spendId}/details][%d] GetProjectSpendDetails default %+v", o._statusCode, o.Payload) -} - -func (o *GetProjectSpendDetailsDefault) String() string { - return fmt.Sprintf("[GET /v1/projects/{projectId}/spend/{spendId}/details][%d] GetProjectSpendDetails default %+v", o._statusCode, o.Payload) -} - -func (o *GetProjectSpendDetailsDefault) GetPayload() *models.Status { - return o.Payload -} - -func (o *GetProjectSpendDetailsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Status) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/internal/client/projects/get_project_spend_history_parameters.go b/internal/client/projects/get_project_spend_history_parameters.go deleted file mode 100644 index 5ff1f65..0000000 --- a/internal/client/projects/get_project_spend_history_parameters.go +++ /dev/null @@ -1,148 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package projects - -// 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" -) - -// NewGetProjectSpendHistoryParams creates a new GetProjectSpendHistoryParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetProjectSpendHistoryParams() *GetProjectSpendHistoryParams { - return &GetProjectSpendHistoryParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetProjectSpendHistoryParamsWithTimeout creates a new GetProjectSpendHistoryParams object -// with the ability to set a timeout on a request. -func NewGetProjectSpendHistoryParamsWithTimeout(timeout time.Duration) *GetProjectSpendHistoryParams { - return &GetProjectSpendHistoryParams{ - timeout: timeout, - } -} - -// NewGetProjectSpendHistoryParamsWithContext creates a new GetProjectSpendHistoryParams object -// with the ability to set a context for a request. -func NewGetProjectSpendHistoryParamsWithContext(ctx context.Context) *GetProjectSpendHistoryParams { - return &GetProjectSpendHistoryParams{ - Context: ctx, - } -} - -// NewGetProjectSpendHistoryParamsWithHTTPClient creates a new GetProjectSpendHistoryParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetProjectSpendHistoryParamsWithHTTPClient(client *http.Client) *GetProjectSpendHistoryParams { - return &GetProjectSpendHistoryParams{ - HTTPClient: client, - } -} - -/* -GetProjectSpendHistoryParams contains all the parameters to send to the API endpoint - - for the get project spend history operation. - - Typically these are written to a http.Request. -*/ -type GetProjectSpendHistoryParams struct { - - // ID. - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get project spend history params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetProjectSpendHistoryParams) WithDefaults() *GetProjectSpendHistoryParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get project spend history params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetProjectSpendHistoryParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get project spend history params -func (o *GetProjectSpendHistoryParams) WithTimeout(timeout time.Duration) *GetProjectSpendHistoryParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get project spend history params -func (o *GetProjectSpendHistoryParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get project spend history params -func (o *GetProjectSpendHistoryParams) WithContext(ctx context.Context) *GetProjectSpendHistoryParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get project spend history params -func (o *GetProjectSpendHistoryParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get project spend history params -func (o *GetProjectSpendHistoryParams) WithHTTPClient(client *http.Client) *GetProjectSpendHistoryParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get project spend history params -func (o *GetProjectSpendHistoryParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the get project spend history params -func (o *GetProjectSpendHistoryParams) WithID(id string) *GetProjectSpendHistoryParams { - o.SetID(id) - return o -} - -// SetID adds the id to the get project spend history params -func (o *GetProjectSpendHistoryParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *GetProjectSpendHistoryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/internal/client/projects/get_project_spend_history_responses.go b/internal/client/projects/get_project_spend_history_responses.go deleted file mode 100644 index ecadebc..0000000 --- a/internal/client/projects/get_project_spend_history_responses.go +++ /dev/null @@ -1,182 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package projects - -// 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/CudoVentures/terraform-provider-cudo/internal/models" -) - -// GetProjectSpendHistoryReader is a Reader for the GetProjectSpendHistory structure. -type GetProjectSpendHistoryReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetProjectSpendHistoryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetProjectSpendHistoryOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewGetProjectSpendHistoryDefault(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 - } -} - -// NewGetProjectSpendHistoryOK creates a GetProjectSpendHistoryOK with default headers values -func NewGetProjectSpendHistoryOK() *GetProjectSpendHistoryOK { - return &GetProjectSpendHistoryOK{} -} - -/* -GetProjectSpendHistoryOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type GetProjectSpendHistoryOK struct { - Payload *models.GetProjectSpendHistoryResponse -} - -// IsSuccess returns true when this get project spend history o k response has a 2xx status code -func (o *GetProjectSpendHistoryOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this get project spend history o k response has a 3xx status code -func (o *GetProjectSpendHistoryOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get project spend history o k response has a 4xx status code -func (o *GetProjectSpendHistoryOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this get project spend history o k response has a 5xx status code -func (o *GetProjectSpendHistoryOK) IsServerError() bool { - return false -} - -// IsCode returns true when this get project spend history o k response a status code equal to that given -func (o *GetProjectSpendHistoryOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the get project spend history o k response -func (o *GetProjectSpendHistoryOK) Code() int { - return 200 -} - -func (o *GetProjectSpendHistoryOK) Error() string { - return fmt.Sprintf("[GET /v1/projects/{id}/spend][%d] getProjectSpendHistoryOK %+v", 200, o.Payload) -} - -func (o *GetProjectSpendHistoryOK) String() string { - return fmt.Sprintf("[GET /v1/projects/{id}/spend][%d] getProjectSpendHistoryOK %+v", 200, o.Payload) -} - -func (o *GetProjectSpendHistoryOK) GetPayload() *models.GetProjectSpendHistoryResponse { - return o.Payload -} - -func (o *GetProjectSpendHistoryOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.GetProjectSpendHistoryResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetProjectSpendHistoryDefault creates a GetProjectSpendHistoryDefault with default headers values -func NewGetProjectSpendHistoryDefault(code int) *GetProjectSpendHistoryDefault { - return &GetProjectSpendHistoryDefault{ - _statusCode: code, - } -} - -/* -GetProjectSpendHistoryDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type GetProjectSpendHistoryDefault struct { - _statusCode int - - Payload *models.Status -} - -// IsSuccess returns true when this get project spend history default response has a 2xx status code -func (o *GetProjectSpendHistoryDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this get project spend history default response has a 3xx status code -func (o *GetProjectSpendHistoryDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this get project spend history default response has a 4xx status code -func (o *GetProjectSpendHistoryDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this get project spend history default response has a 5xx status code -func (o *GetProjectSpendHistoryDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this get project spend history default response a status code equal to that given -func (o *GetProjectSpendHistoryDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the get project spend history default response -func (o *GetProjectSpendHistoryDefault) Code() int { - return o._statusCode -} - -func (o *GetProjectSpendHistoryDefault) Error() string { - return fmt.Sprintf("[GET /v1/projects/{id}/spend][%d] GetProjectSpendHistory default %+v", o._statusCode, o.Payload) -} - -func (o *GetProjectSpendHistoryDefault) String() string { - return fmt.Sprintf("[GET /v1/projects/{id}/spend][%d] GetProjectSpendHistory default %+v", o._statusCode, o.Payload) -} - -func (o *GetProjectSpendHistoryDefault) GetPayload() *models.Status { - return o.Payload -} - -func (o *GetProjectSpendHistoryDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Status) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/internal/client/virtual_machines/create_disk_snapshot_parameters.go b/internal/client/virtual_machines/create_disk_snapshot_parameters.go deleted file mode 100644 index 77548d9..0000000 --- a/internal/client/virtual_machines/create_disk_snapshot_parameters.go +++ /dev/null @@ -1,215 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package virtual_machines - -// 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" -) - -// NewCreateDiskSnapshotParams creates a new CreateDiskSnapshotParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateDiskSnapshotParams() *CreateDiskSnapshotParams { - return &CreateDiskSnapshotParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateDiskSnapshotParamsWithTimeout creates a new CreateDiskSnapshotParams object -// with the ability to set a timeout on a request. -func NewCreateDiskSnapshotParamsWithTimeout(timeout time.Duration) *CreateDiskSnapshotParams { - return &CreateDiskSnapshotParams{ - timeout: timeout, - } -} - -// NewCreateDiskSnapshotParamsWithContext creates a new CreateDiskSnapshotParams object -// with the ability to set a context for a request. -func NewCreateDiskSnapshotParamsWithContext(ctx context.Context) *CreateDiskSnapshotParams { - return &CreateDiskSnapshotParams{ - Context: ctx, - } -} - -// NewCreateDiskSnapshotParamsWithHTTPClient creates a new CreateDiskSnapshotParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateDiskSnapshotParamsWithHTTPClient(client *http.Client) *CreateDiskSnapshotParams { - return &CreateDiskSnapshotParams{ - HTTPClient: client, - } -} - -/* -CreateDiskSnapshotParams contains all the parameters to send to the API endpoint - - for the create disk snapshot operation. - - Typically these are written to a http.Request. -*/ -type CreateDiskSnapshotParams struct { - - // ID. - ID string - - // ProjectID. - ProjectID string - - // SnapshotID. - SnapshotID string - - // VMID. - VMID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create disk snapshot params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateDiskSnapshotParams) WithDefaults() *CreateDiskSnapshotParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create disk snapshot params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateDiskSnapshotParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create disk snapshot params -func (o *CreateDiskSnapshotParams) WithTimeout(timeout time.Duration) *CreateDiskSnapshotParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create disk snapshot params -func (o *CreateDiskSnapshotParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create disk snapshot params -func (o *CreateDiskSnapshotParams) WithContext(ctx context.Context) *CreateDiskSnapshotParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create disk snapshot params -func (o *CreateDiskSnapshotParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create disk snapshot params -func (o *CreateDiskSnapshotParams) WithHTTPClient(client *http.Client) *CreateDiskSnapshotParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create disk snapshot params -func (o *CreateDiskSnapshotParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the create disk snapshot params -func (o *CreateDiskSnapshotParams) WithID(id string) *CreateDiskSnapshotParams { - o.SetID(id) - return o -} - -// SetID adds the id to the create disk snapshot params -func (o *CreateDiskSnapshotParams) SetID(id string) { - o.ID = id -} - -// WithProjectID adds the projectID to the create disk snapshot params -func (o *CreateDiskSnapshotParams) WithProjectID(projectID string) *CreateDiskSnapshotParams { - o.SetProjectID(projectID) - return o -} - -// SetProjectID adds the projectId to the create disk snapshot params -func (o *CreateDiskSnapshotParams) SetProjectID(projectID string) { - o.ProjectID = projectID -} - -// WithSnapshotID adds the snapshotID to the create disk snapshot params -func (o *CreateDiskSnapshotParams) WithSnapshotID(snapshotID string) *CreateDiskSnapshotParams { - o.SetSnapshotID(snapshotID) - return o -} - -// SetSnapshotID adds the snapshotId to the create disk snapshot params -func (o *CreateDiskSnapshotParams) SetSnapshotID(snapshotID string) { - o.SnapshotID = snapshotID -} - -// WithVMID adds the vMID to the create disk snapshot params -func (o *CreateDiskSnapshotParams) WithVMID(vMID string) *CreateDiskSnapshotParams { - o.SetVMID(vMID) - return o -} - -// SetVMID adds the vmId to the create disk snapshot params -func (o *CreateDiskSnapshotParams) SetVMID(vMID string) { - o.VMID = vMID -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateDiskSnapshotParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - // path param projectId - if err := r.SetPathParam("projectId", o.ProjectID); err != nil { - return err - } - - // query param snapshotId - qrSnapshotID := o.SnapshotID - qSnapshotID := qrSnapshotID - if qSnapshotID != "" { - - if err := r.SetQueryParam("snapshotId", qSnapshotID); err != nil { - return err - } - } - - // query param vmId - qrVMID := o.VMID - qVMID := qrVMID - if qVMID != "" { - - if err := r.SetQueryParam("vmId", qVMID); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/internal/client/virtual_machines/create_disk_snapshot_responses.go b/internal/client/virtual_machines/create_disk_snapshot_responses.go deleted file mode 100644 index a4a0ab0..0000000 --- a/internal/client/virtual_machines/create_disk_snapshot_responses.go +++ /dev/null @@ -1,180 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package virtual_machines - -// 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/CudoVentures/terraform-provider-cudo/internal/models" -) - -// CreateDiskSnapshotReader is a Reader for the CreateDiskSnapshot structure. -type CreateDiskSnapshotReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateDiskSnapshotReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewCreateDiskSnapshotOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewCreateDiskSnapshotDefault(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 - } -} - -// NewCreateDiskSnapshotOK creates a CreateDiskSnapshotOK with default headers values -func NewCreateDiskSnapshotOK() *CreateDiskSnapshotOK { - return &CreateDiskSnapshotOK{} -} - -/* -CreateDiskSnapshotOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type CreateDiskSnapshotOK struct { - Payload models.CreateDiskSnapshotResponse -} - -// IsSuccess returns true when this create disk snapshot o k response has a 2xx status code -func (o *CreateDiskSnapshotOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this create disk snapshot o k response has a 3xx status code -func (o *CreateDiskSnapshotOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create disk snapshot o k response has a 4xx status code -func (o *CreateDiskSnapshotOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this create disk snapshot o k response has a 5xx status code -func (o *CreateDiskSnapshotOK) IsServerError() bool { - return false -} - -// IsCode returns true when this create disk snapshot o k response a status code equal to that given -func (o *CreateDiskSnapshotOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the create disk snapshot o k response -func (o *CreateDiskSnapshotOK) Code() int { - return 200 -} - -func (o *CreateDiskSnapshotOK) Error() string { - return fmt.Sprintf("[POST /v1/projects/{projectId}/disks/{id}/snapshots][%d] createDiskSnapshotOK %+v", 200, o.Payload) -} - -func (o *CreateDiskSnapshotOK) String() string { - return fmt.Sprintf("[POST /v1/projects/{projectId}/disks/{id}/snapshots][%d] createDiskSnapshotOK %+v", 200, o.Payload) -} - -func (o *CreateDiskSnapshotOK) GetPayload() models.CreateDiskSnapshotResponse { - return o.Payload -} - -func (o *CreateDiskSnapshotOK) 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 -} - -// NewCreateDiskSnapshotDefault creates a CreateDiskSnapshotDefault with default headers values -func NewCreateDiskSnapshotDefault(code int) *CreateDiskSnapshotDefault { - return &CreateDiskSnapshotDefault{ - _statusCode: code, - } -} - -/* -CreateDiskSnapshotDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type CreateDiskSnapshotDefault struct { - _statusCode int - - Payload *models.Status -} - -// IsSuccess returns true when this create disk snapshot default response has a 2xx status code -func (o *CreateDiskSnapshotDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this create disk snapshot default response has a 3xx status code -func (o *CreateDiskSnapshotDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this create disk snapshot default response has a 4xx status code -func (o *CreateDiskSnapshotDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this create disk snapshot default response has a 5xx status code -func (o *CreateDiskSnapshotDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this create disk snapshot default response a status code equal to that given -func (o *CreateDiskSnapshotDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the create disk snapshot default response -func (o *CreateDiskSnapshotDefault) Code() int { - return o._statusCode -} - -func (o *CreateDiskSnapshotDefault) Error() string { - return fmt.Sprintf("[POST /v1/projects/{projectId}/disks/{id}/snapshots][%d] CreateDiskSnapshot default %+v", o._statusCode, o.Payload) -} - -func (o *CreateDiskSnapshotDefault) String() string { - return fmt.Sprintf("[POST /v1/projects/{projectId}/disks/{id}/snapshots][%d] CreateDiskSnapshot default %+v", o._statusCode, o.Payload) -} - -func (o *CreateDiskSnapshotDefault) GetPayload() *models.Status { - return o.Payload -} - -func (o *CreateDiskSnapshotDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Status) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/internal/client/virtual_machines/create_vm_snapshot_parameters.go b/internal/client/virtual_machines/create_vm_snapshot_parameters.go deleted file mode 100644 index c67cd71..0000000 --- a/internal/client/virtual_machines/create_vm_snapshot_parameters.go +++ /dev/null @@ -1,191 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package virtual_machines - -// 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" -) - -// NewCreateVMSnapshotParams creates a new CreateVMSnapshotParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateVMSnapshotParams() *CreateVMSnapshotParams { - return &CreateVMSnapshotParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateVMSnapshotParamsWithTimeout creates a new CreateVMSnapshotParams object -// with the ability to set a timeout on a request. -func NewCreateVMSnapshotParamsWithTimeout(timeout time.Duration) *CreateVMSnapshotParams { - return &CreateVMSnapshotParams{ - timeout: timeout, - } -} - -// NewCreateVMSnapshotParamsWithContext creates a new CreateVMSnapshotParams object -// with the ability to set a context for a request. -func NewCreateVMSnapshotParamsWithContext(ctx context.Context) *CreateVMSnapshotParams { - return &CreateVMSnapshotParams{ - Context: ctx, - } -} - -// NewCreateVMSnapshotParamsWithHTTPClient creates a new CreateVMSnapshotParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateVMSnapshotParamsWithHTTPClient(client *http.Client) *CreateVMSnapshotParams { - return &CreateVMSnapshotParams{ - HTTPClient: client, - } -} - -/* -CreateVMSnapshotParams contains all the parameters to send to the API endpoint - - for the create VM snapshot operation. - - Typically these are written to a http.Request. -*/ -type CreateVMSnapshotParams struct { - - // ID. - ID string - - // ProjectID. - ProjectID string - - // SnapshotID. - SnapshotID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create VM snapshot params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateVMSnapshotParams) WithDefaults() *CreateVMSnapshotParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create VM snapshot params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateVMSnapshotParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create VM snapshot params -func (o *CreateVMSnapshotParams) WithTimeout(timeout time.Duration) *CreateVMSnapshotParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create VM snapshot params -func (o *CreateVMSnapshotParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create VM snapshot params -func (o *CreateVMSnapshotParams) WithContext(ctx context.Context) *CreateVMSnapshotParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create VM snapshot params -func (o *CreateVMSnapshotParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create VM snapshot params -func (o *CreateVMSnapshotParams) WithHTTPClient(client *http.Client) *CreateVMSnapshotParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create VM snapshot params -func (o *CreateVMSnapshotParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the create VM snapshot params -func (o *CreateVMSnapshotParams) WithID(id string) *CreateVMSnapshotParams { - o.SetID(id) - return o -} - -// SetID adds the id to the create VM snapshot params -func (o *CreateVMSnapshotParams) SetID(id string) { - o.ID = id -} - -// WithProjectID adds the projectID to the create VM snapshot params -func (o *CreateVMSnapshotParams) WithProjectID(projectID string) *CreateVMSnapshotParams { - o.SetProjectID(projectID) - return o -} - -// SetProjectID adds the projectId to the create VM snapshot params -func (o *CreateVMSnapshotParams) SetProjectID(projectID string) { - o.ProjectID = projectID -} - -// WithSnapshotID adds the snapshotID to the create VM snapshot params -func (o *CreateVMSnapshotParams) WithSnapshotID(snapshotID string) *CreateVMSnapshotParams { - o.SetSnapshotID(snapshotID) - return o -} - -// SetSnapshotID adds the snapshotId to the create VM snapshot params -func (o *CreateVMSnapshotParams) SetSnapshotID(snapshotID string) { - o.SnapshotID = snapshotID -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateVMSnapshotParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - // path param projectId - if err := r.SetPathParam("projectId", o.ProjectID); err != nil { - return err - } - - // query param snapshotId - qrSnapshotID := o.SnapshotID - qSnapshotID := qrSnapshotID - if qSnapshotID != "" { - - if err := r.SetQueryParam("snapshotId", qSnapshotID); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/internal/client/virtual_machines/create_vm_snapshot_responses.go b/internal/client/virtual_machines/create_vm_snapshot_responses.go deleted file mode 100644 index 13ffa3d..0000000 --- a/internal/client/virtual_machines/create_vm_snapshot_responses.go +++ /dev/null @@ -1,180 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package virtual_machines - -// 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/CudoVentures/terraform-provider-cudo/internal/models" -) - -// CreateVMSnapshotReader is a Reader for the CreateVMSnapshot structure. -type CreateVMSnapshotReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateVMSnapshotReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewCreateVMSnapshotOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewCreateVMSnapshotDefault(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 - } -} - -// NewCreateVMSnapshotOK creates a CreateVMSnapshotOK with default headers values -func NewCreateVMSnapshotOK() *CreateVMSnapshotOK { - return &CreateVMSnapshotOK{} -} - -/* -CreateVMSnapshotOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type CreateVMSnapshotOK struct { - Payload models.CreateVMSnapshotResponse -} - -// IsSuccess returns true when this create Vm snapshot o k response has a 2xx status code -func (o *CreateVMSnapshotOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this create Vm snapshot o k response has a 3xx status code -func (o *CreateVMSnapshotOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create Vm snapshot o k response has a 4xx status code -func (o *CreateVMSnapshotOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this create Vm snapshot o k response has a 5xx status code -func (o *CreateVMSnapshotOK) IsServerError() bool { - return false -} - -// IsCode returns true when this create Vm snapshot o k response a status code equal to that given -func (o *CreateVMSnapshotOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the create Vm snapshot o k response -func (o *CreateVMSnapshotOK) Code() int { - return 200 -} - -func (o *CreateVMSnapshotOK) Error() string { - return fmt.Sprintf("[POST /v1/projects/{projectId}/vms/{id}/snapshots][%d] createVmSnapshotOK %+v", 200, o.Payload) -} - -func (o *CreateVMSnapshotOK) String() string { - return fmt.Sprintf("[POST /v1/projects/{projectId}/vms/{id}/snapshots][%d] createVmSnapshotOK %+v", 200, o.Payload) -} - -func (o *CreateVMSnapshotOK) GetPayload() models.CreateVMSnapshotResponse { - return o.Payload -} - -func (o *CreateVMSnapshotOK) 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 -} - -// NewCreateVMSnapshotDefault creates a CreateVMSnapshotDefault with default headers values -func NewCreateVMSnapshotDefault(code int) *CreateVMSnapshotDefault { - return &CreateVMSnapshotDefault{ - _statusCode: code, - } -} - -/* -CreateVMSnapshotDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type CreateVMSnapshotDefault struct { - _statusCode int - - Payload *models.Status -} - -// IsSuccess returns true when this create VM snapshot default response has a 2xx status code -func (o *CreateVMSnapshotDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this create VM snapshot default response has a 3xx status code -func (o *CreateVMSnapshotDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this create VM snapshot default response has a 4xx status code -func (o *CreateVMSnapshotDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this create VM snapshot default response has a 5xx status code -func (o *CreateVMSnapshotDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this create VM snapshot default response a status code equal to that given -func (o *CreateVMSnapshotDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the create VM snapshot default response -func (o *CreateVMSnapshotDefault) Code() int { - return o._statusCode -} - -func (o *CreateVMSnapshotDefault) Error() string { - return fmt.Sprintf("[POST /v1/projects/{projectId}/vms/{id}/snapshots][%d] CreateVMSnapshot default %+v", o._statusCode, o.Payload) -} - -func (o *CreateVMSnapshotDefault) String() string { - return fmt.Sprintf("[POST /v1/projects/{projectId}/vms/{id}/snapshots][%d] CreateVMSnapshot default %+v", o._statusCode, o.Payload) -} - -func (o *CreateVMSnapshotDefault) GetPayload() *models.Status { - return o.Payload -} - -func (o *CreateVMSnapshotDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Status) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/internal/client/virtual_machines/delete_disk_snapshot_parameters.go b/internal/client/virtual_machines/delete_disk_snapshot_parameters.go deleted file mode 100644 index 0e17887..0000000 --- a/internal/client/virtual_machines/delete_disk_snapshot_parameters.go +++ /dev/null @@ -1,215 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package virtual_machines - -// 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" -) - -// NewDeleteDiskSnapshotParams creates a new DeleteDiskSnapshotParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteDiskSnapshotParams() *DeleteDiskSnapshotParams { - return &DeleteDiskSnapshotParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteDiskSnapshotParamsWithTimeout creates a new DeleteDiskSnapshotParams object -// with the ability to set a timeout on a request. -func NewDeleteDiskSnapshotParamsWithTimeout(timeout time.Duration) *DeleteDiskSnapshotParams { - return &DeleteDiskSnapshotParams{ - timeout: timeout, - } -} - -// NewDeleteDiskSnapshotParamsWithContext creates a new DeleteDiskSnapshotParams object -// with the ability to set a context for a request. -func NewDeleteDiskSnapshotParamsWithContext(ctx context.Context) *DeleteDiskSnapshotParams { - return &DeleteDiskSnapshotParams{ - Context: ctx, - } -} - -// NewDeleteDiskSnapshotParamsWithHTTPClient creates a new DeleteDiskSnapshotParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteDiskSnapshotParamsWithHTTPClient(client *http.Client) *DeleteDiskSnapshotParams { - return &DeleteDiskSnapshotParams{ - HTTPClient: client, - } -} - -/* -DeleteDiskSnapshotParams contains all the parameters to send to the API endpoint - - for the delete disk snapshot operation. - - Typically these are written to a http.Request. -*/ -type DeleteDiskSnapshotParams struct { - - // ID. - ID string - - // ProjectID. - ProjectID string - - // SnapshotID. - SnapshotID string - - // VMID. - VMID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete disk snapshot params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteDiskSnapshotParams) WithDefaults() *DeleteDiskSnapshotParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete disk snapshot params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteDiskSnapshotParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete disk snapshot params -func (o *DeleteDiskSnapshotParams) WithTimeout(timeout time.Duration) *DeleteDiskSnapshotParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete disk snapshot params -func (o *DeleteDiskSnapshotParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete disk snapshot params -func (o *DeleteDiskSnapshotParams) WithContext(ctx context.Context) *DeleteDiskSnapshotParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete disk snapshot params -func (o *DeleteDiskSnapshotParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete disk snapshot params -func (o *DeleteDiskSnapshotParams) WithHTTPClient(client *http.Client) *DeleteDiskSnapshotParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete disk snapshot params -func (o *DeleteDiskSnapshotParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the delete disk snapshot params -func (o *DeleteDiskSnapshotParams) WithID(id string) *DeleteDiskSnapshotParams { - o.SetID(id) - return o -} - -// SetID adds the id to the delete disk snapshot params -func (o *DeleteDiskSnapshotParams) SetID(id string) { - o.ID = id -} - -// WithProjectID adds the projectID to the delete disk snapshot params -func (o *DeleteDiskSnapshotParams) WithProjectID(projectID string) *DeleteDiskSnapshotParams { - o.SetProjectID(projectID) - return o -} - -// SetProjectID adds the projectId to the delete disk snapshot params -func (o *DeleteDiskSnapshotParams) SetProjectID(projectID string) { - o.ProjectID = projectID -} - -// WithSnapshotID adds the snapshotID to the delete disk snapshot params -func (o *DeleteDiskSnapshotParams) WithSnapshotID(snapshotID string) *DeleteDiskSnapshotParams { - o.SetSnapshotID(snapshotID) - return o -} - -// SetSnapshotID adds the snapshotId to the delete disk snapshot params -func (o *DeleteDiskSnapshotParams) SetSnapshotID(snapshotID string) { - o.SnapshotID = snapshotID -} - -// WithVMID adds the vMID to the delete disk snapshot params -func (o *DeleteDiskSnapshotParams) WithVMID(vMID string) *DeleteDiskSnapshotParams { - o.SetVMID(vMID) - return o -} - -// SetVMID adds the vmId to the delete disk snapshot params -func (o *DeleteDiskSnapshotParams) SetVMID(vMID string) { - o.VMID = vMID -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteDiskSnapshotParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - // path param projectId - if err := r.SetPathParam("projectId", o.ProjectID); err != nil { - return err - } - - // query param snapshotId - qrSnapshotID := o.SnapshotID - qSnapshotID := qrSnapshotID - if qSnapshotID != "" { - - if err := r.SetQueryParam("snapshotId", qSnapshotID); err != nil { - return err - } - } - - // query param vmId - qrVMID := o.VMID - qVMID := qrVMID - if qVMID != "" { - - if err := r.SetQueryParam("vmId", qVMID); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/internal/client/virtual_machines/delete_disk_snapshot_responses.go b/internal/client/virtual_machines/delete_disk_snapshot_responses.go deleted file mode 100644 index 0ac23a0..0000000 --- a/internal/client/virtual_machines/delete_disk_snapshot_responses.go +++ /dev/null @@ -1,180 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package virtual_machines - -// 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/CudoVentures/terraform-provider-cudo/internal/models" -) - -// DeleteDiskSnapshotReader is a Reader for the DeleteDiskSnapshot structure. -type DeleteDiskSnapshotReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteDiskSnapshotReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDeleteDiskSnapshotOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewDeleteDiskSnapshotDefault(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 - } -} - -// NewDeleteDiskSnapshotOK creates a DeleteDiskSnapshotOK with default headers values -func NewDeleteDiskSnapshotOK() *DeleteDiskSnapshotOK { - return &DeleteDiskSnapshotOK{} -} - -/* -DeleteDiskSnapshotOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type DeleteDiskSnapshotOK struct { - Payload models.DeleteDiskSnapshotResponse -} - -// IsSuccess returns true when this delete disk snapshot o k response has a 2xx status code -func (o *DeleteDiskSnapshotOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this delete disk snapshot o k response has a 3xx status code -func (o *DeleteDiskSnapshotOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete disk snapshot o k response has a 4xx status code -func (o *DeleteDiskSnapshotOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this delete disk snapshot o k response has a 5xx status code -func (o *DeleteDiskSnapshotOK) IsServerError() bool { - return false -} - -// IsCode returns true when this delete disk snapshot o k response a status code equal to that given -func (o *DeleteDiskSnapshotOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the delete disk snapshot o k response -func (o *DeleteDiskSnapshotOK) Code() int { - return 200 -} - -func (o *DeleteDiskSnapshotOK) Error() string { - return fmt.Sprintf("[DELETE /v1/projects/{projectId}/disks/{id}/snapshots][%d] deleteDiskSnapshotOK %+v", 200, o.Payload) -} - -func (o *DeleteDiskSnapshotOK) String() string { - return fmt.Sprintf("[DELETE /v1/projects/{projectId}/disks/{id}/snapshots][%d] deleteDiskSnapshotOK %+v", 200, o.Payload) -} - -func (o *DeleteDiskSnapshotOK) GetPayload() models.DeleteDiskSnapshotResponse { - return o.Payload -} - -func (o *DeleteDiskSnapshotOK) 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 -} - -// NewDeleteDiskSnapshotDefault creates a DeleteDiskSnapshotDefault with default headers values -func NewDeleteDiskSnapshotDefault(code int) *DeleteDiskSnapshotDefault { - return &DeleteDiskSnapshotDefault{ - _statusCode: code, - } -} - -/* -DeleteDiskSnapshotDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type DeleteDiskSnapshotDefault struct { - _statusCode int - - Payload *models.Status -} - -// IsSuccess returns true when this delete disk snapshot default response has a 2xx status code -func (o *DeleteDiskSnapshotDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this delete disk snapshot default response has a 3xx status code -func (o *DeleteDiskSnapshotDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this delete disk snapshot default response has a 4xx status code -func (o *DeleteDiskSnapshotDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this delete disk snapshot default response has a 5xx status code -func (o *DeleteDiskSnapshotDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this delete disk snapshot default response a status code equal to that given -func (o *DeleteDiskSnapshotDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the delete disk snapshot default response -func (o *DeleteDiskSnapshotDefault) Code() int { - return o._statusCode -} - -func (o *DeleteDiskSnapshotDefault) Error() string { - return fmt.Sprintf("[DELETE /v1/projects/{projectId}/disks/{id}/snapshots][%d] DeleteDiskSnapshot default %+v", o._statusCode, o.Payload) -} - -func (o *DeleteDiskSnapshotDefault) String() string { - return fmt.Sprintf("[DELETE /v1/projects/{projectId}/disks/{id}/snapshots][%d] DeleteDiskSnapshot default %+v", o._statusCode, o.Payload) -} - -func (o *DeleteDiskSnapshotDefault) GetPayload() *models.Status { - return o.Payload -} - -func (o *DeleteDiskSnapshotDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Status) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/internal/client/virtual_machines/delete_vm_snapshot_parameters.go b/internal/client/virtual_machines/delete_vm_snapshot_parameters.go deleted file mode 100644 index b7f566b..0000000 --- a/internal/client/virtual_machines/delete_vm_snapshot_parameters.go +++ /dev/null @@ -1,191 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package virtual_machines - -// 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" -) - -// NewDeleteVMSnapshotParams creates a new DeleteVMSnapshotParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteVMSnapshotParams() *DeleteVMSnapshotParams { - return &DeleteVMSnapshotParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteVMSnapshotParamsWithTimeout creates a new DeleteVMSnapshotParams object -// with the ability to set a timeout on a request. -func NewDeleteVMSnapshotParamsWithTimeout(timeout time.Duration) *DeleteVMSnapshotParams { - return &DeleteVMSnapshotParams{ - timeout: timeout, - } -} - -// NewDeleteVMSnapshotParamsWithContext creates a new DeleteVMSnapshotParams object -// with the ability to set a context for a request. -func NewDeleteVMSnapshotParamsWithContext(ctx context.Context) *DeleteVMSnapshotParams { - return &DeleteVMSnapshotParams{ - Context: ctx, - } -} - -// NewDeleteVMSnapshotParamsWithHTTPClient creates a new DeleteVMSnapshotParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteVMSnapshotParamsWithHTTPClient(client *http.Client) *DeleteVMSnapshotParams { - return &DeleteVMSnapshotParams{ - HTTPClient: client, - } -} - -/* -DeleteVMSnapshotParams contains all the parameters to send to the API endpoint - - for the delete VM snapshot operation. - - Typically these are written to a http.Request. -*/ -type DeleteVMSnapshotParams struct { - - // ID. - ID string - - // ProjectID. - ProjectID string - - // SnapshotID. - SnapshotID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete VM snapshot params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteVMSnapshotParams) WithDefaults() *DeleteVMSnapshotParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete VM snapshot params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteVMSnapshotParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete VM snapshot params -func (o *DeleteVMSnapshotParams) WithTimeout(timeout time.Duration) *DeleteVMSnapshotParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete VM snapshot params -func (o *DeleteVMSnapshotParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete VM snapshot params -func (o *DeleteVMSnapshotParams) WithContext(ctx context.Context) *DeleteVMSnapshotParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete VM snapshot params -func (o *DeleteVMSnapshotParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete VM snapshot params -func (o *DeleteVMSnapshotParams) WithHTTPClient(client *http.Client) *DeleteVMSnapshotParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete VM snapshot params -func (o *DeleteVMSnapshotParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the delete VM snapshot params -func (o *DeleteVMSnapshotParams) WithID(id string) *DeleteVMSnapshotParams { - o.SetID(id) - return o -} - -// SetID adds the id to the delete VM snapshot params -func (o *DeleteVMSnapshotParams) SetID(id string) { - o.ID = id -} - -// WithProjectID adds the projectID to the delete VM snapshot params -func (o *DeleteVMSnapshotParams) WithProjectID(projectID string) *DeleteVMSnapshotParams { - o.SetProjectID(projectID) - return o -} - -// SetProjectID adds the projectId to the delete VM snapshot params -func (o *DeleteVMSnapshotParams) SetProjectID(projectID string) { - o.ProjectID = projectID -} - -// WithSnapshotID adds the snapshotID to the delete VM snapshot params -func (o *DeleteVMSnapshotParams) WithSnapshotID(snapshotID string) *DeleteVMSnapshotParams { - o.SetSnapshotID(snapshotID) - return o -} - -// SetSnapshotID adds the snapshotId to the delete VM snapshot params -func (o *DeleteVMSnapshotParams) SetSnapshotID(snapshotID string) { - o.SnapshotID = snapshotID -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteVMSnapshotParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - // path param projectId - if err := r.SetPathParam("projectId", o.ProjectID); err != nil { - return err - } - - // query param snapshotId - qrSnapshotID := o.SnapshotID - qSnapshotID := qrSnapshotID - if qSnapshotID != "" { - - if err := r.SetQueryParam("snapshotId", qSnapshotID); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/internal/client/virtual_machines/delete_vm_snapshot_responses.go b/internal/client/virtual_machines/delete_vm_snapshot_responses.go deleted file mode 100644 index 197131b..0000000 --- a/internal/client/virtual_machines/delete_vm_snapshot_responses.go +++ /dev/null @@ -1,180 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package virtual_machines - -// 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/CudoVentures/terraform-provider-cudo/internal/models" -) - -// DeleteVMSnapshotReader is a Reader for the DeleteVMSnapshot structure. -type DeleteVMSnapshotReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteVMSnapshotReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDeleteVMSnapshotOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewDeleteVMSnapshotDefault(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 - } -} - -// NewDeleteVMSnapshotOK creates a DeleteVMSnapshotOK with default headers values -func NewDeleteVMSnapshotOK() *DeleteVMSnapshotOK { - return &DeleteVMSnapshotOK{} -} - -/* -DeleteVMSnapshotOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type DeleteVMSnapshotOK struct { - Payload models.DeleteVMSnapshotResponse -} - -// IsSuccess returns true when this delete Vm snapshot o k response has a 2xx status code -func (o *DeleteVMSnapshotOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this delete Vm snapshot o k response has a 3xx status code -func (o *DeleteVMSnapshotOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete Vm snapshot o k response has a 4xx status code -func (o *DeleteVMSnapshotOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this delete Vm snapshot o k response has a 5xx status code -func (o *DeleteVMSnapshotOK) IsServerError() bool { - return false -} - -// IsCode returns true when this delete Vm snapshot o k response a status code equal to that given -func (o *DeleteVMSnapshotOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the delete Vm snapshot o k response -func (o *DeleteVMSnapshotOK) Code() int { - return 200 -} - -func (o *DeleteVMSnapshotOK) Error() string { - return fmt.Sprintf("[DELETE /v1/projects/{projectId}/vms/{id}/snapshots][%d] deleteVmSnapshotOK %+v", 200, o.Payload) -} - -func (o *DeleteVMSnapshotOK) String() string { - return fmt.Sprintf("[DELETE /v1/projects/{projectId}/vms/{id}/snapshots][%d] deleteVmSnapshotOK %+v", 200, o.Payload) -} - -func (o *DeleteVMSnapshotOK) GetPayload() models.DeleteVMSnapshotResponse { - return o.Payload -} - -func (o *DeleteVMSnapshotOK) 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 -} - -// NewDeleteVMSnapshotDefault creates a DeleteVMSnapshotDefault with default headers values -func NewDeleteVMSnapshotDefault(code int) *DeleteVMSnapshotDefault { - return &DeleteVMSnapshotDefault{ - _statusCode: code, - } -} - -/* -DeleteVMSnapshotDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type DeleteVMSnapshotDefault struct { - _statusCode int - - Payload *models.Status -} - -// IsSuccess returns true when this delete VM snapshot default response has a 2xx status code -func (o *DeleteVMSnapshotDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this delete VM snapshot default response has a 3xx status code -func (o *DeleteVMSnapshotDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this delete VM snapshot default response has a 4xx status code -func (o *DeleteVMSnapshotDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this delete VM snapshot default response has a 5xx status code -func (o *DeleteVMSnapshotDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this delete VM snapshot default response a status code equal to that given -func (o *DeleteVMSnapshotDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the delete VM snapshot default response -func (o *DeleteVMSnapshotDefault) Code() int { - return o._statusCode -} - -func (o *DeleteVMSnapshotDefault) Error() string { - return fmt.Sprintf("[DELETE /v1/projects/{projectId}/vms/{id}/snapshots][%d] DeleteVMSnapshot default %+v", o._statusCode, o.Payload) -} - -func (o *DeleteVMSnapshotDefault) String() string { - return fmt.Sprintf("[DELETE /v1/projects/{projectId}/vms/{id}/snapshots][%d] DeleteVMSnapshot default %+v", o._statusCode, o.Payload) -} - -func (o *DeleteVMSnapshotDefault) GetPayload() *models.Status { - return o.Payload -} - -func (o *DeleteVMSnapshotDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Status) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/internal/client/virtual_machines/list_disk_snapshots_parameters.go b/internal/client/virtual_machines/list_disk_snapshots_parameters.go deleted file mode 100644 index 2acdbc0..0000000 --- a/internal/client/virtual_machines/list_disk_snapshots_parameters.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package virtual_machines - -// 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" -) - -// NewListDiskSnapshotsParams creates a new ListDiskSnapshotsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListDiskSnapshotsParams() *ListDiskSnapshotsParams { - return &ListDiskSnapshotsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListDiskSnapshotsParamsWithTimeout creates a new ListDiskSnapshotsParams object -// with the ability to set a timeout on a request. -func NewListDiskSnapshotsParamsWithTimeout(timeout time.Duration) *ListDiskSnapshotsParams { - return &ListDiskSnapshotsParams{ - timeout: timeout, - } -} - -// NewListDiskSnapshotsParamsWithContext creates a new ListDiskSnapshotsParams object -// with the ability to set a context for a request. -func NewListDiskSnapshotsParamsWithContext(ctx context.Context) *ListDiskSnapshotsParams { - return &ListDiskSnapshotsParams{ - Context: ctx, - } -} - -// NewListDiskSnapshotsParamsWithHTTPClient creates a new ListDiskSnapshotsParams object -// with the ability to set a custom HTTPClient for a request. -func NewListDiskSnapshotsParamsWithHTTPClient(client *http.Client) *ListDiskSnapshotsParams { - return &ListDiskSnapshotsParams{ - HTTPClient: client, - } -} - -/* -ListDiskSnapshotsParams contains all the parameters to send to the API endpoint - - for the list disk snapshots operation. - - Typically these are written to a http.Request. -*/ -type ListDiskSnapshotsParams struct { - - // ID. - ID string - - // ProjectID. - ProjectID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list disk snapshots params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListDiskSnapshotsParams) WithDefaults() *ListDiskSnapshotsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list disk snapshots params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListDiskSnapshotsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list disk snapshots params -func (o *ListDiskSnapshotsParams) WithTimeout(timeout time.Duration) *ListDiskSnapshotsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list disk snapshots params -func (o *ListDiskSnapshotsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list disk snapshots params -func (o *ListDiskSnapshotsParams) WithContext(ctx context.Context) *ListDiskSnapshotsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list disk snapshots params -func (o *ListDiskSnapshotsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list disk snapshots params -func (o *ListDiskSnapshotsParams) WithHTTPClient(client *http.Client) *ListDiskSnapshotsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list disk snapshots params -func (o *ListDiskSnapshotsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the list disk snapshots params -func (o *ListDiskSnapshotsParams) WithID(id string) *ListDiskSnapshotsParams { - o.SetID(id) - return o -} - -// SetID adds the id to the list disk snapshots params -func (o *ListDiskSnapshotsParams) SetID(id string) { - o.ID = id -} - -// WithProjectID adds the projectID to the list disk snapshots params -func (o *ListDiskSnapshotsParams) WithProjectID(projectID string) *ListDiskSnapshotsParams { - o.SetProjectID(projectID) - return o -} - -// SetProjectID adds the projectId to the list disk snapshots params -func (o *ListDiskSnapshotsParams) SetProjectID(projectID string) { - o.ProjectID = projectID -} - -// WriteToRequest writes these params to a swagger request -func (o *ListDiskSnapshotsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - // path param projectId - if err := r.SetPathParam("projectId", o.ProjectID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/internal/client/virtual_machines/list_disk_snapshots_responses.go b/internal/client/virtual_machines/list_disk_snapshots_responses.go deleted file mode 100644 index c76f1b3..0000000 --- a/internal/client/virtual_machines/list_disk_snapshots_responses.go +++ /dev/null @@ -1,182 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package virtual_machines - -// 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/CudoVentures/terraform-provider-cudo/internal/models" -) - -// ListDiskSnapshotsReader is a Reader for the ListDiskSnapshots structure. -type ListDiskSnapshotsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListDiskSnapshotsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListDiskSnapshotsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewListDiskSnapshotsDefault(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 - } -} - -// NewListDiskSnapshotsOK creates a ListDiskSnapshotsOK with default headers values -func NewListDiskSnapshotsOK() *ListDiskSnapshotsOK { - return &ListDiskSnapshotsOK{} -} - -/* -ListDiskSnapshotsOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ListDiskSnapshotsOK struct { - Payload *models.ListDiskSnapshotsResponse -} - -// IsSuccess returns true when this list disk snapshots o k response has a 2xx status code -func (o *ListDiskSnapshotsOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this list disk snapshots o k response has a 3xx status code -func (o *ListDiskSnapshotsOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list disk snapshots o k response has a 4xx status code -func (o *ListDiskSnapshotsOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this list disk snapshots o k response has a 5xx status code -func (o *ListDiskSnapshotsOK) IsServerError() bool { - return false -} - -// IsCode returns true when this list disk snapshots o k response a status code equal to that given -func (o *ListDiskSnapshotsOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the list disk snapshots o k response -func (o *ListDiskSnapshotsOK) Code() int { - return 200 -} - -func (o *ListDiskSnapshotsOK) Error() string { - return fmt.Sprintf("[GET /v1/projects/{projectId}/disks/{id}/snapshots][%d] listDiskSnapshotsOK %+v", 200, o.Payload) -} - -func (o *ListDiskSnapshotsOK) String() string { - return fmt.Sprintf("[GET /v1/projects/{projectId}/disks/{id}/snapshots][%d] listDiskSnapshotsOK %+v", 200, o.Payload) -} - -func (o *ListDiskSnapshotsOK) GetPayload() *models.ListDiskSnapshotsResponse { - return o.Payload -} - -func (o *ListDiskSnapshotsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ListDiskSnapshotsResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListDiskSnapshotsDefault creates a ListDiskSnapshotsDefault with default headers values -func NewListDiskSnapshotsDefault(code int) *ListDiskSnapshotsDefault { - return &ListDiskSnapshotsDefault{ - _statusCode: code, - } -} - -/* -ListDiskSnapshotsDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ListDiskSnapshotsDefault struct { - _statusCode int - - Payload *models.Status -} - -// IsSuccess returns true when this list disk snapshots default response has a 2xx status code -func (o *ListDiskSnapshotsDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this list disk snapshots default response has a 3xx status code -func (o *ListDiskSnapshotsDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this list disk snapshots default response has a 4xx status code -func (o *ListDiskSnapshotsDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this list disk snapshots default response has a 5xx status code -func (o *ListDiskSnapshotsDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this list disk snapshots default response a status code equal to that given -func (o *ListDiskSnapshotsDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the list disk snapshots default response -func (o *ListDiskSnapshotsDefault) Code() int { - return o._statusCode -} - -func (o *ListDiskSnapshotsDefault) Error() string { - return fmt.Sprintf("[GET /v1/projects/{projectId}/disks/{id}/snapshots][%d] ListDiskSnapshots default %+v", o._statusCode, o.Payload) -} - -func (o *ListDiskSnapshotsDefault) String() string { - return fmt.Sprintf("[GET /v1/projects/{projectId}/disks/{id}/snapshots][%d] ListDiskSnapshots default %+v", o._statusCode, o.Payload) -} - -func (o *ListDiskSnapshotsDefault) GetPayload() *models.Status { - return o.Payload -} - -func (o *ListDiskSnapshotsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Status) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/internal/client/virtual_machines/list_vm_snapshots_parameters.go b/internal/client/virtual_machines/list_vm_snapshots_parameters.go deleted file mode 100644 index e3ac4d6..0000000 --- a/internal/client/virtual_machines/list_vm_snapshots_parameters.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package virtual_machines - -// 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" -) - -// NewListVMSnapshotsParams creates a new ListVMSnapshotsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListVMSnapshotsParams() *ListVMSnapshotsParams { - return &ListVMSnapshotsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListVMSnapshotsParamsWithTimeout creates a new ListVMSnapshotsParams object -// with the ability to set a timeout on a request. -func NewListVMSnapshotsParamsWithTimeout(timeout time.Duration) *ListVMSnapshotsParams { - return &ListVMSnapshotsParams{ - timeout: timeout, - } -} - -// NewListVMSnapshotsParamsWithContext creates a new ListVMSnapshotsParams object -// with the ability to set a context for a request. -func NewListVMSnapshotsParamsWithContext(ctx context.Context) *ListVMSnapshotsParams { - return &ListVMSnapshotsParams{ - Context: ctx, - } -} - -// NewListVMSnapshotsParamsWithHTTPClient creates a new ListVMSnapshotsParams object -// with the ability to set a custom HTTPClient for a request. -func NewListVMSnapshotsParamsWithHTTPClient(client *http.Client) *ListVMSnapshotsParams { - return &ListVMSnapshotsParams{ - HTTPClient: client, - } -} - -/* -ListVMSnapshotsParams contains all the parameters to send to the API endpoint - - for the list VM snapshots operation. - - Typically these are written to a http.Request. -*/ -type ListVMSnapshotsParams struct { - - // ID. - ID string - - // ProjectID. - ProjectID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list VM snapshots params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListVMSnapshotsParams) WithDefaults() *ListVMSnapshotsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list VM snapshots params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListVMSnapshotsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list VM snapshots params -func (o *ListVMSnapshotsParams) WithTimeout(timeout time.Duration) *ListVMSnapshotsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list VM snapshots params -func (o *ListVMSnapshotsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list VM snapshots params -func (o *ListVMSnapshotsParams) WithContext(ctx context.Context) *ListVMSnapshotsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list VM snapshots params -func (o *ListVMSnapshotsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list VM snapshots params -func (o *ListVMSnapshotsParams) WithHTTPClient(client *http.Client) *ListVMSnapshotsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list VM snapshots params -func (o *ListVMSnapshotsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the list VM snapshots params -func (o *ListVMSnapshotsParams) WithID(id string) *ListVMSnapshotsParams { - o.SetID(id) - return o -} - -// SetID adds the id to the list VM snapshots params -func (o *ListVMSnapshotsParams) SetID(id string) { - o.ID = id -} - -// WithProjectID adds the projectID to the list VM snapshots params -func (o *ListVMSnapshotsParams) WithProjectID(projectID string) *ListVMSnapshotsParams { - o.SetProjectID(projectID) - return o -} - -// SetProjectID adds the projectId to the list VM snapshots params -func (o *ListVMSnapshotsParams) SetProjectID(projectID string) { - o.ProjectID = projectID -} - -// WriteToRequest writes these params to a swagger request -func (o *ListVMSnapshotsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - // path param projectId - if err := r.SetPathParam("projectId", o.ProjectID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/internal/client/virtual_machines/list_vm_snapshots_responses.go b/internal/client/virtual_machines/list_vm_snapshots_responses.go deleted file mode 100644 index da0edc1..0000000 --- a/internal/client/virtual_machines/list_vm_snapshots_responses.go +++ /dev/null @@ -1,182 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package virtual_machines - -// 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/CudoVentures/terraform-provider-cudo/internal/models" -) - -// ListVMSnapshotsReader is a Reader for the ListVMSnapshots structure. -type ListVMSnapshotsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListVMSnapshotsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListVMSnapshotsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewListVMSnapshotsDefault(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 - } -} - -// NewListVMSnapshotsOK creates a ListVMSnapshotsOK with default headers values -func NewListVMSnapshotsOK() *ListVMSnapshotsOK { - return &ListVMSnapshotsOK{} -} - -/* -ListVMSnapshotsOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ListVMSnapshotsOK struct { - Payload *models.ListVMSnapshotsResponse -} - -// IsSuccess returns true when this list Vm snapshots o k response has a 2xx status code -func (o *ListVMSnapshotsOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this list Vm snapshots o k response has a 3xx status code -func (o *ListVMSnapshotsOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list Vm snapshots o k response has a 4xx status code -func (o *ListVMSnapshotsOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this list Vm snapshots o k response has a 5xx status code -func (o *ListVMSnapshotsOK) IsServerError() bool { - return false -} - -// IsCode returns true when this list Vm snapshots o k response a status code equal to that given -func (o *ListVMSnapshotsOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the list Vm snapshots o k response -func (o *ListVMSnapshotsOK) Code() int { - return 200 -} - -func (o *ListVMSnapshotsOK) Error() string { - return fmt.Sprintf("[GET /v1/projects/{projectId}/vms/{id}/snapshots][%d] listVmSnapshotsOK %+v", 200, o.Payload) -} - -func (o *ListVMSnapshotsOK) String() string { - return fmt.Sprintf("[GET /v1/projects/{projectId}/vms/{id}/snapshots][%d] listVmSnapshotsOK %+v", 200, o.Payload) -} - -func (o *ListVMSnapshotsOK) GetPayload() *models.ListVMSnapshotsResponse { - return o.Payload -} - -func (o *ListVMSnapshotsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ListVMSnapshotsResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListVMSnapshotsDefault creates a ListVMSnapshotsDefault with default headers values -func NewListVMSnapshotsDefault(code int) *ListVMSnapshotsDefault { - return &ListVMSnapshotsDefault{ - _statusCode: code, - } -} - -/* -ListVMSnapshotsDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ListVMSnapshotsDefault struct { - _statusCode int - - Payload *models.Status -} - -// IsSuccess returns true when this list VM snapshots default response has a 2xx status code -func (o *ListVMSnapshotsDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this list VM snapshots default response has a 3xx status code -func (o *ListVMSnapshotsDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this list VM snapshots default response has a 4xx status code -func (o *ListVMSnapshotsDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this list VM snapshots default response has a 5xx status code -func (o *ListVMSnapshotsDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this list VM snapshots default response a status code equal to that given -func (o *ListVMSnapshotsDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the list VM snapshots default response -func (o *ListVMSnapshotsDefault) Code() int { - return o._statusCode -} - -func (o *ListVMSnapshotsDefault) Error() string { - return fmt.Sprintf("[GET /v1/projects/{projectId}/vms/{id}/snapshots][%d] ListVMSnapshots default %+v", o._statusCode, o.Payload) -} - -func (o *ListVMSnapshotsDefault) String() string { - return fmt.Sprintf("[GET /v1/projects/{projectId}/vms/{id}/snapshots][%d] ListVMSnapshots default %+v", o._statusCode, o.Payload) -} - -func (o *ListVMSnapshotsDefault) GetPayload() *models.Status { - return o.Payload -} - -func (o *ListVMSnapshotsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Status) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/internal/client/virtual_machines/revert_disk_parameters.go b/internal/client/virtual_machines/revert_disk_parameters.go deleted file mode 100644 index cdeacc9..0000000 --- a/internal/client/virtual_machines/revert_disk_parameters.go +++ /dev/null @@ -1,215 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package virtual_machines - -// 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" -) - -// NewRevertDiskParams creates a new RevertDiskParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewRevertDiskParams() *RevertDiskParams { - return &RevertDiskParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewRevertDiskParamsWithTimeout creates a new RevertDiskParams object -// with the ability to set a timeout on a request. -func NewRevertDiskParamsWithTimeout(timeout time.Duration) *RevertDiskParams { - return &RevertDiskParams{ - timeout: timeout, - } -} - -// NewRevertDiskParamsWithContext creates a new RevertDiskParams object -// with the ability to set a context for a request. -func NewRevertDiskParamsWithContext(ctx context.Context) *RevertDiskParams { - return &RevertDiskParams{ - Context: ctx, - } -} - -// NewRevertDiskParamsWithHTTPClient creates a new RevertDiskParams object -// with the ability to set a custom HTTPClient for a request. -func NewRevertDiskParamsWithHTTPClient(client *http.Client) *RevertDiskParams { - return &RevertDiskParams{ - HTTPClient: client, - } -} - -/* -RevertDiskParams contains all the parameters to send to the API endpoint - - for the revert disk operation. - - Typically these are written to a http.Request. -*/ -type RevertDiskParams struct { - - // ID. - ID string - - // ProjectID. - ProjectID string - - // SnapshotID. - SnapshotID string - - // VMID. - VMID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the revert disk params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RevertDiskParams) WithDefaults() *RevertDiskParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the revert disk params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RevertDiskParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the revert disk params -func (o *RevertDiskParams) WithTimeout(timeout time.Duration) *RevertDiskParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the revert disk params -func (o *RevertDiskParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the revert disk params -func (o *RevertDiskParams) WithContext(ctx context.Context) *RevertDiskParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the revert disk params -func (o *RevertDiskParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the revert disk params -func (o *RevertDiskParams) WithHTTPClient(client *http.Client) *RevertDiskParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the revert disk params -func (o *RevertDiskParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the revert disk params -func (o *RevertDiskParams) WithID(id string) *RevertDiskParams { - o.SetID(id) - return o -} - -// SetID adds the id to the revert disk params -func (o *RevertDiskParams) SetID(id string) { - o.ID = id -} - -// WithProjectID adds the projectID to the revert disk params -func (o *RevertDiskParams) WithProjectID(projectID string) *RevertDiskParams { - o.SetProjectID(projectID) - return o -} - -// SetProjectID adds the projectId to the revert disk params -func (o *RevertDiskParams) SetProjectID(projectID string) { - o.ProjectID = projectID -} - -// WithSnapshotID adds the snapshotID to the revert disk params -func (o *RevertDiskParams) WithSnapshotID(snapshotID string) *RevertDiskParams { - o.SetSnapshotID(snapshotID) - return o -} - -// SetSnapshotID adds the snapshotId to the revert disk params -func (o *RevertDiskParams) SetSnapshotID(snapshotID string) { - o.SnapshotID = snapshotID -} - -// WithVMID adds the vMID to the revert disk params -func (o *RevertDiskParams) WithVMID(vMID string) *RevertDiskParams { - o.SetVMID(vMID) - return o -} - -// SetVMID adds the vmId to the revert disk params -func (o *RevertDiskParams) SetVMID(vMID string) { - o.VMID = vMID -} - -// WriteToRequest writes these params to a swagger request -func (o *RevertDiskParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - // path param projectId - if err := r.SetPathParam("projectId", o.ProjectID); err != nil { - return err - } - - // query param snapshotId - qrSnapshotID := o.SnapshotID - qSnapshotID := qrSnapshotID - if qSnapshotID != "" { - - if err := r.SetQueryParam("snapshotId", qSnapshotID); err != nil { - return err - } - } - - // query param vmId - qrVMID := o.VMID - qVMID := qrVMID - if qVMID != "" { - - if err := r.SetQueryParam("vmId", qVMID); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/internal/client/virtual_machines/revert_disk_responses.go b/internal/client/virtual_machines/revert_disk_responses.go deleted file mode 100644 index 3d46560..0000000 --- a/internal/client/virtual_machines/revert_disk_responses.go +++ /dev/null @@ -1,180 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package virtual_machines - -// 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/CudoVentures/terraform-provider-cudo/internal/models" -) - -// RevertDiskReader is a Reader for the RevertDisk structure. -type RevertDiskReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *RevertDiskReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewRevertDiskOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewRevertDiskDefault(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 - } -} - -// NewRevertDiskOK creates a RevertDiskOK with default headers values -func NewRevertDiskOK() *RevertDiskOK { - return &RevertDiskOK{} -} - -/* -RevertDiskOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type RevertDiskOK struct { - Payload models.RevertDiskResponse -} - -// IsSuccess returns true when this revert disk o k response has a 2xx status code -func (o *RevertDiskOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this revert disk o k response has a 3xx status code -func (o *RevertDiskOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this revert disk o k response has a 4xx status code -func (o *RevertDiskOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this revert disk o k response has a 5xx status code -func (o *RevertDiskOK) IsServerError() bool { - return false -} - -// IsCode returns true when this revert disk o k response a status code equal to that given -func (o *RevertDiskOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the revert disk o k response -func (o *RevertDiskOK) Code() int { - return 200 -} - -func (o *RevertDiskOK) Error() string { - return fmt.Sprintf("[POST /v1/projects/{projectId}/disks/{id}/revert][%d] revertDiskOK %+v", 200, o.Payload) -} - -func (o *RevertDiskOK) String() string { - return fmt.Sprintf("[POST /v1/projects/{projectId}/disks/{id}/revert][%d] revertDiskOK %+v", 200, o.Payload) -} - -func (o *RevertDiskOK) GetPayload() models.RevertDiskResponse { - return o.Payload -} - -func (o *RevertDiskOK) 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 -} - -// NewRevertDiskDefault creates a RevertDiskDefault with default headers values -func NewRevertDiskDefault(code int) *RevertDiskDefault { - return &RevertDiskDefault{ - _statusCode: code, - } -} - -/* -RevertDiskDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type RevertDiskDefault struct { - _statusCode int - - Payload *models.Status -} - -// IsSuccess returns true when this revert disk default response has a 2xx status code -func (o *RevertDiskDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this revert disk default response has a 3xx status code -func (o *RevertDiskDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this revert disk default response has a 4xx status code -func (o *RevertDiskDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this revert disk default response has a 5xx status code -func (o *RevertDiskDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this revert disk default response a status code equal to that given -func (o *RevertDiskDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the revert disk default response -func (o *RevertDiskDefault) Code() int { - return o._statusCode -} - -func (o *RevertDiskDefault) Error() string { - return fmt.Sprintf("[POST /v1/projects/{projectId}/disks/{id}/revert][%d] RevertDisk default %+v", o._statusCode, o.Payload) -} - -func (o *RevertDiskDefault) String() string { - return fmt.Sprintf("[POST /v1/projects/{projectId}/disks/{id}/revert][%d] RevertDisk default %+v", o._statusCode, o.Payload) -} - -func (o *RevertDiskDefault) GetPayload() *models.Status { - return o.Payload -} - -func (o *RevertDiskDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Status) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/internal/client/virtual_machines/revert_vm_parameters.go b/internal/client/virtual_machines/revert_vm_parameters.go deleted file mode 100644 index d06b79c..0000000 --- a/internal/client/virtual_machines/revert_vm_parameters.go +++ /dev/null @@ -1,191 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package virtual_machines - -// 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" -) - -// NewRevertVMParams creates a new RevertVMParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewRevertVMParams() *RevertVMParams { - return &RevertVMParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewRevertVMParamsWithTimeout creates a new RevertVMParams object -// with the ability to set a timeout on a request. -func NewRevertVMParamsWithTimeout(timeout time.Duration) *RevertVMParams { - return &RevertVMParams{ - timeout: timeout, - } -} - -// NewRevertVMParamsWithContext creates a new RevertVMParams object -// with the ability to set a context for a request. -func NewRevertVMParamsWithContext(ctx context.Context) *RevertVMParams { - return &RevertVMParams{ - Context: ctx, - } -} - -// NewRevertVMParamsWithHTTPClient creates a new RevertVMParams object -// with the ability to set a custom HTTPClient for a request. -func NewRevertVMParamsWithHTTPClient(client *http.Client) *RevertVMParams { - return &RevertVMParams{ - HTTPClient: client, - } -} - -/* -RevertVMParams contains all the parameters to send to the API endpoint - - for the revert VM operation. - - Typically these are written to a http.Request. -*/ -type RevertVMParams struct { - - // ID. - ID string - - // ProjectID. - ProjectID string - - // SnapshotID. - SnapshotID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the revert VM params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RevertVMParams) WithDefaults() *RevertVMParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the revert VM params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RevertVMParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the revert VM params -func (o *RevertVMParams) WithTimeout(timeout time.Duration) *RevertVMParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the revert VM params -func (o *RevertVMParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the revert VM params -func (o *RevertVMParams) WithContext(ctx context.Context) *RevertVMParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the revert VM params -func (o *RevertVMParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the revert VM params -func (o *RevertVMParams) WithHTTPClient(client *http.Client) *RevertVMParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the revert VM params -func (o *RevertVMParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the revert VM params -func (o *RevertVMParams) WithID(id string) *RevertVMParams { - o.SetID(id) - return o -} - -// SetID adds the id to the revert VM params -func (o *RevertVMParams) SetID(id string) { - o.ID = id -} - -// WithProjectID adds the projectID to the revert VM params -func (o *RevertVMParams) WithProjectID(projectID string) *RevertVMParams { - o.SetProjectID(projectID) - return o -} - -// SetProjectID adds the projectId to the revert VM params -func (o *RevertVMParams) SetProjectID(projectID string) { - o.ProjectID = projectID -} - -// WithSnapshotID adds the snapshotID to the revert VM params -func (o *RevertVMParams) WithSnapshotID(snapshotID string) *RevertVMParams { - o.SetSnapshotID(snapshotID) - return o -} - -// SetSnapshotID adds the snapshotId to the revert VM params -func (o *RevertVMParams) SetSnapshotID(snapshotID string) { - o.SnapshotID = snapshotID -} - -// WriteToRequest writes these params to a swagger request -func (o *RevertVMParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - // path param projectId - if err := r.SetPathParam("projectId", o.ProjectID); err != nil { - return err - } - - // query param snapshotId - qrSnapshotID := o.SnapshotID - qSnapshotID := qrSnapshotID - if qSnapshotID != "" { - - if err := r.SetQueryParam("snapshotId", qSnapshotID); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/internal/client/virtual_machines/revert_vm_responses.go b/internal/client/virtual_machines/revert_vm_responses.go deleted file mode 100644 index 21322c5..0000000 --- a/internal/client/virtual_machines/revert_vm_responses.go +++ /dev/null @@ -1,180 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package virtual_machines - -// 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/CudoVentures/terraform-provider-cudo/internal/models" -) - -// RevertVMReader is a Reader for the RevertVM structure. -type RevertVMReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *RevertVMReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewRevertVMOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewRevertVMDefault(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 - } -} - -// NewRevertVMOK creates a RevertVMOK with default headers values -func NewRevertVMOK() *RevertVMOK { - return &RevertVMOK{} -} - -/* -RevertVMOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type RevertVMOK struct { - Payload models.RevertVMResponse -} - -// IsSuccess returns true when this revert Vm o k response has a 2xx status code -func (o *RevertVMOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this revert Vm o k response has a 3xx status code -func (o *RevertVMOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this revert Vm o k response has a 4xx status code -func (o *RevertVMOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this revert Vm o k response has a 5xx status code -func (o *RevertVMOK) IsServerError() bool { - return false -} - -// IsCode returns true when this revert Vm o k response a status code equal to that given -func (o *RevertVMOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the revert Vm o k response -func (o *RevertVMOK) Code() int { - return 200 -} - -func (o *RevertVMOK) Error() string { - return fmt.Sprintf("[POST /v1/projects/{projectId}/vms/{id}/revert][%d] revertVmOK %+v", 200, o.Payload) -} - -func (o *RevertVMOK) String() string { - return fmt.Sprintf("[POST /v1/projects/{projectId}/vms/{id}/revert][%d] revertVmOK %+v", 200, o.Payload) -} - -func (o *RevertVMOK) GetPayload() models.RevertVMResponse { - return o.Payload -} - -func (o *RevertVMOK) 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 -} - -// NewRevertVMDefault creates a RevertVMDefault with default headers values -func NewRevertVMDefault(code int) *RevertVMDefault { - return &RevertVMDefault{ - _statusCode: code, - } -} - -/* -RevertVMDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type RevertVMDefault struct { - _statusCode int - - Payload *models.Status -} - -// IsSuccess returns true when this revert VM default response has a 2xx status code -func (o *RevertVMDefault) IsSuccess() bool { - return o._statusCode/100 == 2 -} - -// IsRedirect returns true when this revert VM default response has a 3xx status code -func (o *RevertVMDefault) IsRedirect() bool { - return o._statusCode/100 == 3 -} - -// IsClientError returns true when this revert VM default response has a 4xx status code -func (o *RevertVMDefault) IsClientError() bool { - return o._statusCode/100 == 4 -} - -// IsServerError returns true when this revert VM default response has a 5xx status code -func (o *RevertVMDefault) IsServerError() bool { - return o._statusCode/100 == 5 -} - -// IsCode returns true when this revert VM default response a status code equal to that given -func (o *RevertVMDefault) IsCode(code int) bool { - return o._statusCode == code -} - -// Code gets the status code for the revert VM default response -func (o *RevertVMDefault) Code() int { - return o._statusCode -} - -func (o *RevertVMDefault) Error() string { - return fmt.Sprintf("[POST /v1/projects/{projectId}/vms/{id}/revert][%d] RevertVM default %+v", o._statusCode, o.Payload) -} - -func (o *RevertVMDefault) String() string { - return fmt.Sprintf("[POST /v1/projects/{projectId}/vms/{id}/revert][%d] RevertVM default %+v", o._statusCode, o.Payload) -} - -func (o *RevertVMDefault) GetPayload() *models.Status { - return o.Payload -} - -func (o *RevertVMDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Status) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/internal/models/any.go b/internal/models/any.go deleted file mode 100644 index c0b479d..0000000 --- a/internal/models/any.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// Any any -// -// swagger:model Any -type Any struct { - - // at type - AtType string `json:"@type,omitempty"` -} - -// Validate validates this any -func (m *Any) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this any based on context it is used -func (m *Any) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *Any) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Any) UnmarshalBinary(b []byte) error { - var res Any - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/internal/models/create_vm_snapshot_response.go b/internal/models/create_vm_snapshot_response.go deleted file mode 100644 index 990335d..0000000 --- a/internal/models/create_vm_snapshot_response.go +++ /dev/null @@ -1,11 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -// CreateVMSnapshotResponse create VM snapshot response -// -// swagger:model CreateVMSnapshotResponse -type CreateVMSnapshotResponse interface{} diff --git a/internal/models/data_center.go b/internal/models/data_center.go deleted file mode 100644 index 112d3cd..0000000 --- a/internal/models/data_center.go +++ /dev/null @@ -1,122 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DataCenter data center -// -// swagger:model DataCenter -type DataCenter struct { - - // id - // Required: true - ID *string `json:"id"` - - // region Id - // Required: true - RegionID *string `json:"regionId"` - - // renewable energy - // Required: true - RenewableEnergy *bool `json:"renewableEnergy"` - - // supplier name - // Required: true - SupplierName *string `json:"supplierName"` -} - -// Validate validates this data center -func (m *DataCenter) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRegionID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRenewableEnergy(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSupplierName(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DataCenter) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *DataCenter) validateRegionID(formats strfmt.Registry) error { - - if err := validate.Required("regionId", "body", m.RegionID); err != nil { - return err - } - - return nil -} - -func (m *DataCenter) validateRenewableEnergy(formats strfmt.Registry) error { - - if err := validate.Required("renewableEnergy", "body", m.RenewableEnergy); err != nil { - return err - } - - return nil -} - -func (m *DataCenter) validateSupplierName(formats strfmt.Registry) error { - - if err := validate.Required("supplierName", "body", m.SupplierName); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this data center based on context it is used -func (m *DataCenter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *DataCenter) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DataCenter) UnmarshalBinary(b []byte) error { - var res DataCenter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/internal/models/delete_vm_snapshot_response.go b/internal/models/delete_vm_snapshot_response.go deleted file mode 100644 index a4dab02..0000000 --- a/internal/models/delete_vm_snapshot_response.go +++ /dev/null @@ -1,11 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -// DeleteVMSnapshotResponse delete VM snapshot response -// -// swagger:model DeleteVMSnapshotResponse -type DeleteVMSnapshotResponse interface{} diff --git a/internal/models/get_project_spend_details_response.go b/internal/models/get_project_spend_details_response.go deleted file mode 100644 index c4dd834..0000000 --- a/internal/models/get_project_spend_details_response.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// GetProjectSpendDetailsResponse get project spend details response -// -// swagger:model GetProjectSpendDetailsResponse -type GetProjectSpendDetailsResponse struct { - - // orders - // Required: true - Orders []*Order `json:"orders"` - - // spend - // Required: true - Spend *ProjectSpend `json:"spend"` -} - -// Validate validates this get project spend details response -func (m *GetProjectSpendDetailsResponse) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateOrders(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSpend(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GetProjectSpendDetailsResponse) validateOrders(formats strfmt.Registry) error { - - if err := validate.Required("orders", "body", m.Orders); err != nil { - return err - } - - for i := 0; i < len(m.Orders); i++ { - if swag.IsZero(m.Orders[i]) { // not required - continue - } - - if m.Orders[i] != nil { - if err := m.Orders[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orders" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("orders" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *GetProjectSpendDetailsResponse) validateSpend(formats strfmt.Registry) error { - - if err := validate.Required("spend", "body", m.Spend); err != nil { - return err - } - - if m.Spend != nil { - if err := m.Spend.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("spend") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("spend") - } - return err - } - } - - return nil -} - -// ContextValidate validate this get project spend details response based on the context it is used -func (m *GetProjectSpendDetailsResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateOrders(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSpend(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GetProjectSpendDetailsResponse) contextValidateOrders(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Orders); i++ { - - if m.Orders[i] != nil { - if err := m.Orders[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orders" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("orders" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *GetProjectSpendDetailsResponse) contextValidateSpend(ctx context.Context, formats strfmt.Registry) error { - - if m.Spend != nil { - if err := m.Spend.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("spend") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("spend") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *GetProjectSpendDetailsResponse) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *GetProjectSpendDetailsResponse) UnmarshalBinary(b []byte) error { - var res GetProjectSpendDetailsResponse - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/internal/models/get_project_spend_history_response.go b/internal/models/get_project_spend_history_response.go deleted file mode 100644 index aebb877..0000000 --- a/internal/models/get_project_spend_history_response.go +++ /dev/null @@ -1,119 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// GetProjectSpendHistoryResponse get project spend history response -// -// swagger:model GetProjectSpendHistoryResponse -type GetProjectSpendHistoryResponse struct { - - // project spend history - // Required: true - ProjectSpendHistory []*ProjectSpend `json:"projectSpendHistory"` -} - -// Validate validates this get project spend history response -func (m *GetProjectSpendHistoryResponse) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateProjectSpendHistory(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GetProjectSpendHistoryResponse) validateProjectSpendHistory(formats strfmt.Registry) error { - - if err := validate.Required("projectSpendHistory", "body", m.ProjectSpendHistory); err != nil { - return err - } - - for i := 0; i < len(m.ProjectSpendHistory); i++ { - if swag.IsZero(m.ProjectSpendHistory[i]) { // not required - continue - } - - if m.ProjectSpendHistory[i] != nil { - if err := m.ProjectSpendHistory[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("projectSpendHistory" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("projectSpendHistory" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get project spend history response based on the context it is used -func (m *GetProjectSpendHistoryResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateProjectSpendHistory(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GetProjectSpendHistoryResponse) contextValidateProjectSpendHistory(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.ProjectSpendHistory); i++ { - - if m.ProjectSpendHistory[i] != nil { - if err := m.ProjectSpendHistory[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("projectSpendHistory" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("projectSpendHistory" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *GetProjectSpendHistoryResponse) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *GetProjectSpendHistoryResponse) UnmarshalBinary(b []byte) error { - var res GetProjectSpendHistoryResponse - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/internal/models/list_vm_snapshots_response.go b/internal/models/list_vm_snapshots_response.go deleted file mode 100644 index 2430a11..0000000 --- a/internal/models/list_vm_snapshots_response.go +++ /dev/null @@ -1,119 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ListVMSnapshotsResponse list VM snapshots response -// -// swagger:model ListVMSnapshotsResponse -type ListVMSnapshotsResponse struct { - - // snapshots - // Required: true - Snapshots []*Snapshot `json:"snapshots"` -} - -// Validate validates this list VM snapshots response -func (m *ListVMSnapshotsResponse) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateSnapshots(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListVMSnapshotsResponse) validateSnapshots(formats strfmt.Registry) error { - - if err := validate.Required("snapshots", "body", m.Snapshots); err != nil { - return err - } - - for i := 0; i < len(m.Snapshots); i++ { - if swag.IsZero(m.Snapshots[i]) { // not required - continue - } - - if m.Snapshots[i] != nil { - if err := m.Snapshots[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("snapshots" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("snapshots" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list VM snapshots response based on the context it is used -func (m *ListVMSnapshotsResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateSnapshots(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListVMSnapshotsResponse) contextValidateSnapshots(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Snapshots); i++ { - - if m.Snapshots[i] != nil { - if err := m.Snapshots[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("snapshots" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("snapshots" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ListVMSnapshotsResponse) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ListVMSnapshotsResponse) UnmarshalBinary(b []byte) error { - var res ListVMSnapshotsResponse - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/internal/models/order.go b/internal/models/order.go deleted file mode 100644 index 3b5a710..0000000 --- a/internal/models/order.go +++ /dev/null @@ -1,236 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Order order -// -// swagger:model Order -type Order struct { - - // description - // Required: true - Description *string `json:"description"` - - // end time - // Required: true - // Format: date-time - EndTime *strfmt.DateTime `json:"endTime"` - - // order Id - // Required: true - OrderID *string `json:"orderId"` - - // price hr - // Required: true - PriceHr *float32 `json:"priceHr"` - - // quantity - // Required: true - Quantity *int32 `json:"quantity"` - - // spend - // Required: true - Spend *Decimal `json:"spend"` - - // start time - // Required: true - // Format: date-time - StartTime *strfmt.DateTime `json:"startTime"` - - // uid - // Required: true - UID *string `json:"uid"` -} - -// Validate validates this order -func (m *Order) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDescription(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEndTime(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePriceHr(formats); err != nil { - res = append(res, err) - } - - if err := m.validateQuantity(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSpend(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStartTime(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Order) validateDescription(formats strfmt.Registry) error { - - if err := validate.Required("description", "body", m.Description); err != nil { - return err - } - - return nil -} - -func (m *Order) validateEndTime(formats strfmt.Registry) error { - - if err := validate.Required("endTime", "body", m.EndTime); err != nil { - return err - } - - if err := validate.FormatOf("endTime", "body", "date-time", m.EndTime.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Order) validateOrderID(formats strfmt.Registry) error { - - if err := validate.Required("orderId", "body", m.OrderID); err != nil { - return err - } - - return nil -} - -func (m *Order) validatePriceHr(formats strfmt.Registry) error { - - if err := validate.Required("priceHr", "body", m.PriceHr); err != nil { - return err - } - - return nil -} - -func (m *Order) validateQuantity(formats strfmt.Registry) error { - - if err := validate.Required("quantity", "body", m.Quantity); err != nil { - return err - } - - return nil -} - -func (m *Order) validateSpend(formats strfmt.Registry) error { - - if err := validate.Required("spend", "body", m.Spend); err != nil { - return err - } - - if m.Spend != nil { - if err := m.Spend.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("spend") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("spend") - } - return err - } - } - - return nil -} - -func (m *Order) validateStartTime(formats strfmt.Registry) error { - - if err := validate.Required("startTime", "body", m.StartTime); err != nil { - return err - } - - if err := validate.FormatOf("startTime", "body", "date-time", m.StartTime.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Order) validateUID(formats strfmt.Registry) error { - - if err := validate.Required("uid", "body", m.UID); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this order based on the context it is used -func (m *Order) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateSpend(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Order) contextValidateSpend(ctx context.Context, formats strfmt.Registry) error { - - if m.Spend != nil { - if err := m.Spend.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("spend") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("spend") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Order) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Order) UnmarshalBinary(b []byte) error { - var res Order - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/internal/models/project_spend.go b/internal/models/project_spend.go deleted file mode 100644 index 3e7eb37..0000000 --- a/internal/models/project_spend.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ProjectSpend project spend -// -// swagger:model ProjectSpend -type ProjectSpend struct { - - // end time - // Format: date-time - EndTime strfmt.DateTime `json:"endTime,omitempty"` - - // project Id - ProjectID string `json:"projectId,omitempty"` - - // spend - Spend *Decimal `json:"spend,omitempty"` - - // start time - // Format: date-time - StartTime strfmt.DateTime `json:"startTime,omitempty"` - - // uid - UID string `json:"uid,omitempty"` -} - -// Validate validates this project spend -func (m *ProjectSpend) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateEndTime(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSpend(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStartTime(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProjectSpend) validateEndTime(formats strfmt.Registry) error { - if swag.IsZero(m.EndTime) { // not required - return nil - } - - if err := validate.FormatOf("endTime", "body", "date-time", m.EndTime.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ProjectSpend) validateSpend(formats strfmt.Registry) error { - if swag.IsZero(m.Spend) { // not required - return nil - } - - if m.Spend != nil { - if err := m.Spend.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("spend") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("spend") - } - return err - } - } - - return nil -} - -func (m *ProjectSpend) validateStartTime(formats strfmt.Registry) error { - if swag.IsZero(m.StartTime) { // not required - return nil - } - - if err := validate.FormatOf("startTime", "body", "date-time", m.StartTime.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this project spend based on the context it is used -func (m *ProjectSpend) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateSpend(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProjectSpend) contextValidateSpend(ctx context.Context, formats strfmt.Registry) error { - - if m.Spend != nil { - if err := m.Spend.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("spend") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("spend") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ProjectSpend) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ProjectSpend) UnmarshalBinary(b []byte) error { - var res ProjectSpend - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/internal/models/revert_vm_response.go b/internal/models/revert_vm_response.go deleted file mode 100644 index f499902..0000000 --- a/internal/models/revert_vm_response.go +++ /dev/null @@ -1,11 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -// RevertVMResponse revert VM response -// -// swagger:model RevertVMResponse -type RevertVMResponse interface{} diff --git a/internal/models/storage_class.go b/internal/models/storage_class.go deleted file mode 100644 index 44e7948..0000000 --- a/internal/models/storage_class.go +++ /dev/null @@ -1,81 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// StorageClass storage class -// -// swagger:model StorageClass -type StorageClass string - -func NewStorageClass(value StorageClass) *StorageClass { - return &value -} - -// Pointer returns a pointer to a freshly-allocated StorageClass. -func (m StorageClass) Pointer() *StorageClass { - return &m -} - -const ( - - // StorageClassSTORAGECLASSUNKNOWN captures enum value "STORAGE_CLASS_UNKNOWN" - StorageClassSTORAGECLASSUNKNOWN StorageClass = "STORAGE_CLASS_UNKNOWN" - - // StorageClassSTORAGECLASSLOCAL captures enum value "STORAGE_CLASS_LOCAL" - StorageClassSTORAGECLASSLOCAL StorageClass = "STORAGE_CLASS_LOCAL" - - // StorageClassSTORAGECLASSNETWORK captures enum value "STORAGE_CLASS_NETWORK" - StorageClassSTORAGECLASSNETWORK StorageClass = "STORAGE_CLASS_NETWORK" -) - -// for schema -var storageClassEnum []interface{} - -func init() { - var res []StorageClass - if err := json.Unmarshal([]byte(`["STORAGE_CLASS_UNKNOWN","STORAGE_CLASS_LOCAL","STORAGE_CLASS_NETWORK"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - storageClassEnum = append(storageClassEnum, v) - } -} - -func (m StorageClass) validateStorageClassEnum(path, location string, value StorageClass) error { - if err := validate.EnumCase(path, location, value, storageClassEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this storage class -func (m StorageClass) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateStorageClassEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this storage class based on context it is used -func (m StorageClass) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/internal/models/v_router_size.go b/internal/models/v_router_size.go deleted file mode 100644 index e2747fc..0000000 --- a/internal/models/v_router_size.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// VRouterSize v router size -// -// swagger:model VRouterSize -type VRouterSize string - -func NewVRouterSize(value VRouterSize) *VRouterSize { - return &value -} - -// Pointer returns a pointer to a freshly-allocated VRouterSize. -func (m VRouterSize) Pointer() *VRouterSize { - return &m -} - -const ( - - // VRouterSizeVROUTERINSTANCEUNKNOWN captures enum value "VROUTER_INSTANCE_UNKNOWN" - VRouterSizeVROUTERINSTANCEUNKNOWN VRouterSize = "VROUTER_INSTANCE_UNKNOWN" - - // VRouterSizeVROUTERINSTANCESMALL captures enum value "VROUTER_INSTANCE_SMALL" - VRouterSizeVROUTERINSTANCESMALL VRouterSize = "VROUTER_INSTANCE_SMALL" - - // VRouterSizeVROUTERINSTANCEMEDIUM captures enum value "VROUTER_INSTANCE_MEDIUM" - VRouterSizeVROUTERINSTANCEMEDIUM VRouterSize = "VROUTER_INSTANCE_MEDIUM" - - // VRouterSizeVROUTERINSTANCELARGE captures enum value "VROUTER_INSTANCE_LARGE" - VRouterSizeVROUTERINSTANCELARGE VRouterSize = "VROUTER_INSTANCE_LARGE" -) - -// for schema -var vRouterSizeEnum []interface{} - -func init() { - var res []VRouterSize - if err := json.Unmarshal([]byte(`["VROUTER_INSTANCE_UNKNOWN","VROUTER_INSTANCE_SMALL","VROUTER_INSTANCE_MEDIUM","VROUTER_INSTANCE_LARGE"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - vRouterSizeEnum = append(vRouterSizeEnum, v) - } -} - -func (m VRouterSize) validateVRouterSizeEnum(path, location string, value VRouterSize) error { - if err := validate.EnumCase(path, location, value, vRouterSizeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this v router size -func (m VRouterSize) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateVRouterSizeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this v router size based on context it is used -func (m VRouterSize) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -}