U ê üexã@s4dZddlZddlZddlmZGdd„deƒZdS)zImplementation of the DbDoc.éNé)Ú STRING_TYPESc@s8eZdZdZdd„Zdd„Zdd„Zdd „Zd d „Zd S) ÚDbDoczÏRepresents a generic document in JSON format. Args: value (object): The value can be a JSON string or a dict. Raises: ValueError: If ``value`` type is not a basestring or dict. cCs@t|tƒr||_n*t|tƒr*t |¡|_ntd t|ƒ¡ƒ‚dS)NzUnable to handle type: {0}) Ú isinstanceÚdictÚ__dict__rÚjsonÚloadsÚ ValueErrorÚformatÚtype)ÚselfÚvalue©rúa/opt/hc_python/lib64/python3.8/site-packages/../../../lib/python3.8/site-packages/mysqlx/dbdoc.pyÚ__init__)s   zDbDoc.__init__cCs |j|S©N)r)r ÚindexrrrÚ __getitem__2szDbDoc.__getitem__cCs |j ¡Sr)rÚkeys©r rrrr5sz DbDoc.keyscCs$d|jkrt ¡j|jd<|jdS)NZ_id)rÚuuidÚuuid4ÚhexrrrrÚ ensure_id8s zDbDoc.ensure_idcCs t |j¡Sr)rÚdumpsrrrrrÚ__str__=sz DbDoc.__str__N) Ú__name__Ú __module__Ú __qualname__Ú__doc__rrrrrrrrrr s  r)r rrÚcompatrÚobjectrrrrrÚs