github.com/kubearmor/cilium@v1.6.12/api/v1/client/daemon/get_cluster_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 // NewGetClusterNodesParams creates a new GetClusterNodesParams object 22 // with the default values initialized. 23 func NewGetClusterNodesParams() *GetClusterNodesParams { 24 var () 25 return &GetClusterNodesParams{ 26 27 timeout: cr.DefaultTimeout, 28 } 29 } 30 31 // NewGetClusterNodesParamsWithTimeout creates a new GetClusterNodesParams object 32 // with the default values initialized, and the ability to set a timeout on a request 33 func NewGetClusterNodesParamsWithTimeout(timeout time.Duration) *GetClusterNodesParams { 34 var () 35 return &GetClusterNodesParams{ 36 37 timeout: timeout, 38 } 39 } 40 41 // NewGetClusterNodesParamsWithContext creates a new GetClusterNodesParams object 42 // with the default values initialized, and the ability to set a context for a request 43 func NewGetClusterNodesParamsWithContext(ctx context.Context) *GetClusterNodesParams { 44 var () 45 return &GetClusterNodesParams{ 46 47 Context: ctx, 48 } 49 } 50 51 // NewGetClusterNodesParamsWithHTTPClient creates a new GetClusterNodesParams object 52 // with the default values initialized, and the ability to set a custom HTTPClient for a request 53 func NewGetClusterNodesParamsWithHTTPClient(client *http.Client) *GetClusterNodesParams { 54 var () 55 return &GetClusterNodesParams{ 56 HTTPClient: client, 57 } 58 } 59 60 /*GetClusterNodesParams contains all the parameters to send to the API endpoint 61 for the get cluster nodes operation typically these are written to a http.Request 62 */ 63 type GetClusterNodesParams struct { 64 65 /*ClientID 66 Client UUID should be used when the client wants to request 67 a diff of nodes added and / or removed since the last time 68 that client has made a request. 69 70 71 */ 72 ClientID *int64 73 74 timeout time.Duration 75 Context context.Context 76 HTTPClient *http.Client 77 } 78 79 // WithTimeout adds the timeout to the get cluster nodes params 80 func (o *GetClusterNodesParams) WithTimeout(timeout time.Duration) *GetClusterNodesParams { 81 o.SetTimeout(timeout) 82 return o 83 } 84 85 // SetTimeout adds the timeout to the get cluster nodes params 86 func (o *GetClusterNodesParams) SetTimeout(timeout time.Duration) { 87 o.timeout = timeout 88 } 89 90 // WithContext adds the context to the get cluster nodes params 91 func (o *GetClusterNodesParams) WithContext(ctx context.Context) *GetClusterNodesParams { 92 o.SetContext(ctx) 93 return o 94 } 95 96 // SetContext adds the context to the get cluster nodes params 97 func (o *GetClusterNodesParams) SetContext(ctx context.Context) { 98 o.Context = ctx 99 } 100 101 // WithHTTPClient adds the HTTPClient to the get cluster nodes params 102 func (o *GetClusterNodesParams) WithHTTPClient(client *http.Client) *GetClusterNodesParams { 103 o.SetHTTPClient(client) 104 return o 105 } 106 107 // SetHTTPClient adds the HTTPClient to the get cluster nodes params 108 func (o *GetClusterNodesParams) SetHTTPClient(client *http.Client) { 109 o.HTTPClient = client 110 } 111 112 // WithClientID adds the clientID to the get cluster nodes params 113 func (o *GetClusterNodesParams) WithClientID(clientID *int64) *GetClusterNodesParams { 114 o.SetClientID(clientID) 115 return o 116 } 117 118 // SetClientID adds the clientId to the get cluster nodes params 119 func (o *GetClusterNodesParams) SetClientID(clientID *int64) { 120 o.ClientID = clientID 121 } 122 123 // WriteToRequest writes these params to a swagger request 124 func (o *GetClusterNodesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { 125 126 if err := r.SetTimeout(o.timeout); err != nil { 127 return err 128 } 129 var res []error 130 131 if o.ClientID != nil { 132 133 // header param client-id 134 if err := r.SetHeaderParam("client-id", swag.FormatInt64(*o.ClientID)); err != nil { 135 return err 136 } 137 138 } 139 140 if len(res) > 0 { 141 return errors.CompositeValidationError(res...) 142 } 143 return nil 144 }