@@ -1175,20 +1175,7 @@ func mapToAssetBlockModel(ctx context.Context, m map[string]any, _ *diag.Diagnos
11751175// ItemObjectType returns the object type for items in the list data source.
11761176// It covers the fields that apiBodyToModel populates from an API response.
11771177func ItemObjectType () attr.Type {
1178- return types.ObjectType {AttrTypes : map [string ]attr.Type {
1179- attrTimestamp : types .StringType ,
1180- attrEntity : types.ObjectType {AttrTypes : BlockAttrTypes ()},
1181- attrHost : types.ObjectType {AttrTypes : HostBlockAttrTypes ()},
1182- attrUser : types.ObjectType {AttrTypes : UserBlockAttrTypes ()},
1183- attrService : types.ObjectType {AttrTypes : ServiceBlockAttrTypes ()},
1184- attrCloud : types.ObjectType {AttrTypes : CloudBlockAttrTypes ()},
1185- attrAsset : types.ObjectType {AttrTypes : AssetBlockAttrTypes ()},
1186- attrOrchestrator : types.ObjectType {AttrTypes : OrchestratorBlockAttrTypes ()},
1187- attrEvent : types.ObjectType {AttrTypes : EventBlockAttrTypes ()},
1188- attrLabels : types.MapType {ElemType : types .StringType },
1189- attrTags : types.SetType {ElemType : types .StringType },
1190- attrDocumentJSON : jsontypes.NormalizedType {},
1191- }}
1178+ return types.ObjectType {AttrTypes : ItemAttrTypes ()}
11921179}
11931180
11941181// APIBodyToItem converts a raw entity document from the API list response
@@ -1198,9 +1185,9 @@ func APIBodyToItem(ctx context.Context, body map[string]any, diags *diag.Diagnos
11981185 var item tfModel
11991186 apiBodyToModel (ctx , body , & item , diags )
12001187 if diags .HasError () {
1201- return types .ObjectNull (ItemObjectType ().(types. ObjectType ). AttrTypes )
1188+ return types .ObjectNull (ItemAttrTypes () )
12021189 }
1203- obj , d := types .ObjectValue (ItemObjectType ().(types. ObjectType ). AttrTypes , map [string ]attr.Value {
1190+ obj , d := types .ObjectValue (ItemAttrTypes () , map [string ]attr.Value {
12041191 "@timestamp" : item .Timestamp ,
12051192 attrEntity : item .Entity ,
12061193 attrHost : item .Host ,
0 commit comments