
    vKgpO                         S r SSKrSSKJr  \R                  " \5      r " S S5      r " S S5      r " S S	5      r	 " S
 S5      r
 " S S\	5      r " S S\	5      r " S S5      r " S S\5      r " S S5      rg)a  
The models defined in this file represent the resource JSON description
format and provide a layer of abstraction from the raw JSON. The advantages
of this are:

* Pythonic interface (e.g. ``action.request.operation``)
* Consumers need not change for minor JSON changes (e.g. renamed field)

These models are used both by the resource factory to generate resource
classes as well as by the documentation generator.
    N)
xform_namec                   "    \ rS rSrSrSS jrSrg)
Identifier!   zg
A resource identifier, given by its name.

:type name: string
:param name: The name of the identifier
Nc                     Xl         X l        g N)namemember_name)selfr	   r
   s      U/var/www/highfloat_scraper/venv/lib/python3.13/site-packages/boto3/resources/model.py__init__Identifier.__init__)   s    	&    )r
   r	   r   __name__
__module____qualname____firstlineno____doc__r   __static_attributes__ r   r   r   r   !   s    'r   r   c                       \ rS rSrSrS rSrg)Action/   z
A service operation action.

:type name: string
:param name: The name of the action
:type definition: dict
:param definition: The JSON definition
:type resource_defs: dict
:param resource_defs: All resources defined in the service
c                     X l         Xl        S U l        SU;   a   [        UR	                  S0 5      5      U l        S U l        SU;   a!  [        UR	                  S0 5      U5      U l        UR	                  S5      U l        g )Nrequestresourcepath)_definitionr	   r   Requestgetr   ResponseResourcer   r   r	   
definitionresource_defss       r   r   Action.__init__;   sr    % 	
"":>>)R#@ADL#,z2.DM NN6*	r   )r   r	   r   r   r   Nr   r   r   r   r   r   /   s    	+r   r   c                   .    \ rS rSrSrS r\S 5       rSrg)DefinitionWithParamsN   z
An item which has parameters exposed via the ``params`` property.
A request has an operation and parameters, while a waiter has
a name, a low-level waiter name and parameters.

:type definition: dict
:param definition: The JSON definition
c                     Xl         g r   r   )r   r$   s     r   r   DefinitionWithParams.__init__X   s    %r   c                     / nU R                   R                  S/ 5       H  nUR                  [        S0 UD65        M     U$ )z\
Get a list of auto-filled parameters for this request.

:type: list(:py:class:`Parameter`)
paramsr   r   r!   append	Parameter)r   r.   items      r   r.   DefinitionWithParams.params[   sA     $$((26DMM)+d+, 7 r   r+   N)	r   r   r   r   r   r   propertyr.   r   r   r   r   r(   r(   N   s     &  r   r(   c                   $    \ rS rSrSr SS jrSrg)r1   j   a  
An auto-filled parameter which has a source and target. For example,
the ``QueueUrl`` may be auto-filled from a resource's ``url`` identifier
when making calls to ``queue.receive_messages``.

:type target: string
:param target: The destination parameter name, e.g. ``QueueUrl``
:type source_type: string
:param source_type: Where the source is defined.
:type source: string
:param source: The source name, e.g. ``Url``
Nc                 |    Xl         X l        X0l        X@l        XPl        U(       a  [
        R                  SU5        g g )Nz#Unknown parameter options found: %s)targetsourcer	   r   valueloggerwarning)r   r8   r9   r	   r   r:   kwargss          r   r   Parameter.__init__x   s6     		
 NN@&I r   )r	   r   r9   r8   r:   )NNNr   r   r   r   r1   r1   j   s     ;?Jr   r1   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )r       zd
A service operation action request.

:type definition: dict
:param definition: The JSON definition
c                 P   > [         TU ]  U5        UR                  S5      U l        g )N	operation)superr   r!   rB   )r   r$   	__class__s     r   r   Request.__init__   s"    $ $4r   )rB   )r   r   r   r   r   r   r   __classcell__rD   s   @r   r    r       s    5 5r   r    c                   0   ^  \ rS rSrSrSrU 4S jrSrU =r$ )Waiter   z
An event waiter specification.

:type name: string
:param name: Name of the waiter
:type definition: dict
:param definition: The JSON definition
	WaitUntilc                 \   > [         TU ]  U5        Xl        UR                  S5      U l        g )N
