@@ -45,10 +45,22 @@ func (c *ConditionSetClient) Read(ctx context.Context, data ConditionSetModel) (
4545 return ConditionSetModel {}, err
4646 }
4747
48- var resourceKey string
49-
48+ // Handle resource: if API returns null, keep it null to maintain consistency
49+ var resource types. String
5050 if conditionSet .Resource != nil {
51- resourceKey = conditionSet .Resource .Key
51+ resource = types .StringValue (conditionSet .Resource .Key )
52+ } else {
53+ resource = types .StringPointerValue (nil )
54+ }
55+
56+ // Handle description: if API returns null and state is null, keep it null
57+ // This ensures consistency for omitted description fields
58+ var description types.String
59+ if conditionSet .Description != nil {
60+ description = types .StringPointerValue (conditionSet .Description )
61+ } else {
62+ // API returned null - explicitly set to null to maintain consistency
63+ description = types .StringPointerValue (nil )
5264 }
5365
5466 state := ConditionSetModel {
@@ -58,8 +70,8 @@ func (c *ConditionSetClient) Read(ctx context.Context, data ConditionSetModel) (
5870 EnvironmentId : types .StringValue (conditionSet .EnvironmentId ),
5971 Key : types .StringValue (conditionSet .Key ),
6072 Name : types .StringValue (conditionSet .Name ),
61- Description : types . StringPointerValue ( conditionSet . Description ) ,
62- Resource : types . StringValue ( resourceKey ) ,
73+ Description : description ,
74+ Resource : resource ,
6375 Conditions : types .StringValue (string (conditionsMarshalled )),
6476 }
6577
0 commit comments