# 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 AsyncRawCreditsClient, RawCreditsClient
from .types.count_billing_credits_grants_response import CountBillingCreditsGrantsResponse
from .types.count_billing_credits_response import CountBillingCreditsResponse
from .types.count_billing_plan_credit_grants_response import CountBillingPlanCreditGrantsResponse
from .types.count_credit_bundles_request_status import CountCreditBundlesRequestStatus
from .types.count_credit_bundles_response import CountCreditBundlesResponse
from .types.count_credit_ledger_request_period import CountCreditLedgerRequestPeriod
from .types.count_credit_ledger_response import CountCreditLedgerResponse
from .types.create_billing_credit_request_body_burn_strategy import CreateBillingCreditRequestBodyBurnStrategy
from .types.create_billing_credit_request_body_default_rollover_policy import (
    CreateBillingCreditRequestBodyDefaultRolloverPolicy,
)
from .types.create_billing_credit_response import CreateBillingCreditResponse
from .types.create_billing_plan_credit_grant_request_body_expiry_type import (
    CreateBillingPlanCreditGrantRequestBodyExpiryType,
)
from .types.create_billing_plan_credit_grant_request_body_expiry_unit import (
    CreateBillingPlanCreditGrantRequestBodyExpiryUnit,
)
from .types.create_billing_plan_credit_grant_request_body_reset_cadence import (
    CreateBillingPlanCreditGrantRequestBodyResetCadence,
)
from .types.create_billing_plan_credit_grant_request_body_reset_start import (
    CreateBillingPlanCreditGrantRequestBodyResetStart,
)
from .types.create_billing_plan_credit_grant_request_body_reset_type import (
    CreateBillingPlanCreditGrantRequestBodyResetType,
)
from .types.create_billing_plan_credit_grant_response import CreateBillingPlanCreditGrantResponse
from .types.create_company_credit_grant_expiry_type import CreateCompanyCreditGrantExpiryType
from .types.create_company_credit_grant_expiry_unit import CreateCompanyCreditGrantExpiryUnit
from .types.create_credit_bundle_request_body_expiry_type import CreateCreditBundleRequestBodyExpiryType
from .types.create_credit_bundle_request_body_expiry_unit import CreateCreditBundleRequestBodyExpiryUnit
from .types.create_credit_bundle_request_body_status import CreateCreditBundleRequestBodyStatus
from .types.create_credit_bundle_response import CreateCreditBundleResponse
from .types.delete_billing_plan_credit_grant_response import DeleteBillingPlanCreditGrantResponse
from .types.delete_credit_bundle_response import DeleteCreditBundleResponse
from .types.get_credit_bundle_response import GetCreditBundleResponse
from .types.get_enriched_credit_ledger_request_period import GetEnrichedCreditLedgerRequestPeriod
from .types.get_enriched_credit_ledger_response import GetEnrichedCreditLedgerResponse
from .types.get_single_billing_credit_response import GetSingleBillingCreditResponse
from .types.grant_billing_credits_to_company_response import GrantBillingCreditsToCompanyResponse
from .types.list_billing_credits_response import ListBillingCreditsResponse
from .types.list_billing_plan_credit_grants_response import ListBillingPlanCreditGrantsResponse
from .types.list_company_grants_request_dir import ListCompanyGrantsRequestDir
from .types.list_company_grants_request_order import ListCompanyGrantsRequestOrder
from .types.list_company_grants_response import ListCompanyGrantsResponse
from .types.list_credit_bundles_request_status import ListCreditBundlesRequestStatus
from .types.list_credit_bundles_response import ListCreditBundlesResponse
from .types.list_grants_for_credit_response import ListGrantsForCreditResponse
from .types.soft_delete_billing_credit_response import SoftDeleteBillingCreditResponse
from .types.update_billing_credit_request_body_burn_strategy import UpdateBillingCreditRequestBodyBurnStrategy
from .types.update_billing_credit_request_body_default_rollover_policy import (
    UpdateBillingCreditRequestBodyDefaultRolloverPolicy,
)
from .types.update_billing_credit_response import UpdateBillingCreditResponse
from .types.update_credit_bundle_details_request_body_expiry_type import UpdateCreditBundleDetailsRequestBodyExpiryType
from .types.update_credit_bundle_details_request_body_expiry_unit import UpdateCreditBundleDetailsRequestBodyExpiryUnit
from .types.update_credit_bundle_details_request_body_status import UpdateCreditBundleDetailsRequestBodyStatus
from .types.update_credit_bundle_details_response import UpdateCreditBundleDetailsResponse
from .types.zero_out_grant_request_body_reason import ZeroOutGrantRequestBodyReason
from .types.zero_out_grant_response import ZeroOutGrantResponse

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


class CreditsClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawCreditsClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawCreditsClient
        """
        return self._raw_client

    def list_billing_credits(
        self,
        *,
        ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        name: typing.Optional[str] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ListBillingCreditsResponse:
        """
        Parameters
        ----------
        ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]

        name : 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
        -------
        ListBillingCreditsResponse
            OK

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

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.credits.list_billing_credits(
            name="name",
            limit=1,
            offset=1,
        )
        """
        _response = self._raw_client.list_billing_credits(
            ids=ids, name=name, limit=limit, offset=offset, request_options=request_options
        )
        return _response.data

    def create_billing_credit(
        self,
        *,
        currency: str,
        description: str,
        name: str,
        burn_strategy: typing.Optional[CreateBillingCreditRequestBodyBurnStrategy] = OMIT,
        default_expiry_unit: typing.Optional[str] = OMIT,
        default_expiry_unit_count: typing.Optional[int] = OMIT,
        default_rollover_policy: typing.Optional[CreateBillingCreditRequestBodyDefaultRolloverPolicy] = OMIT,
        icon: typing.Optional[str] = OMIT,
        per_unit_price: typing.Optional[int] = OMIT,
        per_unit_price_decimal: typing.Optional[str] = OMIT,
        plural_name: typing.Optional[str] = OMIT,
        singular_name: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CreateBillingCreditResponse:
        """
        Parameters
        ----------
        currency : str

        description : str

        name : str

        burn_strategy : typing.Optional[CreateBillingCreditRequestBodyBurnStrategy]

        default_expiry_unit : typing.Optional[str]

        default_expiry_unit_count : typing.Optional[int]

        default_rollover_policy : typing.Optional[CreateBillingCreditRequestBodyDefaultRolloverPolicy]

        icon : typing.Optional[str]

        per_unit_price : typing.Optional[int]

        per_unit_price_decimal : typing.Optional[str]

        plural_name : typing.Optional[str]

        singular_name : typing.Optional[str]

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

        Returns
        -------
        CreateBillingCreditResponse
            Created

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

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.credits.create_billing_credit(
            currency="currency",
            description="description",
            name="name",
        )
        """
        _response = self._raw_client.create_billing_credit(
            currency=currency,
            description=description,
            name=name,
            burn_strategy=burn_strategy,
            default_expiry_unit=default_expiry_unit,
            default_expiry_unit_count=default_expiry_unit_count,
            default_rollover_policy=default_rollover_policy,
            icon=icon,
            per_unit_price=per_unit_price,
            per_unit_price_decimal=per_unit_price_decimal,
            plural_name=plural_name,
            singular_name=singular_name,
            request_options=request_options,
        )
        return _response.data

    def get_single_billing_credit(
        self, credit_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> GetSingleBillingCreditResponse:
        """
        Parameters
        ----------
        credit_id : str
            credit_id

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

        Returns
        -------
        GetSingleBillingCreditResponse
            OK

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

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.credits.get_single_billing_credit(
            credit_id="credit_id",
        )
        """
        _response = self._raw_client.get_single_billing_credit(credit_id, request_options=request_options)
        return _response.data

    def update_billing_credit(
        self,
        credit_id: str,
        *,
        description: str,
        name: str,
        burn_strategy: typing.Optional[UpdateBillingCreditRequestBodyBurnStrategy] = OMIT,
        default_expiry_unit: typing.Optional[typing.Literal["days"]] = OMIT,
        default_expiry_unit_count: typing.Optional[int] = OMIT,
        default_rollover_policy: typing.Optional[UpdateBillingCreditRequestBodyDefaultRolloverPolicy] = OMIT,
        icon: typing.Optional[str] = OMIT,
        per_unit_price: typing.Optional[int] = OMIT,
        per_unit_price_decimal: typing.Optional[str] = OMIT,
        plural_name: typing.Optional[str] = OMIT,
        singular_name: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> UpdateBillingCreditResponse:
        """
        Parameters
        ----------
        credit_id : str
            credit_id

        description : str

        name : str

        burn_strategy : typing.Optional[UpdateBillingCreditRequestBodyBurnStrategy]

        default_expiry_unit : typing.Optional[typing.Literal["days"]]

        default_expiry_unit_count : typing.Optional[int]

        default_rollover_policy : typing.Optional[UpdateBillingCreditRequestBodyDefaultRolloverPolicy]

        icon : typing.Optional[str]

        per_unit_price : typing.Optional[int]

        per_unit_price_decimal : typing.Optional[str]

        plural_name : typing.Optional[str]

        singular_name : typing.Optional[str]

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

        Returns
        -------
        UpdateBillingCreditResponse
            OK

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

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.credits.update_billing_credit(
            credit_id="credit_id",
            description="description",
            name="name",
        )
        """
        _response = self._raw_client.update_billing_credit(
            credit_id,
            description=description,
            name=name,
            burn_strategy=burn_strategy,
            default_expiry_unit=default_expiry_unit,
            default_expiry_unit_count=default_expiry_unit_count,
            default_rollover_policy=default_rollover_policy,
            icon=icon,
            per_unit_price=per_unit_price,
            per_unit_price_decimal=per_unit_price_decimal,
            plural_name=plural_name,
            singular_name=singular_name,
            request_options=request_options,
        )
        return _response.data

    def soft_delete_billing_credit(
        self, credit_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> SoftDeleteBillingCreditResponse:
        """
        Parameters
        ----------
        credit_id : str
            credit_id

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

        Returns
        -------
        SoftDeleteBillingCreditResponse
            OK

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

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.credits.soft_delete_billing_credit(
            credit_id="credit_id",
        )
        """
        _response = self._raw_client.soft_delete_billing_credit(credit_id, request_options=request_options)
        return _response.data

    def list_credit_bundles(
        self,
        *,
        ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        credit_id: typing.Optional[str] = None,
        status: typing.Optional[ListCreditBundlesRequestStatus] = None,
        bundle_type: typing.Optional[typing.Literal["fixed"]] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ListCreditBundlesResponse:
        """
        Parameters
        ----------
        ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]

        credit_id : typing.Optional[str]

        status : typing.Optional[ListCreditBundlesRequestStatus]

        bundle_type : typing.Optional[typing.Literal["fixed"]]

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

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

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.credits.list_credit_bundles(
            credit_id="credit_id",
            status="active",
            limit=1,
            offset=1,
        )
        """
        _response = self._raw_client.list_credit_bundles(
            ids=ids,
            credit_id=credit_id,
            status=status,
            bundle_type=bundle_type,
            limit=limit,
            offset=offset,
            request_options=request_options,
        )
        return _response.data

    def create_credit_bundle(
        self,
        *,
        bundle_name: str,
        credit_id: str,
        currency: str,
        price_per_unit: int,
        bundle_type: typing.Optional[typing.Literal["fixed"]] = OMIT,
        expiry_type: typing.Optional[CreateCreditBundleRequestBodyExpiryType] = OMIT,
        expiry_unit: typing.Optional[CreateCreditBundleRequestBodyExpiryUnit] = OMIT,
        expiry_unit_count: typing.Optional[int] = OMIT,
        price_per_unit_decimal: typing.Optional[str] = OMIT,
        quantity: typing.Optional[int] = OMIT,
        status: typing.Optional[CreateCreditBundleRequestBodyStatus] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CreateCreditBundleResponse:
        """
        Parameters
        ----------
        bundle_name : str

        credit_id : str

        currency : str

        price_per_unit : int

        bundle_type : typing.Optional[typing.Literal["fixed"]]

        expiry_type : typing.Optional[CreateCreditBundleRequestBodyExpiryType]

        expiry_unit : typing.Optional[CreateCreditBundleRequestBodyExpiryUnit]

        expiry_unit_count : typing.Optional[int]

        price_per_unit_decimal : typing.Optional[str]

        quantity : typing.Optional[int]

        status : typing.Optional[CreateCreditBundleRequestBodyStatus]

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

        Returns
        -------
        CreateCreditBundleResponse
            Created

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

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.credits.create_credit_bundle(
            bundle_name="bundle_name",
            credit_id="credit_id",
            currency="currency",
            price_per_unit=1,
        )
        """
        _response = self._raw_client.create_credit_bundle(
            bundle_name=bundle_name,
            credit_id=credit_id,
            currency=currency,
            price_per_unit=price_per_unit,
            bundle_type=bundle_type,
            expiry_type=expiry_type,
            expiry_unit=expiry_unit,
            expiry_unit_count=expiry_unit_count,
            price_per_unit_decimal=price_per_unit_decimal,
            quantity=quantity,
            status=status,
            request_options=request_options,
        )
        return _response.data

    def get_credit_bundle(
        self, bundle_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> GetCreditBundleResponse:
        """
        Parameters
        ----------
        bundle_id : str
            bundle_id

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

        Returns
        -------
        GetCreditBundleResponse
            OK

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

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.credits.get_credit_bundle(
            bundle_id="bundle_id",
        )
        """
        _response = self._raw_client.get_credit_bundle(bundle_id, request_options=request_options)
        return _response.data

    def update_credit_bundle_details(
        self,
        bundle_id: str,
        *,
        bundle_name: str,
        price_per_unit: int,
        expiry_type: typing.Optional[UpdateCreditBundleDetailsRequestBodyExpiryType] = OMIT,
        expiry_unit: typing.Optional[UpdateCreditBundleDetailsRequestBodyExpiryUnit] = OMIT,
        expiry_unit_count: typing.Optional[int] = OMIT,
        price_per_unit_decimal: typing.Optional[str] = OMIT,
        quantity: typing.Optional[int] = OMIT,
        status: typing.Optional[UpdateCreditBundleDetailsRequestBodyStatus] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> UpdateCreditBundleDetailsResponse:
        """
        Parameters
        ----------
        bundle_id : str
            bundle_id

        bundle_name : str

        price_per_unit : int

        expiry_type : typing.Optional[UpdateCreditBundleDetailsRequestBodyExpiryType]

        expiry_unit : typing.Optional[UpdateCreditBundleDetailsRequestBodyExpiryUnit]

        expiry_unit_count : typing.Optional[int]

        price_per_unit_decimal : typing.Optional[str]

        quantity : typing.Optional[int]

        status : typing.Optional[UpdateCreditBundleDetailsRequestBodyStatus]

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

        Returns
        -------
        UpdateCreditBundleDetailsResponse
            OK

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

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.credits.update_credit_bundle_details(
            bundle_id="bundle_id",
            bundle_name="bundle_name",
            price_per_unit=1,
        )
        """
        _response = self._raw_client.update_credit_bundle_details(
            bundle_id,
            bundle_name=bundle_name,
            price_per_unit=price_per_unit,
            expiry_type=expiry_type,
            expiry_unit=expiry_unit,
            expiry_unit_count=expiry_unit_count,
            price_per_unit_decimal=price_per_unit_decimal,
            quantity=quantity,
            status=status,
            request_options=request_options,
        )
        return _response.data

    def delete_credit_bundle(
        self, bundle_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> DeleteCreditBundleResponse:
        """
        Parameters
        ----------
        bundle_id : str
            bundle_id

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

        Returns
        -------
        DeleteCreditBundleResponse
            OK

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

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.credits.delete_credit_bundle(
            bundle_id="bundle_id",
        )
        """
        _response = self._raw_client.delete_credit_bundle(bundle_id, request_options=request_options)
        return _response.data

    def count_credit_bundles(
        self,
        *,
        ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        credit_id: typing.Optional[str] = None,
        status: typing.Optional[CountCreditBundlesRequestStatus] = None,
        bundle_type: typing.Optional[typing.Literal["fixed"]] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CountCreditBundlesResponse:
        """
        Parameters
        ----------
        ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]

        credit_id : typing.Optional[str]

        status : typing.Optional[CountCreditBundlesRequestStatus]

        bundle_type : typing.Optional[typing.Literal["fixed"]]

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

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

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.credits.count_credit_bundles(
            credit_id="credit_id",
            status="active",
            limit=1,
            offset=1,
        )
        """
        _response = self._raw_client.count_credit_bundles(
            ids=ids,
            credit_id=credit_id,
            status=status,
            bundle_type=bundle_type,
            limit=limit,
            offset=offset,
            request_options=request_options,
        )
        return _response.data

    def count_billing_credits(
        self,
        *,
        ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        name: typing.Optional[str] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CountBillingCreditsResponse:
        """
        Parameters
        ----------
        ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]

        name : 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
        -------
        CountBillingCreditsResponse
            OK

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

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.credits.count_billing_credits(
            name="name",
            limit=1,
            offset=1,
        )
        """
        _response = self._raw_client.count_billing_credits(
            ids=ids, name=name, limit=limit, offset=offset, request_options=request_options
        )
        return _response.data

    def zero_out_grant(
        self,
        grant_id: str,
        *,
        reason: typing.Optional[ZeroOutGrantRequestBodyReason] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ZeroOutGrantResponse:
        """
        Parameters
        ----------
        grant_id : str
            grant_id

        reason : typing.Optional[ZeroOutGrantRequestBodyReason]

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

        Returns
        -------
        ZeroOutGrantResponse
            OK

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

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.credits.zero_out_grant(
            grant_id="grant_id",
        )
        """
        _response = self._raw_client.zero_out_grant(grant_id, reason=reason, request_options=request_options)
        return _response.data

    def grant_billing_credits_to_company(
        self,
        *,
        company_id: str,
        credit_id: str,
        quantity: int,
        reason: str,
        billing_periods_count: typing.Optional[int] = OMIT,
        expires_at: typing.Optional[dt.datetime] = OMIT,
        expiry_type: typing.Optional[CreateCompanyCreditGrantExpiryType] = OMIT,
        expiry_unit: typing.Optional[CreateCompanyCreditGrantExpiryUnit] = OMIT,
        expiry_unit_count: typing.Optional[int] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> GrantBillingCreditsToCompanyResponse:
        """
        Parameters
        ----------
        company_id : str

        credit_id : str

        quantity : int

        reason : str

        billing_periods_count : typing.Optional[int]

        expires_at : typing.Optional[dt.datetime]

        expiry_type : typing.Optional[CreateCompanyCreditGrantExpiryType]

        expiry_unit : typing.Optional[CreateCompanyCreditGrantExpiryUnit]

        expiry_unit_count : typing.Optional[int]

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

        Returns
        -------
        GrantBillingCreditsToCompanyResponse
            Created

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

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.credits.grant_billing_credits_to_company(
            company_id="company_id",
            credit_id="credit_id",
            quantity=1,
            reason="reason",
        )
        """
        _response = self._raw_client.grant_billing_credits_to_company(
            company_id=company_id,
            credit_id=credit_id,
            quantity=quantity,
            reason=reason,
            billing_periods_count=billing_periods_count,
            expires_at=expires_at,
            expiry_type=expiry_type,
            expiry_unit=expiry_unit,
            expiry_unit_count=expiry_unit_count,
            request_options=request_options,
        )
        return _response.data

    def list_company_grants(
        self,
        *,
        company_id: typing.Optional[str] = None,
        order: typing.Optional[ListCompanyGrantsRequestOrder] = None,
        dir: typing.Optional[ListCompanyGrantsRequestDir] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ListCompanyGrantsResponse:
        """
        Parameters
        ----------
        company_id : typing.Optional[str]

        order : typing.Optional[ListCompanyGrantsRequestOrder]

        dir : typing.Optional[ListCompanyGrantsRequestDir]

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

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

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.credits.list_company_grants(
            company_id="company_id",
            order="created_at",
            dir="asc",
            limit=1,
            offset=1,
        )
        """
        _response = self._raw_client.list_company_grants(
            company_id=company_id, order=order, dir=dir, limit=limit, offset=offset, request_options=request_options
        )
        return _response.data

    def count_billing_credits_grants(
        self,
        *,
        credit_id: typing.Optional[str] = None,
        ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CountBillingCreditsGrantsResponse:
        """
        Parameters
        ----------
        credit_id : typing.Optional[str]

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

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

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.credits.count_billing_credits_grants(
            credit_id="credit_id",
            limit=1,
            offset=1,
        )
        """
        _response = self._raw_client.count_billing_credits_grants(
            credit_id=credit_id, ids=ids, limit=limit, offset=offset, request_options=request_options
        )
        return _response.data

    def list_grants_for_credit(
        self,
        *,
        credit_id: typing.Optional[str] = None,
        ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ListGrantsForCreditResponse:
        """
        Parameters
        ----------
        credit_id : typing.Optional[str]

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

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

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.credits.list_grants_for_credit(
            credit_id="credit_id",
            limit=1,
            offset=1,
        )
        """
        _response = self._raw_client.list_grants_for_credit(
            credit_id=credit_id, ids=ids, limit=limit, offset=offset, request_options=request_options
        )
        return _response.data

    def get_enriched_credit_ledger(
        self,
        *,
        company_id: str,
        period: GetEnrichedCreditLedgerRequestPeriod,
        billing_credit_id: typing.Optional[str] = None,
        feature_id: typing.Optional[str] = None,
        start_time: typing.Optional[str] = None,
        end_time: typing.Optional[str] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> GetEnrichedCreditLedgerResponse:
        """
        Parameters
        ----------
        company_id : str

        period : GetEnrichedCreditLedgerRequestPeriod

        billing_credit_id : typing.Optional[str]

        feature_id : typing.Optional[str]

        start_time : typing.Optional[str]

        end_time : 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
        -------
        GetEnrichedCreditLedgerResponse
            OK

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

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.credits.get_enriched_credit_ledger(
            company_id="company_id",
            billing_credit_id="billing_credit_id",
            feature_id="feature_id",
            period="daily",
            start_time="start_time",
            end_time="end_time",
            limit=1,
            offset=1,
        )
        """
        _response = self._raw_client.get_enriched_credit_ledger(
            company_id=company_id,
            period=period,
            billing_credit_id=billing_credit_id,
            feature_id=feature_id,
            start_time=start_time,
            end_time=end_time,
            limit=limit,
            offset=offset,
            request_options=request_options,
        )
        return _response.data

    def count_credit_ledger(
        self,
        *,
        company_id: str,
        period: CountCreditLedgerRequestPeriod,
        billing_credit_id: typing.Optional[str] = None,
        feature_id: typing.Optional[str] = None,
        start_time: typing.Optional[str] = None,
        end_time: typing.Optional[str] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CountCreditLedgerResponse:
        """
        Parameters
        ----------
        company_id : str

        period : CountCreditLedgerRequestPeriod

        billing_credit_id : typing.Optional[str]

        feature_id : typing.Optional[str]

        start_time : typing.Optional[str]

        end_time : 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
        -------
        CountCreditLedgerResponse
            OK

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

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.credits.count_credit_ledger(
            company_id="company_id",
            billing_credit_id="billing_credit_id",
            feature_id="feature_id",
            period="daily",
            start_time="start_time",
            end_time="end_time",
            limit=1,
            offset=1,
        )
        """
        _response = self._raw_client.count_credit_ledger(
            company_id=company_id,
            period=period,
            billing_credit_id=billing_credit_id,
            feature_id=feature_id,
            start_time=start_time,
            end_time=end_time,
            limit=limit,
            offset=offset,
            request_options=request_options,
        )
        return _response.data

    def list_billing_plan_credit_grants(
        self,
        *,
        credit_id: typing.Optional[str] = None,
        plan_id: typing.Optional[str] = None,
        plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ListBillingPlanCreditGrantsResponse:
        """
        Parameters
        ----------
        credit_id : typing.Optional[str]

        plan_id : typing.Optional[str]

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

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

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

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.credits.list_billing_plan_credit_grants(
            credit_id="credit_id",
            plan_id="plan_id",
            limit=1,
            offset=1,
        )
        """
        _response = self._raw_client.list_billing_plan_credit_grants(
            credit_id=credit_id,
            plan_id=plan_id,
            plan_ids=plan_ids,
            ids=ids,
            limit=limit,
            offset=offset,
            request_options=request_options,
        )
        return _response.data

    def create_billing_plan_credit_grant(
        self,
        *,
        credit_amount: int,
        credit_id: str,
        plan_id: str,
        reset_cadence: CreateBillingPlanCreditGrantRequestBodyResetCadence,
        reset_start: CreateBillingPlanCreditGrantRequestBodyResetStart,
        expiry_type: typing.Optional[CreateBillingPlanCreditGrantRequestBodyExpiryType] = OMIT,
        expiry_unit: typing.Optional[CreateBillingPlanCreditGrantRequestBodyExpiryUnit] = OMIT,
        expiry_unit_count: typing.Optional[int] = OMIT,
        reset_type: typing.Optional[CreateBillingPlanCreditGrantRequestBodyResetType] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CreateBillingPlanCreditGrantResponse:
        """
        Parameters
        ----------
        credit_amount : int

        credit_id : str

        plan_id : str

        reset_cadence : CreateBillingPlanCreditGrantRequestBodyResetCadence

        reset_start : CreateBillingPlanCreditGrantRequestBodyResetStart

        expiry_type : typing.Optional[CreateBillingPlanCreditGrantRequestBodyExpiryType]

        expiry_unit : typing.Optional[CreateBillingPlanCreditGrantRequestBodyExpiryUnit]

        expiry_unit_count : typing.Optional[int]

        reset_type : typing.Optional[CreateBillingPlanCreditGrantRequestBodyResetType]

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

        Returns
        -------
        CreateBillingPlanCreditGrantResponse
            Created

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

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.credits.create_billing_plan_credit_grant(
            credit_amount=1,
            credit_id="credit_id",
            plan_id="plan_id",
            reset_cadence="monthly",
            reset_start="billing_period",
        )
        """
        _response = self._raw_client.create_billing_plan_credit_grant(
            credit_amount=credit_amount,
            credit_id=credit_id,
            plan_id=plan_id,
            reset_cadence=reset_cadence,
            reset_start=reset_start,
            expiry_type=expiry_type,
            expiry_unit=expiry_unit,
            expiry_unit_count=expiry_unit_count,
            reset_type=reset_type,
            request_options=request_options,
        )
        return _response.data

    def delete_billing_plan_credit_grant(
        self, plan_grant_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> DeleteBillingPlanCreditGrantResponse:
        """
        Parameters
        ----------
        plan_grant_id : str
            plan_grant_id

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

        Returns
        -------
        DeleteBillingPlanCreditGrantResponse
            OK

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

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.credits.delete_billing_plan_credit_grant(
            plan_grant_id="plan_grant_id",
        )
        """
        _response = self._raw_client.delete_billing_plan_credit_grant(plan_grant_id, request_options=request_options)
        return _response.data

    def count_billing_plan_credit_grants(
        self,
        *,
        credit_id: typing.Optional[str] = None,
        plan_id: typing.Optional[str] = None,
        plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CountBillingPlanCreditGrantsResponse:
        """
        Parameters
        ----------
        credit_id : typing.Optional[str]

        plan_id : typing.Optional[str]

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

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

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

        client = Schematic(
            api_key="YOUR_API_KEY",
        )
        client.credits.count_billing_plan_credit_grants(
            credit_id="credit_id",
            plan_id="plan_id",
            limit=1,
            offset=1,
        )
        """
        _response = self._raw_client.count_billing_plan_credit_grants(
            credit_id=credit_id,
            plan_id=plan_id,
            plan_ids=plan_ids,
            ids=ids,
            limit=limit,
            offset=offset,
            request_options=request_options,
        )
        return _response.data


class AsyncCreditsClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawCreditsClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawCreditsClient
        """
        return self._raw_client

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

        name : 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
        -------
        ListBillingCreditsResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.credits.list_billing_credits(
                name="name",
                limit=1,
                offset=1,
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.list_billing_credits(
            ids=ids, name=name, limit=limit, offset=offset, request_options=request_options
        )
        return _response.data

    async def create_billing_credit(
        self,
        *,
        currency: str,
        description: str,
        name: str,
        burn_strategy: typing.Optional[CreateBillingCreditRequestBodyBurnStrategy] = OMIT,
        default_expiry_unit: typing.Optional[str] = OMIT,
        default_expiry_unit_count: typing.Optional[int] = OMIT,
        default_rollover_policy: typing.Optional[CreateBillingCreditRequestBodyDefaultRolloverPolicy] = OMIT,
        icon: typing.Optional[str] = OMIT,
        per_unit_price: typing.Optional[int] = OMIT,
        per_unit_price_decimal: typing.Optional[str] = OMIT,
        plural_name: typing.Optional[str] = OMIT,
        singular_name: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CreateBillingCreditResponse:
        """
        Parameters
        ----------
        currency : str

        description : str

        name : str

        burn_strategy : typing.Optional[CreateBillingCreditRequestBodyBurnStrategy]

        default_expiry_unit : typing.Optional[str]

        default_expiry_unit_count : typing.Optional[int]

        default_rollover_policy : typing.Optional[CreateBillingCreditRequestBodyDefaultRolloverPolicy]

        icon : typing.Optional[str]

        per_unit_price : typing.Optional[int]

        per_unit_price_decimal : typing.Optional[str]

        plural_name : typing.Optional[str]

        singular_name : typing.Optional[str]

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

        Returns
        -------
        CreateBillingCreditResponse
            Created

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.credits.create_billing_credit(
                currency="currency",
                description="description",
                name="name",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.create_billing_credit(
            currency=currency,
            description=description,
            name=name,
            burn_strategy=burn_strategy,
            default_expiry_unit=default_expiry_unit,
            default_expiry_unit_count=default_expiry_unit_count,
            default_rollover_policy=default_rollover_policy,
            icon=icon,
            per_unit_price=per_unit_price,
            per_unit_price_decimal=per_unit_price_decimal,
            plural_name=plural_name,
            singular_name=singular_name,
            request_options=request_options,
        )
        return _response.data

    async def get_single_billing_credit(
        self, credit_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> GetSingleBillingCreditResponse:
        """
        Parameters
        ----------
        credit_id : str
            credit_id

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

        Returns
        -------
        GetSingleBillingCreditResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.credits.get_single_billing_credit(
                credit_id="credit_id",
            )


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

    async def update_billing_credit(
        self,
        credit_id: str,
        *,
        description: str,
        name: str,
        burn_strategy: typing.Optional[UpdateBillingCreditRequestBodyBurnStrategy] = OMIT,
        default_expiry_unit: typing.Optional[typing.Literal["days"]] = OMIT,
        default_expiry_unit_count: typing.Optional[int] = OMIT,
        default_rollover_policy: typing.Optional[UpdateBillingCreditRequestBodyDefaultRolloverPolicy] = OMIT,
        icon: typing.Optional[str] = OMIT,
        per_unit_price: typing.Optional[int] = OMIT,
        per_unit_price_decimal: typing.Optional[str] = OMIT,
        plural_name: typing.Optional[str] = OMIT,
        singular_name: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> UpdateBillingCreditResponse:
        """
        Parameters
        ----------
        credit_id : str
            credit_id

        description : str

        name : str

        burn_strategy : typing.Optional[UpdateBillingCreditRequestBodyBurnStrategy]

        default_expiry_unit : typing.Optional[typing.Literal["days"]]

        default_expiry_unit_count : typing.Optional[int]

        default_rollover_policy : typing.Optional[UpdateBillingCreditRequestBodyDefaultRolloverPolicy]

        icon : typing.Optional[str]

        per_unit_price : typing.Optional[int]

        per_unit_price_decimal : typing.Optional[str]

        plural_name : typing.Optional[str]

        singular_name : typing.Optional[str]

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

        Returns
        -------
        UpdateBillingCreditResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.credits.update_billing_credit(
                credit_id="credit_id",
                description="description",
                name="name",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.update_billing_credit(
            credit_id,
            description=description,
            name=name,
            burn_strategy=burn_strategy,
            default_expiry_unit=default_expiry_unit,
            default_expiry_unit_count=default_expiry_unit_count,
            default_rollover_policy=default_rollover_policy,
            icon=icon,
            per_unit_price=per_unit_price,
            per_unit_price_decimal=per_unit_price_decimal,
            plural_name=plural_name,
            singular_name=singular_name,
            request_options=request_options,
        )
        return _response.data

    async def soft_delete_billing_credit(
        self, credit_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> SoftDeleteBillingCreditResponse:
        """
        Parameters
        ----------
        credit_id : str
            credit_id

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

        Returns
        -------
        SoftDeleteBillingCreditResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.credits.soft_delete_billing_credit(
                credit_id="credit_id",
            )


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

    async def list_credit_bundles(
        self,
        *,
        ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        credit_id: typing.Optional[str] = None,
        status: typing.Optional[ListCreditBundlesRequestStatus] = None,
        bundle_type: typing.Optional[typing.Literal["fixed"]] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ListCreditBundlesResponse:
        """
        Parameters
        ----------
        ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]

        credit_id : typing.Optional[str]

        status : typing.Optional[ListCreditBundlesRequestStatus]

        bundle_type : typing.Optional[typing.Literal["fixed"]]

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

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.credits.list_credit_bundles(
                credit_id="credit_id",
                status="active",
                limit=1,
                offset=1,
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.list_credit_bundles(
            ids=ids,
            credit_id=credit_id,
            status=status,
            bundle_type=bundle_type,
            limit=limit,
            offset=offset,
            request_options=request_options,
        )
        return _response.data

    async def create_credit_bundle(
        self,
        *,
        bundle_name: str,
        credit_id: str,
        currency: str,
        price_per_unit: int,
        bundle_type: typing.Optional[typing.Literal["fixed"]] = OMIT,
        expiry_type: typing.Optional[CreateCreditBundleRequestBodyExpiryType] = OMIT,
        expiry_unit: typing.Optional[CreateCreditBundleRequestBodyExpiryUnit] = OMIT,
        expiry_unit_count: typing.Optional[int] = OMIT,
        price_per_unit_decimal: typing.Optional[str] = OMIT,
        quantity: typing.Optional[int] = OMIT,
        status: typing.Optional[CreateCreditBundleRequestBodyStatus] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CreateCreditBundleResponse:
        """
        Parameters
        ----------
        bundle_name : str

        credit_id : str

        currency : str

        price_per_unit : int

        bundle_type : typing.Optional[typing.Literal["fixed"]]

        expiry_type : typing.Optional[CreateCreditBundleRequestBodyExpiryType]

        expiry_unit : typing.Optional[CreateCreditBundleRequestBodyExpiryUnit]

        expiry_unit_count : typing.Optional[int]

        price_per_unit_decimal : typing.Optional[str]

        quantity : typing.Optional[int]

        status : typing.Optional[CreateCreditBundleRequestBodyStatus]

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

        Returns
        -------
        CreateCreditBundleResponse
            Created

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.credits.create_credit_bundle(
                bundle_name="bundle_name",
                credit_id="credit_id",
                currency="currency",
                price_per_unit=1,
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.create_credit_bundle(
            bundle_name=bundle_name,
            credit_id=credit_id,
            currency=currency,
            price_per_unit=price_per_unit,
            bundle_type=bundle_type,
            expiry_type=expiry_type,
            expiry_unit=expiry_unit,
            expiry_unit_count=expiry_unit_count,
            price_per_unit_decimal=price_per_unit_decimal,
            quantity=quantity,
            status=status,
            request_options=request_options,
        )
        return _response.data

    async def get_credit_bundle(
        self, bundle_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> GetCreditBundleResponse:
        """
        Parameters
        ----------
        bundle_id : str
            bundle_id

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

        Returns
        -------
        GetCreditBundleResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.credits.get_credit_bundle(
                bundle_id="bundle_id",
            )


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

    async def update_credit_bundle_details(
        self,
        bundle_id: str,
        *,
        bundle_name: str,
        price_per_unit: int,
        expiry_type: typing.Optional[UpdateCreditBundleDetailsRequestBodyExpiryType] = OMIT,
        expiry_unit: typing.Optional[UpdateCreditBundleDetailsRequestBodyExpiryUnit] = OMIT,
        expiry_unit_count: typing.Optional[int] = OMIT,
        price_per_unit_decimal: typing.Optional[str] = OMIT,
        quantity: typing.Optional[int] = OMIT,
        status: typing.Optional[UpdateCreditBundleDetailsRequestBodyStatus] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> UpdateCreditBundleDetailsResponse:
        """
        Parameters
        ----------
        bundle_id : str
            bundle_id

        bundle_name : str

        price_per_unit : int

        expiry_type : typing.Optional[UpdateCreditBundleDetailsRequestBodyExpiryType]

        expiry_unit : typing.Optional[UpdateCreditBundleDetailsRequestBodyExpiryUnit]

        expiry_unit_count : typing.Optional[int]

        price_per_unit_decimal : typing.Optional[str]

        quantity : typing.Optional[int]

        status : typing.Optional[UpdateCreditBundleDetailsRequestBodyStatus]

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

        Returns
        -------
        UpdateCreditBundleDetailsResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.credits.update_credit_bundle_details(
                bundle_id="bundle_id",
                bundle_name="bundle_name",
                price_per_unit=1,
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.update_credit_bundle_details(
            bundle_id,
            bundle_name=bundle_name,
            price_per_unit=price_per_unit,
            expiry_type=expiry_type,
            expiry_unit=expiry_unit,
            expiry_unit_count=expiry_unit_count,
            price_per_unit_decimal=price_per_unit_decimal,
            quantity=quantity,
            status=status,
            request_options=request_options,
        )
        return _response.data

    async def delete_credit_bundle(
        self, bundle_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> DeleteCreditBundleResponse:
        """
        Parameters
        ----------
        bundle_id : str
            bundle_id

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

        Returns
        -------
        DeleteCreditBundleResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.credits.delete_credit_bundle(
                bundle_id="bundle_id",
            )


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

    async def count_credit_bundles(
        self,
        *,
        ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        credit_id: typing.Optional[str] = None,
        status: typing.Optional[CountCreditBundlesRequestStatus] = None,
        bundle_type: typing.Optional[typing.Literal["fixed"]] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CountCreditBundlesResponse:
        """
        Parameters
        ----------
        ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]

        credit_id : typing.Optional[str]

        status : typing.Optional[CountCreditBundlesRequestStatus]

        bundle_type : typing.Optional[typing.Literal["fixed"]]

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

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.credits.count_credit_bundles(
                credit_id="credit_id",
                status="active",
                limit=1,
                offset=1,
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.count_credit_bundles(
            ids=ids,
            credit_id=credit_id,
            status=status,
            bundle_type=bundle_type,
            limit=limit,
            offset=offset,
            request_options=request_options,
        )
        return _response.data

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

        name : 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
        -------
        CountBillingCreditsResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.credits.count_billing_credits(
                name="name",
                limit=1,
                offset=1,
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.count_billing_credits(
            ids=ids, name=name, limit=limit, offset=offset, request_options=request_options
        )
        return _response.data

    async def zero_out_grant(
        self,
        grant_id: str,
        *,
        reason: typing.Optional[ZeroOutGrantRequestBodyReason] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ZeroOutGrantResponse:
        """
        Parameters
        ----------
        grant_id : str
            grant_id

        reason : typing.Optional[ZeroOutGrantRequestBodyReason]

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

        Returns
        -------
        ZeroOutGrantResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.credits.zero_out_grant(
                grant_id="grant_id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.zero_out_grant(grant_id, reason=reason, request_options=request_options)
        return _response.data

    async def grant_billing_credits_to_company(
        self,
        *,
        company_id: str,
        credit_id: str,
        quantity: int,
        reason: str,
        billing_periods_count: typing.Optional[int] = OMIT,
        expires_at: typing.Optional[dt.datetime] = OMIT,
        expiry_type: typing.Optional[CreateCompanyCreditGrantExpiryType] = OMIT,
        expiry_unit: typing.Optional[CreateCompanyCreditGrantExpiryUnit] = OMIT,
        expiry_unit_count: typing.Optional[int] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> GrantBillingCreditsToCompanyResponse:
        """
        Parameters
        ----------
        company_id : str

        credit_id : str

        quantity : int

        reason : str

        billing_periods_count : typing.Optional[int]

        expires_at : typing.Optional[dt.datetime]

        expiry_type : typing.Optional[CreateCompanyCreditGrantExpiryType]

        expiry_unit : typing.Optional[CreateCompanyCreditGrantExpiryUnit]

        expiry_unit_count : typing.Optional[int]

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

        Returns
        -------
        GrantBillingCreditsToCompanyResponse
            Created

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.credits.grant_billing_credits_to_company(
                company_id="company_id",
                credit_id="credit_id",
                quantity=1,
                reason="reason",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.grant_billing_credits_to_company(
            company_id=company_id,
            credit_id=credit_id,
            quantity=quantity,
            reason=reason,
            billing_periods_count=billing_periods_count,
            expires_at=expires_at,
            expiry_type=expiry_type,
            expiry_unit=expiry_unit,
            expiry_unit_count=expiry_unit_count,
            request_options=request_options,
        )
        return _response.data

    async def list_company_grants(
        self,
        *,
        company_id: typing.Optional[str] = None,
        order: typing.Optional[ListCompanyGrantsRequestOrder] = None,
        dir: typing.Optional[ListCompanyGrantsRequestDir] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ListCompanyGrantsResponse:
        """
        Parameters
        ----------
        company_id : typing.Optional[str]

        order : typing.Optional[ListCompanyGrantsRequestOrder]

        dir : typing.Optional[ListCompanyGrantsRequestDir]

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

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.credits.list_company_grants(
                company_id="company_id",
                order="created_at",
                dir="asc",
                limit=1,
                offset=1,
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.list_company_grants(
            company_id=company_id, order=order, dir=dir, limit=limit, offset=offset, request_options=request_options
        )
        return _response.data

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

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

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.credits.count_billing_credits_grants(
                credit_id="credit_id",
                limit=1,
                offset=1,
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.count_billing_credits_grants(
            credit_id=credit_id, ids=ids, limit=limit, offset=offset, request_options=request_options
        )
        return _response.data

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

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

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.credits.list_grants_for_credit(
                credit_id="credit_id",
                limit=1,
                offset=1,
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.list_grants_for_credit(
            credit_id=credit_id, ids=ids, limit=limit, offset=offset, request_options=request_options
        )
        return _response.data

    async def get_enriched_credit_ledger(
        self,
        *,
        company_id: str,
        period: GetEnrichedCreditLedgerRequestPeriod,
        billing_credit_id: typing.Optional[str] = None,
        feature_id: typing.Optional[str] = None,
        start_time: typing.Optional[str] = None,
        end_time: typing.Optional[str] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> GetEnrichedCreditLedgerResponse:
        """
        Parameters
        ----------
        company_id : str

        period : GetEnrichedCreditLedgerRequestPeriod

        billing_credit_id : typing.Optional[str]

        feature_id : typing.Optional[str]

        start_time : typing.Optional[str]

        end_time : 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
        -------
        GetEnrichedCreditLedgerResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.credits.get_enriched_credit_ledger(
                company_id="company_id",
                billing_credit_id="billing_credit_id",
                feature_id="feature_id",
                period="daily",
                start_time="start_time",
                end_time="end_time",
                limit=1,
                offset=1,
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.get_enriched_credit_ledger(
            company_id=company_id,
            period=period,
            billing_credit_id=billing_credit_id,
            feature_id=feature_id,
            start_time=start_time,
            end_time=end_time,
            limit=limit,
            offset=offset,
            request_options=request_options,
        )
        return _response.data

    async def count_credit_ledger(
        self,
        *,
        company_id: str,
        period: CountCreditLedgerRequestPeriod,
        billing_credit_id: typing.Optional[str] = None,
        feature_id: typing.Optional[str] = None,
        start_time: typing.Optional[str] = None,
        end_time: typing.Optional[str] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CountCreditLedgerResponse:
        """
        Parameters
        ----------
        company_id : str

        period : CountCreditLedgerRequestPeriod

        billing_credit_id : typing.Optional[str]

        feature_id : typing.Optional[str]

        start_time : typing.Optional[str]

        end_time : 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
        -------
        CountCreditLedgerResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.credits.count_credit_ledger(
                company_id="company_id",
                billing_credit_id="billing_credit_id",
                feature_id="feature_id",
                period="daily",
                start_time="start_time",
                end_time="end_time",
                limit=1,
                offset=1,
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.count_credit_ledger(
            company_id=company_id,
            period=period,
            billing_credit_id=billing_credit_id,
            feature_id=feature_id,
            start_time=start_time,
            end_time=end_time,
            limit=limit,
            offset=offset,
            request_options=request_options,
        )
        return _response.data

    async def list_billing_plan_credit_grants(
        self,
        *,
        credit_id: typing.Optional[str] = None,
        plan_id: typing.Optional[str] = None,
        plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ListBillingPlanCreditGrantsResponse:
        """
        Parameters
        ----------
        credit_id : typing.Optional[str]

        plan_id : typing.Optional[str]

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

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

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.credits.list_billing_plan_credit_grants(
                credit_id="credit_id",
                plan_id="plan_id",
                limit=1,
                offset=1,
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.list_billing_plan_credit_grants(
            credit_id=credit_id,
            plan_id=plan_id,
            plan_ids=plan_ids,
            ids=ids,
            limit=limit,
            offset=offset,
            request_options=request_options,
        )
        return _response.data

    async def create_billing_plan_credit_grant(
        self,
        *,
        credit_amount: int,
        credit_id: str,
        plan_id: str,
        reset_cadence: CreateBillingPlanCreditGrantRequestBodyResetCadence,
        reset_start: CreateBillingPlanCreditGrantRequestBodyResetStart,
        expiry_type: typing.Optional[CreateBillingPlanCreditGrantRequestBodyExpiryType] = OMIT,
        expiry_unit: typing.Optional[CreateBillingPlanCreditGrantRequestBodyExpiryUnit] = OMIT,
        expiry_unit_count: typing.Optional[int] = OMIT,
        reset_type: typing.Optional[CreateBillingPlanCreditGrantRequestBodyResetType] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CreateBillingPlanCreditGrantResponse:
        """
        Parameters
        ----------
        credit_amount : int

        credit_id : str

        plan_id : str

        reset_cadence : CreateBillingPlanCreditGrantRequestBodyResetCadence

        reset_start : CreateBillingPlanCreditGrantRequestBodyResetStart

        expiry_type : typing.Optional[CreateBillingPlanCreditGrantRequestBodyExpiryType]

        expiry_unit : typing.Optional[CreateBillingPlanCreditGrantRequestBodyExpiryUnit]

        expiry_unit_count : typing.Optional[int]

        reset_type : typing.Optional[CreateBillingPlanCreditGrantRequestBodyResetType]

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

        Returns
        -------
        CreateBillingPlanCreditGrantResponse
            Created

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.credits.create_billing_plan_credit_grant(
                credit_amount=1,
                credit_id="credit_id",
                plan_id="plan_id",
                reset_cadence="monthly",
                reset_start="billing_period",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.create_billing_plan_credit_grant(
            credit_amount=credit_amount,
            credit_id=credit_id,
            plan_id=plan_id,
            reset_cadence=reset_cadence,
            reset_start=reset_start,
            expiry_type=expiry_type,
            expiry_unit=expiry_unit,
            expiry_unit_count=expiry_unit_count,
            reset_type=reset_type,
            request_options=request_options,
        )
        return _response.data

    async def delete_billing_plan_credit_grant(
        self, plan_grant_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> DeleteBillingPlanCreditGrantResponse:
        """
        Parameters
        ----------
        plan_grant_id : str
            plan_grant_id

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

        Returns
        -------
        DeleteBillingPlanCreditGrantResponse
            OK

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.credits.delete_billing_plan_credit_grant(
                plan_grant_id="plan_grant_id",
            )


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

    async def count_billing_plan_credit_grants(
        self,
        *,
        credit_id: typing.Optional[str] = None,
        plan_id: typing.Optional[str] = None,
        plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CountBillingPlanCreditGrantsResponse:
        """
        Parameters
        ----------
        credit_id : typing.Optional[str]

        plan_id : typing.Optional[str]

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

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

        Examples
        --------
        import asyncio

        from schematic import AsyncSchematic

        client = AsyncSchematic(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.credits.count_billing_plan_credit_grants(
                credit_id="credit_id",
                plan_id="plan_id",
                limit=1,
                offset=1,
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.count_billing_plan_credit_grants(
            credit_id=credit_id,
            plan_id=plan_id,
            plan_ids=plan_ids,
            ids=ids,
            limit=limit,
            offset=offset,
            request_options=request_options,
        )
        return _response.data
