gtslib/client/accounts/account_note_parameters.go
decentral1se e4ade9c758
All checks were successful
continuous-integration/drone/push Build is passing
feat: init
2024-07-31 22:47:18 +02:00

195 lines
4.8 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
package accounts
// 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"
)
// NewAccountNoteParams creates a new AccountNoteParams 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 NewAccountNoteParams() *AccountNoteParams {
return &AccountNoteParams{
timeout: cr.DefaultTimeout,
}
}
// NewAccountNoteParamsWithTimeout creates a new AccountNoteParams object
// with the ability to set a timeout on a request.
func NewAccountNoteParamsWithTimeout(timeout time.Duration) *AccountNoteParams {
return &AccountNoteParams{
timeout: timeout,
}
}
// NewAccountNoteParamsWithContext creates a new AccountNoteParams object
// with the ability to set a context for a request.
func NewAccountNoteParamsWithContext(ctx context.Context) *AccountNoteParams {
return &AccountNoteParams{
Context: ctx,
}
}
// NewAccountNoteParamsWithHTTPClient creates a new AccountNoteParams object
// with the ability to set a custom HTTPClient for a request.
func NewAccountNoteParamsWithHTTPClient(client *http.Client) *AccountNoteParams {
return &AccountNoteParams{
HTTPClient: client,
}
}
/*
AccountNoteParams contains all the parameters to send to the API endpoint
for the account note operation.
Typically these are written to a http.Request.
*/
type AccountNoteParams struct {
/* Comment.
The text of the note. Omit this parameter or send an empty string to clear the note.
*/
Comment *string
/* ID.
The id of the account for which to set a note.
*/
ID string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the account note params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AccountNoteParams) WithDefaults() *AccountNoteParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the account note params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AccountNoteParams) SetDefaults() {
var (
commentDefault = string("")
)
val := AccountNoteParams{
Comment: &commentDefault,
}
val.timeout = o.timeout
val.Context = o.Context
val.HTTPClient = o.HTTPClient
*o = val
}
// WithTimeout adds the timeout to the account note params
func (o *AccountNoteParams) WithTimeout(timeout time.Duration) *AccountNoteParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the account note params
func (o *AccountNoteParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the account note params
func (o *AccountNoteParams) WithContext(ctx context.Context) *AccountNoteParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the account note params
func (o *AccountNoteParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the account note params
func (o *AccountNoteParams) WithHTTPClient(client *http.Client) *AccountNoteParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the account note params
func (o *AccountNoteParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithComment adds the comment to the account note params
func (o *AccountNoteParams) WithComment(comment *string) *AccountNoteParams {
o.SetComment(comment)
return o
}
// SetComment adds the comment to the account note params
func (o *AccountNoteParams) SetComment(comment *string) {
o.Comment = comment
}
// WithID adds the id to the account note params
func (o *AccountNoteParams) WithID(id string) *AccountNoteParams {
o.SetID(id)
return o
}
// SetID adds the id to the account note params
func (o *AccountNoteParams) SetID(id string) {
o.ID = id
}
// WriteToRequest writes these params to a swagger request
func (o *AccountNoteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.Comment != nil {
// form param comment
var frComment string
if o.Comment != nil {
frComment = *o.Comment
}
fComment := frComment
if fComment != "" {
if err := r.SetFormParam("comment", fComment); err != nil {
return err
}
}
}
// path param id
if err := r.SetPathParam("id", o.ID); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}