src/schoology-extractor/data_generation/discussions.py
def load_discussions(
    request_client: RequestClient, section_id: str, discussions: List[Dict]
) -> List[Dict]:
    """
    Load a list of discussions via the Schoology API.

    Parameters
    ----------
    request_client : RequestClient
        A RequestClient initialized for access to the Schoology API
    section_id: str
        The Schoology id of the section that the discussions are associated with
    discussions: List[Dict]
        A list of JSON-like discussion objects in a form suitable for submission
        to the Schoology discussion create endpoint.

    Returns
    -------
    List[Dict]
        A list of JSON-like discussion objects incorporating the response values from the
        Schoology API, e.g. resource ids and status from individual POSTing
    """
    logger.info("Creating %s discussions via Schoology API", len(discussions))

    post_responses: List[Dict] = []
    for discussion in discussions:
        response: Dict = request_client.post(
            f"sections/{section_id}/discussions", discussion
        )
        post_responses.append(response)

    logger.info("Successfully created %s discussions", len(post_responses))
    return post_responses

    Load a list of discussions via the Schoology API.

    Parameters
    ----------
    request_client : RequestClient
        A RequestClient initialized for access to the Schoology API
    section_id: str
        The Schoology id of the section that the discussions are associated with
    discussions: List[Dict]
        A list of JSON-like discussion objects in a form suitable for submission
        to the Schoology discussion create endpoint.

    Returns
    -------
    List[Dict]
        A list of JSON-like discussion objects incorporating the response values from the
        Schoology API, e.g. resource ids and status from individual POSTing
    
Load a list of discussions via the Schoology API.
Parameters

request_client : RequestClient
A RequestClient initialized for access to the Schoology API
section_id: str
The Schoology id of the section that the discussions are associated with
discussions: List[Dict]
A list of JSON-like discussion objects in a form suitable for submission
to the Schoology discussion create endpoint.

Returns

List[Dict]
A list of JSON-like discussion objects incorporating the response values from the
Schoology API, e.g. resource ids and status from individual POSTing
Load a list of discussions via the Schoology API . Parameters request_client : RequestClient A RequestClient initialized for access to the Schoology API section_id : str The Schoology id of the section that the discussions are associated with discussions : List [ Dict ] A list of JSON - like discussion objects in a form suitable for submission to the Schoology discussion create endpoint . Returns List [ Dict ] A list of JSON - like discussion objects incorporating the response values from the Schoology API e . g . resource ids and status from individual POSTing
def load_discussions(
    request_client: RequestClient, section_id: str, discussions: List[Dict]
) -> List[Dict]:
    logger.info("Creating %s discussions via Schoology API", len(discussions))
    post_responses: List[Dict] = []
    for discussion in discussions:
        response: Dict = request_client.post(
            f"sections/{section_id}/discussions", discussion
        )
        post_responses.append(response)
    logger.info("Successfully created %s discussions", len(post_responses))
    return post_responses
def load_discussions ( request_client : RequestClient , section_id : str , discussions : List [ Dict ] ) -> List [ Dict ] : logger . info ( "Creating %s discussions via Schoology API" , len ( discussions ) ) post_responses : List [ Dict ] = [ ] for discussion in discussions : response : Dict = request_client . post ( f"sections/{section_id}/discussions" , discussion ) post_responses . append ( response ) logger . info ( "Successfully created %s discussions" , len ( post_responses ) ) return post_responses
Load a list of discussions via the Schoology API.
Load a list of discussions via the Schoology API .
"""
    Load a list of discussions via the Schoology API.

    Parameters
    ----------
    request_client : RequestClient
        A RequestClient initialized for access to the Schoology API
    section_id: str
        The Schoology id of the section that the discussions are associated with
    discussions: List[Dict]
        A list of JSON-like discussion objects in a form suitable for submission
        to the Schoology discussion create endpoint.

    Returns
    -------
    List[Dict]
        A list of JSON-like discussion objects incorporating the response values from the
        Schoology API, e.g. resource ids and status from individual POSTing
    """
request_client
RequestClient
section_id
str
discussions
List[Dict]