github.com/sap/cf-mta-plugin@v2.6.3+incompatible/clients/cfrestclient/operations/get_shared_domains_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 // NewGetSharedDomainsParams creates a new GetSharedDomainsParams object 22 // with the default values initialized. 23 func NewGetSharedDomainsParams() *GetSharedDomainsParams { 24 var () 25 return &GetSharedDomainsParams{ 26 27 timeout: cr.DefaultTimeout, 28 } 29 } 30 31 // NewGetSharedDomainsParamsWithTimeout creates a new GetSharedDomainsParams object 32 // with the default values initialized, and the ability to set a timeout on a request 33 func NewGetSharedDomainsParamsWithTimeout(timeout time.Duration) *GetSharedDomainsParams { 34 var () 35 return &GetSharedDomainsParams{ 36 37 timeout: timeout, 38 } 39 } 40 41 // NewGetSharedDomainsParamsWithContext creates a new GetSharedDomainsParams object 42 // with the default values initialized, and the ability to set a context for a request 43 func NewGetSharedDomainsParamsWithContext(ctx context.Context) *GetSharedDomainsParams { 44 var () 45 return &GetSharedDomainsParams{ 46 47 Context: ctx, 48 } 49 } 50 51 // NewGetSharedDomainsParamsWithHTTPClient creates a new GetSharedDomainsParams object 52 // with the default values initialized, and the ability to set a custom HTTPClient for a request 53 func NewGetSharedDomainsParamsWithHTTPClient(client *http.Client) *GetSharedDomainsParams { 54 var () 55 return &GetSharedDomainsParams{ 56 HTTPClient: client, 57 } 58 } 59 60 /*GetSharedDomainsParams contains all the parameters to send to the API endpoint 61 for the get shared domains operation typically these are written to a http.Request 62 */ 63 type GetSharedDomainsParams struct { 64 65 /*OrderDirection*/ 66 OrderDirection *string 67 /*Page*/ 68 Page *string 69 /*ResultsPerPage*/ 70 ResultsPerPage *string 71 72 timeout time.Duration 73 Context context.Context 74 HTTPClient *http.Client 75 } 76 77 // WithTimeout adds the timeout to the get shared domains params 78 func (o *GetSharedDomainsParams) WithTimeout(timeout time.Duration) *GetSharedDomainsParams { 79 o.SetTimeout(timeout) 80 return o 81 } 82 83 // SetTimeout adds the timeout to the get shared domains params 84 func (o *GetSharedDomainsParams) SetTimeout(timeout time.Duration) { 85 o.timeout = timeout 86 } 87 88 // WithContext adds the context to the get shared domains params 89 func (o *GetSharedDomainsParams) WithContext(ctx context.Context) *GetSharedDomainsParams { 90 o.SetContext(ctx) 91 return o 92 } 93 94 // SetContext adds the context to the get shared domains params 95 func (o *GetSharedDomainsParams) SetContext(ctx context.Context) { 96 o.Context = ctx 97 } 98 99 // WithHTTPClient adds the HTTPClient to the get shared domains params 100 func (o *GetSharedDomainsParams) WithHTTPClient(client *http.Client) *GetSharedDomainsParams { 101 o.SetHTTPClient(client) 102 return o 103 } 104 105 // SetHTTPClient adds the HTTPClient to the get shared domains params 106 func (o *GetSharedDomainsParams) SetHTTPClient(client *http.Client) { 107 o.HTTPClient = client 108 } 109 110 // WithOrderDirection adds the orderDirection to the get shared domains params 111 func (o *GetSharedDomainsParams) WithOrderDirection(orderDirection *string) *GetSharedDomainsParams { 112 o.SetOrderDirection(orderDirection) 113 return o 114 } 115 116 // SetOrderDirection adds the orderDirection to the get shared domains params 117 func (o *GetSharedDomainsParams) SetOrderDirection(orderDirection *string) { 118 o.OrderDirection = orderDirection 119 } 120 121 // WithPage adds the page to the get shared domains params 122 func (o *GetSharedDomainsParams) WithPage(page *string) *GetSharedDomainsParams { 123 o.SetPage(page) 124 return o 125 } 126 127 // SetPage adds the page to the get shared domains params 128 func (o *GetSharedDomainsParams) SetPage(page *string) { 129 o.Page = page 130 } 131 132 // WithResultsPerPage adds the resultsPerPage to the get shared domains params 133 func (o *GetSharedDomainsParams) WithResultsPerPage(resultsPerPage *string) *GetSharedDomainsParams { 134 o.SetResultsPerPage(resultsPerPage) 135 return o 136 } 137 138 // SetResultsPerPage adds the resultsPerPage to the get shared domains params 139 func (o *GetSharedDomainsParams) SetResultsPerPage(resultsPerPage *string) { 140 o.ResultsPerPage = resultsPerPage 141 } 142 143 // WriteToRequest writes these params to a swagger request 144 func (o *GetSharedDomainsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { 145 146 if err := r.SetTimeout(o.timeout); err != nil { 147 return err 148 } 149 var res []error 150 151 if o.OrderDirection != nil { 152 153 // query param order-direction 154 var qrOrderDirection string 155 if o.OrderDirection != nil { 156 qrOrderDirection = *o.OrderDirection 157 } 158 qOrderDirection := qrOrderDirection 159 if qOrderDirection != "" { 160 if err := r.SetQueryParam("order-direction", qOrderDirection); err != nil { 161 return err 162 } 163 } 164 165 } 166 167 if o.Page != nil { 168 169 // query param page 170 var qrPage string 171 if o.Page != nil { 172 qrPage = *o.Page 173 } 174 qPage := qrPage 175 if qPage != "" { 176 if err := r.SetQueryParam("page", qPage); err != nil { 177 return err 178 } 179 } 180 181 } 182 183 if o.ResultsPerPage != nil { 184 185 // query param results-per-page 186 var qrResultsPerPage string 187 if o.ResultsPerPage != nil { 188 qrResultsPerPage = *o.ResultsPerPage 189 } 190 qResultsPerPage := qrResultsPerPage 191 if qResultsPerPage != "" { 192 if err := r.SetQueryParam("results-per-page", qResultsPerPage); err != nil { 193 return err 194 } 195 } 196 197 } 198 199 if len(res) > 0 { 200 return errors.CompositeValidationError(res...) 201 } 202 return nil 203 }