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