Skip to content

Commit

Permalink
feat(api): api update (#232)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Nov 4, 2024
1 parent e339794 commit 66adc05
Show file tree
Hide file tree
Showing 6 changed files with 200 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 71
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/conductor%2Fconductor-a6a18ba80810ceb90173e44a17324eb2a9fbd683627c02811c5d70eaedc142af.yml
configured_endpoints: 72
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/conductor%2Fconductor-1eeb4013155ccc760ed7f7d33c403b74e4a1c22db9c98e09fce7a16ae2e6497d.yml
5 changes: 3 additions & 2 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,10 @@ Methods:
Types:

```python
from conductor.types.qbd import CheckListResponse
from conductor.types.qbd import QbdCheck
```

Methods:

- <code title="get /quickbooks-desktop/checks">client.qbd.checks.<a href="./src/conductor/resources/qbd/checks.py">list</a>(\*\*<a href="src/conductor/types/qbd/check_list_params.py">params</a>) -> <a href="./src/conductor/types/qbd/check_list_response.py">SyncCursorPage[CheckListResponse]</a></code>
- <code title="get /quickbooks-desktop/checks/{id}">client.qbd.checks.<a href="./src/conductor/resources/qbd/checks.py">retrieve</a>(id) -> <a href="./src/conductor/types/qbd/qbd_check.py">QbdCheck</a></code>
- <code title="get /quickbooks-desktop/checks">client.qbd.checks.<a href="./src/conductor/resources/qbd/checks.py">list</a>(\*\*<a href="src/conductor/types/qbd/check_list_params.py">params</a>) -> <a href="./src/conductor/types/qbd/qbd_check.py">SyncCursorPage[QbdCheck]</a></code>
106 changes: 99 additions & 7 deletions src/conductor/resources/qbd/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from ...types.qbd import check_list_params
from ...pagination import SyncCursorPage, AsyncCursorPage
from ..._base_client import AsyncPaginator, make_request_options
from ...types.qbd.check_list_response import CheckListResponse
from ...types.qbd.qbd_check import QbdCheck

__all__ = ["ChecksResource", "AsyncChecksResource"]

Expand All @@ -45,6 +45,46 @@ def with_streaming_response(self) -> ChecksResourceWithStreamingResponse:
"""
return ChecksResourceWithStreamingResponse(self)

def retrieve(
self,
id: str,
*,
conductor_end_user_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> QbdCheck:
"""
Retrieves a check by ID.
Args:
id: The QuickBooks-assigned unique identifier of the check to retrieve.
conductor_end_user_id: The ID of the EndUser to receive this request (e.g.,
`"Conductor-End-User-Id: {{END_USER_ID}}"`).
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
"""
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
extra_headers = {"Conductor-End-User-Id": conductor_end_user_id, **(extra_headers or {})}
return self._get(
f"/quickbooks-desktop/checks/{id}",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=QbdCheck,
)

def list(
self,
*,
Expand Down Expand Up @@ -73,7 +113,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SyncCursorPage[CheckListResponse]:
) -> SyncCursorPage[QbdCheck]:
"""
Returns a list of checks.
Expand Down Expand Up @@ -164,7 +204,7 @@ def list(
extra_headers = {"Conductor-End-User-Id": conductor_end_user_id, **(extra_headers or {})}
return self._get_api_list(
"/quickbooks-desktop/checks",
page=SyncCursorPage[CheckListResponse],
page=SyncCursorPage[QbdCheck],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
Expand Down Expand Up @@ -194,7 +234,7 @@ def list(
check_list_params.CheckListParams,
),
),
model=CheckListResponse,
model=QbdCheck,
)


Expand All @@ -218,6 +258,46 @@ def with_streaming_response(self) -> AsyncChecksResourceWithStreamingResponse:
"""
return AsyncChecksResourceWithStreamingResponse(self)

async def retrieve(
self,
id: str,
*,
conductor_end_user_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> QbdCheck:
"""
Retrieves a check by ID.
Args:
id: The QuickBooks-assigned unique identifier of the check to retrieve.
conductor_end_user_id: The ID of the EndUser to receive this request (e.g.,
`"Conductor-End-User-Id: {{END_USER_ID}}"`).
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
"""
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
extra_headers = {"Conductor-End-User-Id": conductor_end_user_id, **(extra_headers or {})}
return await self._get(
f"/quickbooks-desktop/checks/{id}",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=QbdCheck,
)

def list(
self,
*,
Expand Down Expand Up @@ -246,7 +326,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AsyncPaginator[CheckListResponse, AsyncCursorPage[CheckListResponse]]:
) -> AsyncPaginator[QbdCheck, AsyncCursorPage[QbdCheck]]:
"""
Returns a list of checks.
Expand Down Expand Up @@ -337,7 +417,7 @@ def list(
extra_headers = {"Conductor-End-User-Id": conductor_end_user_id, **(extra_headers or {})}
return self._get_api_list(
"/quickbooks-desktop/checks",
page=AsyncCursorPage[CheckListResponse],
page=AsyncCursorPage[QbdCheck],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
Expand Down Expand Up @@ -367,14 +447,17 @@ def list(
check_list_params.CheckListParams,
),
),
model=CheckListResponse,
model=QbdCheck,
)


class ChecksResourceWithRawResponse:
def __init__(self, checks: ChecksResource) -> None:
self._checks = checks

self.retrieve = to_raw_response_wrapper(
checks.retrieve,
)
self.list = to_raw_response_wrapper(
checks.list,
)
Expand All @@ -384,6 +467,9 @@ class AsyncChecksResourceWithRawResponse:
def __init__(self, checks: AsyncChecksResource) -> None:
self._checks = checks

self.retrieve = async_to_raw_response_wrapper(
checks.retrieve,
)
self.list = async_to_raw_response_wrapper(
checks.list,
)
Expand All @@ -393,6 +479,9 @@ class ChecksResourceWithStreamingResponse:
def __init__(self, checks: ChecksResource) -> None:
self._checks = checks

self.retrieve = to_streamed_response_wrapper(
checks.retrieve,
)
self.list = to_streamed_response_wrapper(
checks.list,
)
Expand All @@ -402,6 +491,9 @@ class AsyncChecksResourceWithStreamingResponse:
def __init__(self, checks: AsyncChecksResource) -> None:
self._checks = checks

self.retrieve = async_to_streamed_response_wrapper(
checks.retrieve,
)
self.list = async_to_streamed_response_wrapper(
checks.list,
)
2 changes: 1 addition & 1 deletion src/conductor/types/qbd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from .invoice import Invoice as Invoice
from .customer import Customer as Customer
from .transfer import Transfer as Transfer
from .qbd_check import QbdCheck as QbdCheck
from .service_item import ServiceItem as ServiceItem
from .standard_term import StandardTerm as StandardTerm
from .inventory_item import InventoryItem as InventoryItem
Expand All @@ -25,7 +26,6 @@
from .non_inventory_item import NonInventoryItem as NonInventoryItem
from .vendor_list_params import VendorListParams as VendorListParams
from .account_list_params import AccountListParams as AccountListParams
from .check_list_response import CheckListResponse as CheckListResponse
from .class_create_params import ClassCreateParams as ClassCreateParams
from .class_list_response import ClassListResponse as ClassListResponse
from .class_update_params import ClassUpdateParams as ClassUpdateParams
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from ..._models import BaseModel

__all__ = [
"CheckListResponse",
"QbdCheck",
"Account",
"Address",
"Currency",
Expand Down Expand Up @@ -1172,7 +1172,7 @@ class SalesTaxCode(BaseModel):
"""


class CheckListResponse(BaseModel):
class QbdCheck(BaseModel):
id: str
"""The unique identifier assigned by QuickBooks to this check.
Expand Down
Loading

0 comments on commit 66adc05

Please sign in to comment.