@@ -45,8 +45,8 @@ type scheduleResourceModel struct {
45
45
LoadTestID types.String `tfsdk:"load_test_id"`
46
46
Starts types.String `tfsdk:"starts"`
47
47
Frequency types.String `tfsdk:"frequency"`
48
- Interval types.Int64 `tfsdk:"interval"`
49
- Occurrences types.Int64 `tfsdk:"occurrences"`
48
+ Interval types.Int32 `tfsdk:"interval"`
49
+ Occurrences types.Int32 `tfsdk:"occurrences"`
50
50
Until types.String `tfsdk:"until"`
51
51
Deactivated types.Bool `tfsdk:"deactivated"`
52
52
NextRun types.String `tfsdk:"next_run"`
@@ -87,11 +87,11 @@ func (r *scheduleResource) Schema(_ context.Context, _ resource.SchemaRequest, r
87
87
Description : "The frequency of the schedule (HOURLY, DAILY, WEEKLY, MONTHLY)." ,
88
88
Required : true ,
89
89
},
90
- "interval" : schema.Int64Attribute {
90
+ "interval" : schema.Int32Attribute {
91
91
Description : "The interval between each frequency iteration (e.g., 2 = every 2 hours for HOURLY)." ,
92
92
Optional : true ,
93
93
},
94
- "occurrences" : schema.Int64Attribute {
94
+ "occurrences" : schema.Int32Attribute {
95
95
Description : "How many times the recurrence will repeat." ,
96
96
Optional : true ,
97
97
},
@@ -173,11 +173,11 @@ func (r *scheduleResource) Create(ctx context.Context, req resource.CreateReques
173
173
// Build recurrence rule
174
174
recurrenceRule := k6 .NewScheduleRecurrenceRule (* frequency )
175
175
if ! plan .Interval .IsNull () {
176
- interval := int32 ( plan .Interval .ValueInt64 () )
176
+ interval := plan .Interval .ValueInt32 ( )
177
177
recurrenceRule .SetInterval (interval )
178
178
}
179
179
if ! plan .Occurrences .IsNull () {
180
- count := int32 ( plan .Occurrences .ValueInt64 () )
180
+ count := plan .Occurrences .ValueInt32 ( )
181
181
recurrenceRule .SetCount (count )
182
182
}
183
183
if ! plan .Until .IsNull () {
@@ -320,11 +320,11 @@ func (r *scheduleResource) Update(ctx context.Context, req resource.UpdateReques
320
320
// Build recurrence rule
321
321
recurrenceRule := k6 .NewScheduleRecurrenceRule (* frequency )
322
322
if ! plan .Interval .IsNull () {
323
- interval := int32 ( plan .Interval .ValueInt64 () )
323
+ interval := plan .Interval .ValueInt32 ( )
324
324
recurrenceRule .SetInterval (interval )
325
325
}
326
326
if ! plan .Occurrences .IsNull () {
327
- count := int32 ( plan .Occurrences .ValueInt64 () )
327
+ count := plan .Occurrences .ValueInt32 ( )
328
328
recurrenceRule .SetCount (count )
329
329
}
330
330
if ! plan .Until .IsNull () {
@@ -430,15 +430,15 @@ func (r *scheduleResource) populateModelFromAPI(schedule *k6.ScheduleApiModel, m
430
430
model .Frequency = types .StringValue (string (recurrenceRule .GetFrequency ()))
431
431
432
432
if interval , ok := recurrenceRule .GetIntervalOk (); ok && interval != nil {
433
- model .Interval = types .Int64Value ( int64 ( * interval ) )
433
+ model .Interval = types .Int32Value ( * interval )
434
434
} else {
435
- model .Interval = types .Int64Null ()
435
+ model .Interval = types .Int32Null ()
436
436
}
437
437
438
438
if count , ok := recurrenceRule .GetCountOk (); ok && count != nil {
439
- model .Occurrences = types .Int64Value ( int64 ( * count ) )
439
+ model .Occurrences = types .Int32Value ( * count )
440
440
} else {
441
- model .Occurrences = types .Int64Null ()
441
+ model .Occurrences = types .Int32Null ()
442
442
}
443
443
444
444
if until , ok := recurrenceRule .GetUntilOk (); ok && until != nil {
0 commit comments