Cyclops 4 HPC is the purpose built stack to support large HPC centers with resource accounting and billing of cluster as well as cloud resources.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
cyclops-4-hpc/services/plan-manager/client/plan_management/create_plan_parameters.go

138 lines
3.5 KiB

// Code generated by go-swagger; DO NOT EDIT.
package plan_management
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
"github.com/Cyclops-Labs/cyclops-4-hpc.git/services/plan-manager/models"
)
// NewCreatePlanParams creates a new CreatePlanParams object
// with the default values initialized.
func NewCreatePlanParams() *CreatePlanParams {
var ()
return &CreatePlanParams{
timeout: cr.DefaultTimeout,
}
}
// NewCreatePlanParamsWithTimeout creates a new CreatePlanParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewCreatePlanParamsWithTimeout(timeout time.Duration) *CreatePlanParams {
var ()
return &CreatePlanParams{
timeout: timeout,
}
}
// NewCreatePlanParamsWithContext creates a new CreatePlanParams object
// with the default values initialized, and the ability to set a context for a request
func NewCreatePlanParamsWithContext(ctx context.Context) *CreatePlanParams {
var ()
return &CreatePlanParams{
Context: ctx,
}
}
// NewCreatePlanParamsWithHTTPClient creates a new CreatePlanParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewCreatePlanParamsWithHTTPClient(client *http.Client) *CreatePlanParams {
var ()
return &CreatePlanParams{
HTTPClient: client,
}
}
/*CreatePlanParams contains all the parameters to send to the API endpoint
for the create plan operation typically these are written to a http.Request
*/
type CreatePlanParams struct {
/*Plan
Plan to be added
*/
Plan *models.Plan
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithTimeout adds the timeout to the create plan params
func (o *CreatePlanParams) WithTimeout(timeout time.Duration) *CreatePlanParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the create plan params
func (o *CreatePlanParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the create plan params
func (o *CreatePlanParams) WithContext(ctx context.Context) *CreatePlanParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the create plan params
func (o *CreatePlanParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the create plan params
func (o *CreatePlanParams) WithHTTPClient(client *http.Client) *CreatePlanParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the create plan params
func (o *CreatePlanParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithPlan adds the plan to the create plan params
func (o *CreatePlanParams) WithPlan(plan *models.Plan) *CreatePlanParams {
o.SetPlan(plan)
return o
}
// SetPlan adds the plan to the create plan params
func (o *CreatePlanParams) SetPlan(plan *models.Plan) {
o.Plan = plan
}
// WriteToRequest writes these params to a swagger request
func (o *CreatePlanParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.Plan != nil {
if err := r.SetBodyParam(o.Plan); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}