github.com/cilium/cilium@v1.16.2/api/v1/health/client/restapi/get_healthz_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 restapi 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 22 // NewGetHealthzParams creates a new GetHealthzParams object, 23 // with the default timeout for this client. 24 // 25 // Default values are not hydrated, since defaults are normally applied by the API server side. 26 // 27 // To enforce default values in parameter, use SetDefaults or WithDefaults. 28 func NewGetHealthzParams() *GetHealthzParams { 29 return &GetHealthzParams{ 30 timeout: cr.DefaultTimeout, 31 } 32 } 33 34 // NewGetHealthzParamsWithTimeout creates a new GetHealthzParams object 35 // with the ability to set a timeout on a request. 36 func NewGetHealthzParamsWithTimeout(timeout time.Duration) *GetHealthzParams { 37 return &GetHealthzParams{ 38 timeout: timeout, 39 } 40 } 41 42 // NewGetHealthzParamsWithContext creates a new GetHealthzParams object 43 // with the ability to set a context for a request. 44 func NewGetHealthzParamsWithContext(ctx context.Context) *GetHealthzParams { 45 return &GetHealthzParams{ 46 Context: ctx, 47 } 48 } 49 50 // NewGetHealthzParamsWithHTTPClient creates a new GetHealthzParams object 51 // with the ability to set a custom HTTPClient for a request. 52 func NewGetHealthzParamsWithHTTPClient(client *http.Client) *GetHealthzParams { 53 return &GetHealthzParams{ 54 HTTPClient: client, 55 } 56 } 57 58 /* 59 GetHealthzParams contains all the parameters to send to the API endpoint 60 61 for the get healthz operation. 62 63 Typically these are written to a http.Request. 64 */ 65 type GetHealthzParams struct { 66 timeout time.Duration 67 Context context.Context 68 HTTPClient *http.Client 69 } 70 71 // WithDefaults hydrates default values in the get healthz params (not the query body). 72 // 73 // All values with no default are reset to their zero value. 74 func (o *GetHealthzParams) WithDefaults() *GetHealthzParams { 75 o.SetDefaults() 76 return o 77 } 78 79 // SetDefaults hydrates default values in the get healthz params (not the query body). 80 // 81 // All values with no default are reset to their zero value. 82 func (o *GetHealthzParams) SetDefaults() { 83 // no default values defined for this parameter 84 } 85 86 // WithTimeout adds the timeout to the get healthz params 87 func (o *GetHealthzParams) WithTimeout(timeout time.Duration) *GetHealthzParams { 88 o.SetTimeout(timeout) 89 return o 90 } 91 92 // SetTimeout adds the timeout to the get healthz params 93 func (o *GetHealthzParams) SetTimeout(timeout time.Duration) { 94 o.timeout = timeout 95 } 96 97 // WithContext adds the context to the get healthz params 98 func (o *GetHealthzParams) WithContext(ctx context.Context) *GetHealthzParams { 99 o.SetContext(ctx) 100 return o 101 } 102 103 // SetContext adds the context to the get healthz params 104 func (o *GetHealthzParams) SetContext(ctx context.Context) { 105 o.Context = ctx 106 } 107 108 // WithHTTPClient adds the HTTPClient to the get healthz params 109 func (o *GetHealthzParams) WithHTTPClient(client *http.Client) *GetHealthzParams { 110 o.SetHTTPClient(client) 111 return o 112 } 113 114 // SetHTTPClient adds the HTTPClient to the get healthz params 115 func (o *GetHealthzParams) SetHTTPClient(client *http.Client) { 116 o.HTTPClient = client 117 } 118 119 // WriteToRequest writes these params to a swagger request 120 func (o *GetHealthzParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { 121 122 if err := r.SetTimeout(o.timeout); err != nil { 123 return err 124 } 125 var res []error 126 127 if len(res) > 0 { 128 return errors.CompositeValidationError(res...) 129 } 130 return nil 131 }