lib/api/members/members_client/operations/create_enrollment_parameter...

158 lines
4.7 KiB
Go
Raw Normal View History

2023-03-28 17:47:34 +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 operations
// 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/members/members_models"
)
// NewCreateEnrollmentParams creates a new CreateEnrollmentParams 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 NewCreateEnrollmentParams() *CreateEnrollmentParams {
return &CreateEnrollmentParams{
timeout: cr.DefaultTimeout,
}
}
// NewCreateEnrollmentParamsWithTimeout creates a new CreateEnrollmentParams object
// with the ability to set a timeout on a request.
func NewCreateEnrollmentParamsWithTimeout(timeout time.Duration) *CreateEnrollmentParams {
return &CreateEnrollmentParams{
timeout: timeout,
}
}
// NewCreateEnrollmentParamsWithContext creates a new CreateEnrollmentParams object
// with the ability to set a context for a request.
func NewCreateEnrollmentParamsWithContext(ctx context.Context) *CreateEnrollmentParams {
return &CreateEnrollmentParams{
Context: ctx,
}
}
// NewCreateEnrollmentParamsWithHTTPClient creates a new CreateEnrollmentParams object
// with the ability to set a custom HTTPClient for a request.
func NewCreateEnrollmentParamsWithHTTPClient(client *http.Client) *CreateEnrollmentParams {
return &CreateEnrollmentParams{
HTTPClient: client,
}
}
/*
CreateEnrollmentParams contains all the parameters to send to the API endpoint
for the create enrollment operation.
Typically these are written to a http.Request.
*/
type CreateEnrollmentParams struct {
/* EnrollmentRequest.
An array of new Enrollment records
*/
EnrollmentRequest *members_models.EnrollmentRequest
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the create enrollment params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *CreateEnrollmentParams) WithDefaults() *CreateEnrollmentParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the create enrollment params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *CreateEnrollmentParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the create enrollment params
func (o *CreateEnrollmentParams) WithTimeout(timeout time.Duration) *CreateEnrollmentParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the create enrollment params
func (o *CreateEnrollmentParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the create enrollment params
func (o *CreateEnrollmentParams) WithContext(ctx context.Context) *CreateEnrollmentParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the create enrollment params
func (o *CreateEnrollmentParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the create enrollment params
func (o *CreateEnrollmentParams) WithHTTPClient(client *http.Client) *CreateEnrollmentParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the create enrollment params
func (o *CreateEnrollmentParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithEnrollmentRequest adds the enrollmentRequest to the create enrollment params
func (o *CreateEnrollmentParams) WithEnrollmentRequest(enrollmentRequest *members_models.EnrollmentRequest) *CreateEnrollmentParams {
o.SetEnrollmentRequest(enrollmentRequest)
return o
}
// SetEnrollmentRequest adds the enrollmentRequest to the create enrollment params
func (o *CreateEnrollmentParams) SetEnrollmentRequest(enrollmentRequest *members_models.EnrollmentRequest) {
o.EnrollmentRequest = enrollmentRequest
}
// WriteToRequest writes these params to a swagger request
func (o *CreateEnrollmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.EnrollmentRequest != nil {
if err := r.SetBodyParam(o.EnrollmentRequest); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}