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

171 lines
4.7 KiB
Go
Raw 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"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
// NewDeleteContactsParams creates a new DeleteContactsParams 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 NewDeleteContactsParams() *DeleteContactsParams {
return NewDeleteContactsParamsWithTimeout(cr.DefaultTimeout)
2023-03-28 17:47:34 +00:00
}
// NewDeleteContactsParamsWithTimeout creates a new DeleteContactsParams object
// with the ability to set a timeout on a request.
func NewDeleteContactsParamsWithTimeout(timeout time.Duration) *DeleteContactsParams {
return &DeleteContactsParams{
inner: innerParams{
timeout: timeout,
},
2023-03-28 17:47:34 +00:00
}
}
// NewDeleteContactsParamsWithContext creates a new DeleteContactsParams object
// with the ability to set a context for a request.
//
// Deprecated: use the operation call with context to pass the context instead of [DeleteContactsParams].
2023-03-28 17:47:34 +00:00
func NewDeleteContactsParamsWithContext(ctx context.Context) *DeleteContactsParams {
return &DeleteContactsParams{
inner: innerParams{
ctx: ctx,
},
2023-03-28 17:47:34 +00:00
}
}
// NewDeleteContactsParamsWithHTTPClient creates a new DeleteContactsParams object
// with the ability to set a custom HTTPClient for a request.
func NewDeleteContactsParamsWithHTTPClient(client *http.Client) *DeleteContactsParams {
return &DeleteContactsParams{
HTTPClient: client,
}
}
/*
DeleteContactsParams contains all the parameters to send to the API endpoint
for the delete contacts operation.
Typically these are written to a http.Request.
*/
type DeleteContactsParams struct {
// ContactID.
//
// Record Id of a Contact
2023-03-28 17:47:34 +00:00
ContactID *string
HTTPClient *http.Client
inner innerParams
2023-03-28 17:47:34 +00:00
}
// WithDefaults hydrates default values in the delete contacts params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *DeleteContactsParams) WithDefaults() *DeleteContactsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the delete contacts params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *DeleteContactsParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the delete contacts params.
2023-03-28 17:47:34 +00:00
func (o *DeleteContactsParams) WithTimeout(timeout time.Duration) *DeleteContactsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the delete contacts params.
2023-03-28 17:47:34 +00:00
func (o *DeleteContactsParams) SetTimeout(timeout time.Duration) {
o.inner.timeout = timeout
2023-03-28 17:47:34 +00:00
}
// WithContext adds the context to the delete contacts params.
//
// Deprecated: use the operation call with context to pass the context instead of [DeleteContactsParams].
2023-03-28 17:47:34 +00:00
func (o *DeleteContactsParams) WithContext(ctx context.Context) *DeleteContactsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the delete contacts params.
//
// Deprecated: use the operation call with context to pass the context instead of [DeleteContactsParams].
2023-03-28 17:47:34 +00:00
func (o *DeleteContactsParams) SetContext(ctx context.Context) {
o.inner.ctx = ctx
2023-03-28 17:47:34 +00:00
}
// WithHTTPClient adds the HTTPClient to the delete contacts params.
2023-03-28 17:47:34 +00:00
func (o *DeleteContactsParams) WithHTTPClient(client *http.Client) *DeleteContactsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the delete contacts params.
2023-03-28 17:47:34 +00:00
func (o *DeleteContactsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithContactID adds the contactID to the delete contacts params.
2023-03-28 17:47:34 +00:00
func (o *DeleteContactsParams) WithContactID(contactID *string) *DeleteContactsParams {
o.SetContactID(contactID)
return o
}
// SetContactID adds the contactId to the delete contacts params.
2023-03-28 17:47:34 +00:00
func (o *DeleteContactsParams) SetContactID(contactID *string) {
o.ContactID = contactID
}
// WriteToRequest writes these params to a [runtime.ClientRequest].
2023-03-28 17:47:34 +00:00
func (o *DeleteContactsParams) 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.ContactID != nil {
// query param contactId
var qrContactID string
if o.ContactID != nil {
qrContactID = *o.ContactID
}
qContactID := qrContactID
if qContactID != "" {
if err := r.SetQueryParam("contactId", qContactID); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}