o
    Vf@                     @   st   d dl mZ d dlmZ d dlmZ d dlmZ G dd deZ	G dd de	Z
G d	d
 d
e	ZG dd de	ZdS )    )DocumentStructuredocument_model_driven_methoddocument_paginate_methoddocument_wait_methodc                       sZ   e Zd ZdZ fddZ fddZdd Zdd	d
Zdd ZeZ	dd Z
dd Z  ZS )LazyLoadedDocstringa0  Used for lazily loading docstrings

    You can instantiate this class and assign it to a __doc__ value.
    The docstring will not be generated till accessed via __doc__ or
    help(). Note that all docstring classes **must** subclass from
    this class. It cannot be used directly as a docstring.
    c                    s    t    || _|| _d| _dS )z
        The args and kwargs are the same as the underlying document
        generation function. These just get proxied to the underlying
        function.
        N)super__init__	_gen_args_gen_kwargs
_docstringselfargskwargs	__class__ X/home/ubuntu/oakencloud.com/venv/lib/python3.10/site-packages/botocore/docs/docstring.pyr      s   

zLazyLoadedDocstring.__init__c                    s   t  | S N)r
   __new__)clsr   r   r   r   r   r   '   s   zLazyLoadedDocstring.__new__c                 O   s   t d)Nzq_write_docstring is not implemented. Please subclass from this class and provide your own _write_docstring method)NotImplementedErrorr   r   r   r   _write_docstring+   s   z$LazyLoadedDocstring._write_docstring   c                 C   s   | j du r	|   | j |S )a  Expands tabs to spaces

        So this is a big hack in order to get lazy loaded docstring work
        for the ``help()``. In the ``help()`` function, ``pydoc`` and
        ``inspect`` are used. At some point the ``inspect.cleandoc``
        method is called. To clean the docs ``expandtabs`` is called
        and that is where we override the method to generate and return the
        docstrings.
        N)r   	_generate
expandtabs)r   tabsizer   r   r   r   1   s   

zLazyLoadedDocstring.expandtabsc                 C   s   |   S r   )r   r   r   r   r   __str__?   s   zLazyLoadedDocstring.__str__c                 C   s   | j d u r
|  | _ | j S r   )r   _create_docstringr    r   r   r   r   E   s   

zLazyLoadedDocstring._generatec                 C   s6   t ddd}| j|g| jR i | j | dS )N	docstringhtml)targetzutf-8)r   r   r   r   flush_structuredecode)r   docstring_structurer   r   r   r"   K   s   z%LazyLoadedDocstring._create_docstring)r   )__name__
__module____qualname____doc__r   r   r   r   r!   __repr__r   r"   __classcell__r   r   r   r   r	      s    
r	   c                   @      e Zd Zdd ZdS )ClientMethodDocstringc                 O      t |i | d S r   r   r   r   r   r   r   V      z&ClientMethodDocstring._write_docstringNr)   r*   r+   r   r   r   r   r   r0   U       r0   c                   @   r/   )WaiterDocstringc                 O   r1   r   r   r   r   r   r   r   [   r2   z WaiterDocstring._write_docstringNr3   r   r   r   r   r5   Z   r4   r5   c                   @   r/   )PaginatorDocstringc                 O   r1   r   r   r   r   r   r   r   `   r2   z#PaginatorDocstring._write_docstringNr3   r   r   r   r   r6   _   r4   r6   N)botocore.docs.bcdoc.restdocr   botocore.docs.methodr   botocore.docs.paginatorr   botocore.docs.waiterr   strr	   r0   r5   r6   r   r   r   r   <module>   s   B