Skip to content
Back to top
View this page

# AttachmentGetting

class dsviper.AttachmentGetting

  Bases: `object`

  An interface used to retreive a value (aka document) state.

  Note: Not directly instantiable.

  attachment(attachment_runtime_id: ValueUUId) → Attachment

    Return the attachment or raise.

  definitions() → DefinitionsConst

    Return the definitions.

  static diff_keys(current_attachment_getting: AttachmentGetting, other_attachment_getting: AttachmentGetting, attachment: Attachment) → tuple[ValueSet, ValueSet, ValueSet, ValueSet]

    Return the tuple (added_keys, removed_keys, different_keys, same_keys).

    - added_keys: keys present in ‘other’ and not in ‘current’.

    - removed_keys: keys present in ‘current’ and not in ‘other’.

    - different_keys: documents present in both but not equal.

    - same_keys: documents present in both and equal.

  enumerate(attachment: Attachment, *, encoded: bool = True) → list[tuple[ValueKey, _OutputValues]]

    Return a list of (key, document).

  get(attachment: Attachment, key: ValueKey) → ValueOptional

    Return an optional<document_type> associated with the key in the attachment.

  has(attachment: Attachment, key: ValueKey) → bool

    Return True if a document is present for the key.

  keys(attachment: Attachment) → ValueSet

    Return all keys.