waiterName)rC   r   r	   r!   waiter_name)r   r	   r$   rD   s      r   r   Waiter.__init__   s*    $ 	 &>>,7r   )r	   rN   )	r   r   r   r   r   PREFIXr   r   rF   rG   s   @r   rI   rI      s     F8 8r   rI   c                   >    \ rS rSrSrS r\S 5       r\S 5       rSr	g)r"      z
A resource response to create after performing an action.

:type definition: dict
:param definition: The JSON definition
:type resource_defs: dict
:param resource_defs: All resources defined in the service
c                 t    Xl         X l        UR                  S5      U l        UR                  S5      U l        g )Ntyper   )r   _resource_defsr!   rT   r   )r   r$   r%   s      r   r   ResponseResource.__init__   s2    %+ NN6*	 NN6*	r   c                     / nU R                   R                  S/ 5       H  nUR                  [        S0 UD65        M     U$ )zF
A list of resource identifiers.

:type: list(:py:class:`Identifier`)
identifiersr   r/   )r   rX   r2   s      r   rX   ResponseResource.identifiers   sD     $$((;Dy0401 < r   c                 r    [        U R                  U R                  U R                     U R                  5      $ )zU
Get the resource model for the response resource.

:type: :py:class:`ResourceModel`
)ResourceModelrT   rU   r   s    r   modelResponseResource.model   s1     IIt**4995t7J7J
 	
r   )r   rU   r   rT   N)
r   r   r   r   r   r   r4   rX   r]   r   r   r   r   r"   r"      s4    +   
 
r   r"   c                   (    \ rS rSrSr\S 5       rSrg)
Collection   z
A group of resources. See :py:class:`Action`.

:type name: string
:param name: The name of the collection
:type definition: dict
:param definition: The JSON definition
:type resource_defs: dict
:param resource_defs: All resources defined in the service
c                 B    U R                   R                  R                  $ )z
Get a list of batch actions supported by the resource type
contained in this action. This is a shortcut for accessing
the same information through the resource model.

