# 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 .raw_client import AsyncRawEntitlementsClient, RawEntitlementsClient
from .types.count_company_overrides_response import CountCompanyOverridesResponse
from .types.count_feature_companies_response import CountFeatureCompaniesResponse
from .types.count_feature_usage_response import CountFeatureUsageResponse
from .types.count_feature_users_response import CountFeatureUsersResponse
from .types.count_plan_entitlements_response import CountPlanEntitlementsResponse
from .types.create_company_override_request_body_metric_period import CreateCompanyOverrideRequestBodyMetricPeriod
from .types.create_company_override_request_body_metric_period_month_reset import (
    CreateCompanyOverrideRequestBodyMetricPeriodMonthReset,
)
from .types.create_company_override_request_body_value_type import CreateCompanyOverrideRequestBodyValueType
from .types.create_company_override_response import CreateCompanyOverrideResponse
from .types.create_plan_entitlement_request_body_metric_period import CreatePlanEntitlementRequestBodyMetricPeriod
from .types.create_plan_entitlement_request_body_metric_period_month_reset import (
    CreatePlanEntitlementRequestBodyMetricPeriodMonthReset,
)
from .types.create_plan_entitlement_request_body_value_type import CreatePlanEntitlementRequestBodyValueType
from .types.create_plan_entitlement_response import CreatePlanEntitlementResponse
from .types.delete_company_override_response import DeleteCompanyOverrideResponse
from .types.delete_plan_entitlement_response import DeletePlanEntitlementResponse
from .types.get_company_override_response import GetCompanyOverrideResponse
from .types.get_feature_usage_by_company_response import GetFeatureUsageByCompanyResponse
from .types.get_plan_entitlement_response import GetPlanEntitlementResponse
from .types.list_company_overrides_response import ListCompanyOverridesResponse
from .types.list_feature_companies_response import ListFeatureCompaniesResponse
from .types.list_feature_usage_response import ListFeatureUsageResponse
from .types.list_feature_users_response import ListFeatureUsersResponse
from .types.list_plan_entitlements_response import ListPlanEntitlementsResponse
from .types.update_company_override_request_body_metric_period import UpdateCompanyOverrideRequestBodyMetricPeriod
from .types.update_company_override_request_body_metric_period_month_reset import (
    UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset,
)
from .types.update_company_override_request_body_value_type import UpdateCompanyOverrideRequestBodyValueType
from .types.update_company_override_response import UpdateCompanyOverrideResponse
from .types.update_plan_entitlement_request_body_metric_period import UpdatePlanEntitlementRequestBodyMetricPeriod
from .types.update_plan_entitlement_request_body_metric_period_month_reset import (
    UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset,
)
from .types.update_plan_entitlement_request_body_value_type import UpdatePlanEntitlementRequestBodyValueType
from .types.update_plan_entitlement_response import UpdatePlanEntitlementResponse

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


class EntitlementsClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawEntitlementsClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawEntitlementsClient
        """
        return self._raw_client

    def list_company_overrides(
        self,
        *,
        company_id: typing.Optional[str] = None,
        company_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        feature_id: typing.Optional[str] = None,
        feature_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        without_expired: typing.Optional[bool] = None,
        q: typing.Optional[str] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ListCompanyOverridesResponse:
        """
        Parameters
        ----------
        company_id : typing.Optional[str]
            Filter company overrides by a single company ID (starting with comp_)

        company_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            Filter company overrides by multiple company IDs (starting with comp_)

        feature_id : typing.Optional[str]
            Filter company overrides by a single feature ID (starting with feat_)

        feature_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            Filter company overrides by multiple feature IDs (starting with feat_)

        ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            Filter company overrides by multiple company override IDs (starting with cmov_)

        without_expired : typing.Optional[bool]
            Filter company overrides by whether they have not expired

        q : typing.Optional[str]
            Search for company overrides by feature or company name

        limit : typing.Optional[int]
            Page limit (default 100)

        offset : typing.Optional[int]
            Page offset (default 0)

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

        Returns
        -------
        ListCompanyOverridesResponse
            OK

        Examples
        --------
        from schematic import Schematic

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.entitlements.list_company_overrides()
        """
        _response = self._raw_client.list_company_overrides(
            company_id=company_id,
            company_ids=company_ids,
            feature_id=feature_id,
            feature_ids=feature_ids,
            ids=ids,
            without_expired=without_expired,
            q=q,
            limit=limit,
            offset=offset,
            request_options=request_options,
        )
        return _response.data

    def create_company_override(
        self,
        *,
        company_id: str,
        feature_id: str,
        value_type: CreateCompanyOverrideRequestBodyValueType,
        expiration_date: typing.Optional[dt.datetime] = OMIT,
        metric_period: typing.Optional[CreateCompanyOverrideRequestBodyMetricPeriod] = OMIT,
        metric_period_month_reset: typing.Optional[CreateCompanyOverrideRequestBodyMetricPeriodMonthReset] = OMIT,
        value_bool: typing.Optional[bool] = OMIT,
        value_numeric: typing.Optional[int] = OMIT,
        value_trait_id: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CreateCompanyOverrideResponse:
        """
        Parameters
        ----------
        company_id : str

        feature_id : str

        value_type : CreateCompanyOverrideRequestBodyValueType

        expiration_date : typing.Optional[dt.datetime]

        metric_period : typing.Optional[CreateCompanyOverrideRequestBodyMetricPeriod]

        metric_period_month_reset : typing.Optional[CreateCompanyOverrideRequestBodyMetricPeriodMonthReset]

        value_bool : typing.Optional[bool]

        value_numeric : typing.Optional[int]

        value_trait_id : typing.Optional[str]

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

        Returns
        -------
        CreateCompanyOverrideResponse
            Created

        Examples
        --------
        from schematic import Schematic

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.entitlements.create_company_override(
            company_id="company_id",
            feature_id="feature_id",
            value_type="boolean",
        )
        """
        _response = self._raw_client.create_company_override(
            company_id=company_id,
            feature_id=feature_id,
            value_type=value_type,
            expiration_date=expiration_date,
            metric_period=metric_period,
            metric_period_month_reset=metric_period_month_reset,
            value_bool=value_bool,
            value_numeric=value_numeric,
            value_trait_id=value_trait_id,
            request_options=request_options,
        )
        return _response.data

    def get_company_override(
        self, company_override_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> GetCompanyOverrideResponse:
        """
        Parameters
        ----------
        company_override_id : str
            company_override_id

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

        Returns
        -------
        GetCompanyOverrideResponse
            OK

        Examples
        --------
        from schematic import Schematic

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.entitlements.get_company_override(
            company_override_id="company_override_id",
        )
        """
        _response = self._raw_client.get_company_override(company_override_id, request_options=request_options)
        return _response.data

    def update_company_override(
        self,
        company_override_id: str,
        *,
        value_type: UpdateCompanyOverrideRequestBodyValueType,
        expiration_date: typing.Optional[dt.datetime] = OMIT,
        metric_period: typing.Optional[UpdateCompanyOverrideRequestBodyMetricPeriod] = OMIT,
        metric_period_month_reset: typing.Optional[UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset] = OMIT,
        value_bool: typing.Optional[bool] = OMIT,
        value_numeric: typing.Optional[int] = OMIT,
        value_trait_id: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> UpdateCompanyOverrideResponse:
        """
        Parameters
        ----------
        company_override_id : str
            company_override_id

        value_type : UpdateCompanyOverrideRequestBodyValueType

        expiration_date : typing.Optional[dt.datetime]

        metric_period : typing.Optional[UpdateCompanyOverrideRequestBodyMetricPeriod]

        metric_period_month_reset : typing.Optional[UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset]

        value_bool : typing.Optional[bool]

        value_numeric : typing.Optional[int]

        value_trait_id : typing.Optional[str]

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

        Returns
        -------
        UpdateCompanyOverrideResponse
            OK

        Examples
        --------
        from schematic import Schematic

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.entitlements.update_company_override(
            company_override_id="company_override_id",
            value_type="boolean",
        )
        """
        _response = self._raw_client.update_company_override(
            company_override_id,
            value_type=value_type,
            expiration_date=expiration_date,
            metric_period=metric_period,
            metric_period_month_reset=metric_period_month_reset,
            value_bool=value_bool,
            value_numeric=value_numeric,
            value_trait_id=value_trait_id,
            request_options=request_options,
        )
        return _response.data

    def delete_company_override(
        self, company_override_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> DeleteCompanyOverrideResponse:
        """
        Parameters
        ----------
        company_override_id : str
            company_override_id

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

        Returns
        -------
        DeleteCompanyOverrideResponse
            OK

        Examples
        --------
        from schematic import Schematic

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.entitlements.delete_company_override(
            company_override_id="company_override_id",
        )
        """
        _response = self._raw_client.delete_company_override(company_override_id, request_options=request_options)
        return _response.data

    def count_company_overrides(
        self,
        *,
        company_id: typing.Optional[str] = None,
        company_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        feature_id: typing.Optional[str] = None,
        feature_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        without_expired: typing.Optional[bool] = None,
        q: typing.Optional[str] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CountCompanyOverridesResponse:
        """
        Parameters
        ----------
        company_id : typing.Optional[str]
            Filter company overrides by a single company ID (starting with comp_)

        company_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            Filter company overrides by multiple company IDs (starting with comp_)

        feature_id : typing.Optional[str]
            Filter company overrides by a single feature ID (starting with feat_)

        feature_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            Filter company overrides by multiple feature IDs (starting with feat_)

        ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            Filter company overrides by multiple company override IDs (starting with cmov_)

        without_expired : typing.Optional[bool]
            Filter company overrides by whether they have not expired

        q : typing.Optional[str]
            Search for company overrides by feature or company name

        limit : typing.Optional[int]
            Page limit (default 100)

        offset : typing.Optional[int]
            Page offset (default 0)

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

        Returns
        -------
        CountCompanyOverridesResponse
            OK

        Examples
        --------
        from schematic import Schematic

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.entitlements.count_company_overrides()
        """
        _response = self._raw_client.count_company_overrides(
            company_id=company_id,
            company_ids=company_ids,
            feature_id=feature_id,
            feature_ids=feature_ids,
            ids=ids,
            without_expired=without_expired,
            q=q,
            limit=limit,
            offset=offset,
            request_options=request_options,
        )
        return _response.data

    def list_feature_companies(
        self,
        *,
        feature_id: str,
        q: typing.Optional[str] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ListFeatureCompaniesResponse:
        """
        Parameters
        ----------
        feature_id : str

        q : typing.Optional[str]

        limit : typing.Optional[int]
            Page limit (default 100)

        offset : typing.Optional[int]
            Page offset (default 0)

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

        Returns
        -------
        ListFeatureCompaniesResponse
            OK

        Examples
        --------
        from schematic import Schematic

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.entitlements.list_feature_companies(
            feature_id="feature_id",
        )
        """
        _response = self._raw_client.list_feature_companies(
            feature_id=feature_id, q=q, limit=limit, offset=offset, request_options=request_options
        )
        return _response.data

    def count_feature_companies(
        self,
        *,
        feature_id: str,
        q: typing.Optional[str] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CountFeatureCompaniesResponse:
        """
        Parameters
        ----------
        feature_id : str

        q : typing.Optional[str]

        limit : typing.Optional[int]
            Page limit (default 100)

        offset : typing.Optional[int]
            Page offset (default 0)

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

        Returns
        -------
        CountFeatureCompaniesResponse
            OK

        Examples
        --------
        from schematic import Schematic

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.entitlements.count_feature_companies(
            feature_id="feature_id",
        )
        """
        _response = self._raw_client.count_feature_companies(
            feature_id=feature_id, q=q, limit=limit, offset=offset, request_options=request_options
        )
        return _response.data

    def list_feature_usage(
        self,
        *,
        company_id: typing.Optional[str] = None,
        company_keys: typing.Optional[typing.Dict[str, str]] = None,
        feature_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        q: typing.Optional[str] = None,
        without_negative_entitlements: typing.Optional[bool] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ListFeatureUsageResponse:
        """
        Parameters
        ----------
        company_id : typing.Optional[str]

        company_keys : typing.Optional[typing.Dict[str, str]]

        feature_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]

        q : typing.Optional[str]

        without_negative_entitlements : typing.Optional[bool]

        limit : typing.Optional[int]
            Page limit (default 100)

        offset : typing.Optional[int]
            Page offset (default 0)

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

        Returns
        -------
        ListFeatureUsageResponse
            OK

        Examples
        --------
        from schematic import Schematic

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.entitlements.list_feature_usage()
        """
        _response = self._raw_client.list_feature_usage(
            company_id=company_id,
            company_keys=company_keys,
            feature_ids=feature_ids,
            q=q,
            without_negative_entitlements=without_negative_entitlements,
            limit=limit,
            offset=offset,
            request_options=request_options,
        )
        return _response.data

    def count_feature_usage(
        self,
        *,
        company_id: typing.Optional[str] = None,
        company_keys: typing.Optional[typing.Dict[str, str]] = None,
        feature_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        q: typing.Optional[str] = None,
        without_negative_entitlements: typing.Optional[bool] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CountFeatureUsageResponse:
        """
        Parameters
        ----------
        company_id : typing.Optional[str]

        company_keys : typing.Optional[typing.Dict[str, str]]

        feature_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]

        q : typing.Optional[str]

        without_negative_entitlements : typing.Optional[bool]

        limit : typing.Optional[int]
            Page limit (default 100)

        offset : typing.Optional[int]
            Page offset (default 0)

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

        Returns
        -------
        CountFeatureUsageResponse
            OK

        Examples
        --------
        from schematic import Schematic

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.entitlements.count_feature_usage()
        """
        _response = self._raw_client.count_feature_usage(
            company_id=company_id,
            company_keys=company_keys,
            feature_ids=feature_ids,
            q=q,
            without_negative_entitlements=without_negative_entitlements,
            limit=limit,
            offset=offset,
            request_options=request_options,
        )
        return _response.data

    def list_feature_users(
        self,
        *,
        feature_id: str,
        q: typing.Optional[str] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ListFeatureUsersResponse:
        """
        Parameters
        ----------
        feature_id : str

        q : typing.Optional[str]

        limit : typing.Optional[int]
            Page limit (default 100)

        offset : typing.Optional[int]
            Page offset (default 0)

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

        Returns
        -------
        ListFeatureUsersResponse
            OK

        Examples
        --------
        from schematic import Schematic

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.entitlements.list_feature_users(
            feature_id="feature_id",
        )
        """
        _response = self._raw_client.list_feature_users(
            feature_id=feature_id, q=q, limit=limit, offset=offset, request_options=request_options
        )
        return _response.data

    def count_feature_users(
        self,
        *,
        feature_id: str,
        q: typing.Optional[str] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CountFeatureUsersResponse:
        """
        Parameters
        ----------
        feature_id : str

        q : typing.Optional[str]

        limit : typing.Optional[int]
            Page limit (default 100)

        offset : typing.Optional[int]
            Page offset (default 0)

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

        Returns
        -------
        CountFeatureUsersResponse
            OK

        Examples
        --------
        from schematic import Schematic

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.entitlements.count_feature_users(
            feature_id="feature_id",
        )
        """
        _response = self._raw_client.count_feature_users(
            feature_id=feature_id, q=q, limit=limit, offset=offset, request_options=request_options
        )
        return _response.data

    def list_plan_entitlements(
        self,
        *,
        feature_id: typing.Optional[str] = None,
        feature_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        plan_id: typing.Optional[str] = None,
        plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        q: typing.Optional[str] = None,
        with_metered_products: typing.Optional[bool] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ListPlanEntitlementsResponse:
        """
        Parameters
        ----------
        feature_id : typing.Optional[str]
            Filter plan entitlements by a single feature ID (starting with feat_)

        feature_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            Filter plan entitlements by multiple feature IDs (starting with feat_)

        ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            Filter plan entitlements by multiple plan entitlement IDs (starting with pltl_)

        plan_id : typing.Optional[str]
            Filter plan entitlements by a single plan ID (starting with plan_)

        plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            Filter plan entitlements by multiple plan IDs (starting with plan_)

        q : typing.Optional[str]
            Search for plan entitlements by feature or company name

        with_metered_products : typing.Optional[bool]
            Filter plan entitlements only with metered products

        limit : typing.Optional[int]
            Page limit (default 100)

        offset : typing.Optional[int]
            Page offset (default 0)

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

        Returns
        -------
        ListPlanEntitlementsResponse
            OK

        Examples
        --------
        from schematic import Schematic

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.entitlements.list_plan_entitlements()
        """
        _response = self._raw_client.list_plan_entitlements(
            feature_id=feature_id,
            feature_ids=feature_ids,
            ids=ids,
            plan_id=plan_id,
            plan_ids=plan_ids,
            q=q,
            with_metered_products=with_metered_products,
            limit=limit,
            offset=offset,
            request_options=request_options,
        )
        return _response.data

    def create_plan_entitlement(
        self,
        *,
        feature_id: str,
        plan_id: str,
        value_type: CreatePlanEntitlementRequestBodyValueType,
        currency: typing.Optional[str] = OMIT,
        metric_period: typing.Optional[CreatePlanEntitlementRequestBodyMetricPeriod] = OMIT,
        metric_period_month_reset: typing.Optional[CreatePlanEntitlementRequestBodyMetricPeriodMonthReset] = OMIT,
        monthly_metered_price_id: typing.Optional[str] = OMIT,
        monthly_unit_price: typing.Optional[int] = OMIT,
        monthly_unit_price_decimal: typing.Optional[str] = OMIT,
        overage_billing_product_id: typing.Optional[str] = OMIT,
        price_behavior: typing.Optional[str] = OMIT,
        soft_limit: typing.Optional[int] = OMIT,
        value_bool: typing.Optional[bool] = OMIT,
        value_numeric: typing.Optional[int] = OMIT,
        value_trait_id: typing.Optional[str] = OMIT,
        yearly_metered_price_id: typing.Optional[str] = OMIT,
        yearly_unit_price: typing.Optional[int] = OMIT,
        yearly_unit_price_decimal: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CreatePlanEntitlementResponse:
        """
        Parameters
        ----------
        feature_id : str

        plan_id : str

        value_type : CreatePlanEntitlementRequestBodyValueType

        currency : typing.Optional[str]

        metric_period : typing.Optional[CreatePlanEntitlementRequestBodyMetricPeriod]

        metric_period_month_reset : typing.Optional[CreatePlanEntitlementRequestBodyMetricPeriodMonthReset]

        monthly_metered_price_id : typing.Optional[str]

        monthly_unit_price : typing.Optional[int]

        monthly_unit_price_decimal : typing.Optional[str]

        overage_billing_product_id : typing.Optional[str]

        price_behavior : typing.Optional[str]

        soft_limit : typing.Optional[int]

        value_bool : typing.Optional[bool]

        value_numeric : typing.Optional[int]

        value_trait_id : typing.Optional[str]

        yearly_metered_price_id : typing.Optional[str]

        yearly_unit_price : typing.Optional[int]

        yearly_unit_price_decimal : typing.Optional[str]

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

        Returns
        -------
        CreatePlanEntitlementResponse
            Created

        Examples
        --------
        from schematic import Schematic

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.entitlements.create_plan_entitlement(
            feature_id="feature_id",
            plan_id="plan_id",
            value_type="boolean",
        )
        """
        _response = self._raw_client.create_plan_entitlement(
            feature_id=feature_id,
            plan_id=plan_id,
            value_type=value_type,
            currency=currency,
            metric_period=metric_period,
            metric_period_month_reset=metric_period_month_reset,
            monthly_metered_price_id=monthly_metered_price_id,
            monthly_unit_price=monthly_unit_price,
            monthly_unit_price_decimal=monthly_unit_price_decimal,
            overage_billing_product_id=overage_billing_product_id,
            price_behavior=price_behavior,
            soft_limit=soft_limit,
            value_bool=value_bool,
            value_numeric=value_numeric,
            value_trait_id=value_trait_id,
            yearly_metered_price_id=yearly_metered_price_id,
            yearly_unit_price=yearly_unit_price,
            yearly_unit_price_decimal=yearly_unit_price_decimal,
            request_options=request_options,
        )
        return _response.data

    def get_plan_entitlement(
        self, plan_entitlement_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> GetPlanEntitlementResponse:
        """
        Parameters
        ----------
        plan_entitlement_id : str
            plan_entitlement_id

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

        Returns
        -------
        GetPlanEntitlementResponse
            OK

        Examples
        --------
        from schematic import Schematic

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.entitlements.get_plan_entitlement(
            plan_entitlement_id="plan_entitlement_id",
        )
        """
        _response = self._raw_client.get_plan_entitlement(plan_entitlement_id, request_options=request_options)
        return _response.data

    def update_plan_entitlement(
        self,
        plan_entitlement_id: str,
        *,
        value_type: UpdatePlanEntitlementRequestBodyValueType,
        currency: typing.Optional[str] = OMIT,
        metric_period: typing.Optional[UpdatePlanEntitlementRequestBodyMetricPeriod] = OMIT,
        metric_period_month_reset: typing.Optional[UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset] = OMIT,
        monthly_metered_price_id: typing.Optional[str] = OMIT,
        monthly_unit_price: typing.Optional[int] = OMIT,
        monthly_unit_price_decimal: typing.Optional[str] = OMIT,
        overage_billing_product_id: typing.Optional[str] = OMIT,
        price_behavior: typing.Optional[str] = OMIT,
        soft_limit: typing.Optional[int] = OMIT,
        value_bool: typing.Optional[bool] = OMIT,
        value_numeric: typing.Optional[int] = OMIT,
        value_trait_id: typing.Optional[str] = OMIT,
        yearly_metered_price_id: typing.Optional[str] = OMIT,
        yearly_unit_price: typing.Optional[int] = OMIT,
        yearly_unit_price_decimal: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> UpdatePlanEntitlementResponse:
        """
        Parameters
        ----------
        plan_entitlement_id : str
            plan_entitlement_id

        value_type : UpdatePlanEntitlementRequestBodyValueType

        currency : typing.Optional[str]

        metric_period : typing.Optional[UpdatePlanEntitlementRequestBodyMetricPeriod]

        metric_period_month_reset : typing.Optional[UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset]

        monthly_metered_price_id : typing.Optional[str]

        monthly_unit_price : typing.Optional[int]

        monthly_unit_price_decimal : typing.Optional[str]

        overage_billing_product_id : typing.Optional[str]

        price_behavior : typing.Optional[str]

        soft_limit : typing.Optional[int]

        value_bool : typing.Optional[bool]

        value_numeric : typing.Optional[int]

        value_trait_id : typing.Optional[str]

        yearly_metered_price_id : typing.Optional[str]

        yearly_unit_price : typing.Optional[int]

        yearly_unit_price_decimal : typing.Optional[str]

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

        Returns
        -------
        UpdatePlanEntitlementResponse
            OK

        Examples
        --------
        from schematic import Schematic

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.entitlements.update_plan_entitlement(
            plan_entitlement_id="plan_entitlement_id",
            value_type="boolean",
        )
        """
        _response = self._raw_client.update_plan_entitlement(
            plan_entitlement_id,
            value_type=value_type,
            currency=currency,
            metric_period=metric_period,
            metric_period_month_reset=metric_period_month_reset,
            monthly_metered_price_id=monthly_metered_price_id,
            monthly_unit_price=monthly_unit_price,
            monthly_unit_price_decimal=monthly_unit_price_decimal,
            overage_billing_product_id=overage_billing_product_id,
            price_behavior=price_behavior,
            soft_limit=soft_limit,
            value_bool=value_bool,
            value_numeric=value_numeric,
            value_trait_id=value_trait_id,
            yearly_metered_price_id=yearly_metered_price_id,
            yearly_unit_price=yearly_unit_price,
            yearly_unit_price_decimal=yearly_unit_price_decimal,
            request_options=request_options,
        )
        return _response.data

    def delete_plan_entitlement(
        self, plan_entitlement_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> DeletePlanEntitlementResponse:
        """
        Parameters
        ----------
        plan_entitlement_id : str
            plan_entitlement_id

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

        Returns
        -------
        DeletePlanEntitlementResponse
            OK

        Examples
        --------
        from schematic import Schematic

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.entitlements.delete_plan_entitlement(
            plan_entitlement_id="plan_entitlement_id",
        )
        """
        _response = self._raw_client.delete_plan_entitlement(plan_entitlement_id, request_options=request_options)
        return _response.data

    def count_plan_entitlements(
        self,
        *,
        feature_id: typing.Optional[str] = None,
        feature_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        plan_id: typing.Optional[str] = None,
        plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        q: typing.Optional[str] = None,
        with_metered_products: typing.Optional[bool] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CountPlanEntitlementsResponse:
        """
        Parameters
        ----------
        feature_id : typing.Optional[str]
            Filter plan entitlements by a single feature ID (starting with feat_)

        feature_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            Filter plan entitlements by multiple feature IDs (starting with feat_)

        ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            Filter plan entitlements by multiple plan entitlement IDs (starting with pltl_)

        plan_id : typing.Optional[str]
            Filter plan entitlements by a single plan ID (starting with plan_)

        plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            Filter plan entitlements by multiple plan IDs (starting with plan_)

        q : typing.Optional[str]
            Search for plan entitlements by feature or company name

        with_metered_products : typing.Optional[bool]
            Filter plan entitlements only with metered products

        limit : typing.Optional[int]
            Page limit (default 100)

        offset : typing.Optional[int]
            Page offset (default 0)

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

        Returns
        -------
        CountPlanEntitlementsResponse
            OK

        Examples
        --------
        from schematic import Schematic

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.entitlements.count_plan_entitlements()
        """
        _response = self._raw_client.count_plan_entitlements(
            feature_id=feature_id,
            feature_ids=feature_ids,
            ids=ids,
            plan_id=plan_id,
            plan_ids=plan_ids,
            q=q,
            with_metered_products=with_metered_products,
            limit=limit,
            offset=offset,
            request_options=request_options,
        )
        return _response.data

    def get_feature_usage_by_company(
        self, *, keys: typing.Dict[str, str], request_options: typing.Optional[RequestOptions] = None
    ) -> GetFeatureUsageByCompanyResponse:
        """
        Parameters
        ----------
        keys : typing.Dict[str, str]
            Key/value pairs

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

        Returns
        -------
        GetFeatureUsageByCompanyResponse
            OK

        Examples
        --------
        from schematic import Schematic

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.entitlements.get_feature_usage_by_company(
            keys={"keys": "keys"},
        )
        """
        _response = self._raw_client.get_feature_usage_by_company(keys=keys, request_options=request_options)
        return _response.data


class AsyncEntitlementsClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawEntitlementsClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawEntitlementsClient
        """
        return self._raw_client

    async def list_company_overrides(
        self,
        *,
        company_id: typing.Optional[str] = None,
        company_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        feature_id: typing.Optional[str] = None,
        feature_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        without_expired: typing.Optional[bool] = None,
        q: typing.Optional[str] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ListCompanyOverridesResponse:
        """
        Parameters
        ----------
        company_id : typing.Optional[str]
            Filter company overrides by a single company ID (starting with comp_)

        company_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            Filter company overrides by multiple company IDs (starting with comp_)

        feature_id : typing.Optional[str]
            Filter company overrides by a single feature ID (starting with feat_)

        feature_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            Filter company overrides by multiple feature IDs (starting with feat_)

        ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            Filter company overrides by multiple company override IDs (starting with cmov_)

        without_expired : typing.Optional[bool]
            Filter company overrides by whether they have not expired

        q : typing.Optional[str]
            Search for company overrides by feature or company name

        limit : typing.Optional[int]
            Page limit (default 100)

        offset : typing.Optional[int]
            Page offset (default 0)

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

        Returns
        -------
        ListCompanyOverridesResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.entitlements.list_company_overrides()


        asyncio.run(main())
        """
        _response = await self._raw_client.list_company_overrides(
            company_id=company_id,
            company_ids=company_ids,
            feature_id=feature_id,
            feature_ids=feature_ids,
            ids=ids,
            without_expired=without_expired,
            q=q,
            limit=limit,
            offset=offset,
            request_options=request_options,
        )
        return _response.data

    async def create_company_override(
        self,
        *,
        company_id: str,
        feature_id: str,
        value_type: CreateCompanyOverrideRequestBodyValueType,
        expiration_date: typing.Optional[dt.datetime] = OMIT,
        metric_period: typing.Optional[CreateCompanyOverrideRequestBodyMetricPeriod] = OMIT,
        metric_period_month_reset: typing.Optional[CreateCompanyOverrideRequestBodyMetricPeriodMonthReset] = OMIT,
        value_bool: typing.Optional[bool] = OMIT,
        value_numeric: typing.Optional[int] = OMIT,
        value_trait_id: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CreateCompanyOverrideResponse:
        """
        Parameters
        ----------
        company_id : str

        feature_id : str

        value_type : CreateCompanyOverrideRequestBodyValueType

        expiration_date : typing.Optional[dt.datetime]

        metric_period : typing.Optional[CreateCompanyOverrideRequestBodyMetricPeriod]

        metric_period_month_reset : typing.Optional[CreateCompanyOverrideRequestBodyMetricPeriodMonthReset]

        value_bool : typing.Optional[bool]

        value_numeric : typing.Optional[int]

        value_trait_id : typing.Optional[str]

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

        Returns
        -------
        CreateCompanyOverrideResponse
            Created

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.entitlements.create_company_override(
                company_id="company_id",
                feature_id="feature_id",
                value_type="boolean",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.create_company_override(
            company_id=company_id,
            feature_id=feature_id,
            value_type=value_type,
            expiration_date=expiration_date,
            metric_period=metric_period,
            metric_period_month_reset=metric_period_month_reset,
            value_bool=value_bool,
            value_numeric=value_numeric,
            value_trait_id=value_trait_id,
            request_options=request_options,
        )
        return _response.data

    async def get_company_override(
        self, company_override_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> GetCompanyOverrideResponse:
        """
        Parameters
        ----------
        company_override_id : str
            company_override_id

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

        Returns
        -------
        GetCompanyOverrideResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.entitlements.get_company_override(
                company_override_id="company_override_id",
            )


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

    async def update_company_override(
        self,
        company_override_id: str,
        *,
        value_type: UpdateCompanyOverrideRequestBodyValueType,
        expiration_date: typing.Optional[dt.datetime] = OMIT,
        metric_period: typing.Optional[UpdateCompanyOverrideRequestBodyMetricPeriod] = OMIT,
        metric_period_month_reset: typing.Optional[UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset] = OMIT,
        value_bool: typing.Optional[bool] = OMIT,
        value_numeric: typing.Optional[int] = OMIT,
        value_trait_id: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> UpdateCompanyOverrideResponse:
        """
        Parameters
        ----------
        company_override_id : str
            company_override_id

        value_type : UpdateCompanyOverrideRequestBodyValueType

        expiration_date : typing.Optional[dt.datetime]

        metric_period : typing.Optional[UpdateCompanyOverrideRequestBodyMetricPeriod]

        metric_period_month_reset : typing.Optional[UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset]

        value_bool : typing.Optional[bool]

        value_numeric : typing.Optional[int]

        value_trait_id : typing.Optional[str]

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

        Returns
        -------
        UpdateCompanyOverrideResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.entitlements.update_company_override(
                company_override_id="company_override_id",
                value_type="boolean",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.update_company_override(
            company_override_id,
            value_type=value_type,
            expiration_date=expiration_date,
            metric_period=metric_period,
            metric_period_month_reset=metric_period_month_reset,
            value_bool=value_bool,
            value_numeric=value_numeric,
            value_trait_id=value_trait_id,
            request_options=request_options,
        )
        return _response.data

    async def delete_company_override(
        self, company_override_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> DeleteCompanyOverrideResponse:
        """
        Parameters
        ----------
        company_override_id : str
            company_override_id

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

        Returns
        -------
        DeleteCompanyOverrideResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.entitlements.delete_company_override(
                company_override_id="company_override_id",
            )


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

    async def count_company_overrides(
        self,
        *,
        company_id: typing.Optional[str] = None,
        company_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        feature_id: typing.Optional[str] = None,
        feature_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        without_expired: typing.Optional[bool] = None,
        q: typing.Optional[str] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CountCompanyOverridesResponse:
        """
        Parameters
        ----------
        company_id : typing.Optional[str]
            Filter company overrides by a single company ID (starting with comp_)

        company_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            Filter company overrides by multiple company IDs (starting with comp_)

        feature_id : typing.Optional[str]
            Filter company overrides by a single feature ID (starting with feat_)

        feature_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            Filter company overrides by multiple feature IDs (starting with feat_)

        ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            Filter company overrides by multiple company override IDs (starting with cmov_)

        without_expired : typing.Optional[bool]
            Filter company overrides by whether they have not expired

        q : typing.Optional[str]
            Search for company overrides by feature or company name

        limit : typing.Optional[int]
            Page limit (default 100)

        offset : typing.Optional[int]
            Page offset (default 0)

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

        Returns
        -------
        CountCompanyOverridesResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.entitlements.count_company_overrides()


        asyncio.run(main())
        """
        _response = await self._raw_client.count_company_overrides(
            company_id=company_id,
            company_ids=company_ids,
            feature_id=feature_id,
            feature_ids=feature_ids,
            ids=ids,
            without_expired=without_expired,
            q=q,
            limit=limit,
            offset=offset,
            request_options=request_options,
        )
        return _response.data

    async def list_feature_companies(
        self,
        *,
        feature_id: str,
        q: typing.Optional[str] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ListFeatureCompaniesResponse:
        """
        Parameters
        ----------
        feature_id : str

        q : typing.Optional[str]

        limit : typing.Optional[int]
            Page limit (default 100)

        offset : typing.Optional[int]
            Page offset (default 0)

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

        Returns
        -------
        ListFeatureCompaniesResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.entitlements.list_feature_companies(
                feature_id="feature_id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.list_feature_companies(
            feature_id=feature_id, q=q, limit=limit, offset=offset, request_options=request_options
        )
        return _response.data

    async def count_feature_companies(
        self,
        *,
        feature_id: str,
        q: typing.Optional[str] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CountFeatureCompaniesResponse:
        """
        Parameters
        ----------
        feature_id : str

        q : typing.Optional[str]

        limit : typing.Optional[int]
            Page limit (default 100)

        offset : typing.Optional[int]
            Page offset (default 0)

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

        Returns
        -------
        CountFeatureCompaniesResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.entitlements.count_feature_companies(
                feature_id="feature_id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.count_feature_companies(
            feature_id=feature_id, q=q, limit=limit, offset=offset, request_options=request_options
        )
        return _response.data

    async def list_feature_usage(
        self,
        *,
        company_id: typing.Optional[str] = None,
        company_keys: typing.Optional[typing.Dict[str, str]] = None,
        feature_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        q: typing.Optional[str] = None,
        without_negative_entitlements: typing.Optional[bool] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ListFeatureUsageResponse:
        """
        Parameters
        ----------
        company_id : typing.Optional[str]

        company_keys : typing.Optional[typing.Dict[str, str]]

        feature_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]

        q : typing.Optional[str]

        without_negative_entitlements : typing.Optional[bool]

        limit : typing.Optional[int]
            Page limit (default 100)

        offset : typing.Optional[int]
            Page offset (default 0)

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

        Returns
        -------
        ListFeatureUsageResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.entitlements.list_feature_usage()


        asyncio.run(main())
        """
        _response = await self._raw_client.list_feature_usage(
            company_id=company_id,
            company_keys=company_keys,
            feature_ids=feature_ids,
            q=q,
            without_negative_entitlements=without_negative_entitlements,
            limit=limit,
            offset=offset,
            request_options=request_options,
        )
        return _response.data

    async def count_feature_usage(
        self,
        *,
        company_id: typing.Optional[str] = None,
        company_keys: typing.Optional[typing.Dict[str, str]] = None,
        feature_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        q: typing.Optional[str] = None,
        without_negative_entitlements: typing.Optional[bool] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CountFeatureUsageResponse:
        """
        Parameters
        ----------
        company_id : typing.Optional[str]

        company_keys : typing.Optional[typing.Dict[str, str]]

        feature_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]

        q : typing.Optional[str]

        without_negative_entitlements : typing.Optional[bool]

        limit : typing.Optional[int]
            Page limit (default 100)

        offset : typing.Optional[int]
            Page offset (default 0)

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

        Returns
        -------
        CountFeatureUsageResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.entitlements.count_feature_usage()


        asyncio.run(main())
        """
        _response = await self._raw_client.count_feature_usage(
            company_id=company_id,
            company_keys=company_keys,
            feature_ids=feature_ids,
            q=q,
            without_negative_entitlements=without_negative_entitlements,
            limit=limit,
            offset=offset,
            request_options=request_options,
        )
        return _response.data

    async def list_feature_users(
        self,
        *,
        feature_id: str,
        q: typing.Optional[str] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ListFeatureUsersResponse:
        """
        Parameters
        ----------
        feature_id : str

        q : typing.Optional[str]

        limit : typing.Optional[int]
            Page limit (default 100)

        offset : typing.Optional[int]
            Page offset (default 0)

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

        Returns
        -------
        ListFeatureUsersResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.entitlements.list_feature_users(
                feature_id="feature_id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.list_feature_users(
            feature_id=feature_id, q=q, limit=limit, offset=offset, request_options=request_options
        )
        return _response.data

    async def count_feature_users(
        self,
        *,
        feature_id: str,
        q: typing.Optional[str] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CountFeatureUsersResponse:
        """
        Parameters
        ----------
        feature_id : str

        q : typing.Optional[str]

        limit : typing.Optional[int]
            Page limit (default 100)

        offset : typing.Optional[int]
            Page offset (default 0)

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

        Returns
        -------
        CountFeatureUsersResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.entitlements.count_feature_users(
                feature_id="feature_id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.count_feature_users(
            feature_id=feature_id, q=q, limit=limit, offset=offset, request_options=request_options
        )
        return _response.data

    async def list_plan_entitlements(
        self,
        *,
        feature_id: typing.Optional[str] = None,
        feature_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        plan_id: typing.Optional[str] = None,
        plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        q: typing.Optional[str] = None,
        with_metered_products: typing.Optional[bool] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ListPlanEntitlementsResponse:
        """
        Parameters
        ----------
        feature_id : typing.Optional[str]
            Filter plan entitlements by a single feature ID (starting with feat_)

        feature_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            Filter plan entitlements by multiple feature IDs (starting with feat_)

        ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            Filter plan entitlements by multiple plan entitlement IDs (starting with pltl_)

        plan_id : typing.Optional[str]
            Filter plan entitlements by a single plan ID (starting with plan_)

        plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            Filter plan entitlements by multiple plan IDs (starting with plan_)

        q : typing.Optional[str]
            Search for plan entitlements by feature or company name

        with_metered_products : typing.Optional[bool]
            Filter plan entitlements only with metered products

        limit : typing.Optional[int]
            Page limit (default 100)

        offset : typing.Optional[int]
            Page offset (default 0)

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

        Returns
        -------
        ListPlanEntitlementsResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.entitlements.list_plan_entitlements()


        asyncio.run(main())
        """
        _response = await self._raw_client.list_plan_entitlements(
            feature_id=feature_id,
            feature_ids=feature_ids,
            ids=ids,
            plan_id=plan_id,
            plan_ids=plan_ids,
            q=q,
            with_metered_products=with_metered_products,
            limit=limit,
            offset=offset,
            request_options=request_options,
        )
        return _response.data

    async def create_plan_entitlement(
        self,
        *,
        feature_id: str,
        plan_id: str,
        value_type: CreatePlanEntitlementRequestBodyValueType,
        currency: typing.Optional[str] = OMIT,
        metric_period: typing.Optional[CreatePlanEntitlementRequestBodyMetricPeriod] = OMIT,
        metric_period_month_reset: typing.Optional[CreatePlanEntitlementRequestBodyMetricPeriodMonthReset] = OMIT,
        monthly_metered_price_id: typing.Optional[str] = OMIT,
        monthly_unit_price: typing.Optional[int] = OMIT,
        monthly_unit_price_decimal: typing.Optional[str] = OMIT,
        overage_billing_product_id: typing.Optional[str] = OMIT,
        price_behavior: typing.Optional[str] = OMIT,
        soft_limit: typing.Optional[int] = OMIT,
        value_bool: typing.Optional[bool] = OMIT,
        value_numeric: typing.Optional[int] = OMIT,
        value_trait_id: typing.Optional[str] = OMIT,
        yearly_metered_price_id: typing.Optional[str] = OMIT,
        yearly_unit_price: typing.Optional[int] = OMIT,
        yearly_unit_price_decimal: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CreatePlanEntitlementResponse:
        """
        Parameters
        ----------
        feature_id : str

        plan_id : str

        value_type : CreatePlanEntitlementRequestBodyValueType

        currency : typing.Optional[str]

        metric_period : typing.Optional[CreatePlanEntitlementRequestBodyMetricPeriod]

        metric_period_month_reset : typing.Optional[CreatePlanEntitlementRequestBodyMetricPeriodMonthReset]

        monthly_metered_price_id : typing.Optional[str]

        monthly_unit_price : typing.Optional[int]

        monthly_unit_price_decimal : typing.Optional[str]

        overage_billing_product_id : typing.Optional[str]

        price_behavior : typing.Optional[str]

        soft_limit : typing.Optional[int]

        value_bool : typing.Optional[bool]

        value_numeric : typing.Optional[int]

        value_trait_id : typing.Optional[str]

        yearly_metered_price_id : typing.Optional[str]

        yearly_unit_price : typing.Optional[int]

        yearly_unit_price_decimal : typing.Optional[str]

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

        Returns
        -------
        CreatePlanEntitlementResponse
            Created

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.entitlements.create_plan_entitlement(
                feature_id="feature_id",
                plan_id="plan_id",
                value_type="boolean",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.create_plan_entitlement(
            feature_id=feature_id,
            plan_id=plan_id,
            value_type=value_type,
            currency=currency,
            metric_period=metric_period,
            metric_period_month_reset=metric_period_month_reset,
            monthly_metered_price_id=monthly_metered_price_id,
            monthly_unit_price=monthly_unit_price,
            monthly_unit_price_decimal=monthly_unit_price_decimal,
            overage_billing_product_id=overage_billing_product_id,
            price_behavior=price_behavior,
            soft_limit=soft_limit,
            value_bool=value_bool,
            value_numeric=value_numeric,
            value_trait_id=value_trait_id,
            yearly_metered_price_id=yearly_metered_price_id,
            yearly_unit_price=yearly_unit_price,
            yearly_unit_price_decimal=yearly_unit_price_decimal,
            request_options=request_options,
        )
        return _response.data

    async def get_plan_entitlement(
        self, plan_entitlement_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> GetPlanEntitlementResponse:
        """
        Parameters
        ----------
        plan_entitlement_id : str
            plan_entitlement_id

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

        Returns
        -------
        GetPlanEntitlementResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.entitlements.get_plan_entitlement(
                plan_entitlement_id="plan_entitlement_id",
            )


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

    async def update_plan_entitlement(
        self,
        plan_entitlement_id: str,
        *,
        value_type: UpdatePlanEntitlementRequestBodyValueType,
        currency: typing.Optional[str] = OMIT,
        metric_period: typing.Optional[UpdatePlanEntitlementRequestBodyMetricPeriod] = OMIT,
        metric_period_month_reset: typing.Optional[UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset] = OMIT,
        monthly_metered_price_id: typing.Optional[str] = OMIT,
        monthly_unit_price: typing.Optional[int] = OMIT,
        monthly_unit_price_decimal: typing.Optional[str] = OMIT,
        overage_billing_product_id: typing.Optional[str] = OMIT,
        price_behavior: typing.Optional[str] = OMIT,
        soft_limit: typing.Optional[int] = OMIT,
        value_bool: typing.Optional[bool] = OMIT,
        value_numeric: typing.Optional[int] = OMIT,
        value_trait_id: typing.Optional[str] = OMIT,
        yearly_metered_price_id: typing.Optional[str] = OMIT,
        yearly_unit_price: typing.Optional[int] = OMIT,
        yearly_unit_price_decimal: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> UpdatePlanEntitlementResponse:
        """
        Parameters
        ----------
        plan_entitlement_id : str
            plan_entitlement_id

        value_type : UpdatePlanEntitlementRequestBodyValueType

        currency : typing.Optional[str]

        metric_period : typing.Optional[UpdatePlanEntitlementRequestBodyMetricPeriod]

        metric_period_month_reset : typing.Optional[UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset]

        monthly_metered_price_id : typing.Optional[str]

        monthly_unit_price : typing.Optional[int]

        monthly_unit_price_decimal : typing.Optional[str]

        overage_billing_product_id : typing.Optional[str]

        price_behavior : typing.Optional[str]

        soft_limit : typing.Optional[int]

        value_bool : typing.Optional[bool]

        value_numeric : typing.Optional[int]

        value_trait_id : typing.Optional[str]

        yearly_metered_price_id : typing.Optional[str]

        yearly_unit_price : typing.Optional[int]

        yearly_unit_price_decimal : typing.Optional[str]

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

        Returns
        -------
        UpdatePlanEntitlementResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.entitlements.update_plan_entitlement(
                plan_entitlement_id="plan_entitlement_id",
                value_type="boolean",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.update_plan_entitlement(
            plan_entitlement_id,
            value_type=value_type,
            currency=currency,
            metric_period=metric_period,
            metric_period_month_reset=metric_period_month_reset,
            monthly_metered_price_id=monthly_metered_price_id,
            monthly_unit_price=monthly_unit_price,
            monthly_unit_price_decimal=monthly_unit_price_decimal,
            overage_billing_product_id=overage_billing_product_id,
            price_behavior=price_behavior,
            soft_limit=soft_limit,
            value_bool=value_bool,
            value_numeric=value_numeric,
            value_trait_id=value_trait_id,
            yearly_metered_price_id=yearly_metered_price_id,
            yearly_unit_price=yearly_unit_price,
            yearly_unit_price_decimal=yearly_unit_price_decimal,
            request_options=request_options,
        )
        return _response.data

    async def delete_plan_entitlement(
        self, plan_entitlement_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> DeletePlanEntitlementResponse:
        """
        Parameters
        ----------
        plan_entitlement_id : str
            plan_entitlement_id

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

        Returns
        -------
        DeletePlanEntitlementResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.entitlements.delete_plan_entitlement(
                plan_entitlement_id="plan_entitlement_id",
            )


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

    async def count_plan_entitlements(
        self,
        *,
        feature_id: typing.Optional[str] = None,
        feature_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        plan_id: typing.Optional[str] = None,
        plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        q: typing.Optional[str] = None,
        with_metered_products: typing.Optional[bool] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CountPlanEntitlementsResponse:
        """
        Parameters
        ----------
        feature_id : typing.Optional[str]
            Filter plan entitlements by a single feature ID (starting with feat_)

        feature_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            Filter plan entitlements by multiple feature IDs (starting with feat_)

        ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            Filter plan entitlements by multiple plan entitlement IDs (starting with pltl_)

        plan_id : typing.Optional[str]
            Filter plan entitlements by a single plan ID (starting with plan_)

        plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            Filter plan entitlements by multiple plan IDs (starting with plan_)

        q : typing.Optional[str]
            Search for plan entitlements by feature or company name

        with_metered_products : typing.Optional[bool]
            Filter plan entitlements only with metered products

        limit : typing.Optional[int]
            Page limit (default 100)

        offset : typing.Optional[int]
            Page offset (default 0)

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

        Returns
        -------
        CountPlanEntitlementsResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.entitlements.count_plan_entitlements()


        asyncio.run(main())
        """
        _response = await self._raw_client.count_plan_entitlements(
            feature_id=feature_id,
            feature_ids=feature_ids,
            ids=ids,
            plan_id=plan_id,
            plan_ids=plan_ids,
            q=q,
            with_metered_products=with_metered_products,
            limit=limit,
            offset=offset,
            request_options=request_options,
        )
        return _response.data

    async def get_feature_usage_by_company(
        self, *, keys: typing.Dict[str, str], request_options: typing.Optional[RequestOptions] = None
    ) -> GetFeatureUsageByCompanyResponse:
        """
        Parameters
        ----------
        keys : typing.Dict[str, str]
            Key/value pairs

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

        Returns
        -------
        GetFeatureUsageByCompanyResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.entitlements.get_feature_usage_by_company(
                keys={"keys": "keys"},
            )


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