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