143 lines
3.9 KiB
Go
143 lines
3.9 KiB
Go
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
|
// All rights reserved worldwide.
|
|
// Proprietary product; unlicensed use is not allowed
|
|
|
|
package services
|
|
|
|
// 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"
|
|
|
|
"github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models"
|
|
)
|
|
|
|
// NewPostServicesParams creates a new PostServicesParams object
|
|
// with the default values initialized.
|
|
func NewPostServicesParams() *PostServicesParams {
|
|
var ()
|
|
return &PostServicesParams{
|
|
|
|
timeout: cr.DefaultTimeout,
|
|
}
|
|
}
|
|
|
|
// NewPostServicesParamsWithTimeout creates a new PostServicesParams object
|
|
// with the default values initialized, and the ability to set a timeout on a request
|
|
func NewPostServicesParamsWithTimeout(timeout time.Duration) *PostServicesParams {
|
|
var ()
|
|
return &PostServicesParams{
|
|
|
|
timeout: timeout,
|
|
}
|
|
}
|
|
|
|
// NewPostServicesParamsWithContext creates a new PostServicesParams object
|
|
// with the default values initialized, and the ability to set a context for a request
|
|
func NewPostServicesParamsWithContext(ctx context.Context) *PostServicesParams {
|
|
var ()
|
|
return &PostServicesParams{
|
|
|
|
Context: ctx,
|
|
}
|
|
}
|
|
|
|
// NewPostServicesParamsWithHTTPClient creates a new PostServicesParams object
|
|
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
|
func NewPostServicesParamsWithHTTPClient(client *http.Client) *PostServicesParams {
|
|
var ()
|
|
return &PostServicesParams{
|
|
HTTPClient: client,
|
|
}
|
|
}
|
|
|
|
/*PostServicesParams contains all the parameters to send to the API endpoint
|
|
for the post services operation typically these are written to a http.Request
|
|
*/
|
|
type PostServicesParams struct {
|
|
|
|
/*ServiceRequest
|
|
An array of Service records
|
|
|
|
*/
|
|
ServiceRequest *sf_gate_models.ServiceRequest
|
|
|
|
timeout time.Duration
|
|
Context context.Context
|
|
HTTPClient *http.Client
|
|
}
|
|
|
|
// WithTimeout adds the timeout to the post services params
|
|
func (o *PostServicesParams) WithTimeout(timeout time.Duration) *PostServicesParams {
|
|
o.SetTimeout(timeout)
|
|
return o
|
|
}
|
|
|
|
// SetTimeout adds the timeout to the post services params
|
|
func (o *PostServicesParams) SetTimeout(timeout time.Duration) {
|
|
o.timeout = timeout
|
|
}
|
|
|
|
// WithContext adds the context to the post services params
|
|
func (o *PostServicesParams) WithContext(ctx context.Context) *PostServicesParams {
|
|
o.SetContext(ctx)
|
|
return o
|
|
}
|
|
|
|
// SetContext adds the context to the post services params
|
|
func (o *PostServicesParams) SetContext(ctx context.Context) {
|
|
o.Context = ctx
|
|
}
|
|
|
|
// WithHTTPClient adds the HTTPClient to the post services params
|
|
func (o *PostServicesParams) WithHTTPClient(client *http.Client) *PostServicesParams {
|
|
o.SetHTTPClient(client)
|
|
return o
|
|
}
|
|
|
|
// SetHTTPClient adds the HTTPClient to the post services params
|
|
func (o *PostServicesParams) SetHTTPClient(client *http.Client) {
|
|
o.HTTPClient = client
|
|
}
|
|
|
|
// WithServiceRequest adds the serviceRequest to the post services params
|
|
func (o *PostServicesParams) WithServiceRequest(serviceRequest *sf_gate_models.ServiceRequest) *PostServicesParams {
|
|
o.SetServiceRequest(serviceRequest)
|
|
return o
|
|
}
|
|
|
|
// SetServiceRequest adds the serviceRequest to the post services params
|
|
func (o *PostServicesParams) SetServiceRequest(serviceRequest *sf_gate_models.ServiceRequest) {
|
|
o.ServiceRequest = serviceRequest
|
|
}
|
|
|
|
// WriteToRequest writes these params to a swagger request
|
|
func (o *PostServicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
|
|
|
if err := r.SetTimeout(o.timeout); err != nil {
|
|
return err
|
|
}
|
|
var res []error
|
|
|
|
if o.ServiceRequest != nil {
|
|
if err := r.SetBodyParam(o.ServiceRequest); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|