github.com/sap/cf-mta-plugin@v2.6.3+incompatible/clients/restclient/operations/purge_configuration_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 // NewPurgeConfigurationParams creates a new PurgeConfigurationParams object 22 // with the default values initialized. 23 func NewPurgeConfigurationParams() *PurgeConfigurationParams { 24 var () 25 return &PurgeConfigurationParams{ 26 27 timeout: cr.DefaultTimeout, 28 } 29 } 30 31 // NewPurgeConfigurationParamsWithTimeout creates a new PurgeConfigurationParams object 32 // with the default values initialized, and the ability to set a timeout on a request 33 func NewPurgeConfigurationParamsWithTimeout(timeout time.Duration) *PurgeConfigurationParams { 34 var () 35 return &PurgeConfigurationParams{ 36 37 timeout: timeout, 38 } 39 } 40 41 // NewPurgeConfigurationParamsWithContext creates a new PurgeConfigurationParams object 42 // with the default values initialized, and the ability to set a context for a request 43 func NewPurgeConfigurationParamsWithContext(ctx context.Context) *PurgeConfigurationParams { 44 var () 45 return &PurgeConfigurationParams{ 46 47 Context: ctx, 48 } 49 } 50 51 // NewPurgeConfigurationParamsWithHTTPClient creates a new PurgeConfigurationParams object 52 // with the default values initialized, and the ability to set a custom HTTPClient for a request 53 func NewPurgeConfigurationParamsWithHTTPClient(client *http.Client) *PurgeConfigurationParams { 54 var () 55 return &PurgeConfigurationParams{ 56 HTTPClient: client, 57 } 58 } 59 60 /*PurgeConfigurationParams contains all the parameters to send to the API endpoint 61 for the purge configuration operation typically these are written to a http.Request 62 */ 63 type PurgeConfigurationParams struct { 64 65 /*Org*/ 66 Org string 67 /*Space*/ 68 Space string 69 70 timeout time.Duration 71 Context context.Context 72 HTTPClient *http.Client 73 } 74 75 // WithTimeout adds the timeout to the purge configuration params 76 func (o *PurgeConfigurationParams) WithTimeout(timeout time.Duration) *PurgeConfigurationParams { 77 o.SetTimeout(timeout) 78 return o 79 } 80 81 // SetTimeout adds the timeout to the purge configuration params 82 func (o *PurgeConfigurationParams) SetTimeout(timeout time.Duration) { 83 o.timeout = timeout 84 } 85 86 // WithContext adds the context to the purge configuration params 87 func (o *PurgeConfigurationParams) WithContext(ctx context.Context) *PurgeConfigurationParams { 88 o.SetContext(ctx) 89 return o 90 } 91 92 // SetContext adds the context to the purge configuration params 93 func (o *PurgeConfigurationParams) SetContext(ctx context.Context) { 94 o.Context = ctx 95 } 96 97 // WithHTTPClient adds the HTTPClient to the purge configuration params 98 func (o *PurgeConfigurationParams) WithHTTPClient(client *http.Client) *PurgeConfigurationParams { 99 o.SetHTTPClient(client) 100 return o 101 } 102 103 // SetHTTPClient adds the HTTPClient to the purge configuration params 104 func (o *PurgeConfigurationParams) SetHTTPClient(client *http.Client) { 105 o.HTTPClient = client 106 } 107 108 // WithOrg adds the org to the purge configuration params 109 func (o *PurgeConfigurationParams) WithOrg(org string) *PurgeConfigurationParams { 110 o.SetOrg(org) 111 return o 112 } 113 114 // SetOrg adds the org to the purge configuration params 115 func (o *PurgeConfigurationParams) SetOrg(org string) { 116 o.Org = org 117 } 118 119 // WithSpace adds the space to the purge configuration params 120 func (o *PurgeConfigurationParams) WithSpace(space string) *PurgeConfigurationParams { 121 o.SetSpace(space) 122 return o 123 } 124 125 // SetSpace adds the space to the purge configuration params 126 func (o *PurgeConfigurationParams) SetSpace(space string) { 127 o.Space = space 128 } 129 130 // WriteToRequest writes these params to a swagger request 131 func (o *PurgeConfigurationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { 132 133 if err := r.SetTimeout(o.timeout); err != nil { 134 return err 135 } 136 var res []error 137 138 // query param org 139 qrOrg := o.Org 140 qOrg := qrOrg 141 if qOrg != "" { 142 if err := r.SetQueryParam("org", qOrg); err != nil { 143 return err 144 } 145 } 146 147 // query param space 148 qrSpace := o.Space 149 qSpace := qrSpace 150 if qSpace != "" { 151 if err := r.SetQueryParam("space", qSpace); err != nil { 152 return err 153 } 154 } 155 156 if len(res) > 0 { 157 return errors.CompositeValidationError(res...) 158 } 159 return nil 160 }