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