|
| 1 | +# This file was auto-generated by Fern from our API Definition. |
| 2 | + |
| 3 | +import typing |
| 4 | + |
| 5 | +from ......core.client_wrapper import AsyncClientWrapper, SyncClientWrapper |
| 6 | +from ......core.request_options import RequestOptions |
| 7 | +from ......types.list_billing_fields_v1response import ListBillingFieldsV1Response |
| 8 | +from .raw_client import AsyncRawFieldsClient, RawFieldsClient |
| 9 | + |
| 10 | + |
| 11 | +class FieldsClient: |
| 12 | + def __init__(self, *, client_wrapper: SyncClientWrapper): |
| 13 | + self._raw_client = RawFieldsClient(client_wrapper=client_wrapper) |
| 14 | + |
| 15 | + @property |
| 16 | + def with_raw_response(self) -> RawFieldsClient: |
| 17 | + """ |
| 18 | + Retrieves a raw implementation of this client that returns raw responses. |
| 19 | +
|
| 20 | + Returns |
| 21 | + ------- |
| 22 | + RawFieldsClient |
| 23 | + """ |
| 24 | + return self._raw_client |
| 25 | + |
| 26 | + def list( |
| 27 | + self, |
| 28 | + project_id: str, |
| 29 | + *, |
| 30 | + start: typing.Optional[str] = None, |
| 31 | + end: typing.Optional[str] = None, |
| 32 | + request_options: typing.Optional[RequestOptions] = None, |
| 33 | + ) -> ListBillingFieldsV1Response: |
| 34 | + """ |
| 35 | + 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. |
| 36 | +
|
| 37 | + Parameters |
| 38 | + ---------- |
| 39 | + project_id : str |
| 40 | + The unique identifier of the project |
| 41 | +
|
| 42 | + start : typing.Optional[str] |
| 43 | + Start date of the requested date range. Format accepted is YYYY-MM-DD |
| 44 | +
|
| 45 | + end : typing.Optional[str] |
| 46 | + End date of the requested date range. Format accepted is YYYY-MM-DD |
| 47 | +
|
| 48 | + request_options : typing.Optional[RequestOptions] |
| 49 | + Request-specific configuration. |
| 50 | +
|
| 51 | + Returns |
| 52 | + ------- |
| 53 | + ListBillingFieldsV1Response |
| 54 | + A list of billing fields for a specific project |
| 55 | +
|
| 56 | + Examples |
| 57 | + -------- |
| 58 | + from deepgram import DeepgramClient |
| 59 | +
|
| 60 | + client = DeepgramClient( |
| 61 | + api_key="YOUR_API_KEY", |
| 62 | + ) |
| 63 | + client.manage.v1.projects.billing.fields.list( |
| 64 | + project_id="123456-7890-1234-5678-901234", |
| 65 | + ) |
| 66 | + """ |
| 67 | + _response = self._raw_client.list(project_id, start=start, end=end, request_options=request_options) |
| 68 | + return _response.data |
| 69 | + |
| 70 | + |
| 71 | +class AsyncFieldsClient: |
| 72 | + def __init__(self, *, client_wrapper: AsyncClientWrapper): |
| 73 | + self._raw_client = AsyncRawFieldsClient(client_wrapper=client_wrapper) |
| 74 | + |
| 75 | + @property |
| 76 | + def with_raw_response(self) -> AsyncRawFieldsClient: |
| 77 | + """ |
| 78 | + Retrieves a raw implementation of this client that returns raw responses. |
| 79 | +
|
| 80 | + Returns |
| 81 | + ------- |
| 82 | + AsyncRawFieldsClient |
| 83 | + """ |
| 84 | + return self._raw_client |
| 85 | + |
| 86 | + async def list( |
| 87 | + self, |
| 88 | + project_id: str, |
| 89 | + *, |
| 90 | + start: typing.Optional[str] = None, |
| 91 | + end: typing.Optional[str] = None, |
| 92 | + request_options: typing.Optional[RequestOptions] = None, |
| 93 | + ) -> ListBillingFieldsV1Response: |
| 94 | + """ |
| 95 | + 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. |
| 96 | +
|
| 97 | + Parameters |
| 98 | + ---------- |
| 99 | + project_id : str |
| 100 | + The unique identifier of the project |
| 101 | +
|
| 102 | + start : typing.Optional[str] |
| 103 | + Start date of the requested date range. Format accepted is YYYY-MM-DD |
| 104 | +
|
| 105 | + end : typing.Optional[str] |
| 106 | + End date of the requested date range. Format accepted is YYYY-MM-DD |
| 107 | +
|
| 108 | + request_options : typing.Optional[RequestOptions] |
| 109 | + Request-specific configuration. |
| 110 | +
|
| 111 | + Returns |
| 112 | + ------- |
| 113 | + ListBillingFieldsV1Response |
| 114 | + A list of billing fields for a specific project |
| 115 | +
|
| 116 | + Examples |
| 117 | + -------- |
| 118 | + import asyncio |
| 119 | +
|
| 120 | + from deepgram import AsyncDeepgramClient |
| 121 | +
|
| 122 | + client = AsyncDeepgramClient( |
| 123 | + api_key="YOUR_API_KEY", |
| 124 | + ) |
| 125 | +
|
| 126 | +
|
| 127 | + async def main() -> None: |
| 128 | + await client.manage.v1.projects.billing.fields.list( |
| 129 | + project_id="123456-7890-1234-5678-901234", |
| 130 | + ) |
| 131 | +
|
| 132 | +
|
| 133 | + asyncio.run(main()) |
| 134 | + """ |
| 135 | + _response = await self._raw_client.list(project_id, start=start, end=end, request_options=request_options) |
| 136 | + return _response.data |
0 commit comments