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_model service_name _service_name)selfclientshared_examplesrU/Users/kashii/Desktop/Projects/Workshops/worker-safety/lambda/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)styleZh2)rrrrrr)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__sortedZli)rrrZofficial_service_name class_name method_namerrrr,s        z"ClientDocumenter._add_client_introcCs|jjd|jjjddS)Nz %s.Client)r#)rZstart_sphinx_py_classrr r!)rrrrrr@sz%ClientDocumenter._add_class_signaturecCs6|j|j|dj|jd|jdS)Nz+client = session.create_client('{service}'))service)rZstart_codeblockrrformatr Z end_codeblock)rrrrrrDs    z-ClientDocumenter._add_client_creation_examplecCs2|d}x"t|D]}|||||qWdS)Nmethods)rr"_add_client_method)rrrr$rrrrMs z$ClientDocumenter._add_client_methodscCs4||}||r$||||n |||dS)N)r_is_custom_method_add_custom_method_add_model_driven_method)rrr$methodrrrr(Ss  z#ClientDocumenter._add_client_methodcCs||jjjkS)N)rr method_to_api_mapping)rr$rrrr)Zsz"ClientDocumenter._is_custom_methodcCst|||dS)N)r)rrr$r,rrrr*]sz#ClientDocumenter._add_custom_methodcCsh|jjj}|jjj|}||}d|}t||||jjj|j|d|j |}|rdt ||||dS)Nzresponse = client.%s) event_emittermethod_descriptionexample_prefix) rr r r-operation_modelrevents documentationr getr)rrr$r operation_namer1r0rrrrr+`s   z)ClientDocumenter._add_model_driven_method)N)r! __module__ __qualname__rrrrrrrr(r)r*r+rrrrrs   r) inspectbotocore.docs.utilsrZbotocore.docs.methodrrrZbotocore.docs.sharedexamplerobjectrrrrr s