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