Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -2912,6 +2912,93 @@ client.manage.v1.projects.billing.breakdown.list(
</dl>


</dd>
</dl>
</details>

## Manage V1 Projects Billing Fields
<details><summary><code>client.manage.v1.projects.billing.fields.<a href="src/deepgram/manage/v1/projects/billing/fields/client.py">list</a>(...)</code></summary>
<dl>
<dd>

#### 📝 Description

<dl>
<dd>

<dl>
<dd>

Lists the accessors, deployment types, tags, and line items used for billing data in the specified time period. Use this endpoint if you want to filter your results from the Billing Breakdown endpoint and want to know what filters are available.
</dd>
</dl>
</dd>
</dl>

#### 🔌 Usage

<dl>
<dd>

<dl>
<dd>

```python
from deepgram import DeepgramClient

client = DeepgramClient(
api_key="YOUR_API_KEY",
)
client.manage.v1.projects.billing.fields.list(
project_id="123456-7890-1234-5678-901234",
)

```
</dd>
</dl>
</dd>
</dl>

#### ⚙️ Parameters

<dl>
<dd>

<dl>
<dd>

**project_id:** `str` — The unique identifier of the project

</dd>
</dl>

<dl>
<dd>

**start:** `typing.Optional[str]` — Start date of the requested date range. Format accepted is YYYY-MM-DD

</dd>
</dl>

<dl>
<dd>

**end:** `typing.Optional[str]` — End date of the requested date range. Format accepted is YYYY-MM-DD

</dd>
</dl>

<dl>
<dd>

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

</dd>
</dl>
</dd>
</dl>


</dd>
</dl>
</details>
Expand Down
9 changes: 9 additions & 0 deletions src/deepgram/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
GetProjectV1Response,
GrantV1Response,
LeaveProjectV1Response,
ListBillingFieldsV1Response,
ListBillingFieldsV1ResponseDeploymentsItem,
ListModelsV1Response,
ListModelsV1ResponseSttModels,
ListModelsV1ResponseTtsModels,
Expand Down Expand Up @@ -223,6 +225,7 @@
GetProjectV1ResponseParams,
GrantV1ResponseParams,
LeaveProjectV1ResponseParams,
ListBillingFieldsV1ResponseParams,
ListModelsV1ResponseParams,
ListModelsV1ResponseSttModelsParams,
ListModelsV1ResponseTtsModelsMetadataParams,
Expand Down Expand Up @@ -399,6 +402,9 @@
"GrantV1ResponseParams": ".requests",
"LeaveProjectV1Response": ".types",
"LeaveProjectV1ResponseParams": ".requests",
"ListBillingFieldsV1Response": ".types",
"ListBillingFieldsV1ResponseDeploymentsItem": ".types",
"ListBillingFieldsV1ResponseParams": ".requests",
"ListModelsV1Response": ".types",
"ListModelsV1ResponseParams": ".requests",
"ListModelsV1ResponseSttModels": ".types",
Expand Down Expand Up @@ -732,6 +738,9 @@ def __dir__():
"GrantV1ResponseParams",
"LeaveProjectV1Response",
"LeaveProjectV1ResponseParams",
"ListBillingFieldsV1Response",
"ListBillingFieldsV1ResponseDeploymentsItem",
"ListBillingFieldsV1ResponseParams",
"ListModelsV1Response",
"ListModelsV1ResponseParams",
"ListModelsV1ResponseSttModels",
Expand Down
12 changes: 10 additions & 2 deletions src/deepgram/manage/v1/projects/billing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
from importlib import import_module

if typing.TYPE_CHECKING:
from . import balances, breakdown, purchases
from . import balances, breakdown, fields, purchases
from .breakdown import BreakdownListRequestDeployment, BreakdownListRequestGroupingItem
_dynamic_imports: typing.Dict[str, str] = {
"BreakdownListRequestDeployment": ".breakdown",
"BreakdownListRequestGroupingItem": ".breakdown",
"balances": ".balances",
"breakdown": ".breakdown",
"fields": ".fields",
"purchases": ".purchases",
}

Expand All @@ -38,4 +39,11 @@ def __dir__():
return sorted(lazy_attrs)


__all__ = ["BreakdownListRequestDeployment", "BreakdownListRequestGroupingItem", "balances", "breakdown", "purchases"]
__all__ = [
"BreakdownListRequestDeployment",
"BreakdownListRequestGroupingItem",
"balances",
"breakdown",
"fields",
"purchases",
]
19 changes: 19 additions & 0 deletions src/deepgram/manage/v1/projects/billing/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
if typing.TYPE_CHECKING:
from .balances.client import AsyncBalancesClient, BalancesClient
from .breakdown.client import AsyncBreakdownClient, BreakdownClient
from .fields.client import AsyncFieldsClient, FieldsClient
from .purchases.client import AsyncPurchasesClient, PurchasesClient


Expand All @@ -19,6 +20,7 @@ def __init__(self, *, client_wrapper: SyncClientWrapper):
self._client_wrapper = client_wrapper
self._balances: typing.Optional[BalancesClient] = None
self._breakdown: typing.Optional[BreakdownClient] = None
self._fields: typing.Optional[FieldsClient] = None
self._purchases: typing.Optional[PurchasesClient] = None

@property
Expand Down Expand Up @@ -48,6 +50,14 @@ def breakdown(self):
self._breakdown = BreakdownClient(client_wrapper=self._client_wrapper)
return self._breakdown

@property
def fields(self):
if self._fields is None:
from .fields.client import FieldsClient # noqa: E402

self._fields = FieldsClient(client_wrapper=self._client_wrapper)
return self._fields

@property
def purchases(self):
if self._purchases is None:
Expand All @@ -63,6 +73,7 @@ def __init__(self, *, client_wrapper: AsyncClientWrapper):
self._client_wrapper = client_wrapper
self._balances: typing.Optional[AsyncBalancesClient] = None
self._breakdown: typing.Optional[AsyncBreakdownClient] = None
self._fields: typing.Optional[AsyncFieldsClient] = None
self._purchases: typing.Optional[AsyncPurchasesClient] = None

@property
Expand Down Expand Up @@ -92,6 +103,14 @@ def breakdown(self):
self._breakdown = AsyncBreakdownClient(client_wrapper=self._client_wrapper)
return self._breakdown

@property
def fields(self):
if self._fields is None:
from .fields.client import AsyncFieldsClient # noqa: E402

self._fields = AsyncFieldsClient(client_wrapper=self._client_wrapper)
return self._fields

@property
def purchases(self):
if self._purchases is None:
Expand Down
4 changes: 4 additions & 0 deletions src/deepgram/manage/v1/projects/billing/fields/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This file was auto-generated by Fern from our API Definition.

# isort: skip_file

136 changes: 136 additions & 0 deletions src/deepgram/manage/v1/projects/billing/fields/client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
# 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.list_billing_fields_v1response import ListBillingFieldsV1Response
from .raw_client import AsyncRawFieldsClient, RawFieldsClient


class FieldsClient:
def __init__(self, *, client_wrapper: SyncClientWrapper):
self._raw_client = RawFieldsClient(client_wrapper=client_wrapper)

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

Returns
-------
RawFieldsClient
"""
return self._raw_client

def list(
self,
project_id: str,
*,
start: typing.Optional[str] = None,
end: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> ListBillingFieldsV1Response:
"""
Lists the accessors, deployment types, tags, and line items used for billing data in the specified time period. Use this endpoint if you want to filter your results from the Billing Breakdown endpoint and want to know what filters are available.

Parameters
----------
project_id : str
The unique identifier of the project

start : typing.Optional[str]
Start date of the requested date range. Format accepted is YYYY-MM-DD

end : typing.Optional[str]
End date of the requested date range. Format accepted is YYYY-MM-DD

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

Returns
-------
ListBillingFieldsV1Response
A list of billing fields for a specific project

Examples
--------
from deepgram import DeepgramClient

client = DeepgramClient(
api_key="YOUR_API_KEY",
)
client.manage.v1.projects.billing.fields.list(
project_id="123456-7890-1234-5678-901234",
)
"""
_response = self._raw_client.list(project_id, start=start, end=end, request_options=request_options)
return _response.data


class AsyncFieldsClient:
def __init__(self, *, client_wrapper: AsyncClientWrapper):
self._raw_client = AsyncRawFieldsClient(client_wrapper=client_wrapper)

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

Returns
-------
AsyncRawFieldsClient
"""
return self._raw_client

async def list(
self,
project_id: str,
*,
start: typing.Optional[str] = None,
end: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> ListBillingFieldsV1Response:
"""
Lists the accessors, deployment types, tags, and line items used for billing data in the specified time period. Use this endpoint if you want to filter your results from the Billing Breakdown endpoint and want to know what filters are available.

Parameters
----------
project_id : str
The unique identifier of the project

start : typing.Optional[str]
Start date of the requested date range. Format accepted is YYYY-MM-DD

end : typing.Optional[str]
End date of the requested date range. Format accepted is YYYY-MM-DD

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

Returns
-------
ListBillingFieldsV1Response
A list of billing fields for a specific project

Examples
--------
import asyncio

from deepgram import AsyncDeepgramClient

client = AsyncDeepgramClient(
api_key="YOUR_API_KEY",
)


async def main() -> None:
await client.manage.v1.projects.billing.fields.list(
project_id="123456-7890-1234-5678-901234",
)


asyncio.run(main())
"""
_response = await self._raw_client.list(project_id, start=start, end=end, request_options=request_options)
return _response.data
Loading