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 customer_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/customerdb/models"
|
|
)
|
|
|
|
// NewAddCustomerParams creates a new AddCustomerParams object
|
|
// with the default values initialized.
|
|
func NewAddCustomerParams() *AddCustomerParams {
|
|
var ()
|
|
return &AddCustomerParams{
|
|
|
|
timeout: cr.DefaultTimeout,
|
|
}
|
|
}
|
|
|
|
// NewAddCustomerParamsWithTimeout creates a new AddCustomerParams object
|
|
// with the default values initialized, and the ability to set a timeout on a request
|
|
func NewAddCustomerParamsWithTimeout(timeout time.Duration) *AddCustomerParams {
|
|
var ()
|
|
return &AddCustomerParams{
|
|
|
|
timeout: timeout,
|
|
}
|
|
}
|
|
|
|
// NewAddCustomerParamsWithContext creates a new AddCustomerParams object
|
|
// with the default values initialized, and the ability to set a context for a request
|
|
func NewAddCustomerParamsWithContext(ctx context.Context) *AddCustomerParams {
|
|
var ()
|
|
return &AddCustomerParams{
|
|
|
|
Context: ctx,
|
|
}
|
|
}
|
|
|
|
// NewAddCustomerParamsWithHTTPClient creates a new AddCustomerParams object
|
|
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
|
func NewAddCustomerParamsWithHTTPClient(client *http.Client) *AddCustomerParams {
|
|
var ()
|
|
return &AddCustomerParams{
|
|
HTTPClient: client,
|
|
}
|
|
}
|
|
|
|
/*AddCustomerParams contains all the parameters to send to the API endpoint
|
|
for the add customer operation typically these are written to a http.Request
|
|
*/
|
|
type AddCustomerParams struct {
|
|
|
|
/*Customer
|
|
Customer to be added
|
|
|
|
*/
|
|
Customer *models.Customer
|
|
|
|
timeout time.Duration
|
|
Context context.Context
|
|
HTTPClient *http.Client
|
|
}
|
|
|
|
// WithTimeout adds the timeout to the add customer params
|
|
func (o *AddCustomerParams) WithTimeout(timeout time.Duration) *AddCustomerParams {
|
|
o.SetTimeout(timeout)
|
|
return o
|
|
}
|
|
|
|
// SetTimeout adds the timeout to the add customer params
|
|
func (o *AddCustomerParams) SetTimeout(timeout time.Duration) {
|
|
o.timeout = timeout
|
|
}
|
|
|
|
// WithContext adds the context to the add customer params
|
|
func (o *AddCustomerParams) WithContext(ctx context.Context) *AddCustomerParams {
|
|
o.SetContext(ctx)
|
|
return o
|
|
}
|
|
|
|
// SetContext adds the context to the add customer params
|
|
func (o *AddCustomerParams) SetContext(ctx context.Context) {
|
|
o.Context = ctx
|
|
}
|
|
|
|
// WithHTTPClient adds the HTTPClient to the add customer params
|
|
func (o *AddCustomerParams) WithHTTPClient(client *http.Client) *AddCustomerParams {
|
|
o.SetHTTPClient(client)
|
|
return o
|
|
}
|
|
|
|
// SetHTTPClient adds the HTTPClient to the add customer params
|
|
func (o *AddCustomerParams) SetHTTPClient(client *http.Client) {
|
|
o.HTTPClient = client
|
|
}
|
|
|
|
// WithCustomer adds the customer to the add customer params
|
|
func (o *AddCustomerParams) WithCustomer(customer *models.Customer) *AddCustomerParams {
|
|
o.SetCustomer(customer)
|
|
return o
|
|
}
|
|
|
|
// SetCustomer adds the customer to the add customer params
|
|
func (o *AddCustomerParams) SetCustomer(customer *models.Customer) {
|
|
o.Customer = customer
|
|
}
|
|
|
|
// WriteToRequest writes these params to a swagger request
|
|
func (o *AddCustomerParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
|
|
|
if err := r.SetTimeout(o.timeout); err != nil {
|
|
return err
|
|
}
|
|
var res []error
|
|
|
|
if o.Customer != nil {
|
|
if err := r.SetBodyParam(o.Customer); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|
|
|