github.com/cilium/cilium@v1.16.2/api/v1/client/endpoint/delete_endpoint_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 // NewDeleteEndpointParams creates a new DeleteEndpointParams 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 NewDeleteEndpointParams() *DeleteEndpointParams { 31 return &DeleteEndpointParams{ 32 timeout: cr.DefaultTimeout, 33 } 34 } 35 36 // NewDeleteEndpointParamsWithTimeout creates a new DeleteEndpointParams object 37 // with the ability to set a timeout on a request. 38 func NewDeleteEndpointParamsWithTimeout(timeout time.Duration) *DeleteEndpointParams { 39 return &DeleteEndpointParams{ 40 timeout: timeout, 41 } 42 } 43 44 // NewDeleteEndpointParamsWithContext creates a new DeleteEndpointParams object 45 // with the ability to set a context for a request. 46 func NewDeleteEndpointParamsWithContext(ctx context.Context) *DeleteEndpointParams { 47 return &DeleteEndpointParams{ 48 Context: ctx, 49 } 50 } 51 52 // NewDeleteEndpointParamsWithHTTPClient creates a new DeleteEndpointParams object 53 // with the ability to set a custom HTTPClient for a request. 54 func NewDeleteEndpointParamsWithHTTPClient(client *http.Client) *DeleteEndpointParams { 55 return &DeleteEndpointParams{ 56 HTTPClient: client, 57 } 58 } 59 60 /* 61 DeleteEndpointParams contains all the parameters to send to the API endpoint 62 63 for the delete endpoint operation. 64 65 Typically these are written to a http.Request. 66 */ 67 type DeleteEndpointParams struct { 68 69 // Endpoint. 70 Endpoint *models.EndpointBatchDeleteRequest 71 72 timeout time.Duration 73 Context context.Context 74 HTTPClient *http.Client 75 } 76 77 // WithDefaults hydrates default values in the delete endpoint params (not the query body). 78 // 79 // All values with no default are reset to their zero value. 80 func (o *DeleteEndpointParams) WithDefaults() *DeleteEndpointParams { 81 o.SetDefaults() 82 return o 83 } 84 85 // SetDefaults hydrates default values in the delete endpoint params (not the query body). 86 // 87 // All values with no default are reset to their zero value. 88 func (o *DeleteEndpointParams) SetDefaults() { 89 // no default values defined for this parameter 90 } 91 92 // WithTimeout adds the timeout to the delete endpoint params 93 func (o *DeleteEndpointParams) WithTimeout(timeout time.Duration) *DeleteEndpointParams { 94 o.SetTimeout(timeout) 95 return o 96 } 97 98 // SetTimeout adds the timeout to the delete endpoint params 99 func (o *DeleteEndpointParams) SetTimeout(timeout time.Duration) { 100 o.timeout = timeout 101 } 102 103 // WithContext adds the context to the delete endpoint params 104 func (o *DeleteEndpointParams) WithContext(ctx context.Context) *DeleteEndpointParams { 105 o.SetContext(ctx) 106 return o 107 } 108 109 // SetContext adds the context to the delete endpoint params 110 func (o *DeleteEndpointParams) SetContext(ctx context.Context) { 111 o.Context = ctx 112 } 113 114 // WithHTTPClient adds the HTTPClient to the delete endpoint params 115 func (o *DeleteEndpointParams) WithHTTPClient(client *http.Client) *DeleteEndpointParams { 116 o.SetHTTPClient(client) 117 return o 118 } 119 120 // SetHTTPClient adds the HTTPClient to the delete endpoint params 121 func (o *DeleteEndpointParams) SetHTTPClient(client *http.Client) { 122 o.HTTPClient = client 123 } 124 125 // WithEndpoint adds the endpoint to the delete endpoint params 126 func (o *DeleteEndpointParams) WithEndpoint(endpoint *models.EndpointBatchDeleteRequest) *DeleteEndpointParams { 127 o.SetEndpoint(endpoint) 128 return o 129 } 130 131 // SetEndpoint adds the endpoint to the delete endpoint params 132 func (o *DeleteEndpointParams) SetEndpoint(endpoint *models.EndpointBatchDeleteRequest) { 133 o.Endpoint = endpoint 134 } 135 136 // WriteToRequest writes these params to a swagger request 137 func (o *DeleteEndpointParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { 138 139 if err := r.SetTimeout(o.timeout); err != nil { 140 return err 141 } 142 var res []error 143 if o.Endpoint != nil { 144 if err := r.SetBodyParam(o.Endpoint); err != nil { 145 return err 146 } 147 } 148 149 if len(res) > 0 { 150 return errors.CompositeValidationError(res...) 151 } 152 return nil 153 }