示例#1
0
def process_service_paginator(
    session: Session,
    service_name: ServiceName,
    service_output_path: Path,
    import_record_renderer: ImportRecordRenderer,
) -> Optional[ServicePaginator]:
    logger.debug(f"Parsing {service_name} ServicePaginator")
    service_paginator = parse_service_paginator(session, service_name)
    if service_paginator is None or not service_paginator.paginators:
        logger.debug(f"Skipping {service_name} ServicePaginator")
        return None

    module_output_path = service_output_path / "paginator.py"

    logger.debug(
        f"Writing {service_name.boto3_name} ServicePaginator to {NicePath(module_output_path)}"
    )

    write_service_paginator(
        service_paginator,
        module_output_path,
        import_record_renderer,
        include_doc=service_name.is_with_docs(),
    )
    return service_paginator
示例#2
0
def process_service_client(
    session: Session,
    service_name: ServiceName,
    service_output_path: Path,
    import_record_renderer: ImportRecordRenderer,
) -> Client:
    logger.debug(f"Parsing {service_name} Client")
    client = parse_client(session, service_name)
    module_output_path = service_output_path / "client.py"
    logger.debug(
        f"Writing Client for {service_name.boto3_name} to {NicePath(module_output_path)}"
    )
    write_client(
        client,
        module_output_path,
        import_record_renderer,
        include_doc=service_name.is_with_docs(),
    )
    return client
示例#3
0
def process_service_resource(
    session: Session,
    service_name: ServiceName,
    service_output_path: Path,
    import_record_renderer: ImportRecordRenderer,
) -> Optional[ServiceResource]:
    logger.debug(f"Parsing {service_name} ServiceResource")
    service_resource = parse_service_resource(session, service_name)
    if service_resource is None:
        logger.debug(f"Skipping {service_name} ServiceResource")
        return None

    module_output_path = service_output_path / "service_resource.py"

    logger.debug(
        f"Writing ServiceResource for {service_name.boto3_name} to {NicePath(module_output_path)}"
    )
    write_service_resource(
        service_resource,
        module_output_path,
        import_record_renderer,
        include_doc=service_name.is_with_docs(),
    )
    return service_resource