Skip to content

Commit

Permalink
Issue/dataclasses (#573)
Browse files Browse the repository at this point in the history
Added dataclasses

Co-authored-by: Sander Van Balen <[email protected]>
  • Loading branch information
wouterdb and sanderr authored Jan 22, 2025
1 parent 66e20a5 commit 29b78b6
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# Changelog

## v8.1.1 - ?
## v8.2.1 - ?


## v8.2.0 - 2025-01-21

- Added support for dataclasses, a special type of entity that has a Python counterpart.

## v8.1.0 - 2025-01-16

- Add json serialization and deserialization plugins
Expand Down
19 changes: 19 additions & 0 deletions model/_init.cf
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,25 @@ entity ManagedDevice:
hoststring name
end

entity Dataclass:
"""
Super class for inmanta entities that have a python counterpart.

The python counterpart is expect to be
- a frozen dataclass,
- with the same name
- in the plugins package of this module
- in the corresponding submodule
- with the exact same fields

The Inmanta entity is expect to
- have no relations
- have no indexes
- have only std::none as implementation

"""
end

entity Host extends ManagedDevice:
"""
A host models a server or computer in the managed infrastructure that
Expand Down
2 changes: 1 addition & 1 deletion module.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
author: Inmanta <[email protected]>
license: Apache 2.0
name: std
version: 8.1.1.dev0
version: 8.2.1.dev0
compiler_version: 2023.6

0 comments on commit 29b78b6

Please sign in to comment.