@@ -37,7 +37,6 @@ type discordChannelResourceModel struct {
37
37
SpaceID types.String `tfsdk:"space_id"`
38
38
RoomsID types.List `tfsdk:"rooms_id"`
39
39
Alarms types.String `tfsdk:"alarms"`
40
- IntegrationID types.String `tfsdk:"integration_id"`
41
40
WebhookURL types.String `tfsdk:"webhook_url"`
42
41
ChannelType types.String `tfsdk:"channel_type"`
43
42
ChannelThread types.String `tfsdk:"channel_thread"`
@@ -152,7 +151,6 @@ func (s *discordChannelResource) Create(ctx context.Context, req resource.Create
152
151
plan .Enabled = types .BoolValue (notificationChannel .Enabled )
153
152
plan .RoomsID , _ = types .ListValueFrom (ctx , types .StringType , notificationChannel .Rooms )
154
153
plan .Alarms = types .StringValue (notificationChannel .Alarms )
155
- plan .IntegrationID = types .StringValue (notificationIntegration .ID )
156
154
157
155
diags = resp .State .Set (ctx , plan )
158
156
resp .Diagnostics .Append (diags ... )
@@ -226,25 +224,15 @@ func (s *discordChannelResource) Update(ctx context.Context, req resource.Update
226
224
return
227
225
}
228
226
229
- notificationIntegration , err := s .client .GetNotificationIntegrationByType (plan .SpaceID .ValueString (), "discord" )
230
- if err != nil {
231
- resp .Diagnostics .AddError (
232
- "Error Creating Discord Notification" ,
233
- "err: " + err .Error (),
234
- )
235
- return
236
- }
237
-
238
227
var roomsID []string
239
228
plan .RoomsID .ElementsAs (ctx , & roomsID , false )
240
229
241
230
commonParams := client.NotificationChannel {
242
- ID : plan .ID .ValueString (),
243
- Name : plan .Name .ValueString (),
244
- Integration : * notificationIntegration ,
245
- Rooms : roomsID ,
246
- Alarms : plan .Alarms .ValueString (),
247
- Enabled : plan .Enabled .ValueBool (),
231
+ ID : plan .ID .ValueString (),
232
+ Name : plan .Name .ValueString (),
233
+ Rooms : roomsID ,
234
+ Alarms : plan .Alarms .ValueString (),
235
+ Enabled : plan .Enabled .ValueBool (),
248
236
}
249
237
250
238
discordParams := client.NotificationDiscordChannel {
@@ -273,7 +261,6 @@ func (s *discordChannelResource) Update(ctx context.Context, req resource.Update
273
261
plan .Enabled = types .BoolValue (notificationChannel .Enabled )
274
262
plan .RoomsID , _ = types .ListValueFrom (ctx , types .StringType , notificationChannel .Rooms )
275
263
plan .Alarms = types .StringValue (notificationChannel .Alarms )
276
- plan .IntegrationID = types .StringValue (notificationIntegration .ID )
277
264
278
265
diags = resp .State .Set (ctx , plan )
279
266
resp .Diagnostics .Append (diags ... )
0 commit comments