@@ -229,6 +229,42 @@ func (f *Client) PutGuestVsock(ctx context.Context, vsock *models.Vsock, opts ..
229229 return f .client .Operations .PutGuestVsock (params )
230230}
231231
232+ // PatchVMOpt is a functional option to be used for the
233+ // PatchVM API in setting any additional optional fields.
234+ type PatchVMOpt func (* ops.PatchVMParams )
235+
236+ // PatchVM is a wrapper for the swagger generated client to make
237+ // calling of the API easier.
238+ func (f * Client ) PatchVM (ctx context.Context , vm * models.VM , opts ... PatchVMOpt ) (* ops.PatchVMNoContent , error ) {
239+ timeout , cancel := context .WithTimeout (ctx , time .Duration (f .firecrackerRequestTimeout )* time .Millisecond )
240+ defer cancel ()
241+
242+ params := ops .NewPatchVMParamsWithContext (timeout )
243+ params .SetBody (vm )
244+ for _ , opt := range opts {
245+ opt (params )
246+ }
247+
248+ return f .client .Operations .PatchVM (params )
249+ }
250+
251+ // CreateSnapshotOpt is a functional option to be used for the
252+ // CreateSnapshot API in setting any additional optional fields.
253+ type CreateSnapshotOpt func (* ops.CreateSnapshotParams )
254+
255+ // CreateSnapshot is a wrapper for the swagger generated client to make
256+ // calling of the API easier.
257+ func (f * Client ) CreateSnapshot (ctx context.Context , snapshotParams * models.SnapshotCreateParams , opts ... CreateSnapshotOpt ) (* ops.CreateSnapshotNoContent , error ) {
258+ params := ops .NewCreateSnapshotParamsWithContext (ctx )
259+ params .SetBody (snapshotParams )
260+
261+ for _ , opt := range opts {
262+ opt (params )
263+ }
264+
265+ return f .client .Operations .CreateSnapshot (params )
266+ }
267+
232268// CreateSyncActionOpt is a functional option to be used for the
233269// CreateSyncAction API in setting any additional optional fields.
234270type CreateSyncActionOpt func (* ops.CreateSyncActionParams )
0 commit comments