// Code generated by go-swagger; DO NOT EDIT.

// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed

package company_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"

	"code.tnxs.net/work/lib/api/sfgate/sfgate_models"
)

// NewPostCompanyServicesParams creates a new PostCompanyServicesParams 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 NewPostCompanyServicesParams() *PostCompanyServicesParams {
	return &PostCompanyServicesParams{
		timeout: cr.DefaultTimeout,
	}
}

// NewPostCompanyServicesParamsWithTimeout creates a new PostCompanyServicesParams object
// with the ability to set a timeout on a request.
func NewPostCompanyServicesParamsWithTimeout(timeout time.Duration) *PostCompanyServicesParams {
	return &PostCompanyServicesParams{
		timeout: timeout,
	}
}

// NewPostCompanyServicesParamsWithContext creates a new PostCompanyServicesParams object
// with the ability to set a context for a request.
func NewPostCompanyServicesParamsWithContext(ctx context.Context) *PostCompanyServicesParams {
	return &PostCompanyServicesParams{
		Context: ctx,
	}
}

// NewPostCompanyServicesParamsWithHTTPClient creates a new PostCompanyServicesParams object
// with the ability to set a custom HTTPClient for a request.
func NewPostCompanyServicesParamsWithHTTPClient(client *http.Client) *PostCompanyServicesParams {
	return &PostCompanyServicesParams{
		HTTPClient: client,
	}
}

/*
PostCompanyServicesParams contains all the parameters to send to the API endpoint

	for the post company services operation.

	Typically these are written to a http.Request.
*/
type PostCompanyServicesParams struct {

	/* CompanyServiceRequest.

	   An array of new CompanyService records
	*/
	CompanyServiceRequest *sfgate_models.CompanyServiceRequest

	timeout    time.Duration
	Context    context.Context
	HTTPClient *http.Client
}

// WithDefaults hydrates default values in the post company services params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostCompanyServicesParams) WithDefaults() *PostCompanyServicesParams {
	o.SetDefaults()
	return o
}

// SetDefaults hydrates default values in the post company services params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostCompanyServicesParams) SetDefaults() {
	// no default values defined for this parameter
}

// WithTimeout adds the timeout to the post company services params
func (o *PostCompanyServicesParams) WithTimeout(timeout time.Duration) *PostCompanyServicesParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the post company services params
func (o *PostCompanyServicesParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the post company services params
func (o *PostCompanyServicesParams) WithContext(ctx context.Context) *PostCompanyServicesParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the post company services params
func (o *PostCompanyServicesParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the post company services params
func (o *PostCompanyServicesParams) WithHTTPClient(client *http.Client) *PostCompanyServicesParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the post company services params
func (o *PostCompanyServicesParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithCompanyServiceRequest adds the companyServiceRequest to the post company services params
func (o *PostCompanyServicesParams) WithCompanyServiceRequest(companyServiceRequest *sfgate_models.CompanyServiceRequest) *PostCompanyServicesParams {
	o.SetCompanyServiceRequest(companyServiceRequest)
	return o
}

// SetCompanyServiceRequest adds the companyServiceRequest to the post company services params
func (o *PostCompanyServicesParams) SetCompanyServiceRequest(companyServiceRequest *sfgate_models.CompanyServiceRequest) {
	o.CompanyServiceRequest = companyServiceRequest
}

// WriteToRequest writes these params to a swagger request
func (o *PostCompanyServicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {

	if err := r.SetTimeout(o.timeout); err != nil {
		return err
	}
	var res []error
	if o.CompanyServiceRequest != nil {
		if err := r.SetBodyParam(o.CompanyServiceRequest); err != nil {
			return err
		}
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
