github.com/sap/cf-mta-plugin@v2.6.3+incompatible/clients/mtaclient/operations/get_mtas_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 // NewGetMtasParams creates a new GetMtasParams object 22 // with the default values initialized. 23 func NewGetMtasParams() *GetMtasParams { 24 25 return &GetMtasParams{ 26 27 timeout: cr.DefaultTimeout, 28 } 29 } 30 31 // NewGetMtasParamsWithTimeout creates a new GetMtasParams object 32 // with the default values initialized, and the ability to set a timeout on a request 33 func NewGetMtasParamsWithTimeout(timeout time.Duration) *GetMtasParams { 34 35 return &GetMtasParams{ 36 37 timeout: timeout, 38 } 39 } 40 41 // NewGetMtasParamsWithContext creates a new GetMtasParams object 42 // with the default values initialized, and the ability to set a context for a request 43 func NewGetMtasParamsWithContext(ctx context.Context) *GetMtasParams { 44 45 return &GetMtasParams{ 46 47 Context: ctx, 48 } 49 } 50 51 // NewGetMtasParamsWithHTTPClient creates a new GetMtasParams object 52 // with the default values initialized, and the ability to set a custom HTTPClient for a request 53 func NewGetMtasParamsWithHTTPClient(client *http.Client) *GetMtasParams { 54 55 return &GetMtasParams{ 56 HTTPClient: client, 57 } 58 } 59 60 /*GetMtasParams contains all the parameters to send to the API endpoint 61 for the get mtas operation typically these are written to a http.Request 62 */ 63 type GetMtasParams struct { 64 timeout time.Duration 65 Context context.Context 66 HTTPClient *http.Client 67 } 68 69 // WithTimeout adds the timeout to the get mtas params 70 func (o *GetMtasParams) WithTimeout(timeout time.Duration) *GetMtasParams { 71 o.SetTimeout(timeout) 72 return o 73 } 74 75 // SetTimeout adds the timeout to the get mtas params 76 func (o *GetMtasParams) SetTimeout(timeout time.Duration) { 77 o.timeout = timeout 78 } 79 80 // WithContext adds the context to the get mtas params 81 func (o *GetMtasParams) WithContext(ctx context.Context) *GetMtasParams { 82 o.SetContext(ctx) 83 return o 84 } 85 86 // SetContext adds the context to the get mtas params 87 func (o *GetMtasParams) SetContext(ctx context.Context) { 88 o.Context = ctx 89 } 90 91 // WithHTTPClient adds the HTTPClient to the get mtas params 92 func (o *GetMtasParams) WithHTTPClient(client *http.Client) *GetMtasParams { 93 o.SetHTTPClient(client) 94 return o 95 } 96 97 // SetHTTPClient adds the HTTPClient to the get mtas params 98 func (o *GetMtasParams) SetHTTPClient(client *http.Client) { 99 o.HTTPClient = client 100 } 101 102 // WriteToRequest writes these params to a swagger request 103 func (o *GetMtasParams) 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 }