github.com/ActiveState/cli@v0.0.0-20240508170324-6801f60cd051/pkg/platform/api/mono/mono_client/authentication/delete_token_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 // NewDeleteTokenParams creates a new DeleteTokenParams 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 NewDeleteTokenParams() *DeleteTokenParams { 26 return &DeleteTokenParams{ 27 timeout: cr.DefaultTimeout, 28 } 29 } 30 31 // NewDeleteTokenParamsWithTimeout creates a new DeleteTokenParams object 32 // with the ability to set a timeout on a request. 33 func NewDeleteTokenParamsWithTimeout(timeout time.Duration) *DeleteTokenParams { 34 return &DeleteTokenParams{ 35 timeout: timeout, 36 } 37 } 38 39 // NewDeleteTokenParamsWithContext creates a new DeleteTokenParams object 40 // with the ability to set a context for a request. 41 func NewDeleteTokenParamsWithContext(ctx context.Context) *DeleteTokenParams { 42 return &DeleteTokenParams{ 43 Context: ctx, 44 } 45 } 46 47 // NewDeleteTokenParamsWithHTTPClient creates a new DeleteTokenParams object 48 // with the ability to set a custom HTTPClient for a request. 49 func NewDeleteTokenParamsWithHTTPClient(client *http.Client) *DeleteTokenParams { 50 return &DeleteTokenParams{ 51 HTTPClient: client, 52 } 53 } 54 55 /* DeleteTokenParams contains all the parameters to send to the API endpoint 56 for the delete token operation. 57 58 Typically these are written to a http.Request. 59 */ 60 type DeleteTokenParams struct { 61 62 /* TokenID. 63 64 tokenID of desired API Token 65 66 Format: uuid 67 */ 68 TokenID strfmt.UUID 69 70 timeout time.Duration 71 Context context.Context 72 HTTPClient *http.Client 73 } 74 75 // WithDefaults hydrates default values in the delete token params (not the query body). 76 // 77 // All values with no default are reset to their zero value. 78 func (o *DeleteTokenParams) WithDefaults() *DeleteTokenParams { 79 o.SetDefaults() 80 return o 81 } 82 83 // SetDefaults hydrates default values in the delete token params (not the query body). 84 // 85 // All values with no default are reset to their zero value. 86 func (o *DeleteTokenParams) SetDefaults() { 87 // no default values defined for this parameter 88 } 89 90 // WithTimeout adds the timeout to the delete token params 91 func (o *DeleteTokenParams) WithTimeout(timeout time.Duration) *DeleteTokenParams { 92 o.SetTimeout(timeout) 93 return o 94 } 95 96 // SetTimeout adds the timeout to the delete token params 97 func (o *DeleteTokenParams) SetTimeout(timeout time.Duration) { 98 o.timeout = timeout 99 } 100 101 // WithContext adds the context to the delete token params 102 func (o *DeleteTokenParams) WithContext(ctx context.Context) *DeleteTokenParams { 103 o.SetContext(ctx) 104 return o 105 } 106 107 // SetContext adds the context to the delete token params 108 func (o *DeleteTokenParams) SetContext(ctx context.Context) { 109 o.Context = ctx 110 } 111 112 // WithHTTPClient adds the HTTPClient to the delete token params 113 func (o *DeleteTokenParams) WithHTTPClient(client *http.Client) *DeleteTokenParams { 114 o.SetHTTPClient(client) 115 return o 116 } 117 118 // SetHTTPClient adds the HTTPClient to the delete token params 119 func (o *DeleteTokenParams) SetHTTPClient(client *http.Client) { 120 o.HTTPClient = client 121 } 122 123 // WithTokenID adds the tokenID to the delete token params 124 func (o *DeleteTokenParams) WithTokenID(tokenID strfmt.UUID) *DeleteTokenParams { 125 o.SetTokenID(tokenID) 126 return o 127 } 128 129 // SetTokenID adds the tokenId to the delete token params 130 func (o *DeleteTokenParams) SetTokenID(tokenID strfmt.UUID) { 131 o.TokenID = tokenID 132 } 133 134 // WriteToRequest writes these params to a swagger request 135 func (o *DeleteTokenParams) 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 // path param tokenID 143 if err := r.SetPathParam("tokenID", o.TokenID.String()); err != nil { 144 return err 145 } 146 147 if len(res) > 0 { 148 return errors.CompositeValidationError(res...) 149 } 150 return nil 151 }