github.com/sap/cf-mta-plugin@v2.6.3+incompatible/clients/mtaclient/operations/get_mta_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 // NewGetMtaParams creates a new GetMtaParams object 22 // with the default values initialized. 23 func NewGetMtaParams() *GetMtaParams { 24 var () 25 return &GetMtaParams{ 26 27 timeout: cr.DefaultTimeout, 28 } 29 } 30 31 // NewGetMtaParamsWithTimeout creates a new GetMtaParams object 32 // with the default values initialized, and the ability to set a timeout on a request 33 func NewGetMtaParamsWithTimeout(timeout time.Duration) *GetMtaParams { 34 var () 35 return &GetMtaParams{ 36 37 timeout: timeout, 38 } 39 } 40 41 // NewGetMtaParamsWithContext creates a new GetMtaParams object 42 // with the default values initialized, and the ability to set a context for a request 43 func NewGetMtaParamsWithContext(ctx context.Context) *GetMtaParams { 44 var () 45 return &GetMtaParams{ 46 47 Context: ctx, 48 } 49 } 50 51 // NewGetMtaParamsWithHTTPClient creates a new GetMtaParams object 52 // with the default values initialized, and the ability to set a custom HTTPClient for a request 53 func NewGetMtaParamsWithHTTPClient(client *http.Client) *GetMtaParams { 54 var () 55 return &GetMtaParams{ 56 HTTPClient: client, 57 } 58 } 59 60 /*GetMtaParams contains all the parameters to send to the API endpoint 61 for the get mta operation typically these are written to a http.Request 62 */ 63 type GetMtaParams struct { 64 65 /*MtaID*/ 66 MtaID string 67 68 timeout time.Duration 69 Context context.Context 70 HTTPClient *http.Client 71 } 72 73 // WithTimeout adds the timeout to the get mta params 74 func (o *GetMtaParams) WithTimeout(timeout time.Duration) *GetMtaParams { 75 o.SetTimeout(timeout) 76 return o 77 } 78 79 // SetTimeout adds the timeout to the get mta params 80 func (o *GetMtaParams) SetTimeout(timeout time.Duration) { 81 o.timeout = timeout 82 } 83 84 // WithContext adds the context to the get mta params 85 func (o *GetMtaParams) WithContext(ctx context.Context) *GetMtaParams { 86 o.SetContext(ctx) 87 return o 88 } 89 90 // SetContext adds the context to the get mta params 91 func (o *GetMtaParams) SetContext(ctx context.Context) { 92 o.Context = ctx 93 } 94 95 // WithHTTPClient adds the HTTPClient to the get mta params 96 func (o *GetMtaParams) WithHTTPClient(client *http.Client) *GetMtaParams { 97 o.SetHTTPClient(client) 98 return o 99 } 100 101 // SetHTTPClient adds the HTTPClient to the get mta params 102 func (o *GetMtaParams) SetHTTPClient(client *http.Client) { 103 o.HTTPClient = client 104 } 105 106 // WithMtaID adds the mtaID to the get mta params 107 func (o *GetMtaParams) WithMtaID(mtaID string) *GetMtaParams { 108 o.SetMtaID(mtaID) 109 return o 110 } 111 112 // SetMtaID adds the mtaId to the get mta params 113 func (o *GetMtaParams) SetMtaID(mtaID string) { 114 o.MtaID = mtaID 115 } 116 117 // WriteToRequest writes these params to a swagger request 118 func (o *GetMtaParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { 119 120 if err := r.SetTimeout(o.timeout); err != nil { 121 return err 122 } 123 var res []error 124 125 // path param mta_id 126 if err := r.SetPathParam("mta_id", o.MtaID); err != nil { 127 return err 128 } 129 130 if len(res) > 0 { 131 return errors.CompositeValidationError(res...) 132 } 133 return nil 134 }