Skip to content

Commit 0d7331b

Browse files
chore(serverbackup): switch to new SDK structure (#1375)
* chore(serverbackup): use new multi API version support SDK * fix linter issues * remove unneeded check --------- Co-authored-by: cgoetz-inovex <carlo.goetz@inovex.de>
1 parent 1cc5c3e commit 0d7331b

File tree

14 files changed

+144
-146
lines changed

14 files changed

+144
-146
lines changed

go.mod

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@ require (
3535
github.com/stackitcloud/stackit-sdk-go/services/redis v0.28.1
3636
github.com/stackitcloud/stackit-sdk-go/services/resourcemanager v0.20.0
3737
github.com/stackitcloud/stackit-sdk-go/services/scf v0.7.0
38+
github.com/stackitcloud/stackit-sdk-go/services/secretsmanager v0.14.3
39+
github.com/stackitcloud/stackit-sdk-go/services/serverbackup v1.6.0
3840
github.com/stackitcloud/stackit-sdk-go/services/secretsmanager v0.17.0
39-
github.com/stackitcloud/stackit-sdk-go/services/serverbackup v1.3.8
41+
github.com/stackitcloud/stackit-sdk-go/services/serverbackup v1.6.0
4042
github.com/stackitcloud/stackit-sdk-go/services/serverupdate v1.5.0
4143
github.com/stackitcloud/stackit-sdk-go/services/serviceaccount v0.12.0
4244
github.com/stackitcloud/stackit-sdk-go/services/serviceenablement v1.4.1

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,8 @@ github.com/stackitcloud/stackit-sdk-go/services/secretsmanager v0.17.0 h1:6gDKTx
724724
github.com/stackitcloud/stackit-sdk-go/services/secretsmanager v0.17.0/go.mod h1:vSWUMTsMbtniEo1I+eCsjCOTODR4iproNAeqG3vr/4I=
725725
github.com/stackitcloud/stackit-sdk-go/services/serverbackup v1.3.8 h1:LLyANBzE8sQa0/49tQBqq4sVLhNgwdqCeQm76srJHWw=
726726
github.com/stackitcloud/stackit-sdk-go/services/serverbackup v1.3.8/go.mod h1:/bmg57XZu+bGczzcoumrukiGMPGzI2mOyTT4BVIQUBs=
727+
github.com/stackitcloud/stackit-sdk-go/services/serverbackup v1.6.0 h1:OGAaEbuoxTZnsWbtFmhkvdvCCV/RpYuE3ALQXmRyOOc=
728+
github.com/stackitcloud/stackit-sdk-go/services/serverbackup v1.6.0/go.mod h1:h2fhcXRiSFP9yJXY8eb37e+2PhMW11g1GB8LL/EQ1aU=
727729
github.com/stackitcloud/stackit-sdk-go/services/serverupdate v1.5.0 h1:4MYNb3VQjVnVPfJ9xhDbSQgoSkxQZJ0tsv9N7O43/RI=
728730
github.com/stackitcloud/stackit-sdk-go/services/serverupdate v1.5.0/go.mod h1:iVCh5xZW/DHBMnJW4Zrw8KMhQIBRAETcnTPi5bbcQIE=
729731
github.com/stackitcloud/stackit-sdk-go/services/serviceaccount v0.12.0 h1:l1EDIlXce2C8JcbBDHVa6nZ4SjPTqmnALTgrhms+NKI=

stackit/internal/services/serverbackup/enable/datasource.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
1111
"github.com/hashicorp/terraform-plugin-framework/types"
1212
"github.com/hashicorp/terraform-plugin-log/tflog"
13-
"github.com/stackitcloud/stackit-sdk-go/services/serverbackup"
13+
serverbackup "github.com/stackitcloud/stackit-sdk-go/services/serverbackup/v2api"
1414

1515
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/conversion"
1616
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core"
@@ -130,7 +130,7 @@ func (d *serverBackupEnableDataSource) Read(ctx context.Context, req datasource.
130130
ctx = tflog.SetField(ctx, "server_id", serverId)
131131
ctx = tflog.SetField(ctx, "region", region)
132132

133-
serviceResp, err := d.client.GetServiceResource(ctx, projectId, serverId, region).Execute()
133+
serviceResp, err := d.client.DefaultAPI.GetServiceResource(ctx, projectId, serverId, region).Execute()
134134
if err != nil {
135135
utils.LogError(
136136
ctx,

stackit/internal/services/serverbackup/enable/datasource_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66

77
"github.com/google/go-cmp/cmp"
88
"github.com/hashicorp/terraform-plugin-framework/types"
9-
"github.com/stackitcloud/stackit-sdk-go/services/serverbackup"
9+
serverbackup "github.com/stackitcloud/stackit-sdk-go/services/serverbackup/v2api"
1010
)
1111

1212
func TestDataMapFields(t *testing.T) {

stackit/internal/services/serverbackup/enable/resource.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
1616
"github.com/hashicorp/terraform-plugin-log/tflog"
1717
"github.com/stackitcloud/stackit-sdk-go/core/oapierror"
18-
"github.com/stackitcloud/stackit-sdk-go/services/serverbackup"
18+
serverbackup "github.com/stackitcloud/stackit-sdk-go/services/serverbackup/v2api"
1919

2020
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/conversion"
2121
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core"
@@ -189,7 +189,7 @@ func (r *serverBackupEnableResource) Create(ctx context.Context, req resource.Cr
189189
ctx = tflog.SetField(ctx, "server_id", serverId)
190190
ctx = tflog.SetField(ctx, "region", region)
191191

192-
err := r.client.EnableServiceResource(ctx, projectId, serverId, region).EnableServiceResourcePayload(serverbackup.EnableServiceResourcePayload{}).Execute()
192+
err := r.client.DefaultAPI.EnableServiceResource(ctx, projectId, serverId, region).EnableServiceResourcePayload(serverbackup.EnableServiceResourcePayload{}).Execute()
193193
if err != nil {
194194
var oapiErr *oapierror.GenericOpenAPIError
195195
ok := errors.As(err, &oapiErr)
@@ -201,7 +201,7 @@ func (r *serverBackupEnableResource) Create(ctx context.Context, req resource.Cr
201201
tflog.Info(ctx, "Server backup is already enabled for this server. Please check duplicate resources.")
202202
}
203203

204-
serviceResp, err := r.client.GetServiceResource(ctx, projectId, serverId, region).Execute()
204+
serviceResp, err := r.client.DefaultAPI.GetServiceResource(ctx, projectId, serverId, region).Execute()
205205
if err != nil {
206206
core.LogAndAddError(ctx, &resp.Diagnostics, "Error reading server backup enable", fmt.Sprintf("Calling API: %v", err))
207207
return
@@ -243,7 +243,7 @@ func (r *serverBackupEnableResource) Read(ctx context.Context, req resource.Read
243243
ctx = tflog.SetField(ctx, "server_id", serverId)
244244
ctx = tflog.SetField(ctx, "region", region)
245245

246-
serviceResp, err := r.client.GetServiceResource(ctx, projectId, serverId, region).Execute()
246+
serviceResp, err := r.client.DefaultAPI.GetServiceResource(ctx, projectId, serverId, region).Execute()
247247
if err != nil {
248248
oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped
249249
if ok && oapiErr.StatusCode == http.StatusNotFound {
@@ -297,7 +297,7 @@ func (r *serverBackupEnableResource) Delete(ctx context.Context, req resource.De
297297
ctx = tflog.SetField(ctx, "server_id", serverId)
298298
ctx = tflog.SetField(ctx, "region", region)
299299

300-
err := r.client.DisableServiceResource(ctx, projectId, serverId, region).Execute()
300+
err := r.client.DefaultAPI.DisableServiceResource(ctx, projectId, serverId, region).Execute()
301301
if err != nil {
302302
core.LogAndAddError(ctx, &resp.Diagnostics, "Error deleting server backup enable", fmt.Sprintf("Calling API: %v", err))
303303
return

stackit/internal/services/serverbackup/enable/resource_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"github.com/google/go-cmp/cmp"
88
"github.com/hashicorp/terraform-plugin-framework/types"
99

10-
"github.com/stackitcloud/stackit-sdk-go/services/serverbackup"
10+
serverbackup "github.com/stackitcloud/stackit-sdk-go/services/serverbackup/v2api"
1111
)
1212

1313
func TestMapFields(t *testing.T) {

stackit/internal/services/serverbackup/schedule/resource.go

Lines changed: 45 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ import (
77
"strconv"
88
"strings"
99

10+
"github.com/hashicorp/terraform-plugin-framework-validators/int32validator"
1011
"github.com/hashicorp/terraform-plugin-framework-validators/listvalidator"
1112
"github.com/hashicorp/terraform-plugin-framework/diag"
13+
"github.com/hashicorp/terraform-plugin-framework/resource/schema/int32planmodifier"
1214

1315
serverbackupUtils "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/serverbackup/utils"
1416

15-
"github.com/hashicorp/terraform-plugin-framework-validators/int64validator"
1617
"github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
1718
"github.com/hashicorp/terraform-plugin-framework/path"
1819
"github.com/hashicorp/terraform-plugin-framework/resource"
1920
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
20-
"github.com/hashicorp/terraform-plugin-framework/resource/schema/int64planmodifier"
2121
"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
2222
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
2323
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
@@ -30,7 +30,7 @@ import (
3030
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/validate"
3131

3232
"github.com/stackitcloud/stackit-sdk-go/core/oapierror"
33-
"github.com/stackitcloud/stackit-sdk-go/services/serverbackup"
33+
serverbackup "github.com/stackitcloud/stackit-sdk-go/services/serverbackup/v2api"
3434
)
3535

3636
// Ensure the implementation satisfies the expected interfaces.
@@ -45,7 +45,7 @@ type Model struct {
4545
ID types.String `tfsdk:"id"`
4646
ProjectId types.String `tfsdk:"project_id"`
4747
ServerId types.String `tfsdk:"server_id"`
48-
BackupScheduleId types.Int64 `tfsdk:"backup_schedule_id"`
48+
BackupScheduleId types.Int32 `tfsdk:"backup_schedule_id"`
4949
Name types.String `tfsdk:"name"`
5050
Rrule types.String `tfsdk:"rrule"`
5151
Enabled types.Bool `tfsdk:"enabled"`
@@ -56,7 +56,7 @@ type Model struct {
5656
// scheduleBackupPropertiesModel maps schedule backup_properties data
5757
type scheduleBackupPropertiesModel struct {
5858
BackupName types.String `tfsdk:"name"`
59-
RetentionPeriod types.Int64 `tfsdk:"retention_period"`
59+
RetentionPeriod types.Int32 `tfsdk:"retention_period"`
6060
VolumeIds types.List `tfsdk:"volume_ids"`
6161
}
6262

@@ -145,14 +145,14 @@ func (r *scheduleResource) Schema(_ context.Context, _ resource.SchemaRequest, r
145145
stringvalidator.LengthBetween(1, 255),
146146
},
147147
},
148-
"backup_schedule_id": schema.Int64Attribute{
148+
"backup_schedule_id": schema.Int32Attribute{
149149
Description: "Backup schedule ID.",
150150
Computed: true,
151-
PlanModifiers: []planmodifier.Int64{
152-
int64planmodifier.UseStateForUnknown(),
151+
PlanModifiers: []planmodifier.Int32{
152+
int32planmodifier.UseStateForUnknown(),
153153
},
154-
Validators: []validator.Int64{
155-
int64validator.AtLeast(1),
154+
Validators: []validator.Int32{
155+
int32validator.AtLeast(1),
156156
},
157157
},
158158
"project_id": schema.StringAttribute{
@@ -209,10 +209,10 @@ func (r *scheduleResource) Schema(_ context.Context, _ resource.SchemaRequest, r
209209
"name": schema.StringAttribute{
210210
Required: true,
211211
},
212-
"retention_period": schema.Int64Attribute{
212+
"retention_period": schema.Int32Attribute{
213213
Required: true,
214-
Validators: []validator.Int64{
215-
int64validator.AtLeast(1),
214+
Validators: []validator.Int32{
215+
int32validator.AtLeast(1),
216216
},
217217
},
218218
},
@@ -268,15 +268,15 @@ func (r *scheduleResource) Create(ctx context.Context, req resource.CreateReques
268268
core.LogAndAddError(ctx, &resp.Diagnostics, "Error creating server backup schedule", fmt.Sprintf("Creating API payload: %v", err))
269269
return
270270
}
271-
scheduleResp, err := r.client.CreateBackupSchedule(ctx, projectId, serverId, region).CreateBackupSchedulePayload(*payload).Execute()
271+
scheduleResp, err := r.client.DefaultAPI.CreateBackupSchedule(ctx, projectId, serverId, region).CreateBackupSchedulePayload(*payload).Execute()
272272
if err != nil {
273273
core.LogAndAddError(ctx, &resp.Diagnostics, "Error creating server backup schedule", fmt.Sprintf("Calling API: %v", err))
274274
return
275275
}
276276

277277
ctx = core.LogResponse(ctx)
278278

279-
ctx = tflog.SetField(ctx, "backup_schedule_id", *scheduleResp.Id)
279+
ctx = tflog.SetField(ctx, "backup_schedule_id", scheduleResp.Id)
280280

281281
// Map response body to schema
282282
err = mapFields(ctx, scheduleResp, &model, region)
@@ -305,15 +305,15 @@ func (r *scheduleResource) Read(ctx context.Context, req resource.ReadRequest, r
305305

306306
projectId := model.ProjectId.ValueString()
307307
serverId := model.ServerId.ValueString()
308-
backupScheduleId := model.BackupScheduleId.ValueInt64()
308+
backupScheduleId := model.BackupScheduleId.ValueInt32()
309309
region := r.providerData.GetRegionWithOverride(model.Region)
310310

311311
ctx = tflog.SetField(ctx, "project_id", projectId)
312312
ctx = tflog.SetField(ctx, "server_id", serverId)
313313
ctx = tflog.SetField(ctx, "backup_schedule_id", backupScheduleId)
314314
ctx = tflog.SetField(ctx, "region", region)
315315

316-
scheduleResp, err := r.client.GetBackupSchedule(ctx, projectId, serverId, region, strconv.FormatInt(backupScheduleId, 10)).Execute()
316+
scheduleResp, err := r.client.DefaultAPI.GetBackupSchedule(ctx, projectId, serverId, region, strconv.FormatInt(int64(backupScheduleId), 10)).Execute()
317317
if err != nil {
318318
oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped
319319
if ok && oapiErr.StatusCode == http.StatusNotFound {
@@ -355,7 +355,7 @@ func (r *scheduleResource) Update(ctx context.Context, req resource.UpdateReques
355355

356356
projectId := model.ProjectId.ValueString()
357357
serverId := model.ServerId.ValueString()
358-
backupScheduleId := model.BackupScheduleId.ValueInt64()
358+
backupScheduleId := model.BackupScheduleId.ValueInt32()
359359
region := r.providerData.GetRegionWithOverride(model.Region)
360360

361361
ctx = tflog.SetField(ctx, "project_id", projectId)
@@ -370,7 +370,7 @@ func (r *scheduleResource) Update(ctx context.Context, req resource.UpdateReques
370370
return
371371
}
372372

373-
scheduleResp, err := r.client.UpdateBackupSchedule(ctx, projectId, serverId, region, strconv.FormatInt(backupScheduleId, 10)).UpdateBackupSchedulePayload(*payload).Execute()
373+
scheduleResp, err := r.client.DefaultAPI.UpdateBackupSchedule(ctx, projectId, serverId, region, strconv.FormatInt(int64(backupScheduleId), 10)).UpdateBackupSchedulePayload(*payload).Execute()
374374
if err != nil {
375375
core.LogAndAddError(ctx, &resp.Diagnostics, "Error updating server backup schedule", fmt.Sprintf("Calling API: %v", err))
376376
return
@@ -405,15 +405,15 @@ func (r *scheduleResource) Delete(ctx context.Context, req resource.DeleteReques
405405

406406
projectId := model.ProjectId.ValueString()
407407
serverId := model.ServerId.ValueString()
408-
backupScheduleId := model.BackupScheduleId.ValueInt64()
408+
backupScheduleId := model.BackupScheduleId.ValueInt32()
409409
region := r.providerData.GetRegionWithOverride(model.Region)
410410

411411
ctx = tflog.SetField(ctx, "project_id", projectId)
412412
ctx = tflog.SetField(ctx, "server_id", serverId)
413413
ctx = tflog.SetField(ctx, "backup_schedule_id", backupScheduleId)
414414
ctx = tflog.SetField(ctx, "region", region)
415415

416-
err := r.client.DeleteBackupSchedule(ctx, projectId, serverId, region, strconv.FormatInt(backupScheduleId, 10)).Execute()
416+
err := r.client.DefaultAPI.DeleteBackupSchedule(ctx, projectId, serverId, region, strconv.FormatInt(int64(backupScheduleId), 10)).Execute()
417417
if err != nil {
418418
core.LogAndAddError(ctx, &resp.Diagnostics, "Error deleting server backup schedule", fmt.Sprintf("Calling API: %v", err))
419419
return
@@ -466,18 +466,15 @@ func mapFields(ctx context.Context, schedule *serverbackup.BackupSchedule, model
466466
if model == nil {
467467
return fmt.Errorf("model input is nil")
468468
}
469-
if schedule.Id == nil {
470-
return fmt.Errorf("response id is nil")
471-
}
472469

473-
model.BackupScheduleId = types.Int64PointerValue(schedule.Id)
470+
model.BackupScheduleId = types.Int32Value(schedule.Id)
474471
model.ID = utils.BuildInternalTerraformId(
475472
model.ProjectId.ValueString(), region, model.ServerId.ValueString(),
476-
strconv.FormatInt(model.BackupScheduleId.ValueInt64(), 10),
473+
strconv.FormatInt(int64(model.BackupScheduleId.ValueInt32()), 10),
477474
)
478-
model.Name = types.StringPointerValue(schedule.Name)
479-
model.Rrule = types.StringPointerValue(schedule.Rrule)
480-
model.Enabled = types.BoolPointerValue(schedule.Enabled)
475+
model.Name = types.StringValue(schedule.Name)
476+
model.Rrule = types.StringValue(schedule.Rrule)
477+
model.Enabled = types.BoolValue(schedule.Enabled)
481478
if schedule.BackupProperties == nil {
482479
model.BackupProperties = nil
483480
return nil
@@ -494,7 +491,7 @@ func mapFields(ctx context.Context, schedule *serverbackup.BackupSchedule, model
494491
}
495492
}
496493

497-
respVolIds := *schedule.BackupProperties.VolumeIds
494+
respVolIds := schedule.BackupProperties.VolumeIds
498495
reconciledVolIds := utils.ReconcileStringSlices(modelVolIds, respVolIds)
499496

500497
var diags diag.Diagnostics
@@ -504,8 +501,8 @@ func mapFields(ctx context.Context, schedule *serverbackup.BackupSchedule, model
504501
}
505502
}
506503
model.BackupProperties = &scheduleBackupPropertiesModel{
507-
BackupName: types.StringValue(*schedule.BackupProperties.Name),
508-
RetentionPeriod: types.Int64Value(*schedule.BackupProperties.RetentionPeriod),
504+
BackupName: types.StringValue(schedule.BackupProperties.Name),
505+
RetentionPeriod: types.Int32Value(schedule.BackupProperties.RetentionPeriod),
509506
VolumeIds: volIds,
510507
}
511508
model.Region = types.StringValue(region)
@@ -521,7 +518,7 @@ func (r *scheduleResource) enableBackupsService(ctx context.Context, model *Mode
521518
region := r.providerData.GetRegionWithOverride(model.Region)
522519

523520
tflog.Debug(ctx, "Enabling server backup service")
524-
request := r.client.EnableServiceResource(ctx, projectId, serverId, region).
521+
request := r.client.DefaultAPI.EnableServiceResource(ctx, projectId, serverId, region).
525522
EnableServiceResourcePayload(serverbackup.EnableServiceResourcePayload{})
526523

527524
if err := request.Execute(); err != nil {
@@ -546,16 +543,16 @@ func (r *scheduleResource) disableBackupsService(ctx context.Context, model *Mod
546543
region := r.providerData.GetRegionWithOverride(model.Region)
547544

548545
tflog.Debug(ctx, "Checking for existing backups")
549-
backups, err := r.client.ListBackups(ctx, projectId, serverId, region).Execute()
546+
backups, err := r.client.DefaultAPI.ListBackups(ctx, projectId, serverId, region).Execute()
550547
if err != nil {
551548
return fmt.Errorf("list backups: %w", err)
552549
}
553-
if len(*backups.Items) > 0 {
550+
if len(backups.Items) > 0 {
554551
tflog.Debug(ctx, "Backups found - will not disable server backup service")
555552
return nil
556553
}
557554

558-
err = r.client.DisableServiceResourceExecute(ctx, projectId, serverId, region)
555+
err = r.client.DefaultAPI.DisableServiceResource(ctx, projectId, serverId, region).Execute()
559556
if err != nil {
560557
return fmt.Errorf("disable server backup service: %w", err)
561558
}
@@ -583,15 +580,15 @@ func toCreatePayload(model *Model) (*serverbackup.CreateBackupSchedulePayload, e
583580
ids = nil
584581
}
585582
backupProperties = serverbackup.BackupProperties{
586-
Name: conversion.StringValueToPointer(model.BackupProperties.BackupName),
587-
RetentionPeriod: conversion.Int64ValueToPointer(model.BackupProperties.RetentionPeriod),
588-
VolumeIds: &ids,
583+
Name: model.BackupProperties.BackupName.ValueString(),
584+
RetentionPeriod: model.BackupProperties.RetentionPeriod.ValueInt32(),
585+
VolumeIds: ids,
589586
}
590587
}
591588
return &serverbackup.CreateBackupSchedulePayload{
592-
Enabled: conversion.BoolValueToPointer(model.Enabled),
593-
Name: conversion.StringValueToPointer(model.Name),
594-
Rrule: conversion.StringValueToPointer(model.Rrule),
589+
Enabled: model.Enabled.ValueBool(),
590+
Name: model.Name.ValueString(),
591+
Rrule: model.Rrule.ValueString(),
595592
BackupProperties: &backupProperties,
596593
}, nil
597594
}
@@ -616,16 +613,16 @@ func toUpdatePayload(model *Model) (*serverbackup.UpdateBackupSchedulePayload, e
616613
ids = nil
617614
}
618615
backupProperties = serverbackup.BackupProperties{
619-
Name: conversion.StringValueToPointer(model.BackupProperties.BackupName),
620-
RetentionPeriod: conversion.Int64ValueToPointer(model.BackupProperties.RetentionPeriod),
621-
VolumeIds: &ids,
616+
Name: model.BackupProperties.BackupName.ValueString(),
617+
RetentionPeriod: model.BackupProperties.RetentionPeriod.ValueInt32(),
618+
VolumeIds: ids,
622619
}
623620
}
624621

625622
return &serverbackup.UpdateBackupSchedulePayload{
626-
Enabled: conversion.BoolValueToPointer(model.Enabled),
627-
Name: conversion.StringValueToPointer(model.Name),
628-
Rrule: conversion.StringValueToPointer(model.Rrule),
623+
Enabled: model.Enabled.ValueBool(),
624+
Name: model.Name.ValueString(),
625+
Rrule: model.Rrule.ValueString(),
629626
BackupProperties: &backupProperties,
630627
}, nil
631628
}

0 commit comments

Comments
 (0)