@@ -818,6 +818,13 @@ will not run in February, April, June, etc.`,
818
818
ValidateFunc : validation .IntBetween (- 1 , 4 ),
819
819
Description : `Week number in a month. 1-4 indicates the 1st to 4th week of the month. -1 indicates the last week of the month.` ,
820
820
},
821
+ "day_offset" : {
822
+ Type : schema .TypeInt ,
823
+ Optional : true ,
824
+ ForceNew : true ,
825
+ ValidateFunc : validation .IntBetween (- 30 , 30 ),
826
+ Description : `Represents the number of days before or after the given week day of month that the patch deployment is scheduled for.` ,
827
+ },
821
828
},
822
829
},
823
830
ExactlyOneOf : []string {"recurring_schedule.0.monthly.0.week_day_of_month" , "recurring_schedule.0.monthly.0.month_day" },
@@ -1977,6 +1984,8 @@ func flattenOSConfigPatchDeploymentRecurringScheduleMonthlyWeekDayOfMonth(v inte
1977
1984
flattenOSConfigPatchDeploymentRecurringScheduleMonthlyWeekDayOfMonthWeekOrdinal (original ["weekOrdinal" ], d , config )
1978
1985
transformed ["day_of_week" ] =
1979
1986
flattenOSConfigPatchDeploymentRecurringScheduleMonthlyWeekDayOfMonthDayOfWeek (original ["dayOfWeek" ], d , config )
1987
+ transformed ["day_offset" ] =
1988
+ flattenOSConfigPatchDeploymentRecurringScheduleMonthlyWeekDayOfMonthDayOffset (original ["dayOffset" ], d , config )
1980
1989
return []interface {}{transformed }
1981
1990
}
1982
1991
func flattenOSConfigPatchDeploymentRecurringScheduleMonthlyWeekDayOfMonthWeekOrdinal (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
@@ -2000,6 +2009,23 @@ func flattenOSConfigPatchDeploymentRecurringScheduleMonthlyWeekDayOfMonthDayOfWe
2000
2009
return v
2001
2010
}
2002
2011
2012
+ func flattenOSConfigPatchDeploymentRecurringScheduleMonthlyWeekDayOfMonthDayOffset (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
2013
+ // Handles the string fixed64 format
2014
+ if strVal , ok := v .(string ); ok {
2015
+ if intVal , err := tpgresource .StringToFixed64 (strVal ); err == nil {
2016
+ return intVal
2017
+ }
2018
+ }
2019
+
2020
+ // number values are represented as float64
2021
+ if floatVal , ok := v .(float64 ); ok {
2022
+ intVal := int (floatVal )
2023
+ return intVal
2024
+ }
2025
+
2026
+ return v // let terraform core handle it otherwise
2027
+ }
2028
+
2003
2029
func flattenOSConfigPatchDeploymentRecurringScheduleMonthlyMonthDay (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
2004
2030
// Handles the string fixed64 format
2005
2031
if strVal , ok := v .(string ); ok {
@@ -3228,6 +3254,13 @@ func expandOSConfigPatchDeploymentRecurringScheduleMonthlyWeekDayOfMonth(v inter
3228
3254
transformed ["dayOfWeek" ] = transformedDayOfWeek
3229
3255
}
3230
3256
3257
+ transformedDayOffset , err := expandOSConfigPatchDeploymentRecurringScheduleMonthlyWeekDayOfMonthDayOffset (original ["day_offset" ], d , config )
3258
+ if err != nil {
3259
+ return nil , err
3260
+ } else if val := reflect .ValueOf (transformedDayOffset ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
3261
+ transformed ["dayOffset" ] = transformedDayOffset
3262
+ }
3263
+
3231
3264
return transformed , nil
3232
3265
}
3233
3266
@@ -3239,6 +3272,10 @@ func expandOSConfigPatchDeploymentRecurringScheduleMonthlyWeekDayOfMonthDayOfWee
3239
3272
return v , nil
3240
3273
}
3241
3274
3275
+ func expandOSConfigPatchDeploymentRecurringScheduleMonthlyWeekDayOfMonthDayOffset (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
3276
+ return v , nil
3277
+ }
3278
+
3242
3279
func expandOSConfigPatchDeploymentRecurringScheduleMonthlyMonthDay (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
3243
3280
return v , nil
3244
3281
}
0 commit comments