github.com/ActiveState/cli@v0.0.0-20240508170324-6801f60cd051/pkg/platform/api/buildlogstream/buildlogstream_client/buildlogstream_operations/get_parameters.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package buildlogstream_operations 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 "github.com/ActiveState/cli/pkg/platform/api/buildlogstream/buildlogstream_models" 19 ) 20 21 // NewGetParams creates a new GetParams object 22 // with the default values initialized. 23 func NewGetParams() *GetParams { 24 var () 25 return &GetParams{ 26 27 timeout: cr.DefaultTimeout, 28 } 29 } 30 31 // NewGetParamsWithTimeout creates a new GetParams object 32 // with the default values initialized, and the ability to set a timeout on a request 33 func NewGetParamsWithTimeout(timeout time.Duration) *GetParams { 34 var () 35 return &GetParams{ 36 37 timeout: timeout, 38 } 39 } 40 41 // NewGetParamsWithContext creates a new GetParams object 42 // with the default values initialized, and the ability to set a context for a request 43 func NewGetParamsWithContext(ctx context.Context) *GetParams { 44 var () 45 return &GetParams{ 46 47 Context: ctx, 48 } 49 } 50 51 // NewGetParamsWithHTTPClient creates a new GetParams object 52 // with the default values initialized, and the ability to set a custom HTTPClient for a request 53 func NewGetParamsWithHTTPClient(client *http.Client) *GetParams { 54 var () 55 return &GetParams{ 56 HTTPClient: client, 57 } 58 } 59 60 /*GetParams contains all the parameters to send to the API endpoint 61 for the get operation typically these are written to a http.Request 62 */ 63 type GetParams struct { 64 65 /*LogRequest*/ 66 LogRequest *buildlogstream_models.LogRequest 67 68 timeout time.Duration 69 Context context.Context 70 HTTPClient *http.Client 71 } 72 73 // WithTimeout adds the timeout to the get params 74 func (o *GetParams) WithTimeout(timeout time.Duration) *GetParams { 75 o.SetTimeout(timeout) 76 return o 77 } 78 79 // SetTimeout adds the timeout to the get params 80 func (o *GetParams) SetTimeout(timeout time.Duration) { 81 o.timeout = timeout 82 } 83 84 // WithContext adds the context to the get params 85 func (o *GetParams) WithContext(ctx context.Context) *GetParams { 86 o.SetContext(ctx) 87 return o 88 } 89 90 // SetContext adds the context to the get params 91 func (o *GetParams) SetContext(ctx context.Context) { 92 o.Context = ctx 93 } 94 95 // WithHTTPClient adds the HTTPClient to the get params 96 func (o *GetParams) WithHTTPClient(client *http.Client) *GetParams { 97 o.SetHTTPClient(client) 98 return o 99 } 100 101 // SetHTTPClient adds the HTTPClient to the get params 102 func (o *GetParams) SetHTTPClient(client *http.Client) { 103 o.HTTPClient = client 104 } 105 106 // WithLogRequest adds the logRequest to the get params 107 func (o *GetParams) WithLogRequest(logRequest *buildlogstream_models.LogRequest) *GetParams { 108 o.SetLogRequest(logRequest) 109 return o 110 } 111 112 // SetLogRequest adds the logRequest to the get params 113 func (o *GetParams) SetLogRequest(logRequest *buildlogstream_models.LogRequest) { 114 o.LogRequest = logRequest 115 } 116 117 // WriteToRequest writes these params to a swagger request 118 func (o *GetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { 119 120 if err := r.SetTimeout(o.timeout); err != nil { 121 return err 122 } 123 var res []error 124 125 if o.LogRequest != nil { 126 if err := r.SetBodyParam(o.LogRequest); err != nil { 127 return err 128 } 129 } 130 131 if len(res) > 0 { 132 return errors.CompositeValidationError(res...) 133 } 134 return nil 135 }