// 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 payment_methods // 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/vernonkeenan/lib/api/members/members_models" ) // NewPostPaymentMethodsParams creates a new PostPaymentMethodsParams 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 NewPostPaymentMethodsParams() *PostPaymentMethodsParams { return &PostPaymentMethodsParams{ timeout: cr.DefaultTimeout, } } // NewPostPaymentMethodsParamsWithTimeout creates a new PostPaymentMethodsParams object // with the ability to set a timeout on a request. func NewPostPaymentMethodsParamsWithTimeout(timeout time.Duration) *PostPaymentMethodsParams { return &PostPaymentMethodsParams{ timeout: timeout, } } // NewPostPaymentMethodsParamsWithContext creates a new PostPaymentMethodsParams object // with the ability to set a context for a request. func NewPostPaymentMethodsParamsWithContext(ctx context.Context) *PostPaymentMethodsParams { return &PostPaymentMethodsParams{ Context: ctx, } } // NewPostPaymentMethodsParamsWithHTTPClient creates a new PostPaymentMethodsParams object // with the ability to set a custom HTTPClient for a request. func NewPostPaymentMethodsParamsWithHTTPClient(client *http.Client) *PostPaymentMethodsParams { return &PostPaymentMethodsParams{ HTTPClient: client, } } /* PostPaymentMethodsParams contains all the parameters to send to the API endpoint for the post payment methods operation. Typically these are written to a http.Request. */ type PostPaymentMethodsParams struct { /* PaymentMethodRequest. An array of new PaymentMethod records */ PaymentMethodRequest *members_models.PaymentMethodRequest timeout time.Duration Context context.Context HTTPClient *http.Client } // WithDefaults hydrates default values in the post payment methods params (not the query body). // // All values with no default are reset to their zero value. func (o *PostPaymentMethodsParams) WithDefaults() *PostPaymentMethodsParams { o.SetDefaults() return o } // SetDefaults hydrates default values in the post payment methods params (not the query body). // // All values with no default are reset to their zero value. func (o *PostPaymentMethodsParams) SetDefaults() { // no default values defined for this parameter } // WithTimeout adds the timeout to the post payment methods params func (o *PostPaymentMethodsParams) WithTimeout(timeout time.Duration) *PostPaymentMethodsParams { o.SetTimeout(timeout) return o } // SetTimeout adds the timeout to the post payment methods params func (o *PostPaymentMethodsParams) SetTimeout(timeout time.Duration) { o.timeout = timeout } // WithContext adds the context to the post payment methods params func (o *PostPaymentMethodsParams) WithContext(ctx context.Context) *PostPaymentMethodsParams { o.SetContext(ctx) return o } // SetContext adds the context to the post payment methods params func (o *PostPaymentMethodsParams) SetContext(ctx context.Context) { o.Context = ctx } // WithHTTPClient adds the HTTPClient to the post payment methods params func (o *PostPaymentMethodsParams) WithHTTPClient(client *http.Client) *PostPaymentMethodsParams { o.SetHTTPClient(client) return o } // SetHTTPClient adds the HTTPClient to the post payment methods params func (o *PostPaymentMethodsParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } // WithPaymentMethodRequest adds the paymentMethodRequest to the post payment methods params func (o *PostPaymentMethodsParams) WithPaymentMethodRequest(paymentMethodRequest *members_models.PaymentMethodRequest) *PostPaymentMethodsParams { o.SetPaymentMethodRequest(paymentMethodRequest) return o } // SetPaymentMethodRequest adds the paymentMethodRequest to the post payment methods params func (o *PostPaymentMethodsParams) SetPaymentMethodRequest(paymentMethodRequest *members_models.PaymentMethodRequest) { o.PaymentMethodRequest = paymentMethodRequest } // WriteToRequest writes these params to a swagger request func (o *PostPaymentMethodsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { if err := r.SetTimeout(o.timeout); err != nil { return err } var res []error if o.PaymentMethodRequest != nil { if err := r.SetBodyParam(o.PaymentMethodRequest); err != nil { return err } } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil }