github.com/goharbor/go-client@v0.210.0/pkg/sdk/v2.0/client/artifact/get_addition_parameters.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package artifact 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 // NewGetAdditionParams creates a new GetAdditionParams 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 NewGetAdditionParams() *GetAdditionParams { 26 return &GetAdditionParams{ 27 timeout: cr.DefaultTimeout, 28 } 29 } 30 31 // NewGetAdditionParamsWithTimeout creates a new GetAdditionParams object 32 // with the ability to set a timeout on a request. 33 func NewGetAdditionParamsWithTimeout(timeout time.Duration) *GetAdditionParams { 34 return &GetAdditionParams{ 35 timeout: timeout, 36 } 37 } 38 39 // NewGetAdditionParamsWithContext creates a new GetAdditionParams object 40 // with the ability to set a context for a request. 41 func NewGetAdditionParamsWithContext(ctx context.Context) *GetAdditionParams { 42 return &GetAdditionParams{ 43 Context: ctx, 44 } 45 } 46 47 // NewGetAdditionParamsWithHTTPClient creates a new GetAdditionParams object 48 // with the ability to set a custom HTTPClient for a request. 49 func NewGetAdditionParamsWithHTTPClient(client *http.Client) *GetAdditionParams { 50 return &GetAdditionParams{ 51 HTTPClient: client, 52 } 53 } 54 55 /* 56 GetAdditionParams contains all the parameters to send to the API endpoint 57 58 for the get addition operation. 59 60 Typically these are written to a http.Request. 61 */ 62 type GetAdditionParams struct { 63 64 /* XRequestID. 65 66 An unique ID for the request 67 */ 68 XRequestID *string 69 70 /* Addition. 71 72 The type of addition. 73 */ 74 Addition string 75 76 /* ProjectName. 77 78 The name of the project 79 */ 80 ProjectName string 81 82 /* Reference. 83 84 The reference of the artifact, can be digest or tag 85 */ 86 Reference 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 addition params (not the query body). 100 // 101 // All values with no default are reset to their zero value. 102 func (o *GetAdditionParams) WithDefaults() *GetAdditionParams { 103 o.SetDefaults() 104 return o 105 } 106 107 // SetDefaults hydrates default values in the get addition params (not the query body). 108 // 109 // All values with no default are reset to their zero value. 110 func (o *GetAdditionParams) SetDefaults() { 111 // no default values defined for this parameter 112 } 113 114 // WithTimeout adds the timeout to the get addition params 115 func (o *GetAdditionParams) WithTimeout(timeout time.Duration) *GetAdditionParams { 116 o.SetTimeout(timeout) 117 return o 118 } 119 120 // SetTimeout adds the timeout to the get addition params 121 func (o *GetAdditionParams) SetTimeout(timeout time.Duration) { 122 o.timeout = timeout 123 } 124 125 // WithContext adds the context to the get addition params 126 func (o *GetAdditionParams) WithContext(ctx context.Context) *GetAdditionParams { 127 o.SetContext(ctx) 128 return o 129 } 130 131 // SetContext adds the context to the get addition params 132 func (o *GetAdditionParams) SetContext(ctx context.Context) { 133 o.Context = ctx 134 } 135 136 // WithHTTPClient adds the HTTPClient to the get addition params 137 func (o *GetAdditionParams) WithHTTPClient(client *http.Client) *GetAdditionParams { 138 o.SetHTTPClient(client) 139 return o 140 } 141 142 // SetHTTPClient adds the HTTPClient to the get addition params 143 func (o *GetAdditionParams) SetHTTPClient(client *http.Client) { 144 o.HTTPClient = client 145 } 146 147 // WithXRequestID adds the xRequestID to the get addition params 148 func (o *GetAdditionParams) WithXRequestID(xRequestID *string) *GetAdditionParams { 149 o.SetXRequestID(xRequestID) 150 return o 151 } 152 153 // SetXRequestID adds the xRequestId to the get addition params 154 func (o *GetAdditionParams) SetXRequestID(xRequestID *string) { 155 o.XRequestID = xRequestID 156 } 157 158 // WithAddition adds the addition to the get addition params 159 func (o *GetAdditionParams) WithAddition(addition string) *GetAdditionParams { 160 o.SetAddition(addition) 161 return o 162 } 163 164 // SetAddition adds the addition to the get addition params 165 func (o *GetAdditionParams) SetAddition(addition string) { 166 o.Addition = addition 167 } 168 169 // WithProjectName adds the projectName to the get addition params 170 func (o *GetAdditionParams) WithProjectName(projectName string) *GetAdditionParams { 171 o.SetProjectName(projectName) 172 return o 173 } 174 175 // SetProjectName adds the projectName to the get addition params 176 func (o *GetAdditionParams) SetProjectName(projectName string) { 177 o.ProjectName = projectName 178 } 179 180 // WithReference adds the reference to the get addition params 181 func (o *GetAdditionParams) WithReference(reference string) *GetAdditionParams { 182 o.SetReference(reference) 183 return o 184 } 185 186 // SetReference adds the reference to the get addition params 187 func (o *GetAdditionParams) SetReference(reference string) { 188 o.Reference = reference 189 } 190 191 // WithRepositoryName adds the repositoryName to the get addition params 192 func (o *GetAdditionParams) WithRepositoryName(repositoryName string) *GetAdditionParams { 193 o.SetRepositoryName(repositoryName) 194 return o 195 } 196 197 // SetRepositoryName adds the repositoryName to the get addition params 198 func (o *GetAdditionParams) SetRepositoryName(repositoryName string) { 199 o.RepositoryName = repositoryName 200 } 201 202 // WriteToRequest writes these params to a swagger request 203 func (o *GetAdditionParams) 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 addition 219 if err := r.SetPathParam("addition", o.Addition); err != nil { 220 return err 221 } 222 223 // path param project_name 224 if err := r.SetPathParam("project_name", o.ProjectName); err != nil { 225 return err 226 } 227 228 // path param reference 229 if err := r.SetPathParam("reference", o.Reference); 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 }