Package comodit_client :: Package api :: Module sync :: Class Diff

Class Diff


Represents a diff between 2 entities' elements.

Instance Methods
 
__init__(self, diff_type, key=None, old_value=None, new_value=None)
Creates a diff instance.

Inherited from object: __long__, __native__, __nonzero__, __unicode__, next

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self, diff_type, key=None, old_value=None, new_value=None)
(Constructor)

 

Creates a diff instance. A diff represents a difference between two entities. There are 7 difference types (called diff types):

  • create: a new field must be added
  • update: an existing field must be updated
  • delete: an existing field must be deleted
  • set-file-content: A file's content must be set/overwritten
  • delete-file-content: A file's content must be cleared
  • set-thumb: A thumbnail must be set
  • delete-thumb: A thumbnail must be removed
Parameters:
  • diff_type (string) - The diff type.
  • key (string) - Diff's type (field name, file name, etc.)
  • old_value (JSON object) - Old field value.
  • new_value (JSON object) - New field value.
Overrides: object.__init__