U
    ´.¬b   ã                   @   sˆ   d dl mZ d dlmZmZ d dlmZ d dlmZ d dl	m
Z
 d dlmZ d dlmZmZmZ G dd	„ d	e
ƒZddd„Zddd„ZdS )é    )Ú
xform_name)Údocument_custom_methodÚdocument_model_driven_method)ÚOperationModel)Úget_service_module_name)ÚBaseDocumenter)Ú%document_model_driven_resource_method)Úadd_resource_type_overviewÚget_resource_ignore_paramsÚget_resource_public_actionsc                   @   s   e Zd Zdd„ ZdS )ÚActionDocumenterc              	   C   sÜ   | j j}i }|D ]}|||j< qt| jjƒ}t|ƒ| jd< t|dddd� t|ƒD ]„}| 	|¡}|dkr˜| j j
r˜t||| j| jjjjj| j j
| jd� qR||krÆt|| j| jjjjj|| | jd� qRt|||| ƒ qRd S )	NÚactionsZActionszŠActions call operations on resources.  They may automatically handle the passing in of arguments set from identifiers and some attributes.Zactions_intro)ÚsectionZresource_typeÚdescriptionZ
intro_link)ÚloadÚreload)r   Úaction_nameÚresource_nameÚevent_emitterÚ
load_modelÚservice_model)r   r   r   Úaction_modelr   )Z_resource_modelr   Únamer   Z	_resourceÚ	__class__ÚsortedÚ
member_mapr	   Zadd_new_sectionr   Údocument_load_reload_actionZ_resource_nameÚmetaÚclientÚeventsZ_service_modelÚdocument_actionr   )Úselfr   Zmodeled_actions_listZmodeled_actionsZmodeled_actionZresource_actionsr   Zaction_section© r"   ú5/tmp/pip-unpacked-wheel-7h_bjh9e/boto3/docs/action.pyÚdocument_actions   sL    ÿø
úû  ÿz!ActionDocumenter.document_actionsN)Ú__name__Ú
__module__Ú__qualname__r$   r"   r"   r"   r#   r      s   r   Tc                 C   sx   |  |jj¡}t|jjƒ}d}|jr0t|jjƒ}t|ƒ}	|j|krF|}	d 	||	|j
¡}
t| |j
|||j|
|||d�	 dS )a¢  Documents a resource action

    :param section: The section to write to

    :param resource_name: The name of the resource

    :param event_emitter: The event emitter to use to emit events

    :param action_model: The model of the action

    :param service_model: The model of the service

    :param include_signature: Whether or not to include the signature.
        It is useful for generating docstrings.
    Úresponsez
{} = {}.{})	r   Úmethod_nameÚoperation_modelr   Úmethod_descriptionÚexample_prefixZexclude_inputZresource_action_modelÚinclude_signatureN)r*   ÚrequestÚ	operationr
   ÚparamsÚresourcer   ÚtypeÚservice_nameÚformatr   r   Zdocumentation)r   r   r   r   r   r-   r*   Zignore_paramsZexample_return_valueÚexample_resource_namer,   r"   r"   r#   r    L   s4    ÿ
  ÿ÷r    c           
   	   C   s^   d  t|ƒt|jjƒ|¡}t|ƒ}|j|kr0|}|› d|› �}	t| |ti |ƒ|||	|d� dS )aý  Documents the resource load action

    :param section: The section to write to

    :param action_name: The name of the loading action should be load or reload

    :param resource_name: The name of the resource

    :param event_emitter: The event emitter to use to emit events

    :param load_model: The model of the load action

    :param service_model: The model of the service

    :param include_signature: Whether or not to include the signature.
        It is useful for generating docstrings.
    z¥Calls :py:meth:`{}.Client.{}` to update the attributes of the {} resource. Note that the load and reload methods are the same method and can be used interchangeably.Ú.)r   r)   r*   r   r+   r,   r-   N)r4   r   r   r.   r/   r3   r   r   )
r   r   r   r   r   r   r-   r   r5   r,   r"   r"   r#   r   ~   s&    
ûÿ	
ùr   N)T)T)Zbotocorer   Zbotocore.docs.methodr   r   Zbotocore.modelr   Zbotocore.utilsr   Zboto3.docs.baser   Zboto3.docs.methodr   Zboto3.docs.utilsr	   r
   r   r   r    r   r"   r"   r"   r#   Ú<module>   s   4 ú
9 ù