github.com/goharbor/go-client@v0.210.0/pkg/sdk/v2.0/client/replication/get_replication_log_parameters.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package replication 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 "github.com/go-openapi/swag" 18 ) 19 20 // NewGetReplicationLogParams creates a new GetReplicationLogParams object, 21 // with the default timeout for this client. 22 // 23 // Default values are not hydrated, since defaults are normally applied by the API server side. 24 // 25 // To enforce default values in parameter, use SetDefaults or WithDefaults. 26 func NewGetReplicationLogParams() *GetReplicationLogParams { 27 return &GetReplicationLogParams{ 28 timeout: cr.DefaultTimeout, 29 } 30 } 31 32 // NewGetReplicationLogParamsWithTimeout creates a new GetReplicationLogParams object 33 // with the ability to set a timeout on a request. 34 func NewGetReplicationLogParamsWithTimeout(timeout time.Duration) *GetReplicationLogParams { 35 return &GetReplicationLogParams{ 36 timeout: timeout, 37 } 38 } 39 40 // NewGetReplicationLogParamsWithContext creates a new GetReplicationLogParams object 41 // with the ability to set a context for a request. 42 func NewGetReplicationLogParamsWithContext(ctx context.Context) *GetReplicationLogParams { 43 return &GetReplicationLogParams{ 44 Context: ctx, 45 } 46 } 47 48 // NewGetReplicationLogParamsWithHTTPClient creates a new GetReplicationLogParams object 49 // with the ability to set a custom HTTPClient for a request. 50 func NewGetReplicationLogParamsWithHTTPClient(client *http.Client) *GetReplicationLogParams { 51 return &GetReplicationLogParams{ 52 HTTPClient: client, 53 } 54 } 55 56 /* 57 GetReplicationLogParams contains all the parameters to send to the API endpoint 58 59 for the get replication log operation. 60 61 Typically these are written to a http.Request. 62 */ 63 type GetReplicationLogParams struct { 64 65 /* XRequestID. 66 67 An unique ID for the request 68 */ 69 XRequestID *string 70 71 /* ID. 72 73 The ID of the execution that the tasks belongs to. 74 75 Format: int64 76 */ 77 ID int64 78 79 /* TaskID. 80 81 The ID of the task. 82 83 Format: int64 84 */ 85 TaskID int64 86 87 timeout time.Duration 88 Context context.Context 89 HTTPClient *http.Client 90 } 91 92 // WithDefaults hydrates default values in the get replication log params (not the query body). 93 // 94 // All values with no default are reset to their zero value. 95 func (o *GetReplicationLogParams) WithDefaults() *GetReplicationLogParams { 96 o.SetDefaults() 97 return o 98 } 99 100 // SetDefaults hydrates default values in the get replication log params (not the query body). 101 // 102 // All values with no default are reset to their zero value. 103 func (o *GetReplicationLogParams) SetDefaults() { 104 // no default values defined for this parameter 105 } 106 107 // WithTimeout adds the timeout to the get replication log params 108 func (o *GetReplicationLogParams) WithTimeout(timeout time.Duration) *GetReplicationLogParams { 109 o.SetTimeout(timeout) 110 return o 111 } 112 113 // SetTimeout adds the timeout to the get replication log params 114 func (o *GetReplicationLogParams) SetTimeout(timeout time.Duration) { 115 o.timeout = timeout 116 } 117 118 // WithContext adds the context to the get replication log params 119 func (o *GetReplicationLogParams) WithContext(ctx context.Context) *GetReplicationLogParams { 120 o.SetContext(ctx) 121 return o 122 } 123 124 // SetContext adds the context to the get replication log params 125 func (o *GetReplicationLogParams) SetContext(ctx context.Context) { 126 o.Context = ctx 127 } 128 129 // WithHTTPClient adds the HTTPClient to the get replication log params 130 func (o *GetReplicationLogParams) WithHTTPClient(client *http.Client) *GetReplicationLogParams { 131 o.SetHTTPClient(client) 132 return o 133 } 134 135 // SetHTTPClient adds the HTTPClient to the get replication log params 136 func (o *GetReplicationLogParams) SetHTTPClient(client *http.Client) { 137 o.HTTPClient = client 138 } 139 140 // WithXRequestID adds the xRequestID to the get replication log params 141 func (o *GetReplicationLogParams) WithXRequestID(xRequestID *string) *GetReplicationLogParams { 142 o.SetXRequestID(xRequestID) 143 return o 144 } 145 146 // SetXRequestID adds the xRequestId to the get replication log params 147 func (o *GetReplicationLogParams) SetXRequestID(xRequestID *string) { 148 o.XRequestID = xRequestID 149 } 150 151 // WithID adds the id to the get replication log params 152 func (o *GetReplicationLogParams) WithID(id int64) *GetReplicationLogParams { 153 o.SetID(id) 154 return o 155 } 156 157 // SetID adds the id to the get replication log params 158 func (o *GetReplicationLogParams) SetID(id int64) { 159 o.ID = id 160 } 161 162 // WithTaskID adds the taskID to the get replication log params 163 func (o *GetReplicationLogParams) WithTaskID(taskID int64) *GetReplicationLogParams { 164 o.SetTaskID(taskID) 165 return o 166 } 167 168 // SetTaskID adds the taskId to the get replication log params 169 func (o *GetReplicationLogParams) SetTaskID(taskID int64) { 170 o.TaskID = taskID 171 } 172 173 // WriteToRequest writes these params to a swagger request 174 func (o *GetReplicationLogParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { 175 176 if err := r.SetTimeout(o.timeout); err != nil { 177 return err 178 } 179 var res []error 180 181 if o.XRequestID != nil { 182 183 // header param X-Request-Id 184 if err := r.SetHeaderParam("X-Request-Id", *o.XRequestID); err != nil { 185 return err 186 } 187 } 188 189 // path param id 190 if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { 191 return err 192 } 193 194 // path param task_id 195 if err := r.SetPathParam("task_id", swag.FormatInt64(o.TaskID)); err != nil { 196 return err 197 } 198 199 if len(res) > 0 { 200 return errors.CompositeValidationError(res...) 201 } 202 return nil 203 }