github.com/goharbor/go-client@v0.210.0/pkg/sdk/v2.0/client/gc/get_gc_schedule_parameters.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package gc 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 // NewGetGCScheduleParams creates a new GetGCScheduleParams 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 NewGetGCScheduleParams() *GetGCScheduleParams { 26 return &GetGCScheduleParams{ 27 timeout: cr.DefaultTimeout, 28 } 29 } 30 31 // NewGetGCScheduleParamsWithTimeout creates a new GetGCScheduleParams object 32 // with the ability to set a timeout on a request. 33 func NewGetGCScheduleParamsWithTimeout(timeout time.Duration) *GetGCScheduleParams { 34 return &GetGCScheduleParams{ 35 timeout: timeout, 36 } 37 } 38 39 // NewGetGCScheduleParamsWithContext creates a new GetGCScheduleParams object 40 // with the ability to set a context for a request. 41 func NewGetGCScheduleParamsWithContext(ctx context.Context) *GetGCScheduleParams { 42 return &GetGCScheduleParams{ 43 Context: ctx, 44 } 45 } 46 47 // NewGetGCScheduleParamsWithHTTPClient creates a new GetGCScheduleParams object 48 // with the ability to set a custom HTTPClient for a request. 49 func NewGetGCScheduleParamsWithHTTPClient(client *http.Client) *GetGCScheduleParams { 50 return &GetGCScheduleParams{ 51 HTTPClient: client, 52 } 53 } 54 55 /* 56 GetGCScheduleParams contains all the parameters to send to the API endpoint 57 58 for the get GC schedule operation. 59 60 Typically these are written to a http.Request. 61 */ 62 type GetGCScheduleParams struct { 63 64 /* XRequestID. 65 66 An unique ID for the request 67 */ 68 XRequestID *string 69 70 timeout time.Duration 71 Context context.Context 72 HTTPClient *http.Client 73 } 74 75 // WithDefaults hydrates default values in the get GC schedule params (not the query body). 76 // 77 // All values with no default are reset to their zero value. 78 func (o *GetGCScheduleParams) WithDefaults() *GetGCScheduleParams { 79 o.SetDefaults() 80 return o 81 } 82 83 // SetDefaults hydrates default values in the get GC schedule params (not the query body). 84 // 85 // All values with no default are reset to their zero value. 86 func (o *GetGCScheduleParams) SetDefaults() { 87 // no default values defined for this parameter 88 } 89 90 // WithTimeout adds the timeout to the get GC schedule params 91 func (o *GetGCScheduleParams) WithTimeout(timeout time.Duration) *GetGCScheduleParams { 92 o.SetTimeout(timeout) 93 return o 94 } 95 96 // SetTimeout adds the timeout to the get GC schedule params 97 func (o *GetGCScheduleParams) SetTimeout(timeout time.Duration) { 98 o.timeout = timeout 99 } 100 101 // WithContext adds the context to the get GC schedule params 102 func (o *GetGCScheduleParams) WithContext(ctx context.Context) *GetGCScheduleParams { 103 o.SetContext(ctx) 104 return o 105 } 106 107 // SetContext adds the context to the get GC schedule params 108 func (o *GetGCScheduleParams) SetContext(ctx context.Context) { 109 o.Context = ctx 110 } 111 112 // WithHTTPClient adds the HTTPClient to the get GC schedule params 113 func (o *GetGCScheduleParams) WithHTTPClient(client *http.Client) *GetGCScheduleParams { 114 o.SetHTTPClient(client) 115 return o 116 } 117 118 // SetHTTPClient adds the HTTPClient to the get GC schedule params 119 func (o *GetGCScheduleParams) SetHTTPClient(client *http.Client) { 120 o.HTTPClient = client 121 } 122 123 // WithXRequestID adds the xRequestID to the get GC schedule params 124 func (o *GetGCScheduleParams) WithXRequestID(xRequestID *string) *GetGCScheduleParams { 125 o.SetXRequestID(xRequestID) 126 return o 127 } 128 129 // SetXRequestID adds the xRequestId to the get GC schedule params 130 func (o *GetGCScheduleParams) SetXRequestID(xRequestID *string) { 131 o.XRequestID = xRequestID 132 } 133 134 // WriteToRequest writes these params to a swagger request 135 func (o *GetGCScheduleParams) 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.XRequestID != nil { 143 144 // header param X-Request-Id 145 if err := r.SetHeaderParam("X-Request-Id", *o.XRequestID); err != nil { 146 return err 147 } 148 } 149 150 if len(res) > 0 { 151 return errors.CompositeValidationError(res...) 152 } 153 return nil 154 }