github.com/ActiveState/cli@v0.0.0-20240508170324-6801f60cd051/pkg/platform/api/mono/mono_client/authentication/get_renew_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 // NewGetRenewParams creates a new GetRenewParams 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 NewGetRenewParams() *GetRenewParams { 26 return &GetRenewParams{ 27 timeout: cr.DefaultTimeout, 28 } 29 } 30 31 // NewGetRenewParamsWithTimeout creates a new GetRenewParams object 32 // with the ability to set a timeout on a request. 33 func NewGetRenewParamsWithTimeout(timeout time.Duration) *GetRenewParams { 34 return &GetRenewParams{ 35 timeout: timeout, 36 } 37 } 38 39 // NewGetRenewParamsWithContext creates a new GetRenewParams object 40 // with the ability to set a context for a request. 41 func NewGetRenewParamsWithContext(ctx context.Context) *GetRenewParams { 42 return &GetRenewParams{ 43 Context: ctx, 44 } 45 } 46 47 // NewGetRenewParamsWithHTTPClient creates a new GetRenewParams object 48 // with the ability to set a custom HTTPClient for a request. 49 func NewGetRenewParamsWithHTTPClient(client *http.Client) *GetRenewParams { 50 return &GetRenewParams{ 51 HTTPClient: client, 52 } 53 } 54 55 /* GetRenewParams contains all the parameters to send to the API endpoint 56 for the get renew operation. 57 58 Typically these are written to a http.Request. 59 */ 60 type GetRenewParams struct { 61 62 /* SessionID. 63 64 id of session to renew 65 66 Format: uuid 67 */ 68 SessionID *strfmt.UUID 69 70 timeout time.Duration 71 Context context.Context 72 HTTPClient *http.Client 73 } 74 75 // WithDefaults hydrates default values in the get renew params (not the query body). 76 // 77 // All values with no default are reset to their zero value. 78 func (o *GetRenewParams) WithDefaults() *GetRenewParams { 79 o.SetDefaults() 80 return o 81 } 82 83 // SetDefaults hydrates default values in the get renew params (not the query body). 84 // 85 // All values with no default are reset to their zero value. 86 func (o *GetRenewParams) SetDefaults() { 87 // no default values defined for this parameter 88 } 89 90 // WithTimeout adds the timeout to the get renew params 91 func (o *GetRenewParams) WithTimeout(timeout time.Duration) *GetRenewParams { 92 o.SetTimeout(timeout) 93 return o 94 } 95 96 // SetTimeout adds the timeout to the get renew params 97 func (o *GetRenewParams) SetTimeout(timeout time.Duration) { 98 o.timeout = timeout 99 } 100 101 // WithContext adds the context to the get renew params 102 func (o *GetRenewParams) WithContext(ctx context.Context) *GetRenewParams { 103 o.SetContext(ctx) 104 return o 105 } 106 107 // SetContext adds the context to the get renew params 108 func (o *GetRenewParams) SetContext(ctx context.Context) { 109 o.Context = ctx 110 } 111 112 // WithHTTPClient adds the HTTPClient to the get renew params 113 func (o *GetRenewParams) WithHTTPClient(client *http.Client) *GetRenewParams { 114 o.SetHTTPClient(client) 115 return o 116 } 117 118 // SetHTTPClient adds the HTTPClient to the get renew params 119 func (o *GetRenewParams) SetHTTPClient(client *http.Client) { 120 o.HTTPClient = client 121 } 122 123 // WithSessionID adds the sessionID to the get renew params 124 func (o *GetRenewParams) WithSessionID(sessionID *strfmt.UUID) *GetRenewParams { 125 o.SetSessionID(sessionID) 126 return o 127 } 128 129 // SetSessionID adds the sessionId to the get renew params 130 func (o *GetRenewParams) SetSessionID(sessionID *strfmt.UUID) { 131 o.SessionID = sessionID 132 } 133 134 // WriteToRequest writes these params to a swagger request 135 func (o *GetRenewParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { 136 137 if err := r.SetTimeout(o.timeout); err != nil { 138 return err 139 } 140 var res []error 141 142 if o.SessionID != nil { 143 144 // query param sessionID 145 var qrSessionID strfmt.UUID 146 147 if o.SessionID != nil { 148 qrSessionID = *o.SessionID 149 } 150 qSessionID := qrSessionID.String() 151 if qSessionID != "" { 152 153 if err := r.SetQueryParam("sessionID", qSessionID); err != nil { 154 return err 155 } 156 } 157 } 158 159 if len(res) > 0 { 160 return errors.CompositeValidationError(res...) 161 } 162 return nil 163 }