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