lib/api/sfgate/sfgate_client/accounts/put_accounts_parameters.go

160 lines
4.6 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 accounts
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"
)
// NewPutAccountsParams creates a new PutAccountsParams 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 NewPutAccountsParams() *PutAccountsParams {
return NewPutAccountsParamsWithTimeout(cr.DefaultTimeout)
2023-03-28 17:47:34 +00:00
}
// NewPutAccountsParamsWithTimeout creates a new PutAccountsParams object
// with the ability to set a timeout on a request.
func NewPutAccountsParamsWithTimeout(timeout time.Duration) *PutAccountsParams {
return &PutAccountsParams{
inner: innerParams{
timeout: timeout,
},
2023-03-28 17:47:34 +00:00
}
}
// NewPutAccountsParamsWithContext creates a new PutAccountsParams object
// with the ability to set a context for a request.
//
// Deprecated: use the operation call with context to pass the context instead of [PutAccountsParams].
2023-03-28 17:47:34 +00:00
func NewPutAccountsParamsWithContext(ctx context.Context) *PutAccountsParams {
return &PutAccountsParams{
inner: innerParams{
ctx: ctx,
},
2023-03-28 17:47:34 +00:00
}
}
// NewPutAccountsParamsWithHTTPClient creates a new PutAccountsParams object
// with the ability to set a custom HTTPClient for a request.
func NewPutAccountsParamsWithHTTPClient(client *http.Client) *PutAccountsParams {
return &PutAccountsParams{
HTTPClient: client,
}
}
/*
PutAccountsParams contains all the parameters to send to the API endpoint
for the put accounts operation.
Typically these are written to a http.Request.
*/
type PutAccountsParams struct {
// AccountRequest.
//
// A request with an array of Account Objects
2023-03-28 17:47:34 +00:00
AccountRequest *sfgate_models.AccountRequest
HTTPClient *http.Client
inner innerParams
2023-03-28 17:47:34 +00:00
}
// WithDefaults hydrates default values in the put accounts params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PutAccountsParams) WithDefaults() *PutAccountsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the put accounts params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PutAccountsParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the put accounts params.
2023-03-28 17:47:34 +00:00
func (o *PutAccountsParams) WithTimeout(timeout time.Duration) *PutAccountsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the put accounts params.
2023-03-28 17:47:34 +00:00
func (o *PutAccountsParams) SetTimeout(timeout time.Duration) {
o.inner.timeout = timeout
2023-03-28 17:47:34 +00:00
}
// WithContext adds the context to the put accounts params.
//
// Deprecated: use the operation call with context to pass the context instead of [PutAccountsParams].
2023-03-28 17:47:34 +00:00
func (o *PutAccountsParams) WithContext(ctx context.Context) *PutAccountsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the put accounts params.
//
// Deprecated: use the operation call with context to pass the context instead of [PutAccountsParams].
2023-03-28 17:47:34 +00:00
func (o *PutAccountsParams) SetContext(ctx context.Context) {
o.inner.ctx = ctx
2023-03-28 17:47:34 +00:00
}
// WithHTTPClient adds the HTTPClient to the put accounts params.
2023-03-28 17:47:34 +00:00
func (o *PutAccountsParams) WithHTTPClient(client *http.Client) *PutAccountsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the put accounts params.
2023-03-28 17:47:34 +00:00
func (o *PutAccountsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithAccountRequest adds the accountRequest to the put accounts params.
2023-03-28 17:47:34 +00:00
func (o *PutAccountsParams) WithAccountRequest(accountRequest *sfgate_models.AccountRequest) *PutAccountsParams {
o.SetAccountRequest(accountRequest)
return o
}
// SetAccountRequest adds the accountRequest to the put accounts params.
2023-03-28 17:47:34 +00:00
func (o *PutAccountsParams) SetAccountRequest(accountRequest *sfgate_models.AccountRequest) {
o.AccountRequest = accountRequest
}
// WriteToRequest writes these params to a [runtime.ClientRequest].
2023-03-28 17:47:34 +00:00
func (o *PutAccountsParams) 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.AccountRequest != nil {
if err := r.SetBodyParam(o.AccountRequest); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}