"""
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, List, Optional, Union

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,
        client_id: Optional[str] = None,
        id: Optional[str] = None,
        options: Optional[Dict[str, Any]] = None,
        context: Optional[Dict[str, Any]] = None,
    ) -> Any:
        """Archive profile

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

    def check_suitability(
        self,
        *,
        client_id: str,
        identifiers: Optional[Union[str, List[str]]] = None,
        portfolio_id: Optional[str] = None,
        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"""
        _payload: Dict[str, Any] = {}
        _payload["client_id"] = client_id
        if identifiers is not None:
            _payload["identifiers"] = identifiers
        if portfolio_id is not None:
            _payload["portfolio_id"] = portfolio_id
        return self._call("profiling.check_suitability", params=_payload, options=options, context=context)

    def convert_answers(
        self,
        *,
        answers: Dict[str, Any],
        language: Optional[str] = None,
        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"""
        _payload: Dict[str, Any] = {}
        _payload["answers"] = answers
        if language is not None:
            _payload["language"] = language
        return self._call("profiling.convert_answers", params=_payload, options=options, context=context)

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

        Args:
        client_id: Client ID"""
        _payload: Dict[str, Any] = {}
        _payload["client_id"] = client_id
        if classification is not None:
            _payload["classification"] = classification
        if questionnaire is not None:
            _payload["questionnaire"] = questionnaire
        if visibility is not None:
            _payload["visibility"] = visibility
        return self._call("profiling.create_profile", params=_payload, 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"""
        _payload: Dict[str, Any] = {}
        _payload["client_id"] = client_id
        return self._call("profiling.get_current", params=_payload, options=options, context=context)

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

        Args:
        profile_id: Profile ID"""
        _payload: Dict[str, Any] = {}
        _payload["profile_id"] = profile_id
        if client_id is not None:
            _payload["client_id"] = client_id
        if id is not None:
            _payload["id"] = id
        if version is not None:
            _payload["version"] = version
        return self._call("profiling.get_profile", params=_payload, options=options, context=context)

    def list(
        self,
        *,
        client_id: str,
        current_only: Optional[str] = None,
        limit: Optional[int] = None,
        offset: Optional[int] = None,
        status: Optional[str] = None,
        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"""
        _payload: Dict[str, Any] = {}
        _payload["client_id"] = client_id
        if current_only is not None:
            _payload["current_only"] = current_only
        if limit is not None:
            _payload["limit"] = limit
        if offset is not None:
            _payload["offset"] = offset
        if status is not None:
            _payload["status"] = status
        return self._call("profiling.list", params=_payload, options=options, context=context)

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

        Get questionnaire template."""
        _payload: Dict[str, Any] = {}
        if flat is not None:
            _payload["flat"] = flat
        if language is not None:
            _payload["language"] = language
        return self._call("profiling.questionnaire", params=_payload, options=options, context=context)

    def update(
        self,
        *,
        classification: Optional[str] = None,
        client_id: Optional[str] = None,
        questionnaire: Optional[str] = None,
        options: Optional[Dict[str, Any]] = None,
        context: Optional[Dict[str, Any]] = None,
    ) -> Any:
        """Update profile"""
        _payload: Dict[str, Any] = {}
        if classification is not None:
            _payload["classification"] = classification
        if client_id is not None:
            _payload["client_id"] = client_id
        if questionnaire is not None:
            _payload["questionnaire"] = questionnaire
        return self._call("profiling.update", params=_payload, 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"""
        _payload: Dict[str, Any] = {}
        _payload["answers"] = answers
        return self._call("profiling.validate_answers", params=_payload, 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,
        client_id: Optional[str] = None,
        id: Optional[str] = None,
        options: Optional[Dict[str, Any]] = None,
        context: Optional[Dict[str, Any]] = None,
    ) -> Any:
        """Archive profile

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

    async def check_suitability(
        self,
        *,
        client_id: str,
        identifiers: Optional[Union[str, List[str]]] = None,
        portfolio_id: Optional[str] = None,
        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"""
        _payload: Dict[str, Any] = {}
        _payload["client_id"] = client_id
        if identifiers is not None:
            _payload["identifiers"] = identifiers
        if portfolio_id is not None:
            _payload["portfolio_id"] = portfolio_id
        return await self._call("profiling.check_suitability", params=_payload, options=options, context=context)

    async def convert_answers(
        self,
        *,
        answers: Dict[str, Any],
        language: Optional[str] = None,
        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"""
        _payload: Dict[str, Any] = {}
        _payload["answers"] = answers
        if language is not None:
            _payload["language"] = language
        return await self._call("profiling.convert_answers", params=_payload, options=options, context=context)

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

        Args:
        client_id: Client ID"""
        _payload: Dict[str, Any] = {}
        _payload["client_id"] = client_id
        if classification is not None:
            _payload["classification"] = classification
        if questionnaire is not None:
            _payload["questionnaire"] = questionnaire
        if visibility is not None:
            _payload["visibility"] = visibility
        return await self._call("profiling.create_profile", params=_payload, 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"""
        _payload: Dict[str, Any] = {}
        _payload["client_id"] = client_id
        return await self._call("profiling.get_current", params=_payload, options=options, context=context)

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

        Args:
        profile_id: Profile ID"""
        _payload: Dict[str, Any] = {}
        _payload["profile_id"] = profile_id
        if client_id is not None:
            _payload["client_id"] = client_id
        if id is not None:
            _payload["id"] = id
        if version is not None:
            _payload["version"] = version
        return await self._call("profiling.get_profile", params=_payload, options=options, context=context)

    async def list(
        self,
        *,
        client_id: str,
        current_only: Optional[str] = None,
        limit: Optional[int] = None,
        offset: Optional[int] = None,
        status: Optional[str] = None,
        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"""
        _payload: Dict[str, Any] = {}
        _payload["client_id"] = client_id
        if current_only is not None:
            _payload["current_only"] = current_only
        if limit is not None:
            _payload["limit"] = limit
        if offset is not None:
            _payload["offset"] = offset
        if status is not None:
            _payload["status"] = status
        return await self._call("profiling.list", params=_payload, options=options, context=context)

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

        Get questionnaire template."""
        _payload: Dict[str, Any] = {}
        if flat is not None:
            _payload["flat"] = flat
        if language is not None:
            _payload["language"] = language
        return await self._call("profiling.questionnaire", params=_payload, options=options, context=context)

    async def update(
        self,
        *,
        classification: Optional[str] = None,
        client_id: Optional[str] = None,
        questionnaire: Optional[str] = None,
        options: Optional[Dict[str, Any]] = None,
        context: Optional[Dict[str, Any]] = None,
    ) -> Any:
        """Update profile"""
        _payload: Dict[str, Any] = {}
        if classification is not None:
            _payload["classification"] = classification
        if client_id is not None:
            _payload["client_id"] = client_id
        if questionnaire is not None:
            _payload["questionnaire"] = questionnaire
        return await self._call("profiling.update", params=_payload, 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"""
        _payload: Dict[str, Any] = {}
        _payload["answers"] = answers
        return await self._call("profiling.validate_answers", params=_payload, options=options, context=context)


