lib/api/sfgate/sfgate_client/contacts/put_contacts_parameters.go

160 lines
4.6 KiB
Go
Raw Permalink Normal View History

2023-03-28 17:47:34 +00:00
// 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"
2023-03-28 17:47:34 +00:00
"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)
2023-03-28 17:47:34 +00:00
}
// 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,
},
2023-03-28 17:47:34 +00:00
}
}
// 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].
2023-03-28 17:47:34 +00:00
func NewPutContactsParamsWithContext(ctx context.Context) *PutContactsParams {
return &PutContactsParams{
inner: innerParams{
ctx: ctx,
},
2023-03-28 17:47:34 +00:00
}
}
// 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
2023-03-28 17:47:34 +00:00
ContactRequest *sfgate_models.ContactRequest
HTTPClient *http.Client
inner innerParams
2023-03-28 17:47:34 +00:00
}
// 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.
2023-03-28 17:47:34 +00:00
func (o *PutContactsParams) WithTimeout(timeout time.Duration) *PutContactsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the put contacts params.
2023-03-28 17:47:34 +00:00
func (o *PutContactsParams) SetTimeout(timeout time.Duration) {
o.inner.timeout = timeout
2023-03-28 17:47:34 +00:00
}
// WithContext adds the context to the put contacts params.
//
// Deprecated: use the operation call with context to pass the context instead of [PutContactsParams].
2023-03-28 17:47:34 +00:00
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].
2023-03-28 17:47:34 +00:00
func (o *PutContactsParams) SetContext(ctx context.Context) {
o.inner.ctx = ctx
2023-03-28 17:47:34 +00:00
}
// WithHTTPClient adds the HTTPClient to the put contacts params.
2023-03-28 17:47:34 +00:00
func (o *PutContactsParams) WithHTTPClient(client *http.Client) *PutContactsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the put contacts params.
2023-03-28 17:47:34 +00:00
func (o *PutContactsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithContactRequest adds the contactRequest to the put contacts params.
2023-03-28 17:47:34 +00:00
func (o *PutContactsParams) WithContactRequest(contactRequest *sfgate_models.ContactRequest) *PutContactsParams {
o.SetContactRequest(contactRequest)
return o
}
// SetContactRequest adds the contactRequest to the put contacts params.
2023-03-28 17:47:34 +00:00
func (o *PutContactsParams) SetContactRequest(contactRequest *sfgate_models.ContactRequest) {
o.ContactRequest = contactRequest
}
// WriteToRequest writes these params to a [runtime.ClientRequest].
2023-03-28 17:47:34 +00:00
func (o *PutContactsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.inner.timeout); err != nil {
2023-03-28 17:47:34 +00:00
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
}