github.com/sap/cf-mta-plugin@v2.6.3+incompatible/clients/mtaclient/operations/get_info_parameters.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package operations 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 "net/http" 10 "time" 11 12 "golang.org/x/net/context" 13 14 "github.com/go-openapi/errors" 15 "github.com/go-openapi/runtime" 16 cr "github.com/go-openapi/runtime/client" 17 18 strfmt "github.com/go-openapi/strfmt" 19 ) 20 21 // NewGetInfoParams creates a new GetInfoParams object 22 // with the default values initialized. 23 func NewGetInfoParams() *GetInfoParams { 24 25 return &GetInfoParams{ 26 27 timeout: cr.DefaultTimeout, 28 } 29 } 30 31 // NewGetInfoParamsWithTimeout creates a new GetInfoParams object 32 // with the default values initialized, and the ability to set a timeout on a request 33 func NewGetInfoParamsWithTimeout(timeout time.Duration) *GetInfoParams { 34 35 return &GetInfoParams{ 36 37 timeout: timeout, 38 } 39 } 40 41 // NewGetInfoParamsWithContext creates a new GetInfoParams object 42 // with the default values initialized, and the ability to set a context for a request 43 func NewGetInfoParamsWithContext(ctx context.Context) *GetInfoParams { 44 45 return &GetInfoParams{ 46 47 Context: ctx, 48 } 49 } 50 51 // NewGetInfoParamsWithHTTPClient creates a new GetInfoParams object 52 // with the default values initialized, and the ability to set a custom HTTPClient for a request 53 func NewGetInfoParamsWithHTTPClient(client *http.Client) *GetInfoParams { 54 55 return &GetInfoParams{ 56 HTTPClient: client, 57 } 58 } 59 60 /*GetInfoParams contains all the parameters to send to the API endpoint 61 for the get info operation typically these are written to a http.Request 62 */ 63 type GetInfoParams struct { 64 timeout time.Duration 65 Context context.Context 66 HTTPClient *http.Client 67 } 68 69 // WithTimeout adds the timeout to the get info params 70 func (o *GetInfoParams) WithTimeout(timeout time.Duration) *GetInfoParams { 71 o.SetTimeout(timeout) 72 return o 73 } 74 75 // SetTimeout adds the timeout to the get info params 76 func (o *GetInfoParams) SetTimeout(timeout time.Duration) { 77 o.timeout = timeout 78 } 79 80 // WithContext adds the context to the get info params 81 func (o *GetInfoParams) WithContext(ctx context.Context) *GetInfoParams { 82 o.SetContext(ctx) 83 return o 84 } 85 86 // SetContext adds the context to the get info params 87 func (o *GetInfoParams) SetContext(ctx context.Context) { 88 o.Context = ctx 89 } 90 91 // WithHTTPClient adds the HTTPClient to the get info params 92 func (o *GetInfoParams) WithHTTPClient(client *http.Client) *GetInfoParams { 93 o.SetHTTPClient(client) 94 return o 95 } 96 97 // SetHTTPClient adds the HTTPClient to the get info params 98 func (o *GetInfoParams) SetHTTPClient(client *http.Client) { 99 o.HTTPClient = client 100 } 101 102 // WriteToRequest writes these params to a swagger request 103 func (o *GetInfoParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { 104 105 if err := r.SetTimeout(o.timeout); err != nil { 106 return err 107 } 108 var res []error 109 110 if len(res) > 0 { 111 return errors.CompositeValidationError(res...) 112 } 113 return nil 114 }