B \A@sXddlZddlmZddlmZddlmZddlmZddlmZGddde Z dS) N)get_official_service_name)document_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|_dS)N)_client_shared_examplesmeta service_modelZ service_name _service_name)selfclientshared_examplesr8/tmp/pip-build-uw_ogi45/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)r sectionclient_methodsrrrdocument_clients     z ClientDocumenter.document_clientcCs|jddS)NZClient)styleh2)r rrrrr)szClientDocumenter._add_titlecCs|d}t|jjj}|d||||j|d|j|jj j }x$t |D]}|j d||fqbWdS)NZintroz"A low-level client representing %sz These are the available methods:z:py:meth:`~%s.Client.%s`) add_new_sectionrrr r write_add_client_creation_examplernew_line __class____name__sortedli)r rrZofficial_service_name class_name method_namerrrr,s        z"ClientDocumenter._add_client_introcCs|jjd|jjjddS)Nz %s.Client)r$)rZstart_sphinx_py_classrr r!)r rrrrr@sz%ClientDocumenter._add_class_signaturecCs6|j|j|dj|jd|jdS)Nz+client = session.create_client('{service}'))Zservice)rZstart_codeblockrrformatr Z end_codeblock)r rrrrrDs    z-ClientDocumenter._add_client_creation_examplecCs2|d}x"t|D]}|||||qWdS)Nmethods)rr"_add_client_method)r rrr%rrrrMs z$ClientDocumenter._add_client_methodscCs4||}||r$||||n |||dS)N)r_is_custom_method_add_custom_method_add_model_driven_method)r rr%methodrrrr(Ss  z#ClientDocumenter._add_client_methodcCs||jjjkS)N)rr method_to_api_mapping)r r%rrrr)Zsz"ClientDocumenter._is_custom_methodcCst|||dS)N)r)r rr%r,rrrr*]sz#ClientDocumenter._add_custom_methodcCsh|jjj}|jjj|}||}d|}t||||jjj|j|d|j |}|rdt ||||dS)Nzresponse = client.%s)Z event_emitterZmethod_descriptionexample_prefix) rr r r-operation_modelreventsZ documentationr getr)r rr%r Zoperation_namer/r.rrrrr+`s   z)ClientDocumenter._add_model_driven_method)N)r! __module__ __qualname__rrrrrrrr(r)r*r+rrrrrs   r) inspectZbotocore.docs.utilsrZbotocore.docs.methodrrrZbotocore.docs.sharedexamplerobjectrrrrr s