github.com/goharbor/go-client@v0.210.0/pkg/sdk/v2.0/client/scan/get_report_log_parameters.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package scan 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 // NewGetReportLogParams creates a new GetReportLogParams 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 NewGetReportLogParams() *GetReportLogParams { 26 return &GetReportLogParams{ 27 timeout: cr.DefaultTimeout, 28 } 29 } 30 31 // NewGetReportLogParamsWithTimeout creates a new GetReportLogParams object 32 // with the ability to set a timeout on a request. 33 func NewGetReportLogParamsWithTimeout(timeout time.Duration) *GetReportLogParams { 34 return &GetReportLogParams{ 35 timeout: timeout, 36 } 37 } 38 39 // NewGetReportLogParamsWithContext creates a new GetReportLogParams object 40 // with the ability to set a context for a request. 41 func NewGetReportLogParamsWithContext(ctx context.Context) *GetReportLogParams { 42 return &GetReportLogParams{ 43 Context: ctx, 44 } 45 } 46 47 // NewGetReportLogParamsWithHTTPClient creates a new GetReportLogParams object 48 // with the ability to set a custom HTTPClient for a request. 49 func NewGetReportLogParamsWithHTTPClient(client *http.Client) *GetReportLogParams { 50 return &GetReportLogParams{ 51 HTTPClient: client, 52 } 53 } 54 55 /* 56 GetReportLogParams contains all the parameters to send to the API endpoint 57 58 for the get report log operation. 59 60 Typically these are written to a http.Request. 61 */ 62 type GetReportLogParams struct { 63 64 /* XRequestID. 65 66 An unique ID for the request 67 */ 68 XRequestID *string 69 70 /* ProjectName. 71 72 The name of the project 73 */ 74 ProjectName string 75 76 /* Reference. 77 78 The reference of the artifact, can be digest or tag 79 */ 80 Reference string 81 82 /* ReportID. 83 84 The report id to get the log 85 */ 86 ReportID string 87 88 /* RepositoryName. 89 90 The name of the repository. If it contains slash, encode it twice over with URL encoding. e.g. a/b -> a%2Fb -> a%252Fb 91 */ 92 RepositoryName string 93 94 timeout time.Duration 95 Context context.Context 96 HTTPClient *http.Client 97 } 98 99 // WithDefaults hydrates default values in the get report log params (not the query body). 100 // 101 // All values with no default are reset to their zero value. 102 func (o *GetReportLogParams) WithDefaults() *GetReportLogParams { 103 o.SetDefaults() 104 return o 105 } 106 107 // SetDefaults hydrates default values in the get report log params (not the query body). 108 // 109 // All values with no default are reset to their zero value. 110 func (o *GetReportLogParams) SetDefaults() { 111 // no default values defined for this parameter 112 } 113 114 // WithTimeout adds the timeout to the get report log params 115 func (o *GetReportLogParams) WithTimeout(timeout time.Duration) *GetReportLogParams { 116 o.SetTimeout(timeout) 117 return o 118 } 119 120 // SetTimeout adds the timeout to the get report log params 121 func (o *GetReportLogParams) SetTimeout(timeout time.Duration) { 122 o.timeout = timeout 123 } 124 125 // WithContext adds the context to the get report log params 126 func (o *GetReportLogParams) WithContext(ctx context.Context) *GetReportLogParams { 127 o.SetContext(ctx) 128 return o 129 } 130 131 // SetContext adds the context to the get report log params 132 func (o *GetReportLogParams) SetContext(ctx context.Context) { 133 o.Context = ctx 134 } 135 136 // WithHTTPClient adds the HTTPClient to the get report log params 137 func (o *GetReportLogParams) WithHTTPClient(client *http.Client) *GetReportLogParams { 138 o.SetHTTPClient(client) 139 return o 140 } 141 142 // SetHTTPClient adds the HTTPClient to the get report log params 143 func (o *GetReportLogParams) SetHTTPClient(client *http.Client) { 144 o.HTTPClient = client 145 } 146 147 // WithXRequestID adds the xRequestID to the get report log params 148 func (o *GetReportLogParams) WithXRequestID(xRequestID *string) *GetReportLogParams { 149 o.SetXRequestID(xRequestID) 150 return o 151 } 152 153 // SetXRequestID adds the xRequestId to the get report log params 154 func (o *GetReportLogParams) SetXRequestID(xRequestID *string) { 155 o.XRequestID = xRequestID 156 } 157 158 // WithProjectName adds the projectName to the get report log params 159 func (o *GetReportLogParams) WithProjectName(projectName string) *GetReportLogParams { 160 o.SetProjectName(projectName) 161 return o 162 } 163 164 // SetProjectName adds the projectName to the get report log params 165 func (o *GetReportLogParams) SetProjectName(projectName string) { 166 o.ProjectName = projectName 167 } 168 169 // WithReference adds the reference to the get report log params 170 func (o *GetReportLogParams) WithReference(reference string) *GetReportLogParams { 171 o.SetReference(reference) 172 return o 173 } 174 175 // SetReference adds the reference to the get report log params 176 func (o *GetReportLogParams) SetReference(reference string) { 177 o.Reference = reference 178 } 179 180 // WithReportID adds the reportID to the get report log params 181 func (o *GetReportLogParams) WithReportID(reportID string) *GetReportLogParams { 182 o.SetReportID(reportID) 183 return o 184 } 185 186 // SetReportID adds the reportId to the get report log params 187 func (o *GetReportLogParams) SetReportID(reportID string) { 188 o.ReportID = reportID 189 } 190 191 // WithRepositoryName adds the repositoryName to the get report log params 192 func (o *GetReportLogParams) WithRepositoryName(repositoryName string) *GetReportLogParams { 193 o.SetRepositoryName(repositoryName) 194 return o 195 } 196 197 // SetRepositoryName adds the repositoryName to the get report log params 198 func (o *GetReportLogParams) SetRepositoryName(repositoryName string) { 199 o.RepositoryName = repositoryName 200 } 201 202 // WriteToRequest writes these params to a swagger request 203 func (o *GetReportLogParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { 204 205 if err := r.SetTimeout(o.timeout); err != nil { 206 return err 207 } 208 var res []error 209 210 if o.XRequestID != nil { 211 212 // header param X-Request-Id 213 if err := r.SetHeaderParam("X-Request-Id", *o.XRequestID); err != nil { 214 return err 215 } 216 } 217 218 // path param project_name 219 if err := r.SetPathParam("project_name", o.ProjectName); err != nil { 220 return err 221 } 222 223 // path param reference 224 if err := r.SetPathParam("reference", o.Reference); err != nil { 225 return err 226 } 227 228 // path param report_id 229 if err := r.SetPathParam("report_id", o.ReportID); err != nil { 230 return err 231 } 232 233 // path param repository_name 234 if err := r.SetPathParam("repository_name", o.RepositoryName); err != nil { 235 return err 236 } 237 238 if len(res) > 0 { 239 return errors.CompositeValidationError(res...) 240 } 241 return nil 242 }