@@ -37,7 +37,6 @@ type discordChannelResourceModel struct {
3737 SpaceID types.String `tfsdk:"space_id"`
3838 RoomsID types.List `tfsdk:"rooms_id"`
3939 Alarms types.String `tfsdk:"alarms"`
40- IntegrationID types.String `tfsdk:"integration_id"`
4140 WebhookURL types.String `tfsdk:"webhook_url"`
4241 ChannelType types.String `tfsdk:"channel_type"`
4342 ChannelThread types.String `tfsdk:"channel_thread"`
@@ -152,7 +151,6 @@ func (s *discordChannelResource) Create(ctx context.Context, req resource.Create
152151 plan .Enabled = types .BoolValue (notificationChannel .Enabled )
153152 plan .RoomsID , _ = types .ListValueFrom (ctx , types .StringType , notificationChannel .Rooms )
154153 plan .Alarms = types .StringValue (notificationChannel .Alarms )
155- plan .IntegrationID = types .StringValue (notificationIntegration .ID )
156154
157155 diags = resp .State .Set (ctx , plan )
158156 resp .Diagnostics .Append (diags ... )
@@ -226,25 +224,15 @@ func (s *discordChannelResource) Update(ctx context.Context, req resource.Update
226224 return
227225 }
228226
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-
238227 var roomsID []string
239228 plan .RoomsID .ElementsAs (ctx , & roomsID , false )
240229
241230 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 (),
248236 }
249237
250238 discordParams := client.NotificationDiscordChannel {
@@ -273,7 +261,6 @@ func (s *discordChannelResource) Update(ctx context.Context, req resource.Update
273261 plan .Enabled = types .BoolValue (notificationChannel .Enabled )
274262 plan .RoomsID , _ = types .ListValueFrom (ctx , types .StringType , notificationChannel .Rooms )
275263 plan .Alarms = types .StringValue (notificationChannel .Alarms )
276- plan .IntegrationID = types .StringValue (notificationIntegration .ID )
277264
278265 diags = resp .State .Set (ctx , plan )
279266 resp .Diagnostics .Append (diags ... )
0 commit comments