# coding: utf-8

"""
    University Student API

    This API exposes identity information about university students. The purpose of this API is to give access to basic identity information about university students for use by downstream systems, therefore the data exposed is limited to basic information about who a student is and which institutions they are affiliated with.  This API uses the following identifiers to link people to person-records held within different systems:  * `person.v1.student-records.university.identifiers.cam.ac.uk` - the university student (ust) identifier of this person -   also referred to as USN  Additionally this API uses the following identifiers to link people to institutions or entities which a person may have an affiliation to:  * `institution.v1.student-records.university.identifiers.cam.ac.uk` - the university student (ust) institution identifier.     This encompasses colleges, departments and faculties. The     [CamSIS Coding Manual](https://www.camsis.cam.ac.uk/technical/camsis-coding-manual)     lists the available values for this affiliation (under A01 and M01). * `academic-plan.v1.student-records.university.identifiers.cam.ac.uk` - the university student (ust) academic plan     identifier. The     [CamSIS Coding Manual](https://www.camsis.cam.ac.uk/technical/camsis-coding-manual)     lists the available values for this affiliation (under D07).  Both affiliations provide a `status` field which indicate a student's status within an affiliated entity. This `status` field is the short representation of the academic career field held in CamSIS. The [CamSIS Coding Manual](https://www.camsis.cam.ac.uk/technical/camsis-coding-manual) lists the available values for the `status` field (under D05).  This API is currently backed by data from CamSIS, exposing a view of data that is refreshed nightly.  

    The version of the OpenAPI document: v1alpha2
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501

import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Any, Dict, List, Optional, Tuple, Union
from typing_extensions import Annotated

from pydantic import Field, StrictStr
from typing import Optional
from typing_extensions import Annotated
from identitylib.student_client.models.paginated_results_student import PaginatedResultsStudent
from identitylib.student_client.models.student import Student

from identitylib.student_client.api_client import ApiClient, RequestSerialized
from identitylib.student_client.api_response import ApiResponse
from identitylib.student_client.rest import RESTResponseType


class StudentsApi:
    """NOTE: This class is auto generated by OpenAPI Generator
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    def __init__(self, api_client=None) -> None:
        if api_client is None:
            api_client = ApiClient.get_default()
        self.api_client = api_client


    @validate_call
    def get_v1alpha2_student_students_identifier_get(
        self,
        identifier: StrictStr,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> Student:
        """Get a single student

        Returns a single student based on the identifier provided. The identifier can be provided in the format `<value>@<scheme>`, if the scheme is omitted it shall be assumed that the scheme is `person.v1.student-records.university.identifiers.cam.ac.uk` (also know as the USN).   Currently this endpoint only supports querying by `person.v1.student-records.university.identifiers.cam.ac.uk` identifiers, but may be extended to allow querying by additional identifier schemes in future.

        :param identifier: (required)
        :type identifier: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_v1alpha2_student_students_identifier_get_serialize(
            identifier=identifier,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "Student",
            '400': "HTTPException",
            '404': "HTTPException",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def get_v1alpha2_student_students_identifier_get_with_http_info(
        self,
        identifier: StrictStr,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[Student]:
        """Get a single student

        Returns a single student based on the identifier provided. The identifier can be provided in the format `<value>@<scheme>`, if the scheme is omitted it shall be assumed that the scheme is `person.v1.student-records.university.identifiers.cam.ac.uk` (also know as the USN).   Currently this endpoint only supports querying by `person.v1.student-records.university.identifiers.cam.ac.uk` identifiers, but may be extended to allow querying by additional identifier schemes in future.

        :param identifier: (required)
        :type identifier: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_v1alpha2_student_students_identifier_get_serialize(
            identifier=identifier,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "Student",
            '400': "HTTPException",
            '404': "HTTPException",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def get_v1alpha2_student_students_identifier_get_without_preload_content(
        self,
        identifier: StrictStr,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get a single student

        Returns a single student based on the identifier provided. The identifier can be provided in the format `<value>@<scheme>`, if the scheme is omitted it shall be assumed that the scheme is `person.v1.student-records.university.identifiers.cam.ac.uk` (also know as the USN).   Currently this endpoint only supports querying by `person.v1.student-records.university.identifiers.cam.ac.uk` identifiers, but may be extended to allow querying by additional identifier schemes in future.

        :param identifier: (required)
        :type identifier: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_v1alpha2_student_students_identifier_get_serialize(
            identifier=identifier,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "Student",
            '400': "HTTPException",
            '404': "HTTPException",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _get_v1alpha2_student_students_identifier_get_serialize(
        self,
        identifier,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[str, Union[str, bytes]] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if identifier is not None:
            _path_params['identifier'] = identifier
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        _header_params['Accept'] = self.api_client.select_header_accept(
            [
                'application/json'
            ]
        )


        # authentication setting
        _auth_settings: List[str] = [
            'ApiGatewayOAuthClientCredentials'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/students/{identifier}',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def list_v1alpha2_recent_graduates_recent_graduates_get(
        self,
        affiliation: Annotated[Optional[StrictStr], Field(description="An affiliation to filter by, in the format `<value>@<scheme>`. When included only graduates with a matching affiliation are returned.")] = None,
        cursor: Annotated[Optional[StrictStr], Field(description="The cursor indicating a unique page of results - this should be auto generated on the `next` and `previous` fields and does not need to be manually added / updated.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> PaginatedResultsStudent:
        """List students who have completed a course within the last six months

        Returns students who have ended their affiliation with an institution or academic plan within the last six months, indicating that they have recently completed their studies. This is to allow downstream systems access to data on students who may in-practice continue to have an affiliation with the University, even though their course has technically ended.  Affiliations populated on each recent graduate are limited to the affiliations which have ended within the last six months. Graduates may have additional affiliations which are not represented here. These affiliations can be accessed by querying the `/students` endpoint.  Students who have either been removed or withdrawn from a course are not returned.  To avoid returning very large responses, this endpoint produces a paged response. Where there are additional results which cannot be returned on a single page, a `next` field will be populated with a url containing the next page of results. These `next` urls should be followed until a page is returned with no `next` field, indicating that there are no further results. Each page returned will hold a maximum of 1000 results.  Graduates can be filtered by affiliation, by providing an `affiliation` query parameter. This affiliation should be provided in the format `<value>@<scheme>`. Graduates will only be returned if their affiliation with an institution or academic plan has ended within the last six months.

        :param affiliation: An affiliation to filter by, in the format `<value>@<scheme>`. When included only graduates with a matching affiliation are returned.
        :type affiliation: str
        :param cursor: The cursor indicating a unique page of results - this should be auto generated on the `next` and `previous` fields and does not need to be manually added / updated.
        :type cursor: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._list_v1alpha2_recent_graduates_recent_graduates_get_serialize(
            affiliation=affiliation,
            cursor=cursor,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PaginatedResultsStudent",
            '400': "HTTPException",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def list_v1alpha2_recent_graduates_recent_graduates_get_with_http_info(
        self,
        affiliation: Annotated[Optional[StrictStr], Field(description="An affiliation to filter by, in the format `<value>@<scheme>`. When included only graduates with a matching affiliation are returned.")] = None,
        cursor: Annotated[Optional[StrictStr], Field(description="The cursor indicating a unique page of results - this should be auto generated on the `next` and `previous` fields and does not need to be manually added / updated.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[PaginatedResultsStudent]:
        """List students who have completed a course within the last six months

        Returns students who have ended their affiliation with an institution or academic plan within the last six months, indicating that they have recently completed their studies. This is to allow downstream systems access to data on students who may in-practice continue to have an affiliation with the University, even though their course has technically ended.  Affiliations populated on each recent graduate are limited to the affiliations which have ended within the last six months. Graduates may have additional affiliations which are not represented here. These affiliations can be accessed by querying the `/students` endpoint.  Students who have either been removed or withdrawn from a course are not returned.  To avoid returning very large responses, this endpoint produces a paged response. Where there are additional results which cannot be returned on a single page, a `next` field will be populated with a url containing the next page of results. These `next` urls should be followed until a page is returned with no `next` field, indicating that there are no further results. Each page returned will hold a maximum of 1000 results.  Graduates can be filtered by affiliation, by providing an `affiliation` query parameter. This affiliation should be provided in the format `<value>@<scheme>`. Graduates will only be returned if their affiliation with an institution or academic plan has ended within the last six months.

        :param affiliation: An affiliation to filter by, in the format `<value>@<scheme>`. When included only graduates with a matching affiliation are returned.
        :type affiliation: str
        :param cursor: The cursor indicating a unique page of results - this should be auto generated on the `next` and `previous` fields and does not need to be manually added / updated.
        :type cursor: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._list_v1alpha2_recent_graduates_recent_graduates_get_serialize(
            affiliation=affiliation,
            cursor=cursor,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PaginatedResultsStudent",
            '400': "HTTPException",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def list_v1alpha2_recent_graduates_recent_graduates_get_without_preload_content(
        self,
        affiliation: Annotated[Optional[StrictStr], Field(description="An affiliation to filter by, in the format `<value>@<scheme>`. When included only graduates with a matching affiliation are returned.")] = None,
        cursor: Annotated[Optional[StrictStr], Field(description="The cursor indicating a unique page of results - this should be auto generated on the `next` and `previous` fields and does not need to be manually added / updated.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """List students who have completed a course within the last six months

        Returns students who have ended their affiliation with an institution or academic plan within the last six months, indicating that they have recently completed their studies. This is to allow downstream systems access to data on students who may in-practice continue to have an affiliation with the University, even though their course has technically ended.  Affiliations populated on each recent graduate are limited to the affiliations which have ended within the last six months. Graduates may have additional affiliations which are not represented here. These affiliations can be accessed by querying the `/students` endpoint.  Students who have either been removed or withdrawn from a course are not returned.  To avoid returning very large responses, this endpoint produces a paged response. Where there are additional results which cannot be returned on a single page, a `next` field will be populated with a url containing the next page of results. These `next` urls should be followed until a page is returned with no `next` field, indicating that there are no further results. Each page returned will hold a maximum of 1000 results.  Graduates can be filtered by affiliation, by providing an `affiliation` query parameter. This affiliation should be provided in the format `<value>@<scheme>`. Graduates will only be returned if their affiliation with an institution or academic plan has ended within the last six months.

        :param affiliation: An affiliation to filter by, in the format `<value>@<scheme>`. When included only graduates with a matching affiliation are returned.
        :type affiliation: str
        :param cursor: The cursor indicating a unique page of results - this should be auto generated on the `next` and `previous` fields and does not need to be manually added / updated.
        :type cursor: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._list_v1alpha2_recent_graduates_recent_graduates_get_serialize(
            affiliation=affiliation,
            cursor=cursor,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PaginatedResultsStudent",
            '400': "HTTPException",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _list_v1alpha2_recent_graduates_recent_graduates_get_serialize(
        self,
        affiliation,
        cursor,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[str, Union[str, bytes]] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if affiliation is not None:
            
            _query_params.append(('affiliation', affiliation))
            
        if cursor is not None:
            
            _query_params.append(('cursor', cursor))
            
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        _header_params['Accept'] = self.api_client.select_header_accept(
            [
                'application/json'
            ]
        )


        # authentication setting
        _auth_settings: List[str] = [
            'ApiGatewayOAuthClientCredentials'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/recent-graduates',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def list_v1alpha2_students_students_get(
        self,
        affiliation: Annotated[Optional[StrictStr], Field(description="An affiliation to filter by, in the format `<value>@<scheme>`. When included only the students with a matching affiliation are returned.")] = None,
        cursor: Annotated[Optional[StrictStr], Field(description="The cursor indicating a unique page of results - this should be auto generated on the `next` and `previous` fields and does not need to be manually added / updated.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> PaginatedResultsStudent:
        """List students

        Lists all students held within the University Student management system, allowing basic filtering by affiliation.  To avoid returning very large responses, this endpoint produces a paged response. Where there are additional results which cannot be returned on a single page, a `next` field will be populated with a url containing the next page of results. These `next` urls should be followed until a page is returned with no `next` field, indicating that there are no further results. Each page returned will hold a maximum of 1000 results.  Students can be filtered by affiliation, by providing an `affiliation` query parameter. This affiliation should be provided in the format `<value>@<scheme>`.

        :param affiliation: An affiliation to filter by, in the format `<value>@<scheme>`. When included only the students with a matching affiliation are returned.
        :type affiliation: str
        :param cursor: The cursor indicating a unique page of results - this should be auto generated on the `next` and `previous` fields and does not need to be manually added / updated.
        :type cursor: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._list_v1alpha2_students_students_get_serialize(
            affiliation=affiliation,
            cursor=cursor,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PaginatedResultsStudent",
            '400': "HTTPException",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def list_v1alpha2_students_students_get_with_http_info(
        self,
        affiliation: Annotated[Optional[StrictStr], Field(description="An affiliation to filter by, in the format `<value>@<scheme>`. When included only the students with a matching affiliation are returned.")] = None,
        cursor: Annotated[Optional[StrictStr], Field(description="The cursor indicating a unique page of results - this should be auto generated on the `next` and `previous` fields and does not need to be manually added / updated.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[PaginatedResultsStudent]:
        """List students

        Lists all students held within the University Student management system, allowing basic filtering by affiliation.  To avoid returning very large responses, this endpoint produces a paged response. Where there are additional results which cannot be returned on a single page, a `next` field will be populated with a url containing the next page of results. These `next` urls should be followed until a page is returned with no `next` field, indicating that there are no further results. Each page returned will hold a maximum of 1000 results.  Students can be filtered by affiliation, by providing an `affiliation` query parameter. This affiliation should be provided in the format `<value>@<scheme>`.

        :param affiliation: An affiliation to filter by, in the format `<value>@<scheme>`. When included only the students with a matching affiliation are returned.
        :type affiliation: str
        :param cursor: The cursor indicating a unique page of results - this should be auto generated on the `next` and `previous` fields and does not need to be manually added / updated.
        :type cursor: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._list_v1alpha2_students_students_get_serialize(
            affiliation=affiliation,
            cursor=cursor,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PaginatedResultsStudent",
            '400': "HTTPException",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def list_v1alpha2_students_students_get_without_preload_content(
        self,
        affiliation: Annotated[Optional[StrictStr], Field(description="An affiliation to filter by, in the format `<value>@<scheme>`. When included only the students with a matching affiliation are returned.")] = None,
        cursor: Annotated[Optional[StrictStr], Field(description="The cursor indicating a unique page of results - this should be auto generated on the `next` and `previous` fields and does not need to be manually added / updated.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """List students

        Lists all students held within the University Student management system, allowing basic filtering by affiliation.  To avoid returning very large responses, this endpoint produces a paged response. Where there are additional results which cannot be returned on a single page, a `next` field will be populated with a url containing the next page of results. These `next` urls should be followed until a page is returned with no `next` field, indicating that there are no further results. Each page returned will hold a maximum of 1000 results.  Students can be filtered by affiliation, by providing an `affiliation` query parameter. This affiliation should be provided in the format `<value>@<scheme>`.

        :param affiliation: An affiliation to filter by, in the format `<value>@<scheme>`. When included only the students with a matching affiliation are returned.
        :type affiliation: str
        :param cursor: The cursor indicating a unique page of results - this should be auto generated on the `next` and `previous` fields and does not need to be manually added / updated.
        :type cursor: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._list_v1alpha2_students_students_get_serialize(
            affiliation=affiliation,
            cursor=cursor,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PaginatedResultsStudent",
            '400': "HTTPException",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _list_v1alpha2_students_students_get_serialize(
        self,
        affiliation,
        cursor,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[str, Union[str, bytes]] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if affiliation is not None:
            
            _query_params.append(('affiliation', affiliation))
            
        if cursor is not None:
            
            _query_params.append(('cursor', cursor))
            
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        _header_params['Accept'] = self.api_client.select_header_accept(
            [
                'application/json'
            ]
        )


        # authentication setting
        _auth_settings: List[str] = [
            'ApiGatewayOAuthClientCredentials'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/students',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )


