github.com/ActiveState/cli@v0.0.0-20240508170324-6801f60cd051/pkg/platform/api/mono/mono_client/authentication/get_logout_parameters.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package authentication 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 // NewGetLogoutParams creates a new GetLogoutParams 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 NewGetLogoutParams() *GetLogoutParams { 26 return &GetLogoutParams{ 27 timeout: cr.DefaultTimeout, 28 } 29 } 30 31 // NewGetLogoutParamsWithTimeout creates a new GetLogoutParams object 32 // with the ability to set a timeout on a request. 33 func NewGetLogoutParamsWithTimeout(timeout time.Duration) *GetLogoutParams { 34 return &GetLogoutParams{ 35 timeout: timeout, 36 } 37 } 38 39 // NewGetLogoutParamsWithContext creates a new GetLogoutParams object 40 // with the ability to set a context for a request. 41 func NewGetLogoutParamsWithContext(ctx context.Context) *GetLogoutParams { 42 return &GetLogoutParams{ 43 Context: ctx, 44 } 45 } 46 47 // NewGetLogoutParamsWithHTTPClient creates a new GetLogoutParams object 48 // with the ability to set a custom HTTPClient for a request. 49 func NewGetLogoutParamsWithHTTPClient(client *http.Client) *GetLogoutParams { 50 return &GetLogoutParams{ 51 HTTPClient: client, 52 } 53 } 54 55 /* GetLogoutParams contains all the parameters to send to the API endpoint 56 for the get logout operation. 57 58 Typically these are written to a http.Request. 59 */ 60 type GetLogoutParams struct { 61 timeout time.Duration 62 Context context.Context 63 HTTPClient *http.Client 64 } 65 66 // WithDefaults hydrates default values in the get logout params (not the query body). 67 // 68 // All values with no default are reset to their zero value. 69 func (o *GetLogoutParams) WithDefaults() *GetLogoutParams { 70 o.SetDefaults() 71 return o 72 } 73 74 // SetDefaults hydrates default values in the get logout params (not the query body). 75 // 76 // All values with no default are reset to their zero value. 77 func (o *GetLogoutParams) SetDefaults() { 78 // no default values defined for this parameter 79 } 80 81 // WithTimeout adds the timeout to the get logout params 82 func (o *GetLogoutParams) WithTimeout(timeout time.Duration) *GetLogoutParams { 83 o.SetTimeout(timeout) 84 return o 85 } 86 87 // SetTimeout adds the timeout to the get logout params 88 func (o *GetLogoutParams) SetTimeout(timeout time.Duration) { 89 o.timeout = timeout 90 } 91 92 // WithContext adds the context to the get logout params 93 func (o *GetLogoutParams) WithContext(ctx context.Context) *GetLogoutParams { 94 o.SetContext(ctx) 95 return o 96 } 97 98 // SetContext adds the context to the get logout params 99 func (o *GetLogoutParams) SetContext(ctx context.Context) { 100 o.Context = ctx 101 } 102 103 // WithHTTPClient adds the HTTPClient to the get logout params 104 func (o *GetLogoutParams) WithHTTPClient(client *http.Client) *GetLogoutParams { 105 o.SetHTTPClient(client) 106 return o 107 } 108 109 // SetHTTPClient adds the HTTPClient to the get logout params 110 func (o *GetLogoutParams) SetHTTPClient(client *http.Client) { 111 o.HTTPClient = client 112 } 113 114 // WriteToRequest writes these params to a swagger request 115 func (o *GetLogoutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { 116 117 if err := r.SetTimeout(o.timeout); err != nil { 118 return err 119 } 120 var res []error 121 122 if len(res) > 0 { 123 return errors.CompositeValidationError(res...) 124 } 125 return nil 126 }