# 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_identifier_args_for_signature(identifier_names):
#     return ','.join(identifier_names)
# 
# def get_identifier_description(resource_name, identifier_name):
#     return (
#         f"The {resource_name}'s {identifier_name} identifier. "
#         f"This **must** be set."
#     )
# 
# def get_identifier_values_for_example(identifier_names):
#     return ','.join([f'\'{identifier}\'' for identifier in identifier_names])


from botocore import xform_name
from botocore.utils import get_service_module_name
from boto3.docs.base import BaseDocumenter
from boto3.docs.utils import (
    add_resource_type_overview,
    get_identifier_args_for_signature,
    get_identifier_description,
    get_identifier_values_for_example,
)
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# https://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.



class SubResourceDocumenter(BaseDocumenter):
    def document_sub_resources(self, section):
        add_resource_type_overview(
            section=section,
            resource_type='Sub-resources',
            description=(
                'Sub-resources are methods that create a new instance of a'
                ' child resource. This resource\'s identifiers get passed'
                ' along to the child.'
            ),
            intro_link='subresources_intro',
        )
        sub_resources = sorted(
            self._resource.meta.resource_model.subresources,
            key=lambda sub_resource: sub_resource.name,
        )
        sub_resources_list = []
        self.member_map['sub-resources'] = sub_resources_list

# 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_identifier_args_for_signature(identifier_names):
#     return ','.join(identifier_names)
# 
# def get_identifier_description(resource_name, identifier_name):
#     return (
#         f"The {resource_name}'s {identifier_name} identifier. "
#         f"This **must** be set."
#     )
# 
# def get_identifier_values_for_example(identifier_names):
#     return ','.join([f'\'{identifier}\'' for identifier in identifier_names])


# Path: boto3/docs/subresource.py
from botocore import xform_name
from botocore.utils import get_service_module_name
from boto3.docs.base import BaseDocumenter
from boto3.docs.utils import (
    add_resource_type_overview,
    get_identifier_args_for_signature,
    get_identifier_description,
    get_identifier_values_for_example,
)

# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# https://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.



class SubResourceDocumenter(BaseDocumenter):
    def document_sub_resources(self, section):
        add_resource_type_overview(
            section=section,
            resource_type='Sub-resources',
            description=(
                'Sub-resources are methods that create a new instance of a'
                ' child resource. This resource\'s identifiers get passed'
                ' along to the child.'
            ),
            intro_link='subresources_intro',
        )
        sub_resources = sorted(
            self._resource.meta.resource_model.subresources,
            key=lambda sub_resource: sub_resource.name,
        )
        sub_resources_list = []
        self.member_map['sub-resources'] = sub_resources_list

        for sub_resource in sub_resources: