o ckF[X ã@s ddlmZGdd„deƒZdS)é)ÚDynamoDBItemErrorc@s¢eZdZdZd!dd„Zedd„ƒZedd„ƒZed d „ƒZed d „ƒZ d d„Z d"dd„Z dd„Z d#dd„Z d#dd„Zd#dd„Zdd„Zdd„Zdd„Zdd „ZdS)$ÚItemay An item in Amazon DynamoDB. :ivar hash_key: The HashKey of this item. :ivar range_key: The RangeKey of this item or None if no RangeKey is defined. :ivar hash_key_name: The name of the HashKey associated with this item. :ivar range_key_name: The name of the RangeKey associated with this item. :ivar table: The Table this item belongs to. NcCs´||_d|_|jjj|_|jjj|_|duri}|dur#| |jd¡}|||j<|jr;|dur6| |jd¡}|||j<i|_| ¡D]\}}||jkrT||jkrT|||<qBd|_ dS)Nr) ÚtableÚ_updatesÚschemaÚ hash_key_nameÚ_hash_key_nameÚrange_key_nameÚ_range_key_nameÚgetÚitemsÚconsumed_units)ÚselfrÚhash_keyÚ range_keyÚattrsÚkeyÚvalue©rú4/usr/lib/python3/dist-packages/boto/dynamodb/item.pyÚ__init__'s&    € z Item.__init__cCs ||jS©N©r©rrrrr;s z Item.hash_keycCs | |j¡Sr)r r rrrrr?s zItem.range_keycCó|jSrrrrrrrCózItem.hash_key_namecCrr)r rrrrr GrzItem.range_key_namecCód|f|j|<dS)a² Queue the addition of an attribute to an item in DynamoDB. This will eventually result in an UpdateItem request being issued with an update action of ADD when the save method is called. :type attr_name: str :param attr_name: Name of the attribute you want to alter. :type attr_value: int|long|float|set :param attr_value: Value which is to be added to the attribute. ÚADDN©r©rÚ attr_nameÚ attr_valuerrrÚ add_attributeKó zItem.add_attributecCr)a Queue the deletion of an attribute from an item in DynamoDB. This call will result in a UpdateItem request being issued with update action of DELETE when the save method is called. :type attr_name: str :param attr_name: Name of the attribute you want to alter. :type attr_value: set :param attr_value: A set of values to be removed from the attribute. This parameter is optional. If None, the whole attribute is removed from the item. ÚDELETENrrrrrÚdelete_attributeYszItem.delete_attributecCr)aŸ Queue the putting of an attribute to an item in DynamoDB. This call will result in an UpdateItem request being issued with the update action of PUT when the save method is called. :type attr_name: str :param attr_name: Name of the attribute you want to alter. :type attr_value: int|long|float|str|set :param attr_value: New value of the attribute. ÚPUTNrrrrrÚ put_attributeir#zItem.put_attributecCó|jj |||¡S)añ Commits pending updates to Amazon DynamoDB. :type expected_value: dict :param expected_value: A dictionary of name/value pairs that you expect. This dictionary should have name/value pairs where the name is the name of the attribute and the value is either the value you are expecting or False if you expect the attribute not to exist. :type return_values: str :param return_values: Controls the return of attribute name/value pairs before they were updated. Possible values are: None, 'ALL_OLD', 'UPDATED_OLD', 'ALL_NEW' or 'UPDATED_NEW'. If 'ALL_OLD' is specified and the item is overwritten, the content of the old item is returned. If 'ALL_NEW' is specified, then all the attributes of the new version of the item are returned. If 'UPDATED_NEW' is specified, the new versions of only the updated attributes are returned. )rÚlayer2Ú update_item©rÚexpected_valueÚ return_valuesrrrÚsavews ÿz Item.savecCr()aÛ Delete the item from DynamoDB. :type expected_value: dict :param expected_value: A dictionary of name/value pairs that you expect. This dictionary should have name/value pairs where the name is the name of the attribute and the value is either the value you are expecting or False if you expect the attribute not to exist. :type return_values: str :param return_values: Controls the return of attribute name-value pairs before then were changed. Possible values are: None or 'ALL_OLD'. If 'ALL_OLD' is specified and the item is overwritten, the content of the old item is returned. )rr)Ú delete_itemr+rrrÚdeletes ÿz Item.deletecCr()a Store a new item or completely replace an existing item in Amazon DynamoDB. :type expected_value: dict :param expected_value: A dictionary of name/value pairs that you expect. This dictionary should have name/value pairs where the name is the name of the attribute and the value is either the value you are expecting or False if you expect the attribute not to exist. :type return_values: str :param return_values: Controls the return of attribute name-value pairs before then were changed. Possible values are: None or 'ALL_OLD'. If 'ALL_OLD' is specified and the item is overwritten, the content of the old item is returned. )rr)Úput_itemr+rrrÚput¤szItem.putcCs(|jdur | ||¡t |||¡dS)zfOverrwrite the setter to instead update the _updates method so this can act like a normal dictN)rr'ÚdictÚ __setitem__)rrrrrrr4¹s  zItem.__setitem__cCs$|jdur | |¡t ||¡dS)zRemove this key from the itemsN)rr%r3Ú __delitem__)rrrrrr5Às  zItem.__delitem__cCrr)Ú__dict__rrrrÚ __getstate__ÇszItem.__getstate__cCs|j |¡dSr)r6Úupdate)rÚdrrrÚ __setstate__ÉszItem.__setstate__)NNNr)NN)Ú__name__Ú __module__Ú __qualname__Ú__doc__rÚpropertyrrrr r"r%r'r.r0r2r4r5r7r:rrrrrs*          rN)Úboto.dynamodb.exceptionsrr3rrrrrÚs