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.
138 lines
3.6 KiB
138 lines
3.6 KiB
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
package cycle_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"
|
|
)
|
|
|
|
// NewCreateCycleParams creates a new CreateCycleParams object
|
|
// with the default values initialized.
|
|
func NewCreateCycleParams() *CreateCycleParams {
|
|
var ()
|
|
return &CreateCycleParams{
|
|
|
|
timeout: cr.DefaultTimeout,
|
|
}
|
|
}
|
|
|
|
// NewCreateCycleParamsWithTimeout creates a new CreateCycleParams object
|
|
// with the default values initialized, and the ability to set a timeout on a request
|
|
func NewCreateCycleParamsWithTimeout(timeout time.Duration) *CreateCycleParams {
|
|
var ()
|
|
return &CreateCycleParams{
|
|
|
|
timeout: timeout,
|
|
}
|
|
}
|
|
|
|
// NewCreateCycleParamsWithContext creates a new CreateCycleParams object
|
|
// with the default values initialized, and the ability to set a context for a request
|
|
func NewCreateCycleParamsWithContext(ctx context.Context) *CreateCycleParams {
|
|
var ()
|
|
return &CreateCycleParams{
|
|
|
|
Context: ctx,
|
|
}
|
|
}
|
|
|
|
// NewCreateCycleParamsWithHTTPClient creates a new CreateCycleParams object
|
|
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
|
func NewCreateCycleParamsWithHTTPClient(client *http.Client) *CreateCycleParams {
|
|
var ()
|
|
return &CreateCycleParams{
|
|
HTTPClient: client,
|
|
}
|
|
}
|
|
|
|
/*CreateCycleParams contains all the parameters to send to the API endpoint
|
|
for the create cycle operation typically these are written to a http.Request
|
|
*/
|
|
type CreateCycleParams struct {
|
|
|
|
/*Cycle
|
|
Cycle to be added
|
|
|
|
*/
|
|
Cycle *models.Cycle
|
|
|
|
timeout time.Duration
|
|
Context context.Context
|
|
HTTPClient *http.Client
|
|
}
|
|
|
|
// WithTimeout adds the timeout to the create cycle params
|
|
func (o *CreateCycleParams) WithTimeout(timeout time.Duration) *CreateCycleParams {
|
|
o.SetTimeout(timeout)
|
|
return o
|
|
}
|
|
|
|
// SetTimeout adds the timeout to the create cycle params
|
|
func (o *CreateCycleParams) SetTimeout(timeout time.Duration) {
|
|
o.timeout = timeout
|
|
}
|
|
|
|
// WithContext adds the context to the create cycle params
|
|
func (o *CreateCycleParams) WithContext(ctx context.Context) *CreateCycleParams {
|
|
o.SetContext(ctx)
|
|
return o
|
|
}
|
|
|
|
// SetContext adds the context to the create cycle params
|
|
func (o *CreateCycleParams) SetContext(ctx context.Context) {
|
|
o.Context = ctx
|
|
}
|
|
|
|
// WithHTTPClient adds the HTTPClient to the create cycle params
|
|
func (o *CreateCycleParams) WithHTTPClient(client *http.Client) *CreateCycleParams {
|
|
o.SetHTTPClient(client)
|
|
return o
|
|
}
|
|
|
|
// SetHTTPClient adds the HTTPClient to the create cycle params
|
|
func (o *CreateCycleParams) SetHTTPClient(client *http.Client) {
|
|
o.HTTPClient = client
|
|
}
|
|
|
|
// WithCycle adds the cycle to the create cycle params
|
|
func (o *CreateCycleParams) WithCycle(cycle *models.Cycle) *CreateCycleParams {
|
|
o.SetCycle(cycle)
|
|
return o
|
|
}
|
|
|
|
// SetCycle adds the cycle to the create cycle params
|
|
func (o *CreateCycleParams) SetCycle(cycle *models.Cycle) {
|
|
o.Cycle = cycle
|
|
}
|
|
|
|
// WriteToRequest writes these params to a swagger request
|
|
func (o *CreateCycleParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
|
|
|
if err := r.SetTimeout(o.timeout); err != nil {
|
|
return err
|
|
}
|
|
var res []error
|
|
|
|
if o.Cycle != nil {
|
|
if err := r.SetBodyParam(o.Cycle); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|
|
|