"""
Profiling API namespace.

AUTO-GENERATED by scripts/generate_sdk.py - DO NOT EDIT MANUALLY!
Regenerate with: python scripts/generate_sdk.py --category profiling
"""
from __future__ import annotations

from typing import Any, Dict, Optional

from ._base import AsyncBaseAPI, BaseAPI


class ProfilingAPI(BaseAPI):
    """Profiling namespace: archive, check_suitability, convert_answers, create_profile, get_current, get_profile, list, questionnaire, update, validate_answers."""

    def archive(
        self,
        *,
        profile_id: str,
        options: Optional[Dict[str, Any]] = None,
        context: Optional[Dict[str, Any]] = None,
    ) -> Any:
        """Archive profile

        Args:
        profile_id: Profile ID"""
        params: Dict[str, Any] = {}
        params["profile_id"] = profile_id
        return self._call("profiling.archive", params=params, options=options, context=context)

    def check_suitability(
        self,
        *,
        client_id: str,
        id: str,
        options: Optional[Dict[str, Any]] = None,
        context: Optional[Dict[str, Any]] = None,
    ) -> Any:
        """Check suitability

        Check if portfolio is suitable for client profile.

        Args:
        client_id: Client ID
        id: Portfolio ID"""
        params: Dict[str, Any] = {}
        params["client_id"] = client_id
        params["id"] = id
        return self._call("profiling.check_suitability", params=params, options=options, context=context)

    def convert_answers(
        self,
        *,
        answers: Dict[str, Any],
        options: Optional[Dict[str, Any]] = None,
        context: Optional[Dict[str, Any]] = None,
    ) -> Any:
        """Convert answers to profile

        Calculate risk profile from answers.

        Args:
        answers: Questionnaire answers"""
        params: Dict[str, Any] = {}
        params["answers"] = answers
        return self._call("profiling.convert_answers", params=params, options=options, context=context)

    def create_profile(
        self,
        *,
        client_id: str,
        answers: Dict[str, Any],
        options: Optional[Dict[str, Any]] = None,
        context: Optional[Dict[str, Any]] = None,
    ) -> Any:
        """Create client profile

        Args:
        client_id: Client ID
        answers: Questionnaire answers"""
        params: Dict[str, Any] = {}
        params["client_id"] = client_id
        params["answers"] = answers
        return self._call("profiling.create_profile", params=params, options=options, context=context)

    def get_current(
        self,
        *,
        client_id: str,
        options: Optional[Dict[str, Any]] = None,
        context: Optional[Dict[str, Any]] = None,
    ) -> Any:
        """Get current profile

        Get client's current active profile.

        Args:
        client_id: Client ID"""
        params: Dict[str, Any] = {}
        params["client_id"] = client_id
        return self._call("profiling.get_current", params=params, options=options, context=context)

    def get_profile(
        self,
        *,
        profile_id: str,
        options: Optional[Dict[str, Any]] = None,
        context: Optional[Dict[str, Any]] = None,
    ) -> Any:
        """Get profile by ID

        Args:
        profile_id: Profile ID"""
        params: Dict[str, Any] = {}
        params["profile_id"] = profile_id
        return self._call("profiling.get_profile", params=params, options=options, context=context)

    def list(
        self,
        *,
        client_id: str,
        include_archived: Optional[bool] = False,
        options: Optional[Dict[str, Any]] = None,
        context: Optional[Dict[str, Any]] = None,
    ) -> Any:
        """List profiles

        List all profiles for a client.

        Args:
        client_id: Client ID
        include_archived: Include archived"""
        params: Dict[str, Any] = {}
        params["client_id"] = client_id
        if include_archived is not None:
            params["include_archived"] = include_archived
        return self._call("profiling.list", params=params, options=options, context=context)

    def questionnaire(
        self,
        *,
        version: Optional[str] = "latest",
        options: Optional[Dict[str, Any]] = None,
        context: Optional[Dict[str, Any]] = None,
    ) -> Any:
        """Get MiFID questionnaire

        Get questionnaire template.

        Args:
        version: Questionnaire version"""
        params: Dict[str, Any] = {}
        if version is not None:
            params["version"] = version
        return self._call("profiling.questionnaire", params=params, options=options, context=context)

    def update(
        self,
        *,
        profile_id: str,
        answers: Optional[Dict[str, Any]] = None,
        options: Optional[Dict[str, Any]] = None,
        context: Optional[Dict[str, Any]] = None,
    ) -> Any:
        """Update profile

        Args:
        profile_id: Profile ID
        answers: New answers"""
        params: Dict[str, Any] = {}
        params["profile_id"] = profile_id
        if answers is not None:
            params["answers"] = answers
        return self._call("profiling.update", params=params, options=options, context=context)

    def validate_answers(
        self,
        *,
        answers: Dict[str, Any],
        options: Optional[Dict[str, Any]] = None,
        context: Optional[Dict[str, Any]] = None,
    ) -> Any:
        """Validate answers

        Validate questionnaire answers.

        Args:
        answers: Questionnaire answers"""
        params: Dict[str, Any] = {}
        params["answers"] = answers
        return self._call("profiling.validate_answers", params=params, options=options, context=context)



