lib/api/sfgate/sfgate_client/courses/put_courses_parameters.go

160 lines
4.5 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package courses
import (
"context"
"net/http"
"time"
"code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_models"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
// NewPutCoursesParams creates a new PutCoursesParams 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 NewPutCoursesParams() *PutCoursesParams {
return NewPutCoursesParamsWithTimeout(cr.DefaultTimeout)
}
// NewPutCoursesParamsWithTimeout creates a new PutCoursesParams object
// with the ability to set a timeout on a request.
func NewPutCoursesParamsWithTimeout(timeout time.Duration) *PutCoursesParams {
return &PutCoursesParams{
inner: innerParams{
timeout: timeout,
},
}
}
// NewPutCoursesParamsWithContext creates a new PutCoursesParams object
// with the ability to set a context for a request.
//
// Deprecated: use the operation call with context to pass the context instead of [PutCoursesParams].
func NewPutCoursesParamsWithContext(ctx context.Context) *PutCoursesParams {
return &PutCoursesParams{
inner: innerParams{
ctx: ctx,
},
}
}
// NewPutCoursesParamsWithHTTPClient creates a new PutCoursesParams object
// with the ability to set a custom HTTPClient for a request.
func NewPutCoursesParamsWithHTTPClient(client *http.Client) *PutCoursesParams {
return &PutCoursesParams{
HTTPClient: client,
}
}
/*
PutCoursesParams contains all the parameters to send to the API endpoint
for the put courses operation.
Typically these are written to a http.Request.
*/
type PutCoursesParams struct {
// CourseRequest.
//
// An array of new Course records
CourseRequest *sfgate_models.CourseRequest
HTTPClient *http.Client
inner innerParams
}
// WithDefaults hydrates default values in the put courses params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PutCoursesParams) WithDefaults() *PutCoursesParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the put courses params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PutCoursesParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the put courses params.
func (o *PutCoursesParams) WithTimeout(timeout time.Duration) *PutCoursesParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the put courses params.
func (o *PutCoursesParams) SetTimeout(timeout time.Duration) {
o.inner.timeout = timeout
}
// WithContext adds the context to the put courses params.
//
// Deprecated: use the operation call with context to pass the context instead of [PutCoursesParams].
func (o *PutCoursesParams) WithContext(ctx context.Context) *PutCoursesParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the put courses params.
//
// Deprecated: use the operation call with context to pass the context instead of [PutCoursesParams].
func (o *PutCoursesParams) SetContext(ctx context.Context) {
o.inner.ctx = ctx
}
// WithHTTPClient adds the HTTPClient to the put courses params.
func (o *PutCoursesParams) WithHTTPClient(client *http.Client) *PutCoursesParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the put courses params.
func (o *PutCoursesParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithCourseRequest adds the courseRequest to the put courses params.
func (o *PutCoursesParams) WithCourseRequest(courseRequest *sfgate_models.CourseRequest) *PutCoursesParams {
o.SetCourseRequest(courseRequest)
return o
}
// SetCourseRequest adds the courseRequest to the put courses params.
func (o *PutCoursesParams) SetCourseRequest(courseRequest *sfgate_models.CourseRequest) {
o.CourseRequest = courseRequest
}
// WriteToRequest writes these params to a [runtime.ClientRequest].
func (o *PutCoursesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.inner.timeout); err != nil {
return err
}
var res []error
if o.CourseRequest != nil {
if err := r.SetBodyParam(o.CourseRequest); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}