# Path: boto3/docs/base.py
# class BaseDocumenter:
#     def __init__(self, resource):
#         self._resource = resource
#         self._client = self._resource.meta.client
#         self._resource_model = self._resource.meta.resource_model
#         self._service_model = self._client.meta.service_model
#         self._resource_name = self._resource.meta.resource_model.name
#         self._service_name = self._service_model.service_name
#         self._service_docs_name = self._client.__class__.__name__
#         self.member_map = OrderedDict()
#         self.represents_service_resource = (
#             self._service_name == self._resource_name
#         )
# 
#     @property
#     def class_name(self):
#         return f'{self._service_docs_name}.{self._resource_name}'
# 
# Path: boto3/docs/utils.py
# def add_resource_type_overview(
#     section, resource_type, description, intro_link=None
# ):
#     section.style.new_line()
#     section.write('.. rst-class:: admonition-title')
#     section.style.new_line()
#     section.style.new_line()
#     section.write(resource_type)
#     section.style.new_line()
#     section.style.new_line()
#     section.write(description)
#     section.style.new_line()
#     if intro_link is not None:
#         section.write(
#             f'For more information about {resource_type.lower()} refer to the '
#             f':ref:`Resources Introduction Guide<{intro_link}>`.'
#         )
#         section.style.new_line()
# 
# def get_resource_ignore_params(params):
#     """Helper method to determine which parameters to ignore for actions
# 
#     :returns: A list of the parameter names that does not need to be
#         included in a resource's method call for documentation purposes.
#     """
#     ignore_params = []
#     for param in params:
#         result = jmespath.compile(param.target)
#         current = result.parsed
#         # Use JMESPath to find the left most element in the target expression
#         # which will be the parameter to ignore in the action call.
#         while current['children']:
#             current = current['children'][0]
#         # Make sure the parameter we are about to ignore is a field.
#         # If it is not, we should ignore the result to avoid false positives.
#         if current['type'] == 'field':
#             ignore_params.append(current['value'])
#     return ignore_params


from botocore import xform_name
from botocore.docs.method import document_model_driven_method
from botocore.utils import get_service_module_name
from boto3.docs.base import BaseDocumenter
from boto3.docs.utils import (
    add_resource_type_overview,
    get_resource_ignore_params,
)
def document_resource_waiter(
    section,
    resource_name,
    event_emitter,
    service_model,
    resource_waiter_model,
    service_waiter_model,
    include_signature=True,
):
    waiter_model = service_waiter_model.get_waiter(
        resource_waiter_model.waiter_name
    )
    operation_model = service_model.operation_model(waiter_model.operation)

    ignore_params = get_resource_ignore_params(resource_waiter_model.params)
    service_module_name = get_service_module_name(service_model)
    description = (
        'Waits until this {} is {}. This method calls '
        ':py:meth:`{}.Waiter.{}.wait` which polls. '
        ':py:meth:`{}.Client.{}` every {} seconds until '
        'a successful state is reached. An error is returned '
        'after {} failed checks.'.format(
            resource_name,
            ' '.join(resource_waiter_model.name.split('_')[2:]),
            service_module_name,
            xform_name(resource_waiter_model.waiter_name),
            service_module_name,
            xform_name(waiter_model.operation),
            waiter_model.delay,
            waiter_model.max_attempts,

# Path: boto3/docs/base.py
# class BaseDocumenter:
#     def __init__(self, resource):
#         self._resource = resource
#         self._client = self._resource.meta.client
#         self._resource_model = self._resource.meta.resource_model
#         self._service_model = self._client.meta.service_model
#         self._resource_name = self._resource.meta.resource_model.name
#         self._service_name = self._service_model.service_name
#         self._service_docs_name = self._client.__class__.__name__
#         self.member_map = OrderedDict()
#         self.represents_service_resource = (
#             self._service_name == self._resource_name
#         )
# 
#     @property
#     def class_name(self):
#         return f'{self._service_docs_name}.{self._resource_name}'
# 
# Path: boto3/docs/utils.py
# def add_resource_type_overview(
#     section, resource_type, description, intro_link=None
# ):
#     section.style.new_line()
#     section.write('.. rst-class:: admonition-title')
#     section.style.new_line()
#     section.style.new_line()
#     section.write(resource_type)
#     section.style.new_line()
#     section.style.new_line()
#     section.write(description)
#     section.style.new_line()
#     if intro_link is not None:
#         section.write(
#             f'For more information about {resource_type.lower()} refer to the '
#             f':ref:`Resources Introduction Guide<{intro_link}>`.'
#         )
#         section.style.new_line()
# 
# def get_resource_ignore_params(params):
#     """Helper method to determine which parameters to ignore for actions
# 
#     :returns: A list of the parameter names that does not need to be
#         included in a resource's method call for documentation purposes.
#     """
#     ignore_params = []
#     for param in params:
#         result = jmespath.compile(param.target)
#         current = result.parsed
#         # Use JMESPath to find the left most element in the target expression
#         # which will be the parameter to ignore in the action call.
#         while current['children']:
#             current = current['children'][0]
#         # Make sure the parameter we are about to ignore is a field.
#         # If it is not, we should ignore the result to avoid false positives.
#         if current['type'] == 'field':
#             ignore_params.append(current['value'])
#     return ignore_params


# Path: boto3/docs/waiter.py
from botocore import xform_name
from botocore.docs.method import document_model_driven_method
from botocore.utils import get_service_module_name
from boto3.docs.base import BaseDocumenter
from boto3.docs.utils import (
    add_resource_type_overview,
    get_resource_ignore_params,
)

def document_resource_waiter(
    section,
    resource_name,
    event_emitter,
    service_model,
    resource_waiter_model,
    service_waiter_model,
    include_signature=True,
):
    waiter_model = service_waiter_model.get_waiter(
        resource_waiter_model.waiter_name
    )
    operation_model = service_model.operation_model(waiter_model.operation)

    ignore_params = get_resource_ignore_params(resource_waiter_model.params)
    service_module_name = get_service_module_name(service_model)
    description = (
        'Waits until this {} is {}. This method calls '
        ':py:meth:`{}.Waiter.{}.wait` which polls. '
        ':py:meth:`{}.Client.{}` every {} seconds until '
        'a successful state is reached. An error is returned '
        'after {} failed checks.'.format(
            resource_name,
            ' '.join(resource_waiter_model.name.split('_')[2:]),
            service_module_name,
            xform_name(resource_waiter_model.waiter_name),
            service_module_name,
            xform_name(waiter_model.operation),
            waiter_model.delay,
            waiter_model.max_attempts,

        )