diff --git a/grafanaplane/oncall/schedule.libsonnet b/grafanaplane/oncall/schedule.libsonnet index c60d7a1..50a95e7 100644 --- a/grafanaplane/oncall/schedule.libsonnet +++ b/grafanaplane/oncall/schedule.libsonnet @@ -5,7 +5,6 @@ local raw = import '../zz/main.libsonnet'; local schedule = raw.oncall.v1alpha1.schedule; local forProvider = schedule.spec.parameters.forProvider; -forProvider // raise forProvider functions to here { local base = self, @@ -35,9 +34,9 @@ forProvider // raise forProvider functions to here ] ), withShifts(shifts):: - super.withType('calendar') - + super.withShiftsRef([ - super.shiftsRef.withName(shift) + forProvider.withType('calendar') + + forProvider.withShiftsRef([ + forProvider.shiftsRef.withName(shift) for shift in shifts ]), } diff --git a/grafanaplane/oncall/shift.libsonnet b/grafanaplane/oncall/shift.libsonnet index a064374..9f7944d 100644 --- a/grafanaplane/oncall/shift.libsonnet +++ b/grafanaplane/oncall/shift.libsonnet @@ -3,9 +3,8 @@ local xtd = import 'github.com/jsonnet-libs/xtd/main.libsonnet'; local raw = import '../zz/main.libsonnet'; local shift = raw.oncall.v1alpha1.onCallShift; +local forProvider = shift.spec.parameters.forProvider; -// Lift forProvider functions here for convenience. -shift.spec.parameters.forProvider { '#new':: d.func.new( ||| @@ -19,7 +18,7 @@ shift.spec.parameters.forProvider ), new(name, id=xtd.ascii.stringToRFC1123(name)):: shift.new(id) - + super.withName(name), + + forProvider.withName(name), '#withRollingUsers':: d.func.new( ||| @@ -34,7 +33,15 @@ shift.spec.parameters.forProvider ] ), withRollingUsers(frequency, users):: - super.withType('rolling_users') - + super.withRollingUsers(users) - + super.withFrequency(frequency), + forProvider.withType('rolling_users') + + forProvider.withRollingUsers(users) + + forProvider.withFrequency(frequency), + + // Expose some generated functions here. + '#withStart':: forProvider['#withStart'], + withStart:: forProvider.withStart, + '#withStartRotationFromUserIndex':: forProvider['#withStartRotationFromUserIndex'], + withStartRotationFromUserIndex:: forProvider.withStartRotationFromUserIndex, + '#withByDay':: forProvider['#withByDay'], + withByDay:: forProvider.withByDay, }