src/schoology-extractor/data_generation/sections.py
def rollback_loaded_sections(
    request_client: RequestClient, creation_response: List[Dict]
):
    """
    Delete already loaded sections via the Schoology API.
    **** Used during testing of the load functionality ****

    Parameters
    ----------
    request_client : RequestClient
        A RequestClient initialized for access to the Schoology API
    creation_response: List[Dict]
        A list of JSON-like response objects from a successful section load operation
    """
    logger.info(
        "**** Rolling back %s sections via Schoology API - for testing purposes",
        len(creation_response),
    )

    ids: str = ",".join(map(lambda section: str(section["id"]), creation_response))

    delete_response = request_client.bulk_delete("sections", f"section_ids={ids}")[
        "section"
    ]

    validate_multi_status(delete_response)
    logger.info("**** Successfully deleted %s sections", len(delete_response))

    Delete already loaded sections via the Schoology API.
    **** Used during testing of the load functionality ****

    Parameters
    ----------
    request_client : RequestClient
        A RequestClient initialized for access to the Schoology API
    creation_response: List[Dict]
        A list of JSON-like response objects from a successful section load operation
    
Delete already loaded sections via the Schoology API.
Used during testing of the load functionality

Parameters

request_client : RequestClient
A RequestClient initialized for access to the Schoology API
creation_response: List[Dict]
A list of JSON-like response objects from a successful section load operation
Delete already loaded sections via the Schoology API . Used during testing of the load functionality Parameters request_client : RequestClient A RequestClient initialized for access to the Schoology API creation_response : List [ Dict ] A list of JSON - like response objects from a successful section load operation
def rollback_loaded_sections(
    request_client: RequestClient, creation_response: List[Dict]
):
    logger.info(
        "**** Rolling back %s sections via Schoology API - for testing purposes",
        len(creation_response),
    )
    ids: str = ",".join(map(lambda section: str(section["id"]), creation_response))
    delete_response = request_client.bulk_delete("sections", f"section_ids={ids}")[
        "section"
    ]
    validate_multi_status(delete_response)
    logger.info("**** Successfully deleted %s sections", len(delete_response))
def rollback_loaded_sections ( request_client : RequestClient , creation_response : List [ Dict ] ) : logger . info ( "**** Rolling back %s sections via Schoology API - for testing purposes" , len ( creation_response ) , ) ids : str = "," . join ( map ( lambda section : str ( section [ "id" ] ) , creation_response ) ) delete_response = request_client . bulk_delete ( "sections" , f"section_ids={ids}" ) [ "section" ] validate_multi_status ( delete_response ) logger . info ( "**** Successfully deleted %s sections" , len ( delete_response ) )
Delete already loaded sections via the Schoology API.
Delete already loaded sections via the Schoology API .
"""
    Delete already loaded sections via the Schoology API.
    **** Used during testing of the load functionality ****

    Parameters
    ----------
    request_client : RequestClient
        A RequestClient initialized for access to the Schoology API
    creation_response: List[Dict]
        A list of JSON-like response objects from a successful section load operation
    """
request_client
RequestClient
creation_response
List[Dict]