@@ -98,24 +98,13 @@ func (r *reverseETLModelResource) Create(ctx context.Context, req resource.Creat
98
98
return
99
99
}
100
100
101
- var scheduleConfig map [string ]interface {}
102
- if ! plan .ScheduleConfig .IsNull () && ! plan .ScheduleConfig .IsUnknown () {
103
- diags = plan .ScheduleConfig .Unmarshal (& scheduleConfig )
104
- resp .Diagnostics .Append (diags ... )
105
- if resp .Diagnostics .HasError () {
106
- return
107
- }
108
- }
109
-
110
101
out , body , err := r .client .ReverseETLAPI .CreateReverseEtlModel (r .authContext ).CreateReverseEtlModelInput (api.CreateReverseEtlModelInput {
111
102
Name : plan .Name .ValueString (),
112
103
SourceId : plan .SourceID .ValueString (),
113
104
Description : plan .Description .ValueString (),
114
105
Enabled : plan .Enabled .ValueBool (),
115
- ScheduleStrategy : plan .ScheduleStrategy .ValueString (),
116
106
Query : plan .Query .ValueString (),
117
107
QueryIdentifierColumn : plan .QueryIdentifierColumn .ValueString (),
118
- ScheduleConfig : scheduleConfig ,
119
108
}).Execute ()
120
109
if body != nil {
121
110
defer body .Body .Close ()
@@ -150,6 +139,10 @@ func (r *reverseETLModelResource) Create(ctx context.Context, req resource.Creat
150
139
if resp .Diagnostics .HasError () {
151
140
return
152
141
}
142
+
143
+ // Since we deprecated these values, we just need to set them to the plan values so there are no errors
144
+ resp .State .SetAttribute (ctx , path .Root ("schedule_config" ), plan .ScheduleConfig )
145
+ resp .State .SetAttribute (ctx , path .Root ("schedule_strategy" ), plan .ScheduleStrategy )
153
146
}
154
147
155
148
func (r * reverseETLModelResource ) Read (ctx context.Context , req resource.ReadRequest , resp * resource.ReadResponse ) {
@@ -192,6 +185,14 @@ func (r *reverseETLModelResource) Read(ctx context.Context, req resource.ReadReq
192
185
if resp .Diagnostics .HasError () {
193
186
return
194
187
}
188
+
189
+ // Since we deprecated these values, we just need to set them to the plan values so there are no errors
190
+ if ! previousState .ScheduleConfig .IsNull () && ! previousState .ScheduleConfig .IsUnknown () {
191
+ resp .State .SetAttribute (ctx , path .Root ("schedule_config" ), previousState .ScheduleConfig )
192
+ }
193
+ if ! previousState .ScheduleStrategy .IsNull () && ! previousState .ScheduleStrategy .IsUnknown () {
194
+ resp .State .SetAttribute (ctx , path .Root ("schedule_strategy" ), previousState .ScheduleStrategy )
195
+ }
195
196
}
196
197
197
198
func (r * reverseETLModelResource ) Update (ctx context.Context , req resource.UpdateRequest , resp * resource.UpdateResponse ) {
@@ -209,19 +210,10 @@ func (r *reverseETLModelResource) Update(ctx context.Context, req resource.Updat
209
210
return
210
211
}
211
212
212
- var scheduleConfig map [string ]interface {}
213
- diags = plan .ScheduleConfig .Unmarshal (& scheduleConfig )
214
- resp .Diagnostics .Append (diags ... )
215
- if resp .Diagnostics .HasError () {
216
- return
217
- }
218
-
219
213
out , body , err := r .client .ReverseETLAPI .UpdateReverseEtlModel (r .authContext , state .ID .ValueString ()).UpdateReverseEtlModelInput (api.UpdateReverseEtlModelInput {
220
214
Name : plan .Name .ValueStringPointer (),
221
215
Description : plan .Description .ValueStringPointer (),
222
216
Enabled : plan .Enabled .ValueBoolPointer (),
223
- ScheduleStrategy : plan .ScheduleStrategy .ValueStringPointer (),
224
- ScheduleConfig : scheduleConfig ,
225
217
Query : plan .Query .ValueStringPointer (),
226
218
QueryIdentifierColumn : plan .QueryIdentifierColumn .ValueStringPointer (),
227
219
}).Execute ()
@@ -252,6 +244,10 @@ func (r *reverseETLModelResource) Update(ctx context.Context, req resource.Updat
252
244
if resp .Diagnostics .HasError () {
253
245
return
254
246
}
247
+
248
+ // Since we deprecated these values, we just need to set them to the plan values so there are no errors
249
+ resp .State .SetAttribute (ctx , path .Root ("schedule_config" ), plan .ScheduleConfig )
250
+ resp .State .SetAttribute (ctx , path .Root ("schedule_strategy" ), plan .ScheduleStrategy )
255
251
}
256
252
257
253
func (r * reverseETLModelResource ) Delete (ctx context.Context , req resource.DeleteRequest , resp * resource.DeleteResponse ) {
0 commit comments