
                         x    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 d dlm	Z	 d dlm
Z
  G d d	e      Z	 dd
Zy)    )
xform_name)get_service_module_name)BaseDocumenter)!get_identifier_args_for_signature)!get_identifier_values_for_example)get_identifier_description)add_resource_type_overviewc                       e Zd Zd Zy)SubResourceDocumenterc                 p   t        |ddd       t        | j                  j                  j                  j
                  d       }g }|| j                  d<   |D ][  }|j                  |j                        }|j                  |j                         t        || j                  || j                         ] y )	NzSub-resourceszSub-resources are methods that create a new instance of a child resource. This resource's identifiers get passed along to the child.subresources_intro)sectionresource_typedescription
intro_linkc                     | j                   S )N)name)sub_resources    )lib/third_party/boto3/docs/subresource.py<lambda>z>SubResourceDocumenter.document_sub_resources.<locals>.<lambda>#   s
    \%6%6    )keyzsub-resources)r   resource_namesub_resource_modelservice_model)r	   sorted	_resourcemetaresource_modelsubresources
member_mapadd_new_sectionr   appenddocument_sub_resource_resource_name_service_model)selfr   sub_resourcessub_resources_listr   sub_resource_sections         r   document_sub_resourcesz,SubResourceDocumenter.document_sub_resources   s    ")' ,	- NN..;;6
  +=()L#*#:#:<;L;L#M %%l&7&78!,"11#/"11	 *r   N)__name__
__module____qualname__r+    r   r   r   r      s    r   r   c                 x   g }|j                   j                  D ]6  }|j                  dk(  s|j                  t	        |j
                               8 |r1t        |      }| j                  j                  |j                  |       | j                  d      }d|j                   j                  z  }	|j                  |	       | j                  d      }
t        |      }t	        |      }|j                  |k(  r|}t	        |j                   j                        d|d|j                  d|d}|
j                  j                          |
j!                  |       |
j                  j#                          | j                  d	      }|D ]w  }t%        |j                  |      }	|j!                  d
|z         |j                  j'                          |j!                  d|d|	       |j                  j'                          y | j                  d      }|j                  j'                          |j!                  dt)        |      d|j                   j                  d       |j                  j'                          |j!                  d|j                   j                  z         |j                  j'                          y)aj  Documents a resource action

    :param section: The section to write to

    :param resource_name: The name of the resource

    :param sub_resource_model: The model of the subresource

    :param service_model: The model of the service

    :param include_signature: Whether or not to include the signature.
        It is useful for generating docstrings.
    inputzmethod-introzCreates a %s resource.examplez = .()paramsz:type %s: stringz:param z: returnz:rtype: :py:class:``z:returns: A %s resourceN)resourceidentifierssourcer#   r   targetr   stylestart_sphinx_py_methodr   r"   typeinclude_doc_stringr   service_namestart_codeblockwriteend_codeblockr   new_liner   )r   r   r   r   include_signatureidentifiers_needed
identifiersignature_argsmethod_intro_sectionr   example_sectionexample_valuesexample_resource_namer2   param_sectionreturn_sections                   r   r$   r$   2   s^    (11==
'%%j1B1B&CD > :;MN,,##^	5 #22*-?-H-H-M-MMK++K8--i8O67IJN&}5!!]2 -%..334G
 ))+'"'')++H5M(
0##Z1.;<$$&% 	&$$& ) ,,X6N!!##M2'',,	./ !!#!$6$?$?$D$DDF!!#r   N)T)botocorer   botocore.utilsr   boto3.docs.baser   boto3.docs.utilsr   r   r   r	   r   r$   r/   r   r   <module>rT      s3      2 * > > 7 7N 8 <@>$r   