lib/api/devops/devops_client/service/post_services_parameters.go

156 lines
4.4 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 service
// 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/devops/devops_models"
)
// NewPostServicesParams creates a new PostServicesParams 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 NewPostServicesParams() *PostServicesParams {
return &PostServicesParams{
timeout: cr.DefaultTimeout,
}
}
// NewPostServicesParamsWithTimeout creates a new PostServicesParams object
// with the ability to set a timeout on a request.
func NewPostServicesParamsWithTimeout(timeout time.Duration) *PostServicesParams {
return &PostServicesParams{
timeout: timeout,
}
}
// NewPostServicesParamsWithContext creates a new PostServicesParams object
// with the ability to set a context for a request.
func NewPostServicesParamsWithContext(ctx context.Context) *PostServicesParams {
return &PostServicesParams{
Context: ctx,
}
}
// NewPostServicesParamsWithHTTPClient creates a new PostServicesParams object
// with the ability to set a custom HTTPClient for a request.
func NewPostServicesParamsWithHTTPClient(client *http.Client) *PostServicesParams {
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 *devops_models.ServiceRequest
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the post services params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostServicesParams) WithDefaults() *PostServicesParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the post services params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostServicesParams) SetDefaults() {
// no default values defined for this parameter
}
// 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 *devops_models.ServiceRequest) *PostServicesParams {
o.SetServiceRequest(serviceRequest)
return o
}
// SetServiceRequest adds the serviceRequest to the post services params
func (o *PostServicesParams) SetServiceRequest(serviceRequest *devops_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
}