github.com/kubearmor/cilium@v1.6.12/api/v1/client/policy/get_identity_id_parameters.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package policy 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 20 // NewGetIdentityIDParams creates a new GetIdentityIDParams object 21 // with the default values initialized. 22 func NewGetIdentityIDParams() *GetIdentityIDParams { 23 var () 24 return &GetIdentityIDParams{ 25 26 timeout: cr.DefaultTimeout, 27 } 28 } 29 30 // NewGetIdentityIDParamsWithTimeout creates a new GetIdentityIDParams object 31 // with the default values initialized, and the ability to set a timeout on a request 32 func NewGetIdentityIDParamsWithTimeout(timeout time.Duration) *GetIdentityIDParams { 33 var () 34 return &GetIdentityIDParams{ 35 36 timeout: timeout, 37 } 38 } 39 40 // NewGetIdentityIDParamsWithContext creates a new GetIdentityIDParams object 41 // with the default values initialized, and the ability to set a context for a request 42 func NewGetIdentityIDParamsWithContext(ctx context.Context) *GetIdentityIDParams { 43 var () 44 return &GetIdentityIDParams{ 45 46 Context: ctx, 47 } 48 } 49 50 // NewGetIdentityIDParamsWithHTTPClient creates a new GetIdentityIDParams object 51 // with the default values initialized, and the ability to set a custom HTTPClient for a request 52 func NewGetIdentityIDParamsWithHTTPClient(client *http.Client) *GetIdentityIDParams { 53 var () 54 return &GetIdentityIDParams{ 55 HTTPClient: client, 56 } 57 } 58 59 /*GetIdentityIDParams contains all the parameters to send to the API endpoint 60 for the get identity ID operation typically these are written to a http.Request 61 */ 62 type GetIdentityIDParams struct { 63 64 /*ID 65 Cluster wide unique identifier of a security identity. 66 67 68 */ 69 ID string 70 71 timeout time.Duration 72 Context context.Context 73 HTTPClient *http.Client 74 } 75 76 // WithTimeout adds the timeout to the get identity ID params 77 func (o *GetIdentityIDParams) WithTimeout(timeout time.Duration) *GetIdentityIDParams { 78 o.SetTimeout(timeout) 79 return o 80 } 81 82 // SetTimeout adds the timeout to the get identity ID params 83 func (o *GetIdentityIDParams) SetTimeout(timeout time.Duration) { 84 o.timeout = timeout 85 } 86 87 // WithContext adds the context to the get identity ID params 88 func (o *GetIdentityIDParams) WithContext(ctx context.Context) *GetIdentityIDParams { 89 o.SetContext(ctx) 90 return o 91 } 92 93 // SetContext adds the context to the get identity ID params 94 func (o *GetIdentityIDParams) SetContext(ctx context.Context) { 95 o.Context = ctx 96 } 97 98 // WithHTTPClient adds the HTTPClient to the get identity ID params 99 func (o *GetIdentityIDParams) WithHTTPClient(client *http.Client) *GetIdentityIDParams { 100 o.SetHTTPClient(client) 101 return o 102 } 103 104 // SetHTTPClient adds the HTTPClient to the get identity ID params 105 func (o *GetIdentityIDParams) SetHTTPClient(client *http.Client) { 106 o.HTTPClient = client 107 } 108 109 // WithID adds the id to the get identity ID params 110 func (o *GetIdentityIDParams) WithID(id string) *GetIdentityIDParams { 111 o.SetID(id) 112 return o 113 } 114 115 // SetID adds the id to the get identity ID params 116 func (o *GetIdentityIDParams) SetID(id string) { 117 o.ID = id 118 } 119 120 // WriteToRequest writes these params to a swagger request 121 func (o *GetIdentityIDParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { 122 123 if err := r.SetTimeout(o.timeout); err != nil { 124 return err 125 } 126 var res []error 127 128 // path param id 129 if err := r.SetPathParam("id", o.ID); err != nil { 130 return err 131 } 132 133 if len(res) > 0 { 134 return errors.CompositeValidationError(res...) 135 } 136 return nil 137 }