github.com/cilium/cilium@v1.16.2/api/v1/client/daemon/get_cluster_nodes_parameters.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 // Copyright Authors of Cilium 4 // SPDX-License-Identifier: Apache-2.0 5 6 package daemon 7 8 // This file was generated by the swagger tool. 9 // Editing this file might prove futile when you re-run the swagger generate command 10 11 import ( 12 "context" 13 "net/http" 14 "time" 15 16 "github.com/go-openapi/errors" 17 "github.com/go-openapi/runtime" 18 cr "github.com/go-openapi/runtime/client" 19 "github.com/go-openapi/strfmt" 20 "github.com/go-openapi/swag" 21 ) 22 23 // NewGetClusterNodesParams creates a new GetClusterNodesParams object, 24 // with the default timeout for this client. 25 // 26 // Default values are not hydrated, since defaults are normally applied by the API server side. 27 // 28 // To enforce default values in parameter, use SetDefaults or WithDefaults. 29 func NewGetClusterNodesParams() *GetClusterNodesParams { 30 return &GetClusterNodesParams{ 31 timeout: cr.DefaultTimeout, 32 } 33 } 34 35 // NewGetClusterNodesParamsWithTimeout creates a new GetClusterNodesParams object 36 // with the ability to set a timeout on a request. 37 func NewGetClusterNodesParamsWithTimeout(timeout time.Duration) *GetClusterNodesParams { 38 return &GetClusterNodesParams{ 39 timeout: timeout, 40 } 41 } 42 43 // NewGetClusterNodesParamsWithContext creates a new GetClusterNodesParams object 44 // with the ability to set a context for a request. 45 func NewGetClusterNodesParamsWithContext(ctx context.Context) *GetClusterNodesParams { 46 return &GetClusterNodesParams{ 47 Context: ctx, 48 } 49 } 50 51 // NewGetClusterNodesParamsWithHTTPClient creates a new GetClusterNodesParams object 52 // with the ability to set a custom HTTPClient for a request. 53 func NewGetClusterNodesParamsWithHTTPClient(client *http.Client) *GetClusterNodesParams { 54 return &GetClusterNodesParams{ 55 HTTPClient: client, 56 } 57 } 58 59 /* 60 GetClusterNodesParams contains all the parameters to send to the API endpoint 61 62 for the get cluster nodes operation. 63 64 Typically these are written to a http.Request. 65 */ 66 type GetClusterNodesParams struct { 67 68 /* ClientID. 69 70 Client UUID should be used when the client wants to request 71 a diff of nodes added and / or removed since the last time 72 that client has made a request. 73 74 */ 75 ClientID *int64 76 77 timeout time.Duration 78 Context context.Context 79 HTTPClient *http.Client 80 } 81 82 // WithDefaults hydrates default values in the get cluster nodes params (not the query body). 83 // 84 // All values with no default are reset to their zero value. 85 func (o *GetClusterNodesParams) WithDefaults() *GetClusterNodesParams { 86 o.SetDefaults() 87 return o 88 } 89 90 // SetDefaults hydrates default values in the get cluster nodes params (not the query body). 91 // 92 // All values with no default are reset to their zero value. 93 func (o *GetClusterNodesParams) SetDefaults() { 94 // no default values defined for this parameter 95 } 96 97 // WithTimeout adds the timeout to the get cluster nodes params 98 func (o *GetClusterNodesParams) WithTimeout(timeout time.Duration) *GetClusterNodesParams { 99 o.SetTimeout(timeout) 100 return o 101 } 102 103 // SetTimeout adds the timeout to the get cluster nodes params 104 func (o *GetClusterNodesParams) SetTimeout(timeout time.Duration) { 105 o.timeout = timeout 106 } 107 108 // WithContext adds the context to the get cluster nodes params 109 func (o *GetClusterNodesParams) WithContext(ctx context.Context) *GetClusterNodesParams { 110 o.SetContext(ctx) 111 return o 112 } 113 114 // SetContext adds the context to the get cluster nodes params 115 func (o *GetClusterNodesParams) SetContext(ctx context.Context) { 116 o.Context = ctx 117 } 118 119 // WithHTTPClient adds the HTTPClient to the get cluster nodes params 120 func (o *GetClusterNodesParams) WithHTTPClient(client *http.Client) *GetClusterNodesParams { 121 o.SetHTTPClient(client) 122 return o 123 } 124 125 // SetHTTPClient adds the HTTPClient to the get cluster nodes params 126 func (o *GetClusterNodesParams) SetHTTPClient(client *http.Client) { 127 o.HTTPClient = client 128 } 129 130 // WithClientID adds the clientID to the get cluster nodes params 131 func (o *GetClusterNodesParams) WithClientID(clientID *int64) *GetClusterNodesParams { 132 o.SetClientID(clientID) 133 return o 134 } 135 136 // SetClientID adds the clientId to the get cluster nodes params 137 func (o *GetClusterNodesParams) SetClientID(clientID *int64) { 138 o.ClientID = clientID 139 } 140 141 // WriteToRequest writes these params to a swagger request 142 func (o *GetClusterNodesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { 143 144 if err := r.SetTimeout(o.timeout); err != nil { 145 return err 146 } 147 var res []error 148 149 if o.ClientID != nil { 150 151 // header param client-id 152 if err := r.SetHeaderParam("client-id", swag.FormatInt64(*o.ClientID)); err != nil { 153 return err 154 } 155 } 156 157 if len(res) > 0 { 158 return errors.CompositeValidationError(res...) 159 } 160 return nil 161 }