:rtype: list(:py:class:`Action`)
)r   r]   batch_actionsr\   s    r   rc   Collection.batch_actions   s     }}""000r   r   N)r   r   r   r   r   r4   rc   r   r   r   r   r`   r`      s    	 1 1r   r`   c                       \ rS rSrSrS rSS jrSS jrSS jrS r	\
S	 5       r\
S
 5       r\
S 5       r\
S 5       rS rS r\
S 5       r\
S 5       r\
S 5       r\
S 5       rSrg)r[      a  
A model representing a resource, defined via a JSON description
format. A resource has identifiers, attributes, actions,
sub-resources, references and collections. For more information
on resources, see :ref:`guide_resources`.

:type name: string
:param name: The name of this resource, e.g. ``sqs`` or ``Queue``
:type definition: dict
:param definition: The JSON definition
:type resource_defs: dict
:param resource_defs: All resources defined in the service
c                 b    X l         X0l        0 U l        Xl        UR	                  S5      U l        g )Nshape)r   rU   _renamedr	   r!   rh   r#   s       r   r   ResourceModel.__init__  s,    %+ 	^^G,
r   Nc                    S1n0 U l         U R                  R                  S5      (       a  UR                  S5        U R                  R                  S/ 5       H  nU R	                  X#S   S5        M     U R                  R                  S0 5       H  nU R	                  X$S5        M     U R                  5       R                  5        HO  u  pESnUS	   S    H  nUS
   S:X  d  M  Sn  O   U(       d  U R	                  X$SSS9  M=  U R	                  X$S5        MQ     U R                  R                  S0 5       H  nU R	                  X$S5        M     U R                  R                  S0 5       H'  nU R	                  U[        R                  U-   S5        M)     Ub4  UR                  R                  5        H  nU R	                  X$S5        M     gg)a  
Load a name translation map given a shape. This will set
up renamed values for any collisions, e.g. if the shape,
an action, and a subresource all are all named ``foo``
then the resource will have an action ``foo``, a subresource
named ``Foo`` and a property named ``foo_attribute``.
This is the order of precedence, from most important to
least important:

* Load action (resource.load)
* Identifiers
* Actions
* Subresources
* References
* Collections
* Waiters
* Attributes (shape members)

Batch actions are only exposed on collections, so do not
get modified here. Subresources use upper camel casing, so
are unlikely to collide with anything but other subresources.

Creates a structure like this::

    renames = {
        ('action', 'id'): 'id_action',
        ('collection', 'id'): 'id_collection',
        ('attribute', 'id'): 'id_attribute'
    }

    # Get the final name for an action named 'id'
    name = renames.get(('action', 'id'), 'id')

:type shape: botocore.model.Shape
:param shape: The underlying shape for this resource.
metaloadrX   r	   
identifieractionsactionFr   r9   dataTsubresource
snake_case	referencehasMany
collectionwaiterswaiterN	attribute)ri   r   r!   add_load_name_with_category_get_has_definitionitemsrI   rP   memberskeys)r   rh   namesr2   r	   refdata_requiredrn   s           r   load_rename_mapResourceModel.load_rename_map  s   L ''IIf$$((;D))%f|L < $$((B7D))%x@ 8 11399;ID "M!*om<
h'61$(M =
 !--5 .  --e;G <  $$((B7D))%|D 8 $$((B7D))v}}t+X 8
 **,--e;G - r   c           	      (   U(       a  [        U5      nX!;   aj  [        R                  SU R                   SU SU 35        US-   U-   U R                  X24'   USU-   -  nX!;   a  [        SU R                   SU SU S35      eUR                  U5        g)a  
Load a name with a given category, possibly renaming it
if that name is already in use. The name will be stored
in ``names`` and possibly be set up in ``self._renamed``.

:type names: set
:param names: Existing names (Python attributes, properties, or
              methods) on the resource.
:type name: string
:param name: The original name of the value.
:type category: string
:param category: The value type, such as 'identifier' or 'action'
:type snake_case: bool
:param snake_case: True (default) if the name should be snake cased.
z	Renaming  _zProblem renaming z to !N)r   r;   debugr	   ri   
ValueErrorr{   )r   r   r	   categoryrt   s        r   r|   &ResourceModel._load_name_with_category]  s      d#D=LL9TYYKq
!D6BC.2Sj8.CDMM8*+C(N"D} !'		{!H:T$qI  			$r   c                 `    U(       a  [        U5      nU R                  R                  X4U5      $ )a  
Get a possibly renamed value given a category and name. This
uses the rename map set up in ``load_rename_map``, so that
method must be called once first.

:type category: string
:param category: The value type, such as 'identifier' or 'action'
:type name: string
:param name: The original name of the value
:type snake_case: bool
:param snake_case: True (default) if the name should be snake cased.
:rtype: string
:return: Either the renamed value if it is set, otherwise the
         original name.
)r   ri   r!   )r   r   r	   rt   s       r   	_get_nameResourceModel._get_name~  s+      d#D}}  (!1488r   c                     0 nU R                    Vs/ sH  o3R                  PM     nnUR                  R                  5        H-  u  pV[	        U5      nXt;   a  M  U R                  SUSS9nXV4X''   M/     U$ s  snf )a[  
Get a dictionary of attribute names to original name and shape
models that represent the attributes of this resource. Looks
like the following:

    {
        'some_name': ('SomeName', <Shape...>)
    }

:type shape: botocore.model.Shape
:param shape: The underlying shape for this resource.
:rtype: dict
:return: Mapping of resource attributes.
rz   Frs   )rX   r	   r   r~   r   r   )r   rh   
attributesiidentifier_namesr	   membersnake_caseds           r   get_attributesResourceModel.get_attributes  s     
,0,<,<=,<qFF,<=!MM//1LD$T*K...[U ) K (,nJ# 2  >s   A4c                    / nU R                   R                  S/ 5       H]  nU R                  SUS   5      nUR                  SS5      nU(       a  U R                  SU5      nUR                  [	        X45      5        M_     U$ )zJ
Get a list of resource identifiers.

