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

import typing

from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.request_options import RequestOptions
from ..types.create_or_update_condition_group_request_body import CreateOrUpdateConditionGroupRequestBody
from ..types.create_or_update_condition_request_body import CreateOrUpdateConditionRequestBody
from ..types.create_or_update_flag_request_body import CreateOrUpdateFlagRequestBody
from ..types.create_or_update_rule_request_body import CreateOrUpdateRuleRequestBody
from .raw_client import AsyncRawFeaturesClient, RawFeaturesClient
from .types.check_flag_response import CheckFlagResponse
from .types.check_flags_response import CheckFlagsResponse
from .types.count_audience_companies_response import CountAudienceCompaniesResponse
from .types.count_audience_users_response import CountAudienceUsersResponse
from .types.count_features_response import CountFeaturesResponse
from .types.count_flags_response import CountFlagsResponse
from .types.create_feature_request_body_feature_type import CreateFeatureRequestBodyFeatureType
from .types.create_feature_request_body_lifecycle_phase import CreateFeatureRequestBodyLifecyclePhase
from .types.create_feature_response import CreateFeatureResponse
from .types.create_flag_response import CreateFlagResponse
from .types.delete_feature_response import DeleteFeatureResponse
from .types.delete_flag_response import DeleteFlagResponse
from .types.get_feature_response import GetFeatureResponse
from .types.get_flag_response import GetFlagResponse
from .types.list_audience_companies_response import ListAudienceCompaniesResponse
from .types.list_audience_users_response import ListAudienceUsersResponse
from .types.list_features_response import ListFeaturesResponse
from .types.list_flags_response import ListFlagsResponse
from .types.update_feature_request_body_feature_type import UpdateFeatureRequestBodyFeatureType
from .types.update_feature_request_body_lifecycle_phase import UpdateFeatureRequestBodyLifecyclePhase
from .types.update_feature_response import UpdateFeatureResponse
from .types.update_flag_response import UpdateFlagResponse
from .types.update_flag_rules_response import UpdateFlagRulesResponse

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


class FeaturesClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawFeaturesClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawFeaturesClient
        """
        return self._raw_client

    def count_audience_companies(
        self,
        *,
        condition_groups: typing.Sequence[CreateOrUpdateConditionGroupRequestBody],
        conditions: typing.Sequence[CreateOrUpdateConditionRequestBody],
        limit: typing.Optional[int] = OMIT,
        offset: typing.Optional[int] = OMIT,
        q: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CountAudienceCompaniesResponse:
        """
        Parameters
        ----------
        condition_groups : typing.Sequence[CreateOrUpdateConditionGroupRequestBody]

        conditions : typing.Sequence[CreateOrUpdateConditionRequestBody]

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

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

        q : typing.Optional[str]

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

        Returns
        -------
        CountAudienceCompaniesResponse
            Created

        Examples
        --------
        from schematic import (
            CreateOrUpdateConditionGroupRequestBody,
            CreateOrUpdateConditionRequestBody,
            Schematic,
        )

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.features.count_audience_companies(
            condition_groups=[
                CreateOrUpdateConditionGroupRequestBody(
                    conditions=[
                        CreateOrUpdateConditionRequestBody(
                            condition_type="company",
                            operator="eq",
                            resource_ids=["resource_ids"],
                        )
                    ],
                )
            ],
            conditions=[
                CreateOrUpdateConditionRequestBody(
                    condition_type="company",
                    operator="eq",
                    resource_ids=["resource_ids"],
                )
            ],
        )
        """
        _response = self._raw_client.count_audience_companies(
            condition_groups=condition_groups,
            conditions=conditions,
            limit=limit,
            offset=offset,
            q=q,
            request_options=request_options,
        )
        return _response.data

    def count_audience_users(
        self,
        *,
        condition_groups: typing.Sequence[CreateOrUpdateConditionGroupRequestBody],
        conditions: typing.Sequence[CreateOrUpdateConditionRequestBody],
        limit: typing.Optional[int] = OMIT,
        offset: typing.Optional[int] = OMIT,
        q: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CountAudienceUsersResponse:
        """
        Parameters
        ----------
        condition_groups : typing.Sequence[CreateOrUpdateConditionGroupRequestBody]

        conditions : typing.Sequence[CreateOrUpdateConditionRequestBody]

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

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

        q : typing.Optional[str]

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

        Returns
        -------
        CountAudienceUsersResponse
            Created

        Examples
        --------
        from schematic import (
            CreateOrUpdateConditionGroupRequestBody,
            CreateOrUpdateConditionRequestBody,
            Schematic,
        )

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.features.count_audience_users(
            condition_groups=[
                CreateOrUpdateConditionGroupRequestBody(
                    conditions=[
                        CreateOrUpdateConditionRequestBody(
                            condition_type="company",
                            operator="eq",
                            resource_ids=["resource_ids"],
                        )
                    ],
                )
            ],
            conditions=[
                CreateOrUpdateConditionRequestBody(
                    condition_type="company",
                    operator="eq",
                    resource_ids=["resource_ids"],
                )
            ],
        )
        """
        _response = self._raw_client.count_audience_users(
            condition_groups=condition_groups,
            conditions=conditions,
            limit=limit,
            offset=offset,
            q=q,
            request_options=request_options,
        )
        return _response.data

    def list_audience_companies(
        self,
        *,
        condition_groups: typing.Sequence[CreateOrUpdateConditionGroupRequestBody],
        conditions: typing.Sequence[CreateOrUpdateConditionRequestBody],
        limit: typing.Optional[int] = OMIT,
        offset: typing.Optional[int] = OMIT,
        q: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ListAudienceCompaniesResponse:
        """
        Parameters
        ----------
        condition_groups : typing.Sequence[CreateOrUpdateConditionGroupRequestBody]

        conditions : typing.Sequence[CreateOrUpdateConditionRequestBody]

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

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

        q : typing.Optional[str]

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

        Returns
        -------
        ListAudienceCompaniesResponse
            OK

        Examples
        --------
        from schematic import (
            CreateOrUpdateConditionGroupRequestBody,
            CreateOrUpdateConditionRequestBody,
            Schematic,
        )

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.features.list_audience_companies(
            condition_groups=[
                CreateOrUpdateConditionGroupRequestBody(
                    conditions=[
                        CreateOrUpdateConditionRequestBody(
                            condition_type="company",
                            operator="eq",
                            resource_ids=["resource_ids"],
                        )
                    ],
                )
            ],
            conditions=[
                CreateOrUpdateConditionRequestBody(
                    condition_type="company",
                    operator="eq",
                    resource_ids=["resource_ids"],
                )
            ],
        )
        """
        _response = self._raw_client.list_audience_companies(
            condition_groups=condition_groups,
            conditions=conditions,
            limit=limit,
            offset=offset,
            q=q,
            request_options=request_options,
        )
        return _response.data

    def list_audience_users(
        self,
        *,
        condition_groups: typing.Sequence[CreateOrUpdateConditionGroupRequestBody],
        conditions: typing.Sequence[CreateOrUpdateConditionRequestBody],
        limit: typing.Optional[int] = OMIT,
        offset: typing.Optional[int] = OMIT,
        q: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ListAudienceUsersResponse:
        """
        Parameters
        ----------
        condition_groups : typing.Sequence[CreateOrUpdateConditionGroupRequestBody]

        conditions : typing.Sequence[CreateOrUpdateConditionRequestBody]

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

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

        q : typing.Optional[str]

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

        Returns
        -------
        ListAudienceUsersResponse
            OK

        Examples
        --------
        from schematic import (
            CreateOrUpdateConditionGroupRequestBody,
            CreateOrUpdateConditionRequestBody,
            Schematic,
        )

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.features.list_audience_users(
            condition_groups=[
                CreateOrUpdateConditionGroupRequestBody(
                    conditions=[
                        CreateOrUpdateConditionRequestBody(
                            condition_type="company",
                            operator="eq",
                            resource_ids=["resource_ids"],
                        )
                    ],
                )
            ],
            conditions=[
                CreateOrUpdateConditionRequestBody(
                    condition_type="company",
                    operator="eq",
                    resource_ids=["resource_ids"],
                )
            ],
        )
        """
        _response = self._raw_client.list_audience_users(
            condition_groups=condition_groups,
            conditions=conditions,
            limit=limit,
            offset=offset,
            q=q,
            request_options=request_options,
        )
        return _response.data

    def list_features(
        self,
        *,
        ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        q: typing.Optional[str] = None,
        without_company_override_for: typing.Optional[str] = None,
        without_plan_entitlement_for: typing.Optional[str] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ListFeaturesResponse:
        """
        Parameters
        ----------
        ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]

        q : typing.Optional[str]

        without_company_override_for : typing.Optional[str]
            Filter out features that already have a company override for the specified company ID

        without_plan_entitlement_for : typing.Optional[str]
            Filter out features that already have a plan entitlement for the specified plan ID

        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
        -------
        ListFeaturesResponse
            OK

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

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.features.list_features()
        """
        _response = self._raw_client.list_features(
            ids=ids,
            q=q,
            without_company_override_for=without_company_override_for,
            without_plan_entitlement_for=without_plan_entitlement_for,
            limit=limit,
            offset=offset,
            request_options=request_options,
        )
        return _response.data

    def create_feature(
        self,
        *,
        description: str,
        feature_type: CreateFeatureRequestBodyFeatureType,
        name: str,
        event_subtype: typing.Optional[str] = OMIT,
        flag: typing.Optional[CreateOrUpdateFlagRequestBody] = OMIT,
        icon: typing.Optional[str] = OMIT,
        lifecycle_phase: typing.Optional[CreateFeatureRequestBodyLifecyclePhase] = OMIT,
        maintainer_id: typing.Optional[str] = OMIT,
        plural_name: typing.Optional[str] = OMIT,
        singular_name: typing.Optional[str] = OMIT,
        trait_id: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CreateFeatureResponse:
        """
        Parameters
        ----------
        description : str

        feature_type : CreateFeatureRequestBodyFeatureType

        name : str

        event_subtype : typing.Optional[str]

        flag : typing.Optional[CreateOrUpdateFlagRequestBody]

        icon : typing.Optional[str]

        lifecycle_phase : typing.Optional[CreateFeatureRequestBodyLifecyclePhase]

        maintainer_id : typing.Optional[str]

        plural_name : typing.Optional[str]

        singular_name : typing.Optional[str]

        trait_id : typing.Optional[str]

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

        Returns
        -------
        CreateFeatureResponse
            Created

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

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.features.create_feature(
            description="description",
            feature_type="boolean",
            name="name",
        )
        """
        _response = self._raw_client.create_feature(
            description=description,
            feature_type=feature_type,
            name=name,
            event_subtype=event_subtype,
            flag=flag,
            icon=icon,
            lifecycle_phase=lifecycle_phase,
            maintainer_id=maintainer_id,
            plural_name=plural_name,
            singular_name=singular_name,
            trait_id=trait_id,
            request_options=request_options,
        )
        return _response.data

    def get_feature(
        self, feature_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> GetFeatureResponse:
        """
        Parameters
        ----------
        feature_id : str
            feature_id

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

        Returns
        -------
        GetFeatureResponse
            OK

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

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.features.get_feature(
            feature_id="feature_id",
        )
        """
        _response = self._raw_client.get_feature(feature_id, request_options=request_options)
        return _response.data

    def update_feature(
        self,
        feature_id: str,
        *,
        description: typing.Optional[str] = OMIT,
        event_subtype: typing.Optional[str] = OMIT,
        feature_type: typing.Optional[UpdateFeatureRequestBodyFeatureType] = OMIT,
        flag: typing.Optional[CreateOrUpdateFlagRequestBody] = OMIT,
        icon: typing.Optional[str] = OMIT,
        lifecycle_phase: typing.Optional[UpdateFeatureRequestBodyLifecyclePhase] = OMIT,
        maintainer_id: typing.Optional[str] = OMIT,
        name: typing.Optional[str] = OMIT,
        plural_name: typing.Optional[str] = OMIT,
        singular_name: typing.Optional[str] = OMIT,
        trait_id: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> UpdateFeatureResponse:
        """
        Parameters
        ----------
        feature_id : str
            feature_id

        description : typing.Optional[str]

        event_subtype : typing.Optional[str]

        feature_type : typing.Optional[UpdateFeatureRequestBodyFeatureType]

        flag : typing.Optional[CreateOrUpdateFlagRequestBody]

        icon : typing.Optional[str]

        lifecycle_phase : typing.Optional[UpdateFeatureRequestBodyLifecyclePhase]

        maintainer_id : typing.Optional[str]

        name : typing.Optional[str]

        plural_name : typing.Optional[str]

        singular_name : typing.Optional[str]

        trait_id : typing.Optional[str]

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

        Returns
        -------
        UpdateFeatureResponse
            OK

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

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.features.update_feature(
            feature_id="feature_id",
        )
        """
        _response = self._raw_client.update_feature(
            feature_id,
            description=description,
            event_subtype=event_subtype,
            feature_type=feature_type,
            flag=flag,
            icon=icon,
            lifecycle_phase=lifecycle_phase,
            maintainer_id=maintainer_id,
            name=name,
            plural_name=plural_name,
            singular_name=singular_name,
            trait_id=trait_id,
            request_options=request_options,
        )
        return _response.data

    def delete_feature(
        self, feature_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> DeleteFeatureResponse:
        """
        Parameters
        ----------
        feature_id : str
            feature_id

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

        Returns
        -------
        DeleteFeatureResponse
            OK

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

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.features.delete_feature(
            feature_id="feature_id",
        )
        """
        _response = self._raw_client.delete_feature(feature_id, request_options=request_options)
        return _response.data

    def count_features(
        self,
        *,
        ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        q: typing.Optional[str] = None,
        without_company_override_for: typing.Optional[str] = None,
        without_plan_entitlement_for: typing.Optional[str] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CountFeaturesResponse:
        """
        Parameters
        ----------
        ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]

        q : typing.Optional[str]

        without_company_override_for : typing.Optional[str]
            Filter out features that already have a company override for the specified company ID

        without_plan_entitlement_for : typing.Optional[str]
            Filter out features that already have a plan entitlement for the specified plan ID

        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
        -------
        CountFeaturesResponse
            OK

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

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.features.count_features()
        """
        _response = self._raw_client.count_features(
            ids=ids,
            q=q,
            without_company_override_for=without_company_override_for,
            without_plan_entitlement_for=without_plan_entitlement_for,
            limit=limit,
            offset=offset,
            request_options=request_options,
        )
        return _response.data

    def list_flags(
        self,
        *,
        feature_id: typing.Optional[str] = None,
        ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        q: typing.Optional[str] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ListFlagsResponse:
        """
        Parameters
        ----------
        feature_id : typing.Optional[str]

        ids : typing.Optional[typing.Union[str, typing.Sequence[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
        -------
        ListFlagsResponse
            OK

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

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

    def create_flag(
        self,
        *,
        default_value: bool,
        description: str,
        key: str,
        name: str,
        feature_id: typing.Optional[str] = OMIT,
        maintainer_id: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CreateFlagResponse:
        """
        Parameters
        ----------
        default_value : bool

        description : str

        key : str

        name : str

        feature_id : typing.Optional[str]

        maintainer_id : typing.Optional[str]

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

        Returns
        -------
        CreateFlagResponse
            Created

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

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.features.create_flag(
            default_value=True,
            description="description",
            key="key",
            name="name",
        )
        """
        _response = self._raw_client.create_flag(
            default_value=default_value,
            description=description,
            key=key,
            name=name,
            feature_id=feature_id,
            maintainer_id=maintainer_id,
            request_options=request_options,
        )
        return _response.data

    def get_flag(self, flag_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetFlagResponse:
        """
        Parameters
        ----------
        flag_id : str
            flag_id

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

        Returns
        -------
        GetFlagResponse
            OK

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

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.features.get_flag(
            flag_id="flag_id",
        )
        """
        _response = self._raw_client.get_flag(flag_id, request_options=request_options)
        return _response.data

    def update_flag(
        self,
        flag_id: str,
        *,
        default_value: bool,
        description: str,
        key: str,
        name: str,
        feature_id: typing.Optional[str] = OMIT,
        maintainer_id: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> UpdateFlagResponse:
        """
        Parameters
        ----------
        flag_id : str
            flag_id

        default_value : bool

        description : str

        key : str

        name : str

        feature_id : typing.Optional[str]

        maintainer_id : typing.Optional[str]

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

        Returns
        -------
        UpdateFlagResponse
            OK

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

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.features.update_flag(
            flag_id="flag_id",
            default_value=True,
            description="description",
            key="key",
            name="name",
        )
        """
        _response = self._raw_client.update_flag(
            flag_id,
            default_value=default_value,
            description=description,
            key=key,
            name=name,
            feature_id=feature_id,
            maintainer_id=maintainer_id,
            request_options=request_options,
        )
        return _response.data

    def delete_flag(
        self, flag_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> DeleteFlagResponse:
        """
        Parameters
        ----------
        flag_id : str
            flag_id

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

        Returns
        -------
        DeleteFlagResponse
            OK

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

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.features.delete_flag(
            flag_id="flag_id",
        )
        """
        _response = self._raw_client.delete_flag(flag_id, request_options=request_options)
        return _response.data

    def update_flag_rules(
        self,
        flag_id: str,
        *,
        rules: typing.Sequence[CreateOrUpdateRuleRequestBody],
        request_options: typing.Optional[RequestOptions] = None,
    ) -> UpdateFlagRulesResponse:
        """
        Parameters
        ----------
        flag_id : str
            flag_id

        rules : typing.Sequence[CreateOrUpdateRuleRequestBody]

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

        Returns
        -------
        UpdateFlagRulesResponse
            OK

        Examples
        --------
        from schematic import (
            CreateOrUpdateConditionGroupRequestBody,
            CreateOrUpdateConditionRequestBody,
            CreateOrUpdateRuleRequestBody,
            Schematic,
        )

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.features.update_flag_rules(
            flag_id="flag_id",
            rules=[
                CreateOrUpdateRuleRequestBody(
                    condition_groups=[
                        CreateOrUpdateConditionGroupRequestBody(
                            conditions=[
                                CreateOrUpdateConditionRequestBody(
                                    condition_type="company",
                                    operator="eq",
                                    resource_ids=["resource_ids"],
                                )
                            ],
                        )
                    ],
                    conditions=[
                        CreateOrUpdateConditionRequestBody(
                            condition_type="company",
                            operator="eq",
                            resource_ids=["resource_ids"],
                        )
                    ],
                    name="name",
                    priority=1,
                    value=True,
                )
            ],
        )
        """
        _response = self._raw_client.update_flag_rules(flag_id, rules=rules, request_options=request_options)
        return _response.data

    def check_flag(
        self,
        key: str,
        *,
        company: typing.Optional[typing.Dict[str, str]] = OMIT,
        user: typing.Optional[typing.Dict[str, str]] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CheckFlagResponse:
        """
        Parameters
        ----------
        key : str
            key

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

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

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

        Returns
        -------
        CheckFlagResponse
            OK

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

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.features.check_flag(
            key="key",
        )
        """
        _response = self._raw_client.check_flag(key, company=company, user=user, request_options=request_options)
        return _response.data

    def check_flags(
        self,
        *,
        company: typing.Optional[typing.Dict[str, str]] = OMIT,
        user: typing.Optional[typing.Dict[str, str]] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CheckFlagsResponse:
        """
        Parameters
        ----------
        company : typing.Optional[typing.Dict[str, str]]

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

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

        Returns
        -------
        CheckFlagsResponse
            Created

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

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.features.check_flags()
        """
        _response = self._raw_client.check_flags(company=company, user=user, request_options=request_options)
        return _response.data

    def count_flags(
        self,
        *,
        feature_id: typing.Optional[str] = None,
        ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        q: typing.Optional[str] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CountFlagsResponse:
        """
        Parameters
        ----------
        feature_id : typing.Optional[str]

        ids : typing.Optional[typing.Union[str, typing.Sequence[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
        -------
        CountFlagsResponse
            OK

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

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


class AsyncFeaturesClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawFeaturesClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawFeaturesClient
        """
        return self._raw_client

    async def count_audience_companies(
        self,
        *,
        condition_groups: typing.Sequence[CreateOrUpdateConditionGroupRequestBody],
        conditions: typing.Sequence[CreateOrUpdateConditionRequestBody],
        limit: typing.Optional[int] = OMIT,
        offset: typing.Optional[int] = OMIT,
        q: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CountAudienceCompaniesResponse:
        """
        Parameters
        ----------
        condition_groups : typing.Sequence[CreateOrUpdateConditionGroupRequestBody]

        conditions : typing.Sequence[CreateOrUpdateConditionRequestBody]

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

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

        q : typing.Optional[str]

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

        Returns
        -------
        CountAudienceCompaniesResponse
            Created

        Examples
        --------
        import asyncio

        from schematic import (
            AsyncSchematic,
            CreateOrUpdateConditionGroupRequestBody,
            CreateOrUpdateConditionRequestBody,
        )

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.features.count_audience_companies(
                condition_groups=[
                    CreateOrUpdateConditionGroupRequestBody(
                        conditions=[
                            CreateOrUpdateConditionRequestBody(
                                condition_type="company",
                                operator="eq",
                                resource_ids=["resource_ids"],
                            )
                        ],
                    )
                ],
                conditions=[
                    CreateOrUpdateConditionRequestBody(
                        condition_type="company",
                        operator="eq",
                        resource_ids=["resource_ids"],
                    )
                ],
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.count_audience_companies(
            condition_groups=condition_groups,
            conditions=conditions,
            limit=limit,
            offset=offset,
            q=q,
            request_options=request_options,
        )
        return _response.data

    async def count_audience_users(
        self,
        *,
        condition_groups: typing.Sequence[CreateOrUpdateConditionGroupRequestBody],
        conditions: typing.Sequence[CreateOrUpdateConditionRequestBody],
        limit: typing.Optional[int] = OMIT,
        offset: typing.Optional[int] = OMIT,
        q: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CountAudienceUsersResponse:
        """
        Parameters
        ----------
        condition_groups : typing.Sequence[CreateOrUpdateConditionGroupRequestBody]

        conditions : typing.Sequence[CreateOrUpdateConditionRequestBody]

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

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

        q : typing.Optional[str]

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

        Returns
        -------
        CountAudienceUsersResponse
            Created

        Examples
        --------
        import asyncio

        from schematic import (
            AsyncSchematic,
            CreateOrUpdateConditionGroupRequestBody,
            CreateOrUpdateConditionRequestBody,
        )

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.features.count_audience_users(
                condition_groups=[
                    CreateOrUpdateConditionGroupRequestBody(
                        conditions=[
                            CreateOrUpdateConditionRequestBody(
                                condition_type="company",
                                operator="eq",
                                resource_ids=["resource_ids"],
                            )
                        ],
                    )
                ],
                conditions=[
                    CreateOrUpdateConditionRequestBody(
                        condition_type="company",
                        operator="eq",
                        resource_ids=["resource_ids"],
                    )
                ],
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.count_audience_users(
            condition_groups=condition_groups,
            conditions=conditions,
            limit=limit,
            offset=offset,
            q=q,
            request_options=request_options,
        )
        return _response.data

    async def list_audience_companies(
        self,
        *,
        condition_groups: typing.Sequence[CreateOrUpdateConditionGroupRequestBody],
        conditions: typing.Sequence[CreateOrUpdateConditionRequestBody],
        limit: typing.Optional[int] = OMIT,
        offset: typing.Optional[int] = OMIT,
        q: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ListAudienceCompaniesResponse:
        """
        Parameters
        ----------
        condition_groups : typing.Sequence[CreateOrUpdateConditionGroupRequestBody]

        conditions : typing.Sequence[CreateOrUpdateConditionRequestBody]

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

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

        q : typing.Optional[str]

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

        Returns
        -------
        ListAudienceCompaniesResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import (
            AsyncSchematic,
            CreateOrUpdateConditionGroupRequestBody,
            CreateOrUpdateConditionRequestBody,
        )

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.features.list_audience_companies(
                condition_groups=[
                    CreateOrUpdateConditionGroupRequestBody(
                        conditions=[
                            CreateOrUpdateConditionRequestBody(
                                condition_type="company",
                                operator="eq",
                                resource_ids=["resource_ids"],
                            )
                        ],
                    )
                ],
                conditions=[
                    CreateOrUpdateConditionRequestBody(
                        condition_type="company",
                        operator="eq",
                        resource_ids=["resource_ids"],
                    )
                ],
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.list_audience_companies(
            condition_groups=condition_groups,
            conditions=conditions,
            limit=limit,
            offset=offset,
            q=q,
            request_options=request_options,
        )
        return _response.data

    async def list_audience_users(
        self,
        *,
        condition_groups: typing.Sequence[CreateOrUpdateConditionGroupRequestBody],
        conditions: typing.Sequence[CreateOrUpdateConditionRequestBody],
        limit: typing.Optional[int] = OMIT,
        offset: typing.Optional[int] = OMIT,
        q: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ListAudienceUsersResponse:
        """
        Parameters
        ----------
        condition_groups : typing.Sequence[CreateOrUpdateConditionGroupRequestBody]

        conditions : typing.Sequence[CreateOrUpdateConditionRequestBody]

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

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

        q : typing.Optional[str]

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

        Returns
        -------
        ListAudienceUsersResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import (
            AsyncSchematic,
            CreateOrUpdateConditionGroupRequestBody,
            CreateOrUpdateConditionRequestBody,
        )

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.features.list_audience_users(
                condition_groups=[
                    CreateOrUpdateConditionGroupRequestBody(
                        conditions=[
                            CreateOrUpdateConditionRequestBody(
                                condition_type="company",
                                operator="eq",
                                resource_ids=["resource_ids"],
                            )
                        ],
                    )
                ],
                conditions=[
                    CreateOrUpdateConditionRequestBody(
                        condition_type="company",
                        operator="eq",
                        resource_ids=["resource_ids"],
                    )
                ],
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.list_audience_users(
            condition_groups=condition_groups,
            conditions=conditions,
            limit=limit,
            offset=offset,
            q=q,
            request_options=request_options,
        )
        return _response.data

    async def list_features(
        self,
        *,
        ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        q: typing.Optional[str] = None,
        without_company_override_for: typing.Optional[str] = None,
        without_plan_entitlement_for: typing.Optional[str] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ListFeaturesResponse:
        """
        Parameters
        ----------
        ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]

        q : typing.Optional[str]

        without_company_override_for : typing.Optional[str]
            Filter out features that already have a company override for the specified company ID

        without_plan_entitlement_for : typing.Optional[str]
            Filter out features that already have a plan entitlement for the specified plan ID

        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
        -------
        ListFeaturesResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.features.list_features()


        asyncio.run(main())
        """
        _response = await self._raw_client.list_features(
            ids=ids,
            q=q,
            without_company_override_for=without_company_override_for,
            without_plan_entitlement_for=without_plan_entitlement_for,
            limit=limit,
            offset=offset,
            request_options=request_options,
        )
        return _response.data

    async def create_feature(
        self,
        *,
        description: str,
        feature_type: CreateFeatureRequestBodyFeatureType,
        name: str,
        event_subtype: typing.Optional[str] = OMIT,
        flag: typing.Optional[CreateOrUpdateFlagRequestBody] = OMIT,
        icon: typing.Optional[str] = OMIT,
        lifecycle_phase: typing.Optional[CreateFeatureRequestBodyLifecyclePhase] = OMIT,
        maintainer_id: typing.Optional[str] = OMIT,
        plural_name: typing.Optional[str] = OMIT,
        singular_name: typing.Optional[str] = OMIT,
        trait_id: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CreateFeatureResponse:
        """
        Parameters
        ----------
        description : str

        feature_type : CreateFeatureRequestBodyFeatureType

        name : str

        event_subtype : typing.Optional[str]

        flag : typing.Optional[CreateOrUpdateFlagRequestBody]

        icon : typing.Optional[str]

        lifecycle_phase : typing.Optional[CreateFeatureRequestBodyLifecyclePhase]

        maintainer_id : typing.Optional[str]

        plural_name : typing.Optional[str]

        singular_name : typing.Optional[str]

        trait_id : typing.Optional[str]

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

        Returns
        -------
        CreateFeatureResponse
            Created

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.features.create_feature(
                description="description",
                feature_type="boolean",
                name="name",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.create_feature(
            description=description,
            feature_type=feature_type,
            name=name,
            event_subtype=event_subtype,
            flag=flag,
            icon=icon,
            lifecycle_phase=lifecycle_phase,
            maintainer_id=maintainer_id,
            plural_name=plural_name,
            singular_name=singular_name,
            trait_id=trait_id,
            request_options=request_options,
        )
        return _response.data

    async def get_feature(
        self, feature_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> GetFeatureResponse:
        """
        Parameters
        ----------
        feature_id : str
            feature_id

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

        Returns
        -------
        GetFeatureResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


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


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

    async def update_feature(
        self,
        feature_id: str,
        *,
        description: typing.Optional[str] = OMIT,
        event_subtype: typing.Optional[str] = OMIT,
        feature_type: typing.Optional[UpdateFeatureRequestBodyFeatureType] = OMIT,
        flag: typing.Optional[CreateOrUpdateFlagRequestBody] = OMIT,
        icon: typing.Optional[str] = OMIT,
        lifecycle_phase: typing.Optional[UpdateFeatureRequestBodyLifecyclePhase] = OMIT,
        maintainer_id: typing.Optional[str] = OMIT,
        name: typing.Optional[str] = OMIT,
        plural_name: typing.Optional[str] = OMIT,
        singular_name: typing.Optional[str] = OMIT,
        trait_id: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> UpdateFeatureResponse:
        """
        Parameters
        ----------
        feature_id : str
            feature_id

        description : typing.Optional[str]

        event_subtype : typing.Optional[str]

        feature_type : typing.Optional[UpdateFeatureRequestBodyFeatureType]

        flag : typing.Optional[CreateOrUpdateFlagRequestBody]

        icon : typing.Optional[str]

        lifecycle_phase : typing.Optional[UpdateFeatureRequestBodyLifecyclePhase]

        maintainer_id : typing.Optional[str]

        name : typing.Optional[str]

        plural_name : typing.Optional[str]

        singular_name : typing.Optional[str]

        trait_id : typing.Optional[str]

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

        Returns
        -------
        UpdateFeatureResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


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


        asyncio.run(main())
        """
        _response = await self._raw_client.update_feature(
            feature_id,
            description=description,
            event_subtype=event_subtype,
            feature_type=feature_type,
            flag=flag,
            icon=icon,
            lifecycle_phase=lifecycle_phase,
            maintainer_id=maintainer_id,
            name=name,
            plural_name=plural_name,
            singular_name=singular_name,
            trait_id=trait_id,
            request_options=request_options,
        )
        return _response.data

    async def delete_feature(
        self, feature_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> DeleteFeatureResponse:
        """
        Parameters
        ----------
        feature_id : str
            feature_id

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

        Returns
        -------
        DeleteFeatureResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


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


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

    async def count_features(
        self,
        *,
        ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        q: typing.Optional[str] = None,
        without_company_override_for: typing.Optional[str] = None,
        without_plan_entitlement_for: typing.Optional[str] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CountFeaturesResponse:
        """
        Parameters
        ----------
        ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]

        q : typing.Optional[str]

        without_company_override_for : typing.Optional[str]
            Filter out features that already have a company override for the specified company ID

        without_plan_entitlement_for : typing.Optional[str]
            Filter out features that already have a plan entitlement for the specified plan ID

        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
        -------
        CountFeaturesResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.features.count_features()


        asyncio.run(main())
        """
        _response = await self._raw_client.count_features(
            ids=ids,
            q=q,
            without_company_override_for=without_company_override_for,
            without_plan_entitlement_for=without_plan_entitlement_for,
            limit=limit,
            offset=offset,
            request_options=request_options,
        )
        return _response.data

    async def list_flags(
        self,
        *,
        feature_id: typing.Optional[str] = None,
        ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        q: typing.Optional[str] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ListFlagsResponse:
        """
        Parameters
        ----------
        feature_id : typing.Optional[str]

        ids : typing.Optional[typing.Union[str, typing.Sequence[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
        -------
        ListFlagsResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.features.list_flags()


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

    async def create_flag(
        self,
        *,
        default_value: bool,
        description: str,
        key: str,
        name: str,
        feature_id: typing.Optional[str] = OMIT,
        maintainer_id: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CreateFlagResponse:
        """
        Parameters
        ----------
        default_value : bool

        description : str

        key : str

        name : str

        feature_id : typing.Optional[str]

        maintainer_id : typing.Optional[str]

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

        Returns
        -------
        CreateFlagResponse
            Created

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.features.create_flag(
                default_value=True,
                description="description",
                key="key",
                name="name",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.create_flag(
            default_value=default_value,
            description=description,
            key=key,
            name=name,
            feature_id=feature_id,
            maintainer_id=maintainer_id,
            request_options=request_options,
        )
        return _response.data

    async def get_flag(
        self, flag_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> GetFlagResponse:
        """
        Parameters
        ----------
        flag_id : str
            flag_id

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

        Returns
        -------
        GetFlagResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.features.get_flag(
                flag_id="flag_id",
            )


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

    async def update_flag(
        self,
        flag_id: str,
        *,
        default_value: bool,
        description: str,
        key: str,
        name: str,
        feature_id: typing.Optional[str] = OMIT,
        maintainer_id: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> UpdateFlagResponse:
        """
        Parameters
        ----------
        flag_id : str
            flag_id

        default_value : bool

        description : str

        key : str

        name : str

        feature_id : typing.Optional[str]

        maintainer_id : typing.Optional[str]

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

        Returns
        -------
        UpdateFlagResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.features.update_flag(
                flag_id="flag_id",
                default_value=True,
                description="description",
                key="key",
                name="name",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.update_flag(
            flag_id,
            default_value=default_value,
            description=description,
            key=key,
            name=name,
            feature_id=feature_id,
            maintainer_id=maintainer_id,
            request_options=request_options,
        )
        return _response.data

    async def delete_flag(
        self, flag_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> DeleteFlagResponse:
        """
        Parameters
        ----------
        flag_id : str
            flag_id

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

        Returns
        -------
        DeleteFlagResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.features.delete_flag(
                flag_id="flag_id",
            )


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

    async def update_flag_rules(
        self,
        flag_id: str,
        *,
        rules: typing.Sequence[CreateOrUpdateRuleRequestBody],
        request_options: typing.Optional[RequestOptions] = None,
    ) -> UpdateFlagRulesResponse:
        """
        Parameters
        ----------
        flag_id : str
            flag_id

        rules : typing.Sequence[CreateOrUpdateRuleRequestBody]

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

        Returns
        -------
        UpdateFlagRulesResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import (
            AsyncSchematic,
            CreateOrUpdateConditionGroupRequestBody,
            CreateOrUpdateConditionRequestBody,
            CreateOrUpdateRuleRequestBody,
        )

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.features.update_flag_rules(
                flag_id="flag_id",
                rules=[
                    CreateOrUpdateRuleRequestBody(
                        condition_groups=[
                            CreateOrUpdateConditionGroupRequestBody(
                                conditions=[
                                    CreateOrUpdateConditionRequestBody(
                                        condition_type="company",
                                        operator="eq",
                                        resource_ids=["resource_ids"],
                                    )
                                ],
                            )
                        ],
                        conditions=[
                            CreateOrUpdateConditionRequestBody(
                                condition_type="company",
                                operator="eq",
                                resource_ids=["resource_ids"],
                            )
                        ],
                        name="name",
                        priority=1,
                        value=True,
                    )
                ],
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.update_flag_rules(flag_id, rules=rules, request_options=request_options)
        return _response.data

    async def check_flag(
        self,
        key: str,
        *,
        company: typing.Optional[typing.Dict[str, str]] = OMIT,
        user: typing.Optional[typing.Dict[str, str]] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CheckFlagResponse:
        """
        Parameters
        ----------
        key : str
            key

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

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

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

        Returns
        -------
        CheckFlagResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.features.check_flag(
                key="key",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.check_flag(key, company=company, user=user, request_options=request_options)
        return _response.data

    async def check_flags(
        self,
        *,
        company: typing.Optional[typing.Dict[str, str]] = OMIT,
        user: typing.Optional[typing.Dict[str, str]] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CheckFlagsResponse:
        """
        Parameters
        ----------
        company : typing.Optional[typing.Dict[str, str]]

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

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

        Returns
        -------
        CheckFlagsResponse
            Created

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.features.check_flags()


        asyncio.run(main())
        """
        _response = await self._raw_client.check_flags(company=company, user=user, request_options=request_options)
        return _response.data

    async def count_flags(
        self,
        *,
        feature_id: typing.Optional[str] = None,
        ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        q: typing.Optional[str] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CountFlagsResponse:
        """
        Parameters
        ----------
        feature_id : typing.Optional[str]

        ids : typing.Optional[typing.Union[str, typing.Sequence[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
        -------
        CountFlagsResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.features.count_flags()


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