Skip to content

Commit

Permalink
model.base: Add new attributes to class AdministrativeInformation
Browse files Browse the repository at this point in the history
Version 3.0 of the spec introduces the 2 new attributes
- `creator`
- `template_id`
to class `AdministrativeInformation`.
This commit adds them to the class.
  • Loading branch information
s-heppner committed Aug 11, 2023
1 parent 493d5d3 commit 29e40a4
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions basyx/aas/model/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1094,6 +1094,7 @@ def __init__(


@_string_constraints.constrain_version_type("version")
@_string_constraints.constrain_identifier("template_id")
class AdministrativeInformation(HasDataSpecification):
"""
Administrative meta-information for an element like version information.
Expand All @@ -1103,13 +1104,26 @@ class AdministrativeInformation(HasDataSpecification):
:ivar version: Version of the element.
:ivar revision: Revision of the element.
:ivar creator: The subject ID of the subject responsible for making the element
:ivar template_id: Identifier of the template that guided the creation of the element
*Note:* In case of a submodel, the template ID is the identifier of the submodel template that guided the
creation of the submodel.
*Note:* The submodel template ID is not relevant for validation. Here, the Submodel/semanticId shall be used
*Note:* Usage of the template ID is not restricted to submodel instances.
The creation of submodel templates can also be guided by another submodel template.
:ivar embedded_data_specifications: List of Embedded data specification.
used by the element.
"""

def __init__(self,
version: Optional[VersionType] = None,
revision: Optional[RevisionType] = None,
creator: Optional[Reference] = None,
template_id: Optional[Identifier] = None,
embedded_data_specifications: Iterable[EmbeddedDataSpecification] = ()):
"""
Initializer of AdministrativeInformation
Expand All @@ -1122,6 +1136,8 @@ def __init__(self,
self.version: Optional[VersionType] = version
self._revision: Optional[RevisionType]
self.revision = revision
self.creator: Optional[Reference] = creator
self.template_id: Optional[Identifier] = template_id
self.embedded_data_specifications: List[EmbeddedDataSpecification] = list(embedded_data_specifications)

def _get_revision(self):
Expand Down

0 comments on commit 29e40a4

Please sign in to comment.