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

158 lines
4.3 KiB
Go
Raw Normal View History

2023-04-30 02:07:31 +00:00
// 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
// 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"
"code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_models"
)
// 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 &PutCoursesParams{
timeout: 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{
timeout: timeout,
}
}
// NewPutCoursesParamsWithContext creates a new PutCoursesParams object
// with the ability to set a context for a request.
func NewPutCoursesParamsWithContext(ctx context.Context) *PutCoursesParams {
return &PutCoursesParams{
Context: 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
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// 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.timeout = timeout
}
// WithContext adds the context to the put courses params
func (o *PutCoursesParams) WithContext(ctx context.Context) *PutCoursesParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the put courses params
func (o *PutCoursesParams) SetContext(ctx context.Context) {
o.Context = 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 swagger request
func (o *PutCoursesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.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
}