# This file was auto-generated by Fern from our API Definition.

import datetime as dt
import typing

from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.request_options import RequestOptions
from ..types.audit_log_response import AuditLogResponse
from ..types.data_export_response import DataExportResponse
from ..types.pii_settings_response import PiiSettingsResponse
from ..types.retention_policy_response import RetentionPolicyResponse
from ..types.session_consent_response import SessionConsentResponse
from .raw_client import AsyncRawMeetingBuddyComplianceClient, RawMeetingBuddyComplianceClient

# this is used as the default value for optional parameters
OMIT = typing.cast(typing.Any, ...)


class MeetingBuddyComplianceClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawMeetingBuddyComplianceClient(client_wrapper=client_wrapper)

    @property
    def with_raw_response(self) -> RawMeetingBuddyComplianceClient:
        """
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawMeetingBuddyComplianceClient
        """
        return self._raw_client

    def get_retention_policy(
        self, *, request_options: typing.Optional[RequestOptions] = None
    ) -> RetentionPolicyResponse:
        """
        Get the organization's data retention policy.

        Parameters
        ----------
        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        RetentionPolicyResponse
            Successful Response

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.meeting_buddy_compliance.get_retention_policy()
        """
        _response = self._raw_client.get_retention_policy(request_options=request_options)
        return _response.data

    def set_retention_policy(
        self,
        *,
        retention_days: int,
        policy_type: typing.Optional[str] = OMIT,
        apply_to: typing.Optional[str] = OMIT,
        grace_period_days: typing.Optional[int] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> RetentionPolicyResponse:
        """
        Set or update the organization's data retention policy.

        Parameters
        ----------
        retention_days : int
            Retention period in days (0, 30, 60, 90, 180, 365)

        policy_type : typing.Optional[str]
            Policy type: standard, strict, regulatory

        apply_to : typing.Optional[str]
            Comma-separated content types to apply policy to

        grace_period_days : typing.Optional[int]
            Grace period before permanent deletion

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        RetentionPolicyResponse
            Successful Response

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.meeting_buddy_compliance.set_retention_policy(
            retention_days=1,
        )
        """
        _response = self._raw_client.set_retention_policy(
            retention_days=retention_days,
            policy_type=policy_type,
            apply_to=apply_to,
            grace_period_days=grace_period_days,
            request_options=request_options,
        )
        return _response.data

    def set_pii_settings(
        self,
        *,
        redaction_mode: str,
        categories: typing.Optional[typing.Sequence[str]] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> PiiSettingsResponse:
        """
        Configure PII redaction settings for the organization.

        Parameters
        ----------
        redaction_mode : str
            Redaction mode: none, on_export, always

        categories : typing.Optional[typing.Sequence[str]]
            PII categories: emails, phone_numbers, credit_cards, ssns, addresses

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        PiiSettingsResponse
            Successful Response

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.meeting_buddy_compliance.set_pii_settings(
            redaction_mode="redaction_mode",
        )
        """
        _response = self._raw_client.set_pii_settings(
            redaction_mode=redaction_mode, categories=categories, request_options=request_options
        )
        return _response.data

    def query_audit_log(
        self,
        *,
        action_type: typing.Optional[str] = None,
        resource_type: typing.Optional[str] = None,
        date_from: typing.Optional[dt.datetime] = None,
        date_to: typing.Optional[dt.datetime] = None,
        skip: typing.Optional[int] = None,
        limit: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AuditLogResponse:
        """
        Query the Meeting Buddy audit trail.

        Parameters
        ----------
        action_type : typing.Optional[str]
            Filter by action type

        resource_type : typing.Optional[str]
            Filter by resource type

        date_from : typing.Optional[dt.datetime]
            Start date filter

        date_to : typing.Optional[dt.datetime]
            End date filter

        skip : typing.Optional[int]
            Number of entries to skip

        limit : typing.Optional[int]
            Maximum entries to return

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        AuditLogResponse
            Successful Response

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.meeting_buddy_compliance.query_audit_log()
        """
        _response = self._raw_client.query_audit_log(
            action_type=action_type,
            resource_type=resource_type,
            date_from=date_from,
            date_to=date_to,
            skip=skip,
            limit=limit,
            request_options=request_options,
        )
        return _response.data

    def export_user_data(
        self, *, user_id: str, request_options: typing.Optional[RequestOptions] = None
    ) -> DataExportResponse:
        """
        Export all Meeting Buddy data for a user (GDPR compliance).

        Parameters
        ----------
        user_id : str
            User ID to export data for

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        DataExportResponse
            Successful Response

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.meeting_buddy_compliance.export_user_data(
            user_id="user_id",
        )
        """
        _response = self._raw_client.export_user_data(user_id=user_id, request_options=request_options)
        return _response.data

    def get_session_consent(
        self, session_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> SessionConsentResponse:
        """
        Get consent status for all participants in a session.

        Parameters
        ----------
        session_id : str

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        SessionConsentResponse
            Successful Response

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.meeting_buddy_compliance.get_session_consent(
            session_id="session_id",
        )
        """
        _response = self._raw_client.get_session_consent(session_id, request_options=request_options)
        return _response.data


class AsyncMeetingBuddyComplianceClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawMeetingBuddyComplianceClient(client_wrapper=client_wrapper)

    @property
    def with_raw_response(self) -> AsyncRawMeetingBuddyComplianceClient:
        """
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawMeetingBuddyComplianceClient
        """
        return self._raw_client

    async def get_retention_policy(
        self, *, request_options: typing.Optional[RequestOptions] = None
    ) -> RetentionPolicyResponse:
        """
        Get the organization's data retention policy.

        Parameters
        ----------
        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        RetentionPolicyResponse
            Successful Response

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.meeting_buddy_compliance.get_retention_policy()


        asyncio.run(main())
        """
        _response = await self._raw_client.get_retention_policy(request_options=request_options)
        return _response.data

    async def set_retention_policy(
        self,
        *,
        retention_days: int,
        policy_type: typing.Optional[str] = OMIT,
        apply_to: typing.Optional[str] = OMIT,
        grace_period_days: typing.Optional[int] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> RetentionPolicyResponse:
        """
        Set or update the organization's data retention policy.

        Parameters
        ----------
        retention_days : int
            Retention period in days (0, 30, 60, 90, 180, 365)

        policy_type : typing.Optional[str]
            Policy type: standard, strict, regulatory

        apply_to : typing.Optional[str]
            Comma-separated content types to apply policy to

        grace_period_days : typing.Optional[int]
            Grace period before permanent deletion

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        RetentionPolicyResponse
            Successful Response

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.meeting_buddy_compliance.set_retention_policy(
                retention_days=1,
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.set_retention_policy(
            retention_days=retention_days,
            policy_type=policy_type,
            apply_to=apply_to,
            grace_period_days=grace_period_days,
            request_options=request_options,
        )
        return _response.data

    async def set_pii_settings(
        self,
        *,
        redaction_mode: str,
        categories: typing.Optional[typing.Sequence[str]] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> PiiSettingsResponse:
        """
        Configure PII redaction settings for the organization.

        Parameters
        ----------
        redaction_mode : str
            Redaction mode: none, on_export, always

        categories : typing.Optional[typing.Sequence[str]]
            PII categories: emails, phone_numbers, credit_cards, ssns, addresses

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        PiiSettingsResponse
            Successful Response

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.meeting_buddy_compliance.set_pii_settings(
                redaction_mode="redaction_mode",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.set_pii_settings(
            redaction_mode=redaction_mode, categories=categories, request_options=request_options
        )
        return _response.data

    async def query_audit_log(
        self,
        *,
        action_type: typing.Optional[str] = None,
        resource_type: typing.Optional[str] = None,
        date_from: typing.Optional[dt.datetime] = None,
        date_to: typing.Optional[dt.datetime] = None,
        skip: typing.Optional[int] = None,
        limit: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AuditLogResponse:
        """
        Query the Meeting Buddy audit trail.

        Parameters
        ----------
        action_type : typing.Optional[str]
            Filter by action type

        resource_type : typing.Optional[str]
            Filter by resource type

        date_from : typing.Optional[dt.datetime]
            Start date filter

        date_to : typing.Optional[dt.datetime]
            End date filter

        skip : typing.Optional[int]
            Number of entries to skip

        limit : typing.Optional[int]
            Maximum entries to return

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        AuditLogResponse
            Successful Response

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.meeting_buddy_compliance.query_audit_log()


        asyncio.run(main())
        """
        _response = await self._raw_client.query_audit_log(
            action_type=action_type,
            resource_type=resource_type,
            date_from=date_from,
            date_to=date_to,
            skip=skip,
            limit=limit,
            request_options=request_options,
        )
        return _response.data

    async def export_user_data(
        self, *, user_id: str, request_options: typing.Optional[RequestOptions] = None
    ) -> DataExportResponse:
        """
        Export all Meeting Buddy data for a user (GDPR compliance).

        Parameters
        ----------
        user_id : str
            User ID to export data for

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        DataExportResponse
            Successful Response

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.meeting_buddy_compliance.export_user_data(
                user_id="user_id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.export_user_data(user_id=user_id, request_options=request_options)
        return _response.data

    async def get_session_consent(
        self, session_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> SessionConsentResponse:
        """
        Get consent status for all participants in a session.

        Parameters
        ----------
        session_id : str

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        SessionConsentResponse
            Successful Response

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.meeting_buddy_compliance.get_session_consent(
                session_id="session_id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.get_session_consent(session_id, request_options=request_options)
        return _response.data
