# coding: utf-8

"""
    Student Activities API

    API for managing student activities and tool analytics using the new schema

    The version of the OpenAPI document: 1.0.0
    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 StrictInt, StrictStr
from typing import Any, Dict, Optional
from gauntlet_test_ti.models.get_all_weekly_activities200_response import GetAllWeeklyActivities200Response

from gauntlet_test_ti.api_client import ApiClient, RequestSerialized
from gauntlet_test_ti.api_response import ApiResponse
from gauntlet_test_ti.rest import RESTResponseType


class DefaultApi:
    """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_all_weekly_activities(
        self,
        week_number: StrictInt,
        s3_key: Optional[StrictStr] = None,
        next_index: Optional[StrictInt] = 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__: Optional[StrictStr] = None,
    ) -> GetAllWeeklyActivities200Response:
        """Get all weekly activities for a specific week

        Retrieves all activities for a given week using the new schema

        :param week_number: (required)
        :type week_number: int
        :param s3_key:
        :type s3_key: str
        :param next_index:
        :type next_index: int
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_all_weekly_activities_serialize(
            week_number=week_number,
            s3_key=s3_key,
            next_index=next_index,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GetAllWeeklyActivities200Response",
        }
        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_all_weekly_activities_with_http_info(
        self,
        week_number: StrictInt,
        s3_key: Optional[StrictStr] = None,
        next_index: Optional[StrictInt] = 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__: Optional[StrictStr] = None,
    ) -> ApiResponse[GetAllWeeklyActivities200Response]:
        """Get all weekly activities for a specific week

        Retrieves all activities for a given week using the new schema

        :param week_number: (required)
        :type week_number: int
        :param s3_key:
        :type s3_key: str
        :param next_index:
        :type next_index: int
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_all_weekly_activities_serialize(
            week_number=week_number,
            s3_key=s3_key,
            next_index=next_index,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GetAllWeeklyActivities200Response",
        }
        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_all_weekly_activities_without_preload_content(
        self,
        week_number: StrictInt,
        s3_key: Optional[StrictStr] = None,
        next_index: Optional[StrictInt] = 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__: Optional[StrictStr] = None,
    ) -> RESTResponseType:
        """Get all weekly activities for a specific week

        Retrieves all activities for a given week using the new schema

        :param week_number: (required)
        :type week_number: int
        :param s3_key:
        :type s3_key: str
        :param next_index:
        :type next_index: int
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_all_weekly_activities_serialize(
            week_number=week_number,
            s3_key=s3_key,
            next_index=next_index,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GetAllWeeklyActivities200Response",
        }
        response_data = self.api_client.call_api(
            *_param,
            request_timeout__=request_timeout__
        )
        return response_data.response


    def _get_all_weekly_activities_serialize(
        self,
        week_number,
        s3_key,
        next_index,
        request_auth__,
        content_type__,
        headers__,
        host__,
    ) -> RequestSerialized:


        _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, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if week_number is not None:
            _path_params['week_number'] = week_number
        # process the query parameters
        if s3_key is not None:
            
            _query_params.append(('s3_key', s3_key))
            
        if next_index is not None:
            
            _query_params.append(('next_index', next_index))
            
        # process the header parameters
        # process the form parameters
        # process the body parameter


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


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

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/api/v1/weeks/{week_number}/activities',
            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 get_student_activities(
        self,
        student_id: StrictStr,
        week_number: StrictInt,
        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__: Optional[StrictStr] = None,
    ) -> object:
        """Get student activities for a specific student and week

        Retrieves activities for a given student during a specified week using the new schema

        :param student_id: (required)
        :type student_id: str
        :param week_number: (required)
        :type week_number: int
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_student_activities_serialize(
            student_id=student_id,
            week_number=week_number,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        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_student_activities_with_http_info(
        self,
        student_id: StrictStr,
        week_number: StrictInt,
        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__: Optional[StrictStr] = None,
    ) -> ApiResponse[object]:
        """Get student activities for a specific student and week

        Retrieves activities for a given student during a specified week using the new schema

        :param student_id: (required)
        :type student_id: str
        :param week_number: (required)
        :type week_number: int
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_student_activities_serialize(
            student_id=student_id,
            week_number=week_number,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        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_student_activities_without_preload_content(
        self,
        student_id: StrictStr,
        week_number: StrictInt,
        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__: Optional[StrictStr] = None,
    ) -> RESTResponseType:
        """Get student activities for a specific student and week

        Retrieves activities for a given student during a specified week using the new schema

        :param student_id: (required)
        :type student_id: str
        :param week_number: (required)
        :type week_number: int
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_student_activities_serialize(
            student_id=student_id,
            week_number=week_number,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = self.api_client.call_api(
            *_param,
            request_timeout__=request_timeout__
        )
        return response_data.response


    def _get_student_activities_serialize(
        self,
        student_id,
        week_number,
        request_auth__,
        content_type__,
        headers__,
        host__,
    ) -> RequestSerialized:


        _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, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

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


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


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

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/api/v1/students/{student_id}/week/{week_number}',
            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 get_tool_analytics(
        self,
        tool_name: StrictStr,
        week_number: Optional[StrictInt] = None,
        s3_key: Optional[StrictStr] = None,
        next_index: Optional[StrictInt] = 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__: Optional[StrictStr] = None,
    ) -> object:
        """Get analytics for a specific tool

        Retrieves analytics data for a specified tool using the new schema

        :param tool_name: (required)
        :type tool_name: str
        :param week_number:
        :type week_number: int
        :param s3_key:
        :type s3_key: str
        :param next_index:
        :type next_index: int
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_tool_analytics_serialize(
            tool_name=tool_name,
            week_number=week_number,
            s3_key=s3_key,
            next_index=next_index,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        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_tool_analytics_with_http_info(
        self,
        tool_name: StrictStr,
        week_number: Optional[StrictInt] = None,
        s3_key: Optional[StrictStr] = None,
        next_index: Optional[StrictInt] = 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__: Optional[StrictStr] = None,
    ) -> ApiResponse[object]:
        """Get analytics for a specific tool

        Retrieves analytics data for a specified tool using the new schema

        :param tool_name: (required)
        :type tool_name: str
        :param week_number:
        :type week_number: int
        :param s3_key:
        :type s3_key: str
        :param next_index:
        :type next_index: int
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_tool_analytics_serialize(
            tool_name=tool_name,
            week_number=week_number,
            s3_key=s3_key,
            next_index=next_index,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        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_tool_analytics_without_preload_content(
        self,
        tool_name: StrictStr,
        week_number: Optional[StrictInt] = None,
        s3_key: Optional[StrictStr] = None,
        next_index: Optional[StrictInt] = 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__: Optional[StrictStr] = None,
    ) -> RESTResponseType:
        """Get analytics for a specific tool

        Retrieves analytics data for a specified tool using the new schema

        :param tool_name: (required)
        :type tool_name: str
        :param week_number:
        :type week_number: int
        :param s3_key:
        :type s3_key: str
        :param next_index:
        :type next_index: int
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_tool_analytics_serialize(
            tool_name=tool_name,
            week_number=week_number,
            s3_key=s3_key,
            next_index=next_index,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = self.api_client.call_api(
            *_param,
            request_timeout__=request_timeout__
        )
        return response_data.response


    def _get_tool_analytics_serialize(
        self,
        tool_name,
        week_number,
        s3_key,
        next_index,
        request_auth__,
        content_type__,
        headers__,
        host__,
    ) -> RequestSerialized:


        _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, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if tool_name is not None:
            _path_params['tool_name'] = tool_name
        # process the query parameters
        if week_number is not None:
            
            _query_params.append(('week_number', week_number))
            
        if s3_key is not None:
            
            _query_params.append(('s3_key', s3_key))
            
        if next_index is not None:
            
            _query_params.append(('next_index', next_index))
            
        # process the header parameters
        # process the form parameters
        # process the body parameter


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


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

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/api/v1/tools/{tool_name}/analytics',
            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__
        )


