B W`1-@s^ddlZddlmZddlmZddZdddZd d ZGd d d eZ Gd ddeZ dS)N) xform_name)get_data_membercCsx|D]}|dkrdSqWdS)z Return True if all elements of the iterable are not None (or if the iterable is empty). This is like the built-in ``all``, except checks against None, so 0 and False are allowable values. NFT)iterableelementrrsz,ResourceHandler.__call__..r)r9typer:Zresource_json_definitionsgetr8Zload_from_definitionr(rrdictrrvaluesrangelenrhandle_response_itemr r)r-r*) r/rrr r;Zjson_definition resource_clsrZsearch_responserpluraliZ response_itemrrrr2sB      zResourceHandler.__call__c Cs\d|jji}x0|D]$\}}t|tr2|d}|||<qW|f|}|dk rX||j_|S)a Handles the creation of a single response item by setting parameters and creating the appropriate resource instance. :type resource_cls: ServiceResource subclass :param resource_cls: The resource class to instantiate. :type parent: ServiceResource :param parent: The resource instance to which this action is attached. :type identifiers: dict :param identifiers: Map of identifier names to value or values. :type resource_data: dict or None :param resource_data: Data for resource attributes. :rtype: ServiceResource :return: New resource instance. clientrN)metarJitemsr<r popr ) r/rGrrZ resource_datakwargsrrresourcerrrrF s     z$ResourceHandler.handle_response_item)N)r3r4r5r6r0r2rFrrrrr7s Lr7)NN) rZbotocorerrrr rr-objectr.r7rrrrs   /1