// 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 contacts import ( "context" "net/http" "time" "code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_models" "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) // NewPutContactsParams creates a new PutContactsParams 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 NewPutContactsParams() *PutContactsParams { return NewPutContactsParamsWithTimeout(cr.DefaultTimeout) } // NewPutContactsParamsWithTimeout creates a new PutContactsParams object // with the ability to set a timeout on a request. func NewPutContactsParamsWithTimeout(timeout time.Duration) *PutContactsParams { return &PutContactsParams{ inner: innerParams{ timeout: timeout, }, } } // NewPutContactsParamsWithContext creates a new PutContactsParams object // with the ability to set a context for a request. // // Deprecated: use the operation call with context to pass the context instead of [PutContactsParams]. func NewPutContactsParamsWithContext(ctx context.Context) *PutContactsParams { return &PutContactsParams{ inner: innerParams{ ctx: ctx, }, } } // NewPutContactsParamsWithHTTPClient creates a new PutContactsParams object // with the ability to set a custom HTTPClient for a request. func NewPutContactsParamsWithHTTPClient(client *http.Client) *PutContactsParams { return &PutContactsParams{ HTTPClient: client, } } /* PutContactsParams contains all the parameters to send to the API endpoint for the put contacts operation. Typically these are written to a http.Request. */ type PutContactsParams struct { // ContactRequest. // // An array of new Contact records ContactRequest *sfgate_models.ContactRequest HTTPClient *http.Client inner innerParams } // WithDefaults hydrates default values in the put contacts params (not the query body). // // All values with no default are reset to their zero value. func (o *PutContactsParams) WithDefaults() *PutContactsParams { o.SetDefaults() return o } // SetDefaults hydrates default values in the put contacts params (not the query body). // // All values with no default are reset to their zero value. func (o *PutContactsParams) SetDefaults() { // no default values defined for this parameter } // WithTimeout adds the timeout to the put contacts params. func (o *PutContactsParams) WithTimeout(timeout time.Duration) *PutContactsParams { o.SetTimeout(timeout) return o } // SetTimeout adds the timeout to the put contacts params. func (o *PutContactsParams) SetTimeout(timeout time.Duration) { o.inner.timeout = timeout } // WithContext adds the context to the put contacts params. // // Deprecated: use the operation call with context to pass the context instead of [PutContactsParams]. func (o *PutContactsParams) WithContext(ctx context.Context) *PutContactsParams { o.SetContext(ctx) return o } // SetContext adds the context to the put contacts params. // // Deprecated: use the operation call with context to pass the context instead of [PutContactsParams]. func (o *PutContactsParams) SetContext(ctx context.Context) { o.inner.ctx = ctx } // WithHTTPClient adds the HTTPClient to the put contacts params. func (o *PutContactsParams) WithHTTPClient(client *http.Client) *PutContactsParams { o.SetHTTPClient(client) return o } // SetHTTPClient adds the HTTPClient to the put contacts params. func (o *PutContactsParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } // WithContactRequest adds the contactRequest to the put contacts params. func (o *PutContactsParams) WithContactRequest(contactRequest *sfgate_models.ContactRequest) *PutContactsParams { o.SetContactRequest(contactRequest) return o } // SetContactRequest adds the contactRequest to the put contacts params. func (o *PutContactsParams) SetContactRequest(contactRequest *sfgate_models.ContactRequest) { o.ContactRequest = contactRequest } // WriteToRequest writes these params to a [runtime.ClientRequest]. func (o *PutContactsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { if err := r.SetTimeout(o.inner.timeout); err != nil { return err } var res []error if o.ContactRequest != nil { if err := r.SetBodyParam(o.ContactRequest); err != nil { return err } } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil }