U C^A@sXddlZddlmZddlmZddlmZddlmZddlmZGddde Z dS) N)get_official_service_namedocument_custom_method)document_model_driven_method)get_instance_public_methods)document_shared_examplesc@sfeZdZdddZddZddZdd Zd d Zd d ZddZ ddZ ddZ ddZ ddZ dS)ClientDocumenterNcCs.||_||_|jdkri|_|jjjj|_dSN)_client_shared_examplesmeta service_modelZ service_name _service_name)selfclientshared_examplesr:/tmp/pip-install-6_kvzl1k/botocore/botocore/docs/client.py__init__s  zClientDocumenter.__init__cCs:||||t|j}||||||dS)z]Documents a client and its methods :param section: The section to write to. N) _add_title_add_class_signaturerr _add_client_intro_add_client_methods)rsectionclient_methodsrrrdocument_clients     z ClientDocumenter.document_clientcCs|jddS)NZClient)styleh2rrrrrr)szClientDocumenter._add_titlecCs~|d}t|jjj}|d||||j|d|j|jj j }t |D]}|j d||fq`dS)NZintroz"A low-level client representing %sz These are the available methods:z:py:meth:`~%s.Client.%s`) add_new_sectionrr r r write_add_client_creation_examplernew_line __class____name__sortedli)rrrZofficial_service_name class_name method_namerrrr,s"       z"ClientDocumenter._add_client_introcCs|jjd|jjjddS)Nz %s.Client)r')rZstart_sphinx_py_classr r#r$rrrrr@s z%ClientDocumenter._add_class_signaturecCs6|j|j|dj|jd|jdS)Nz+client = session.create_client('{service}'))Zservice)rZstart_codeblockr"r formatrZ end_codeblockrrrrr!Ds  z-ClientDocumenter._add_client_creation_examplecCs.|d}t|D]}|||||qdS)Nmethods)rr%_add_client_method)rrrr(rrrrMs  z$ClientDocumenter._add_client_methodscCs4||}||r$||||n |||dSr )r_is_custom_method_add_custom_method_add_model_driven_methodrrr(methodrrrr+Ss  z#ClientDocumenter._add_client_methodcCs||jjjkSr )r r method_to_api_mapping)rr(rrrr,Zsz"ClientDocumenter._is_custom_methodcCst|||dSr rr/rrrr-]sz#ClientDocumenter._add_custom_methodcCsh|jjj}|jjj|}||}d|}t||||jjj|j|d|j |}|rdt ||||dS)Nzresponse = client.%s)Z event_emitterZmethod_descriptionexample_prefix) r r r r1operation_modelreventsZ documentationr getr)rrr(r Zoperation_namer3r2rrrrr.`s(   z)ClientDocumenter._add_model_driven_method)N)r$ __module__ __qualname__rrrrrr!rr+r,r-r.rrrrrs   r) inspectZbotocore.docs.utilsrZbotocore.docs.methodrrrZbotocore.docs.sharedexamplerobjectrrrrr s