class AsyncProfilingAPI(AsyncBaseAPI):
    """Profiling namespace: archive, check_suitability, convert_answers, create_profile, get_current, get_profile, list, questionnaire, update, validate_answers."""

    async def archive(
        self,
        *,
        profile_id: str,
        options: Optional[Dict[str, Any]] = None,
        context: Optional[Dict[str, Any]] = None,
    ) -> Any:
        """Archive profile

        Args:
        profile_id: Profile ID"""
        params: Dict[str, Any] = {}
        params["profile_id"] = profile_id
        return await self._call("profiling.archive", params=params, options=options, context=context)

    async def check_suitability(
        self,
        *,
        client_id: str,
        id: str,
        options: Optional[Dict[str, Any]] = None,
        context: Optional[Dict[str, Any]] = None,
    ) -> Any:
        """Check suitability

        Check if portfolio is suitable for client profile.

        Args:
        client_id: Client ID
        id: Portfolio ID"""
        params: Dict[str, Any] = {}
        params["client_id"] = client_id
        params["id"] = id
        return await self._call("profiling.check_suitability", params=params, options=options, context=context)

    async def convert_answers(
        self,
        *,
        answers: Dict[str, Any],
        options: Optional[Dict[str, Any]] = None,
        context: Optional[Dict[str, Any]] = None,
    ) -> Any:
        """Convert answers to profile

        Calculate risk profile from answers.

        Args:
        answers: Questionnaire answers"""
        params: Dict[str, Any] = {}
        params["answers"] = answers
        return await self._call("profiling.convert_answers", params=params, options=options, context=context)

    async def create_profile(
        self,
        *,
        client_id: str,
        answers: Dict[str, Any],
        options: Optional[Dict[str, Any]] = None,
        context: Optional[Dict[str, Any]] = None,
    ) -> Any:
        """Create client profile

        Args:
        client_id: Client ID
        answers: Questionnaire answers"""
        params: Dict[str, Any] = {}
        params["client_id"] = client_id
        params["answers"] = answers
        return await self._call("profiling.create_profile", params=params, options=options, context=context)

    async def get_current(
        self,
        *,
        client_id: str,
        options: Optional[Dict[str, Any]] = None,
        context: Optional[Dict[str, Any]] = None,
    ) -> Any:
        """Get current profile

        Get client's current active profile.

        Args:
        client_id: Client ID"""
        params: Dict[str, Any] = {}
        params["client_id"] = client_id
        return await self._call("profiling.get_current", params=params, options=options, context=context)

    async def get_profile(
        self,
        *,
        profile_id: str,
        options: Optional[Dict[str, Any]] = None,
        context: Optional[Dict[str, Any]] = None,
    ) -> Any:
        """Get profile by ID

        Args:
        profile_id: Profile ID"""
        params: Dict[str, Any] = {}
        params["profile_id"] = profile_id
        return await self._call("profiling.get_profile", params=params, options=options, context=context)

    async def list(
        self,
        *,
        client_id: str,
        include_archived: Optional[bool] = False,
        options: Optional[Dict[str, Any]] = None,
        context: Optional[Dict[str, Any]] = None,
    ) -> Any:
        """List profiles

        List all profiles for a client.

        Args:
        client_id: Client ID
        include_archived: Include archived"""
        params: Dict[str, Any] = {}
        params["client_id"] = client_id
        if include_archived is not None:
            params["include_archived"] = include_archived
        return await self._call("profiling.list", params=params, options=options, context=context)

    async def questionnaire(
        self,
        *,
        version: Optional[str] = "latest",
        options: Optional[Dict[str, Any]] = None,
        context: Optional[Dict[str, Any]] = None,
    ) -> Any:
        """Get MiFID questionnaire

        Get questionnaire template.

        Args:
        version: Questionnaire version"""
        params: Dict[str, Any] = {}
        if version is not None:
            params["version"] = version
        return await self._call("profiling.questionnaire", params=params, options=options, context=context)

    async def update(
        self,
        *,
        profile_id: str,
        answers: Optional[Dict[str, Any]] = None,
        options: Optional[Dict[str, Any]] = None,
        context: Optional[Dict[str, Any]] = None,
    ) -> Any:
        """Update profile

        Args:
        profile_id: Profile ID
        answers: New answers"""
        params: Dict[str, Any] = {}
        params["profile_id"] = profile_id
        if answers is not None:
            params["answers"] = answers
        return await self._call("profiling.update", params=params, options=options, context=context)

    async def validate_answers(
        self,
        *,
        answers: Dict[str, Any],
        options: Optional[Dict[str, Any]] = None,
        context: Optional[Dict[str, Any]] = None,
    ) -> Any:
        """Validate answers

        Validate questionnaire answers.

        Args:
        answers: Questionnaire answers"""
        params: Dict[str, Any] = {}
        params["answers"] = answers
        return await self._call("profiling.validate_answers", params=params, options=options, context=context)


