lib/api/members/members_client/enrollments/post_enrollments_parameters.go

158 lines
4.6 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 enrollments
// 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"
)
// NewPostEnrollmentsParams creates a new PostEnrollmentsParams 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 NewPostEnrollmentsParams() *PostEnrollmentsParams {
return &PostEnrollmentsParams{
timeout: cr.DefaultTimeout,
}
}
// NewPostEnrollmentsParamsWithTimeout creates a new PostEnrollmentsParams object
// with the ability to set a timeout on a request.
func NewPostEnrollmentsParamsWithTimeout(timeout time.Duration) *PostEnrollmentsParams {
return &PostEnrollmentsParams{
timeout: timeout,
}
}
// NewPostEnrollmentsParamsWithContext creates a new PostEnrollmentsParams object
// with the ability to set a context for a request.
func NewPostEnrollmentsParamsWithContext(ctx context.Context) *PostEnrollmentsParams {
return &PostEnrollmentsParams{
Context: ctx,
}
}
// NewPostEnrollmentsParamsWithHTTPClient creates a new PostEnrollmentsParams object
// with the ability to set a custom HTTPClient for a request.
func NewPostEnrollmentsParamsWithHTTPClient(client *http.Client) *PostEnrollmentsParams {
return &PostEnrollmentsParams{
HTTPClient: client,
}
}
/*
PostEnrollmentsParams contains all the parameters to send to the API endpoint
for the post enrollments operation.
Typically these are written to a http.Request.
*/
type PostEnrollmentsParams 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 post enrollments params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostEnrollmentsParams) WithDefaults() *PostEnrollmentsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the post enrollments params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostEnrollmentsParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the post enrollments params
func (o *PostEnrollmentsParams) WithTimeout(timeout time.Duration) *PostEnrollmentsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the post enrollments params
func (o *PostEnrollmentsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the post enrollments params
func (o *PostEnrollmentsParams) WithContext(ctx context.Context) *PostEnrollmentsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the post enrollments params
func (o *PostEnrollmentsParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the post enrollments params
func (o *PostEnrollmentsParams) WithHTTPClient(client *http.Client) *PostEnrollmentsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the post enrollments params
func (o *PostEnrollmentsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithEnrollmentRequest adds the enrollmentRequest to the post enrollments params
func (o *PostEnrollmentsParams) WithEnrollmentRequest(enrollmentRequest *members_models.EnrollmentRequest) *PostEnrollmentsParams {
o.SetEnrollmentRequest(enrollmentRequest)
return o
}
// SetEnrollmentRequest adds the enrollmentRequest to the post enrollments params
func (o *PostEnrollmentsParams) SetEnrollmentRequest(enrollmentRequest *members_models.EnrollmentRequest) {
o.EnrollmentRequest = enrollmentRequest
}
// WriteToRequest writes these params to a swagger request
func (o *PostEnrollmentsParams) 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
}