ó T!¶\c@sûdZddlZddlmZejeƒZdefd„ƒYZdefd„ƒYZ defd „ƒYZ d efd „ƒYZ d e fd „ƒYZ de fd„ƒYZ defd„ƒYZde fd„ƒYZdefd„ƒYZdS(s  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. iÿÿÿÿN(t xform_namet IdentifiercBseZdZdd„ZRS(sw A resource identifier, given by its name. :type name: string :param name: The name of the identifier cCs||_||_dS(N(tnamet member_name(tselfRR((s6/tmp/pip-install-usGedi/boto3/boto3/resources/model.pyt__init__)s N(t__name__t __module__t__doc__tNoneR(((s6/tmp/pip-install-usGedi/boto3/boto3/resources/model.pyR"stActioncBseZdZd„ZRS(s 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 cCs‘||_||_d|_d|krEt|jdiƒƒ|_nd|_d|kr{t|jdiƒ|ƒ|_n|jdƒ|_dS(Ntrequesttresourcetpath( t _definitionRR R tRequesttgetR tResponseResourceR (RRt definitiont resource_defs((s6/tmp/pip-install-usGedi/boto3/boto3/resources/model.pyR:s      (RRRR(((s6/tmp/pip-install-usGedi/boto3/boto3/resources/model.pyR /s tDefinitionWithParamscBs&eZdZd„Zed„ƒZRS(s 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 cCs ||_dS(N(R(RR((s6/tmp/pip-install-usGedi/boto3/boto3/resources/model.pyRUscCs=g}x0|jjdgƒD]}|jt|ƒqW|S(st Get a list of auto-filled parameters for this request. :type: list(:py:class:`Parameter`) tparams(RRtappendt Parameter(RRtitem((s6/tmp/pip-install-usGedi/boto3/boto3/resources/model.pyRXs(RRRRtpropertyR(((s6/tmp/pip-install-usGedi/boto3/boto3/resources/model.pyRLs RcBs eZdZdddd„ZRS(sÌ 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`` cKsJ||_||_||_||_||_|rFtjd|ƒndS(Ns#Unknown parameter options found: %s(ttargettsourceRR tvaluetloggertwarning(RRRRR Rtkwargs((s6/tmp/pip-install-usGedi/boto3/boto3/resources/model.pyRts     N(RRRR R(((s6/tmp/pip-install-usGedi/boto3/boto3/resources/model.pyRgs RcBseZdZd„ZRS(st A service operation action request. :type definition: dict :param definition: The JSON definition cCs,tt|ƒj|ƒ|jdƒ|_dS(Nt operation(tsuperRRRR (RR((s6/tmp/pip-install-usGedi/boto3/boto3/resources/model.pyRs(RRRR(((s6/tmp/pip-install-usGedi/boto3/boto3/resources/model.pyR†stWaitercBseZdZdZd„ZRS(sª An event waiter specification. :type name: string :param name: Name of the waiter :type definition: dict :param definition: The JSON definition t WaitUntilcCs5tt|ƒj|ƒ||_|jdƒ|_dS(Nt waiterName(R!R"RRRt waiter_name(RRR((s6/tmp/pip-install-usGedi/boto3/boto3/resources/model.pyRŸs (RRRtPREFIXR(((s6/tmp/pip-install-usGedi/boto3/boto3/resources/model.pyR"”sRcBs5eZdZd„Zed„ƒZed„ƒZRS(sç 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 cCs:||_||_|jdƒ|_|jdƒ|_dS(NttypeR (Rt_resource_defsRR'R (RRR((s6/tmp/pip-install-usGedi/boto3/boto3/resources/model.pyR²s  cCs=g}x0|jjdgƒD]}|jt|ƒqW|S(s^ A list of resource identifiers. :type: list(:py:class:`Identifier`) t identifiers(RRRR(RR)R((s6/tmp/pip-install-usGedi/boto3/boto3/resources/model.pyR)¼s cCs t|j|j|j|jƒS(sm Get the resource model for the response resource. :type: :py:class:`ResourceModel` (t ResourceModelR'R((R((s6/tmp/pip-install-usGedi/boto3/boto3/resources/model.pytmodelËs(RRRRRR)R+(((s6/tmp/pip-install-usGedi/boto3/boto3/resources/model.pyR©s t CollectioncBseZdZed„ƒZRS(s 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 cCs |jjjS(sò 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+t batch_actions(R((s6/tmp/pip-install-usGedi/boto3/boto3/resources/model.pyR-ás (RRRRR-(((s6/tmp/pip-install-usGedi/boto3/boto3/resources/model.pyR,Ös R*cBsÎeZdZd„Zdd„Zed„Zed„Zd„Z e d„ƒZ e d„ƒZ e d„ƒZ e d „ƒZd „Zd „Ze d „ƒZe d „ƒZe d„ƒZe d„ƒZRS(sù 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 cCs:||_||_i|_||_|jdƒ|_dS(Ntshape(RR(t_renamedRRR.(RRRR((s6/tmp/pip-install-usGedi/boto3/boto3/resources/model.pyRûs     cCsâtdgƒ}i|_|jjdƒr:|jdƒnx4|jjdgƒD]}|j||ddƒqPWx0|jjdiƒD]}|j||dƒq‡WxŽ|jƒjƒD]z\}}t}x0|ddD] }|d d krØt }PqØqØW|s|j||d d tƒq·|j||d ƒq·Wx0|jjdiƒD]}|j||dƒqKWx7|jjdiƒD] }|j|t j |dƒq~W|dk rÞx-|j jƒD]}|j||dƒq¾WndS(sþ 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. tmetatloadR)Rt identifiertactionstactionR Rtdatat subresourcet snake_caset referencethasManyt collectiontwaiterstwaitert attributeN(tsetR/RRtaddt_load_name_with_categoryt_get_has_definitiontitemstFalsetTrueR"R&R tmemberstkeys(RR.tnamesRRtreft data_requiredR2((s6/tmp/pip-install-usGedi/boto3/boto3/resources/model.pytload_rename_maps4&    cCs¨|rt|ƒ}n||kr—tjd|j||fƒ|d||j||f<|d|7}||kr—tdj|j||ƒƒ‚q—n|j|ƒdS(s‚ 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. sRenaming %s %s %st_s Problem renaming {0} {1} to {2}!N(RRtdebugRR/t ValueErrortformatR?(RRGRtcategoryR7((s6/tmp/pip-install-usGedi/boto3/boto3/resources/model.pyR@Qs   cCs.|rt|ƒ}n|jj||f|ƒS(s] 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. (RR/R(RRORR7((s6/tmp/pip-install-usGedi/boto3/boto3/resources/model.pyt _get_namerscCsi}g|jD]}|j^q}xc|jjƒD]R\}}t|ƒ}||kr_q5n|jd|dtƒ}||f||) } :type shape: botocore.model.Shape :param shape: The underlying shape for this resource. :rtype: dict :return: Mapping of resource attributes. R=R7(R)RRERBRRPRC(RR.t attributestitidentifier_namesRtmembert snake_cased((s6/tmp/pip-install-usGedi/boto3/boto3/resources/model.pytget_attributes‡s   cCsƒg}xv|jjdgƒD]_}|jd|dƒ}|jddƒ}|re|jd|ƒ}n|jt||ƒƒqW|S(sb Get a list of resource identifiers. :type: list(:py:class:`Identifier`) R)R2Rt memberNameR=N(RRRPR RR(RR)RRR((s6/tmp/pip-install-usGedi/boto3/boto3/resources/model.pyR)¤scCs:|jjdƒ}|dk r6td||jƒ}n|S(sy Get the load action for this resource, if it is defined. :type: :py:class:`Action` or ``None`` R1N(RRR R R((RR4((s6/tmp/pip-install-usGedi/boto3/boto3/resources/model.pyR1¶s cCsdg}xW|jjdiƒjƒD]:\}}|jd|ƒ}|jt|||jƒƒq"W|S(sc Get a list of actions for this resource. :type: list(:py:class:`Action`) R3R4(RRRBRPRR R((RR3RR((s6/tmp/pip-install-usGedi/boto3/boto3/resources/model.pyR3Äs ( cCsdg}xW|jjdiƒjƒD]:\}}|jd|ƒ}|jt|||jƒƒq"W|S(si Get a list of batch actions for this resource. :type: list(:py:class:`Action`) t batchActionst batch_action(RRRBRPRR R((RR3RR((s6/tmp/pip-install-usGedi/boto3/boto3/resources/model.pyR-Ós ( c Cs2|j|jkri}x|jjƒD]ê\}}t}|jjdiƒjƒ}xH|D]@\}}|jdiƒjdƒ|kr\|||s  -