github.com/kubearmor/cilium@v1.6.12/api/v1/client/daemon/get_nodes_parameters.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package daemon 4 5 // This file was generated by the swagger tool. 6 // Editing this file might prove futile when you re-run the swagger generate command 7 8 import ( 9 "context" 10 "net/http" 11 "time" 12 13 "github.com/go-openapi/errors" 14 "github.com/go-openapi/runtime" 15 cr "github.com/go-openapi/runtime/client" 16 "github.com/go-openapi/swag" 17 18 strfmt "github.com/go-openapi/strfmt" 19 ) 20 21 // NewGetNodesParams creates a new GetNodesParams object 22 // with the default values initialized. 23 func NewGetNodesParams() *GetNodesParams { 24 var () 25 return &GetNodesParams{ 26 27 timeout: cr.DefaultTimeout, 28 } 29 } 30 31 // NewGetNodesParamsWithTimeout creates a new GetNodesParams object 32 // with the default values initialized, and the ability to set a timeout on a request 33 func NewGetNodesParamsWithTimeout(timeout time.Duration) *GetNodesParams { 34 var () 35 return &GetNodesParams{ 36 37 timeout: timeout, 38 } 39 } 40 41 // NewGetNodesParamsWithContext creates a new GetNodesParams object 42 // with the default values initialized, and the ability to set a context for a request 43 func NewGetNodesParamsWithContext(ctx context.Context) *GetNodesParams { 44 var () 45 return &GetNodesParams{ 46 47 Context: ctx, 48 } 49 } 50 51 // NewGetNodesParamsWithHTTPClient creates a new GetNodesParams object 52 // with the default values initialized, and the ability to set a custom HTTPClient for a request 53 func NewGetNodesParamsWithHTTPClient(client *http.Client) *GetNodesParams { 54 var () 55 return &GetNodesParams{ 56 HTTPClient: client, 57 } 58 } 59 60 /*GetNodesParams contains all the parameters to send to the API endpoint 61 for the get nodes operation typically these are written to a http.Request 62 */ 63 type GetNodesParams struct { 64 65 /*ClientID 66 Client UUID that should be used to request new 67 68 69 */ 70 ClientID *int64 71 72 timeout time.Duration 73 Context context.Context 74 HTTPClient *http.Client 75 } 76 77 // WithTimeout adds the timeout to the get nodes params 78 func (o *GetNodesParams) WithTimeout(timeout time.Duration) *GetNodesParams { 79 o.SetTimeout(timeout) 80 return o 81 } 82 83 // SetTimeout adds the timeout to the get nodes params 84 func (o *GetNodesParams) SetTimeout(timeout time.Duration) { 85 o.timeout = timeout 86 } 87 88 // WithContext adds the context to the get nodes params 89 func (o *GetNodesParams) WithContext(ctx context.Context) *GetNodesParams { 90 o.SetContext(ctx) 91 return o 92 } 93 94 // SetContext adds the context to the get nodes params 95 func (o *GetNodesParams) SetContext(ctx context.Context) { 96 o.Context = ctx 97 } 98 99 // WithHTTPClient adds the HTTPClient to the get nodes params 100 func (o *GetNodesParams) WithHTTPClient(client *http.Client) *GetNodesParams { 101 o.SetHTTPClient(client) 102 return o 103 } 104 105 // SetHTTPClient adds the HTTPClient to the get nodes params 106 func (o *GetNodesParams) SetHTTPClient(client *http.Client) { 107 o.HTTPClient = client 108 } 109 110 // WithClientID adds the clientID to the get nodes params 111 func (o *GetNodesParams) WithClientID(clientID *int64) *GetNodesParams { 112 o.SetClientID(clientID) 113 return o 114 } 115 116 // SetClientID adds the clientId to the get nodes params 117 func (o *GetNodesParams) SetClientID(clientID *int64) { 118 o.ClientID = clientID 119 } 120 121 // WriteToRequest writes these params to a swagger request 122 func (o *GetNodesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { 123 124 if err := r.SetTimeout(o.timeout); err != nil { 125 return err 126 } 127 var res []error 128 129 if o.ClientID != nil { 130 131 // header param client-id 132 if err := r.SetHeaderParam("client-id", swag.FormatInt64(*o.ClientID)); err != nil { 133 return err 134 } 135 136 } 137 138 if len(res) > 0 { 139 return errors.CompositeValidationError(res...) 140 } 141 return nil 142 }