github.com/goharbor/go-client@v0.210.0/pkg/sdk/v2.0/client/purge/get_purge_schedule_parameters.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package purge 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 // NewGetPurgeScheduleParams creates a new GetPurgeScheduleParams 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 NewGetPurgeScheduleParams() *GetPurgeScheduleParams { 26 return &GetPurgeScheduleParams{ 27 timeout: cr.DefaultTimeout, 28 } 29 } 30 31 // NewGetPurgeScheduleParamsWithTimeout creates a new GetPurgeScheduleParams object 32 // with the ability to set a timeout on a request. 33 func NewGetPurgeScheduleParamsWithTimeout(timeout time.Duration) *GetPurgeScheduleParams { 34 return &GetPurgeScheduleParams{ 35 timeout: timeout, 36 } 37 } 38 39 // NewGetPurgeScheduleParamsWithContext creates a new GetPurgeScheduleParams object 40 // with the ability to set a context for a request. 41 func NewGetPurgeScheduleParamsWithContext(ctx context.Context) *GetPurgeScheduleParams { 42 return &GetPurgeScheduleParams{ 43 Context: ctx, 44 } 45 } 46 47 // NewGetPurgeScheduleParamsWithHTTPClient creates a new GetPurgeScheduleParams object 48 // with the ability to set a custom HTTPClient for a request. 49 func NewGetPurgeScheduleParamsWithHTTPClient(client *http.Client) *GetPurgeScheduleParams { 50 return &GetPurgeScheduleParams{ 51 HTTPClient: client, 52 } 53 } 54 55 /* 56 GetPurgeScheduleParams contains all the parameters to send to the API endpoint 57 58 for the get purge schedule operation. 59 60 Typically these are written to a http.Request. 61 */ 62 type GetPurgeScheduleParams 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 purge schedule params (not the query body). 76 // 77 // All values with no default are reset to their zero value. 78 func (o *GetPurgeScheduleParams) WithDefaults() *GetPurgeScheduleParams { 79 o.SetDefaults() 80 return o 81 } 82 83 // SetDefaults hydrates default values in the get purge schedule params (not the query body). 84 // 85 // All values with no default are reset to their zero value. 86 func (o *GetPurgeScheduleParams) SetDefaults() { 87 // no default values defined for this parameter 88 } 89 90 // WithTimeout adds the timeout to the get purge schedule params 91 func (o *GetPurgeScheduleParams) WithTimeout(timeout time.Duration) *GetPurgeScheduleParams { 92 o.SetTimeout(timeout) 93 return o 94 } 95 96 // SetTimeout adds the timeout to the get purge schedule params 97 func (o *GetPurgeScheduleParams) SetTimeout(timeout time.Duration) { 98 o.timeout = timeout 99 } 100 101 // WithContext adds the context to the get purge schedule params 102 func (o *GetPurgeScheduleParams) WithContext(ctx context.Context) *GetPurgeScheduleParams { 103 o.SetContext(ctx) 104 return o 105 } 106 107 // SetContext adds the context to the get purge schedule params 108 func (o *GetPurgeScheduleParams) SetContext(ctx context.Context) { 109 o.Context = ctx 110 } 111 112 // WithHTTPClient adds the HTTPClient to the get purge schedule params 113 func (o *GetPurgeScheduleParams) WithHTTPClient(client *http.Client) *GetPurgeScheduleParams { 114 o.SetHTTPClient(client) 115 return o 116 } 117 118 // SetHTTPClient adds the HTTPClient to the get purge schedule params 119 func (o *GetPurgeScheduleParams) SetHTTPClient(client *http.Client) { 120 o.HTTPClient = client 121 } 122 123 // WithXRequestID adds the xRequestID to the get purge schedule params 124 func (o *GetPurgeScheduleParams) WithXRequestID(xRequestID *string) *GetPurgeScheduleParams { 125 o.SetXRequestID(xRequestID) 126 return o 127 } 128 129 // SetXRequestID adds the xRequestId to the get purge schedule params 130 func (o *GetPurgeScheduleParams) SetXRequestID(xRequestID *string) { 131 o.XRequestID = xRequestID 132 } 133 134 // WriteToRequest writes these params to a swagger request 135 func (o *GetPurgeScheduleParams) 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 }