github.com/ActiveState/cli@v0.0.0-20240508170324-6801f60cd051/pkg/platform/api/mono/mono_client/users/search_usernames_parameters.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package users 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 "context" 10 "net/http" 11 "time" 12 13 "github.com/go-openapi/errors" 14 "github.com/go-openapi/runtime" 15 cr "github.com/go-openapi/runtime/client" 16 "github.com/go-openapi/strfmt" 17 ) 18 19 // NewSearchUsernamesParams creates a new SearchUsernamesParams object, 20 // with the default timeout for this client. 21 // 22 // Default values are not hydrated, since defaults are normally applied by the API server side. 23 // 24 // To enforce default values in parameter, use SetDefaults or WithDefaults. 25 func NewSearchUsernamesParams() *SearchUsernamesParams { 26 return &SearchUsernamesParams{ 27 timeout: cr.DefaultTimeout, 28 } 29 } 30 31 // NewSearchUsernamesParamsWithTimeout creates a new SearchUsernamesParams object 32 // with the ability to set a timeout on a request. 33 func NewSearchUsernamesParamsWithTimeout(timeout time.Duration) *SearchUsernamesParams { 34 return &SearchUsernamesParams{ 35 timeout: timeout, 36 } 37 } 38 39 // NewSearchUsernamesParamsWithContext creates a new SearchUsernamesParams object 40 // with the ability to set a context for a request. 41 func NewSearchUsernamesParamsWithContext(ctx context.Context) *SearchUsernamesParams { 42 return &SearchUsernamesParams{ 43 Context: ctx, 44 } 45 } 46 47 // NewSearchUsernamesParamsWithHTTPClient creates a new SearchUsernamesParams object 48 // with the ability to set a custom HTTPClient for a request. 49 func NewSearchUsernamesParamsWithHTTPClient(client *http.Client) *SearchUsernamesParams { 50 return &SearchUsernamesParams{ 51 HTTPClient: client, 52 } 53 } 54 55 /* SearchUsernamesParams contains all the parameters to send to the API endpoint 56 for the search usernames operation. 57 58 Typically these are written to a http.Request. 59 */ 60 type SearchUsernamesParams struct { 61 62 // Body. 63 Body SearchUsernamesBody 64 65 timeout time.Duration 66 Context context.Context 67 HTTPClient *http.Client 68 } 69 70 // WithDefaults hydrates default values in the search usernames params (not the query body). 71 // 72 // All values with no default are reset to their zero value. 73 func (o *SearchUsernamesParams) WithDefaults() *SearchUsernamesParams { 74 o.SetDefaults() 75 return o 76 } 77 78 // SetDefaults hydrates default values in the search usernames params (not the query body). 79 // 80 // All values with no default are reset to their zero value. 81 func (o *SearchUsernamesParams) SetDefaults() { 82 // no default values defined for this parameter 83 } 84 85 // WithTimeout adds the timeout to the search usernames params 86 func (o *SearchUsernamesParams) WithTimeout(timeout time.Duration) *SearchUsernamesParams { 87 o.SetTimeout(timeout) 88 return o 89 } 90 91 // SetTimeout adds the timeout to the search usernames params 92 func (o *SearchUsernamesParams) SetTimeout(timeout time.Duration) { 93 o.timeout = timeout 94 } 95 96 // WithContext adds the context to the search usernames params 97 func (o *SearchUsernamesParams) WithContext(ctx context.Context) *SearchUsernamesParams { 98 o.SetContext(ctx) 99 return o 100 } 101 102 // SetContext adds the context to the search usernames params 103 func (o *SearchUsernamesParams) SetContext(ctx context.Context) { 104 o.Context = ctx 105 } 106 107 // WithHTTPClient adds the HTTPClient to the search usernames params 108 func (o *SearchUsernamesParams) WithHTTPClient(client *http.Client) *SearchUsernamesParams { 109 o.SetHTTPClient(client) 110 return o 111 } 112 113 // SetHTTPClient adds the HTTPClient to the search usernames params 114 func (o *SearchUsernamesParams) SetHTTPClient(client *http.Client) { 115 o.HTTPClient = client 116 } 117 118 // WithBody adds the body to the search usernames params 119 func (o *SearchUsernamesParams) WithBody(body SearchUsernamesBody) *SearchUsernamesParams { 120 o.SetBody(body) 121 return o 122 } 123 124 // SetBody adds the body to the search usernames params 125 func (o *SearchUsernamesParams) SetBody(body SearchUsernamesBody) { 126 o.Body = body 127 } 128 129 // WriteToRequest writes these params to a swagger request 130 func (o *SearchUsernamesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { 131 132 if err := r.SetTimeout(o.timeout); err != nil { 133 return err 134 } 135 var res []error 136 if err := r.SetBodyParam(o.Body); err != nil { 137 return err 138 } 139 140 if len(res) > 0 { 141 return errors.CompositeValidationError(res...) 142 } 143 return nil 144 }