:type: list(:py:class:`Identifier`)
rX   rn   r	   
memberNameNrz   )r   r!   r   r0   r   )r   rX   r2   r	   r
   s        r   rX   ResourceModel.identifiers  sx     $$((;D>>,V=D((<6K"nn[+Fz$<= < r   c                 n    U R                   R                  S5      nUb  [        SXR                  5      nU$ )za
Get the load action for this resource, if it is defined.

:type: :py:class:`Action` or ``None``
rm   )r   r!   r   rU   )r   rp   s     r   rm   ResourceModel.load  s7     !!%%f-FF,?,?@Fr   c                     / nU R                   R                  S0 5      R                  5        H<  u  p#U R                  SU5      nUR	                  [        X#U R                  5      5        M>     U$ )zK
Get a list of actions for this resource.

:type: list(:py:class:`Action`)
ro   rp   r   r!   r~   r   r0   r   rU   r   ro   r	   r2   s       r   ro   ResourceModel.actions  sb     **..y"=CCEJD>>(D1DNN6$d.A.ABC F r   c                     / nU R                   R                  S0 5      R                  5        H<  u  p#U R                  SU5      nUR	                  [        X#U R                  5      5        M>     U$ )zQ
Get a list of batch actions for this resource.

:type: list(:py:class:`Action`)
batchActionsbatch_actionr   r   s       r   rc   ResourceModel.batch_actions  sb     **..~rBHHJJD>>.$7DNN6$d.A.ABC K r   c                    U R                   U R                  ;  a  0 nU R                  R                  5        H  u  p#SnU R                  R	                  S0 5      R                  5       nU H2  u  pgUR	                  S0 5      R	                  S5      U:X  d  M,  XqU'   SnM4     U(       a  Mr  SU/ S.0nUR	                  S/ 5       H   n	US   S   R                  U	S   S	S
.5        M"     XU'   M     U$ U R                  R	                  S0 5      nU$ )a  
Get a ``has`` relationship definition from a model, where the
service resource model is treated special in that it contains
a relationship to every resource defined for the service. This
allows things like ``s3.Object('bucket-name', 'key')`` to
work even though the JSON doesn't define it explicitly.

:rtype: dict
:return: Mapping of names to subresource and reference
         definitions.
Fhasr   rT   T)rT   rX   rX   r	   input)r8   r9   )r	   rU   r~   r   r!   r0   )
r   r$   r	   resource_deffound	has_itemshas_namehas_deffake_hasrn   s
             r   r}   !ResourceModel._get_has_definition  s#    99D/// J&*&9&9&?&?&A"
  ,,00;AAC	)2%H{{:r266v>$F/68, $ *3
 u  !+T",MNH&2&6&6}b&I
 ,];BB'1&'9WM 'J
 (0t$G 'BN  ))--eR8Jr   c                    / nU R                  5       R                  5        H  u  p4U(       a  U R                  SUSS9nOU R                  SU5      n[        X4U R                  5      nSnUR
                  R                   H  nUR                  S:X  d  M  Sn  O   U(       a  U(       d  UR                  U5        M  U(       a  M  U(       d  M  UR                  U5        M     U$ )z
Get a list of sub-resources or references.

:type subresources: bool
:param subresources: ``True`` to get sub-resources, ``False`` to
                     get references.
:rtype: list(:py:class:`Action`)
rr   Frs   ru   rq   T)	r}   r~   r   r   rU   r   rX   r9   r0   )r   subresources	resourcesr	   r$   rp   r   rn   s           r   _get_related_resources$ResourceModel._get_related_resources)  s     	 $ 8 8 : @ @ BD~~mTe~L~~k48Dd.A.ABF!M$oo99
$$.$(M :
 M  (!\mm  (! !C$ r   c                 $    U R                  S5      $ )z?
Get a list of sub-resources.

:type: list(:py:class:`Action`)
Tr   r\   s    r   r   ResourceModel.subresourcesH  s     **400r   c                 $    U R                  S5      $ )zE
Get a list of reference resources.

:type: list(:py:class:`Action`)
Fr   r\   s    r   
referencesResourceModel.referencesQ  s     **511r   c                     / nU R                   R                  S0 5      R                  5        H<  u  p#U R                  SU5      nUR	                  [        X#U R                  5      5        M>     U$ )zS
Get a list of collections for this resource.

:type: list(:py:class:`Collection`)
rv   rw   )r   r!   r~   r   r0   r`   rU   )r   collectionsr	   r2   s       r   r   ResourceModel.collectionsZ  se     **..y"=CCEJD>>,5Dz$d6I6IJK F r   c                     / nU R                   R                  S0 5      R                  5        HB  u  p#U R                  S[        R
                  U-   5      nUR                  [	        X#5      5        MD     U$ )zK
Get a list of waiters for this resource.

:type: list(:py:class:`Waiter`)
rx   ry   )r   r!   r~   r   rI   rP   r0   )r   rx   r	   r2   s       r   rx   ResourceModel.waitersi  sc     **..y"=CCEJD>>(FMMD,@ADNN6$-. F r   )r   ri   rU   r	   rh   r   )T)r   r   r   r   r   r   r   r|   r   r   r4   rX   rm   ro   rc   r}   r   r   r   r   rx   r   r   r   r   r[   r[      s    -LH\B9*<  "      8t> 1 1 2 2    r   r[   )r   loggingbotocorer   	getLoggerr   r;   r   r   r(   r1   r    rI   r"   r`   r[   r   r   r   <module>r      s   
  			8	$' '+ +> 8J JB5" 58! 8,+
 +
\1 10@ @r   