
    vKgv-                     b    S SK r S SKJr  SSKJr  S rSS jrS r " S S	5      r " S
 S5      r	g)    N)
xform_name   )get_data_memberc                      U  H  nUb  M    g   g)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.
FT )iterableelements     X/var/www/highfloat_scraper/venv/lib/python3.13/site-packages/boto3/resources/response.pyall_not_noner      s     ?      c                    / nU  H  nUR                   nUR                  nUS:X  a"  [        R                  " UR                  U5      nOUS:X  a"  [        R                  " UR                  U5      nOXUS:X  a   [        U[        UR                  5      5      nO2US:X  a  [        XR                  5      nOUS:X  a  M  [        SU 35      eUR                  [        U5      U45        M     U$ )a  
Builds a mapping of identifier names to values based on the
identifier source location, type, and target. Identifier
values may be scalars or lists depending on the source type
and location.

:type identifiers: list
:param identifiers: List of :py:class:`~boto3.resources.model.Parameter`
                    definitions
:type parent: ServiceResource
:param parent: The resource instance to which this action is attached.
:type params: dict
:param params: Request parameters sent to the service.
:type raw_response: dict
:param raw_response: Low-level operation response.
:rtype: list
:return: An ordered list of ``(name, value)`` identifier tuples.
responserequestParameter
identifierdatainputzUnsupported source type: )sourcetargetjmespathsearchpathgetattrr   namer   NotImplementedErrorappend)	identifiersparentparamsraw_responseresultsr   r   r   values	            r
   build_identifiersr"       s    & G!
""""ZOOJOO\BE))OOJOOV<E|#FJz$?@Ev $FOO<Ew%(A&&JKK
6*E23) ", Nr   c                    SnUR                  U5      nUR                  nU (       a  U R                  S5       Hl  nUR                  S5      nUR                  S:X  a  UR
                  U   nM5  UR                  S:X  a  UR                  nMS  [        SUR                   SU 35      e   UR                  S:X  a  0 nU$ UR                  S:X  a  / nU$ UR                  S:X  a  0 nU$ )	ai  
Creates an appropriate empty response for the type that is expected,
based on the service model's shape type. For example, a value that
is normally a list would then return an empty list. A structure would
return an empty dict, and a number would return None.

:type search_path: string
:param search_path: JMESPath expression to search in the response
:type operation_name: string
:param operation_name: Name of the underlying service operation.
:type service_model: :ref:`botocore.model.ServiceModel`
:param service_model: The Botocore service model
:rtype: dict, list, or None
:return: An appropriate empty value
N.z[0123456789]$	structurelistzSearch path hits shape type z from map)operation_modeloutput_shapesplitstrip	type_namemembersmemberr   )search_pathoperation_nameservice_modelr   r(   shapeitems          r
   build_empty_responser4   N   s      H#33NCO((E
  %%c*D::o.D+-d+F*)25??2C6$P  + +% O 
F	" O 
E	!Or   c                   $    \ rS rSrSrS rS rSrg)
RawHandler   a'  
A raw action response handler. This passed through the response
dictionary, optionally after performing a JMESPath search if one
has been defined for the action.

:type search_path: string
:param search_path: JMESPath expression to search in the response
:rtype: dict
:return: Service response
c                     Xl         g Nr/   )selfr/   s     r
   __init__RawHandler.__init__   s    &r   c                     U R                   (       a1  U R                   S:w  a!  [        R                  " U R                   U5      nU$ )
:type parent: ServiceResource
:param parent: The resource instance to which this action is attached.
:type params: dict
:param params: Request parameters sent to the service.
:type response: dict
:param response: Low-level operation response.
$)r/   r   r   )r;   r   r   r   s       r
   __call__RawHandler.__call__   s5      0 0C 7t'7'7BHr   r:   N)__name__
__module____qualname____firstlineno____doc__r<   rA   __static_attributes__r   r   r
   r6   r6      s    	'r   r6   c                   0    \ rS rSrSr SS jrS rS rSrg)	ResourceHandler   a"  
Creates a new resource or list of new resources from the low-level
response based on the given response resource definition.

:type search_path: string
:param search_path: JMESPath expression to search in the response

:type factory: ResourceFactory
:param factory: The factory that created the resource class to which
                this action is attached.

:type resource_model: :py:class:`~boto3.resources.model.ResponseResource`
:param resource_model: Response resource model.

:type service_context: :py:class:`~boto3.utils.ServiceContext`
:param service_context: Context about the AWS service

:type operation_name: string
:param operation_name: Name of the underlying service operation, if it
                       exists.

:rtype: ServiceResource or list
:return: New resource instance(s).
Nc                 @    Xl         X l        X0l        XPl        X@l        g r9   )r/   factoryresource_modelr0   service_context)r;   r/   rM   rN   rO   r0   s         r
   r<   ResourceHandler.__init__   s!     ',,.r   c           	         U R                   R                  nU R                  R                  R	                  U5      nU R
                  R                  UUU R                  S9nUnSnU R                  (       a!  [        R                  " U R                  U5      n[        [        U R                   R                  XU5      5      n	U	R                  5        V
s/ sH  n
[        U
[        5      (       d  M  U
PM     nn
U(       aP  / n[!        [#        US   5      5       H1  nSnU(       a  X   nUR%                  U R'                  XaX5      5        M3     U$ [)        U	R                  5       5      (       a  U R'                  XaX5      nU$ SnU R*                  b5  [-        U R                  U R*                  U R                  R.                  5      nU$ s  sn
f )r?   )resource_namesingle_resource_json_definitionrO   Nr   )rN   typerO   resource_json_definitionsgetrM   load_from_definitionr/   r   r   dictr"   r   values
isinstancer&   rangelenr   handle_response_itemr   r0   r4   r1   )r;   r   r   r   rR   json_definitionresource_clsr   search_responser   vpluraliresponse_items                 r
   rA   ResourceHandler.__call__   s    ++00..HHLL

 ||88',; 00 9 

   &ood.>.>MO ##//
 )//1I1Z45H!1IH 3vay>* !%"$3$6M--$k +B + +,,.// 00kH$  H"". 0$$''((66 Q Js   G/Gc                     SUR                   R                  0nUR                  5        H/  u  pg[        U[        5      (       a  UR                  S5      nXuU'   M1     U" S0 UD6nUb  XHR                   l        U$ )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.
clientr   r   )metarg   itemsrZ   r&   popr   )	r;   r_   r   r   resource_datakwargsr   r!   resources	            r
   r]   $ResourceHandler.handle_response_item  sv    & fkk((
 ',,.KD%&&		! 4L /  )&)$!.MMr   )rM   r0   rN   r/   rO   r9   )	rC   rD   rE   rF   rG   r<   rA   r]   rH   r   r   r
   rJ   rJ      s    > /Rh"r   rJ   )NN)
r   botocorer   r   r   r   r"   r4   r6   rJ   r   r   r
   <module>rp      s7      #	+\.b >^ ^r   