github.com/cilium/cilium@v1.16.2/api/v1/client/endpoint/patch_endpoint_id_config_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 endpoint 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 21 "github.com/cilium/cilium/api/v1/models" 22 ) 23 24 // NewPatchEndpointIDConfigParams creates a new PatchEndpointIDConfigParams object, 25 // with the default timeout for this client. 26 // 27 // Default values are not hydrated, since defaults are normally applied by the API server side. 28 // 29 // To enforce default values in parameter, use SetDefaults or WithDefaults. 30 func NewPatchEndpointIDConfigParams() *PatchEndpointIDConfigParams { 31 return &PatchEndpointIDConfigParams{ 32 timeout: cr.DefaultTimeout, 33 } 34 } 35 36 // NewPatchEndpointIDConfigParamsWithTimeout creates a new PatchEndpointIDConfigParams object 37 // with the ability to set a timeout on a request. 38 func NewPatchEndpointIDConfigParamsWithTimeout(timeout time.Duration) *PatchEndpointIDConfigParams { 39 return &PatchEndpointIDConfigParams{ 40 timeout: timeout, 41 } 42 } 43 44 // NewPatchEndpointIDConfigParamsWithContext creates a new PatchEndpointIDConfigParams object 45 // with the ability to set a context for a request. 46 func NewPatchEndpointIDConfigParamsWithContext(ctx context.Context) *PatchEndpointIDConfigParams { 47 return &PatchEndpointIDConfigParams{ 48 Context: ctx, 49 } 50 } 51 52 // NewPatchEndpointIDConfigParamsWithHTTPClient creates a new PatchEndpointIDConfigParams object 53 // with the ability to set a custom HTTPClient for a request. 54 func NewPatchEndpointIDConfigParamsWithHTTPClient(client *http.Client) *PatchEndpointIDConfigParams { 55 return &PatchEndpointIDConfigParams{ 56 HTTPClient: client, 57 } 58 } 59 60 /* 61 PatchEndpointIDConfigParams contains all the parameters to send to the API endpoint 62 63 for the patch endpoint ID config operation. 64 65 Typically these are written to a http.Request. 66 */ 67 type PatchEndpointIDConfigParams struct { 68 69 // EndpointConfiguration. 70 EndpointConfiguration *models.EndpointConfigurationSpec 71 72 /* ID. 73 74 String describing an endpoint with the format ``[prefix:]id``. If no prefix 75 is specified, a prefix of ``cilium-local:`` is assumed. Not all endpoints 76 will be addressable by all endpoint ID prefixes with the exception of the 77 local Cilium UUID which is assigned to all endpoints. 78 79 Supported endpoint id prefixes: 80 - cilium-local: Local Cilium endpoint UUID, e.g. cilium-local:3389595 81 - cilium-global: Global Cilium endpoint UUID, e.g. cilium-global:cluster1:nodeX:452343 82 - cni-attachment-id: CNI attachment ID, e.g. cni-attachment-id:22222:eth0 83 - container-id: Container runtime ID, e.g. container-id:22222 (deprecated, may not be unique) 84 - container-name: Container name, e.g. container-name:foobar (deprecated, may not be unique) 85 - pod-name: pod name for this container if K8s is enabled, e.g. pod-name:default:foobar (deprecated, may not be unique) 86 - cep-name: cep name for this container if K8s is enabled, e.g. pod-name:default:foobar-net1 87 - docker-endpoint: Docker libnetwork endpoint ID, e.g. docker-endpoint:4444 88 89 */ 90 ID string 91 92 timeout time.Duration 93 Context context.Context 94 HTTPClient *http.Client 95 } 96 97 // WithDefaults hydrates default values in the patch endpoint ID config params (not the query body). 98 // 99 // All values with no default are reset to their zero value. 100 func (o *PatchEndpointIDConfigParams) WithDefaults() *PatchEndpointIDConfigParams { 101 o.SetDefaults() 102 return o 103 } 104 105 // SetDefaults hydrates default values in the patch endpoint ID config params (not the query body). 106 // 107 // All values with no default are reset to their zero value. 108 func (o *PatchEndpointIDConfigParams) SetDefaults() { 109 // no default values defined for this parameter 110 } 111 112 // WithTimeout adds the timeout to the patch endpoint ID config params 113 func (o *PatchEndpointIDConfigParams) WithTimeout(timeout time.Duration) *PatchEndpointIDConfigParams { 114 o.SetTimeout(timeout) 115 return o 116 } 117 118 // SetTimeout adds the timeout to the patch endpoint ID config params 119 func (o *PatchEndpointIDConfigParams) SetTimeout(timeout time.Duration) { 120 o.timeout = timeout 121 } 122 123 // WithContext adds the context to the patch endpoint ID config params 124 func (o *PatchEndpointIDConfigParams) WithContext(ctx context.Context) *PatchEndpointIDConfigParams { 125 o.SetContext(ctx) 126 return o 127 } 128 129 // SetContext adds the context to the patch endpoint ID config params 130 func (o *PatchEndpointIDConfigParams) SetContext(ctx context.Context) { 131 o.Context = ctx 132 } 133 134 // WithHTTPClient adds the HTTPClient to the patch endpoint ID config params 135 func (o *PatchEndpointIDConfigParams) WithHTTPClient(client *http.Client) *PatchEndpointIDConfigParams { 136 o.SetHTTPClient(client) 137 return o 138 } 139 140 // SetHTTPClient adds the HTTPClient to the patch endpoint ID config params 141 func (o *PatchEndpointIDConfigParams) SetHTTPClient(client *http.Client) { 142 o.HTTPClient = client 143 } 144 145 // WithEndpointConfiguration adds the endpointConfiguration to the patch endpoint ID config params 146 func (o *PatchEndpointIDConfigParams) WithEndpointConfiguration(endpointConfiguration *models.EndpointConfigurationSpec) *PatchEndpointIDConfigParams { 147 o.SetEndpointConfiguration(endpointConfiguration) 148 return o 149 } 150 151 // SetEndpointConfiguration adds the endpointConfiguration to the patch endpoint ID config params 152 func (o *PatchEndpointIDConfigParams) SetEndpointConfiguration(endpointConfiguration *models.EndpointConfigurationSpec) { 153 o.EndpointConfiguration = endpointConfiguration 154 } 155 156 // WithID adds the id to the patch endpoint ID config params 157 func (o *PatchEndpointIDConfigParams) WithID(id string) *PatchEndpointIDConfigParams { 158 o.SetID(id) 159 return o 160 } 161 162 // SetID adds the id to the patch endpoint ID config params 163 func (o *PatchEndpointIDConfigParams) SetID(id string) { 164 o.ID = id 165 } 166 167 // WriteToRequest writes these params to a swagger request 168 func (o *PatchEndpointIDConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { 169 170 if err := r.SetTimeout(o.timeout); err != nil { 171 return err 172 } 173 var res []error 174 if o.EndpointConfiguration != nil { 175 if err := r.SetBodyParam(o.EndpointConfiguration); err != nil { 176 return err 177 } 178 } 179 180 // path param id 181 if err := r.SetPathParam("id", o.ID); err != nil { 182 return err 183 } 184 185 if len(res) > 0 { 186 return errors.CompositeValidationError(res...) 187 } 188 return nil 189 }