github.com/kubearmor/cilium@v1.6.12/api/v1/client/endpoint/patch_endpoint_id_config_parameters.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package endpoint 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 17 strfmt "github.com/go-openapi/strfmt" 18 19 models "github.com/cilium/cilium/api/v1/models" 20 ) 21 22 // NewPatchEndpointIDConfigParams creates a new PatchEndpointIDConfigParams object 23 // with the default values initialized. 24 func NewPatchEndpointIDConfigParams() *PatchEndpointIDConfigParams { 25 var () 26 return &PatchEndpointIDConfigParams{ 27 28 timeout: cr.DefaultTimeout, 29 } 30 } 31 32 // NewPatchEndpointIDConfigParamsWithTimeout creates a new PatchEndpointIDConfigParams object 33 // with the default values initialized, and the ability to set a timeout on a request 34 func NewPatchEndpointIDConfigParamsWithTimeout(timeout time.Duration) *PatchEndpointIDConfigParams { 35 var () 36 return &PatchEndpointIDConfigParams{ 37 38 timeout: timeout, 39 } 40 } 41 42 // NewPatchEndpointIDConfigParamsWithContext creates a new PatchEndpointIDConfigParams object 43 // with the default values initialized, and the ability to set a context for a request 44 func NewPatchEndpointIDConfigParamsWithContext(ctx context.Context) *PatchEndpointIDConfigParams { 45 var () 46 return &PatchEndpointIDConfigParams{ 47 48 Context: ctx, 49 } 50 } 51 52 // NewPatchEndpointIDConfigParamsWithHTTPClient creates a new PatchEndpointIDConfigParams object 53 // with the default values initialized, and the ability to set a custom HTTPClient for a request 54 func NewPatchEndpointIDConfigParamsWithHTTPClient(client *http.Client) *PatchEndpointIDConfigParams { 55 var () 56 return &PatchEndpointIDConfigParams{ 57 HTTPClient: client, 58 } 59 } 60 61 /*PatchEndpointIDConfigParams contains all the parameters to send to the API endpoint 62 for the patch endpoint ID config operation typically these are written to a http.Request 63 */ 64 type PatchEndpointIDConfigParams struct { 65 66 /*EndpointConfiguration*/ 67 EndpointConfiguration *models.EndpointConfigurationSpec 68 /*ID 69 String describing an endpoint with the format ``[prefix:]id``. If no prefix 70 is specified, a prefix of ``cilium-local:`` is assumed. Not all endpoints 71 will be addressable by all endpoint ID prefixes with the exception of the 72 local Cilium UUID which is assigned to all endpoints. 73 74 Supported endpoint id prefixes: 75 - cilium-local: Local Cilium endpoint UUID, e.g. cilium-local:3389595 76 - cilium-global: Global Cilium endpoint UUID, e.g. cilium-global:cluster1:nodeX:452343 77 - container-id: Container runtime ID, e.g. container-id:22222 78 - container-name: Container name, e.g. container-name:foobar 79 - pod-name: pod name for this container if K8s is enabled, e.g. pod-name:default:foobar 80 - docker-endpoint: Docker libnetwork endpoint ID, e.g. docker-endpoint:4444 81 82 83 */ 84 ID string 85 86 timeout time.Duration 87 Context context.Context 88 HTTPClient *http.Client 89 } 90 91 // WithTimeout adds the timeout to the patch endpoint ID config params 92 func (o *PatchEndpointIDConfigParams) WithTimeout(timeout time.Duration) *PatchEndpointIDConfigParams { 93 o.SetTimeout(timeout) 94 return o 95 } 96 97 // SetTimeout adds the timeout to the patch endpoint ID config params 98 func (o *PatchEndpointIDConfigParams) SetTimeout(timeout time.Duration) { 99 o.timeout = timeout 100 } 101 102 // WithContext adds the context to the patch endpoint ID config params 103 func (o *PatchEndpointIDConfigParams) WithContext(ctx context.Context) *PatchEndpointIDConfigParams { 104 o.SetContext(ctx) 105 return o 106 } 107 108 // SetContext adds the context to the patch endpoint ID config params 109 func (o *PatchEndpointIDConfigParams) SetContext(ctx context.Context) { 110 o.Context = ctx 111 } 112 113 // WithHTTPClient adds the HTTPClient to the patch endpoint ID config params 114 func (o *PatchEndpointIDConfigParams) WithHTTPClient(client *http.Client) *PatchEndpointIDConfigParams { 115 o.SetHTTPClient(client) 116 return o 117 } 118 119 // SetHTTPClient adds the HTTPClient to the patch endpoint ID config params 120 func (o *PatchEndpointIDConfigParams) SetHTTPClient(client *http.Client) { 121 o.HTTPClient = client 122 } 123 124 // WithEndpointConfiguration adds the endpointConfiguration to the patch endpoint ID config params 125 func (o *PatchEndpointIDConfigParams) WithEndpointConfiguration(endpointConfiguration *models.EndpointConfigurationSpec) *PatchEndpointIDConfigParams { 126 o.SetEndpointConfiguration(endpointConfiguration) 127 return o 128 } 129 130 // SetEndpointConfiguration adds the endpointConfiguration to the patch endpoint ID config params 131 func (o *PatchEndpointIDConfigParams) SetEndpointConfiguration(endpointConfiguration *models.EndpointConfigurationSpec) { 132 o.EndpointConfiguration = endpointConfiguration 133 } 134 135 // WithID adds the id to the patch endpoint ID config params 136 func (o *PatchEndpointIDConfigParams) WithID(id string) *PatchEndpointIDConfigParams { 137 o.SetID(id) 138 return o 139 } 140 141 // SetID adds the id to the patch endpoint ID config params 142 func (o *PatchEndpointIDConfigParams) SetID(id string) { 143 o.ID = id 144 } 145 146 // WriteToRequest writes these params to a swagger request 147 func (o *PatchEndpointIDConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { 148 149 if err := r.SetTimeout(o.timeout); err != nil { 150 return err 151 } 152 var res []error 153 154 if o.EndpointConfiguration != nil { 155 if err := r.SetBodyParam(o.EndpointConfiguration); err != nil { 156 return err 157 } 158 } 159 160 // path param id 161 if err := r.SetPathParam("id", o.ID); err != nil { 162 return err 163 } 164 165 if len(res) > 0 { 166 return errors.CompositeValidationError(res...) 167 } 168 return nil 169 }