Skip to content

Commit

Permalink
feat(api): api update (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Oct 9, 2024
1 parent d75fe5c commit 028221b
Show file tree
Hide file tree
Showing 10 changed files with 300 additions and 19 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: 48
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/conductor%2Fconductor-718574f99ce1ca403cfbfed1749f5ef4c78733d417d71ce29dcceb152e3b5cec.yml
configured_endpoints: 49
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/conductor%2Fconductor-b72cbb29975fb7eb76998a0147cb708ab08c0084eec602f0d3e2751e2eecadb5.yml
1 change: 1 addition & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ from conductor.types.qbd import QbdStandardTerm, StandardTermListResponse

Methods:

- <code title="post /quickbooks-desktop/standard-terms">client.qbd.standard_terms.<a href="./src/conductor/resources/qbd/standard_terms.py">create</a>(\*\*<a href="src/conductor/types/qbd/standard_term_create_params.py">params</a>) -> <a href="./src/conductor/types/qbd/qbd_standard_term.py">QbdStandardTerm</a></code>
- <code title="get /quickbooks-desktop/standard-terms/{id}">client.qbd.standard_terms.<a href="./src/conductor/resources/qbd/standard_terms.py">retrieve</a>(id) -> <a href="./src/conductor/types/qbd/qbd_standard_term.py">QbdStandardTerm</a></code>
- <code title="get /quickbooks-desktop/standard-terms">client.qbd.standard_terms.<a href="./src/conductor/resources/qbd/standard_terms.py">list</a>(\*\*<a href="src/conductor/types/qbd/standard_term_list_params.py">params</a>) -> <a href="./src/conductor/types/qbd/standard_term_list_response.py">StandardTermListResponse</a></code>

Expand Down
12 changes: 6 additions & 6 deletions src/conductor/resources/qbd/date_driven_terms.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ def create(
`"Conductor-End-User-Id: {{END_USER_ID}}"`).
discount_day_of_month: The day of the month within which payment must be received to qualify for the
discount defined by `discountPercentage`.
discount specified by `discountPercentage`.
discount_percentage: The discount percentage applied to the payment if received by the
`discountDayOfMonth`. The value is between 0 and 100.
discount_percentage: The discount percentage applied to the payment if received on or before the
specified `discountDayOfMonth`. The value is between 0 and 100.
grace_period_days: The number of days before `dueDayOfMonth` when an invoice or bill issued within
this threshold is considered due the following month. For example, with
Expand Down Expand Up @@ -321,10 +321,10 @@ async def create(
`"Conductor-End-User-Id: {{END_USER_ID}}"`).
discount_day_of_month: The day of the month within which payment must be received to qualify for the
discount defined by `discountPercentage`.
discount specified by `discountPercentage`.
discount_percentage: The discount percentage applied to the payment if received by the
`discountDayOfMonth`. The value is between 0 and 100.
discount_percentage: The discount percentage applied to the payment if received on or before the
specified `discountDayOfMonth`. The value is between 0 and 100.
grace_period_days: The number of days before `dueDayOfMonth` when an invoice or bill issued within
this threshold is considered due the following month. For example, with
Expand Down
142 changes: 141 additions & 1 deletion src/conductor/resources/qbd/standard_terms.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
from ...types.qbd import standard_term_list_params
from ...types.qbd import standard_term_list_params, standard_term_create_params
from ..._base_client import make_request_options
from ...types.qbd.qbd_standard_term import QbdStandardTerm
from ...types.qbd.standard_term_list_response import StandardTermListResponse
Expand Down Expand Up @@ -47,6 +47,70 @@ def with_streaming_response(self) -> StandardTermsResourceWithStreamingResponse:
"""
return StandardTermsResourceWithStreamingResponse(self)

def create(
self,
*,
name: str,
conductor_end_user_id: str,
discount_days: float | NotGiven = NOT_GIVEN,
discount_percentage: str | NotGiven = NOT_GIVEN,
due_days: float | NotGiven = NOT_GIVEN,
is_active: bool | NotGiven = NOT_GIVEN,
# 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,
) -> QbdStandardTerm:
"""
Creates a standard term.
Args:
name: The case-insensitive unique name of this standard term, unique across all
standard terms.
conductor_end_user_id: The ID of the EndUser to receive this request (e.g.,
`"Conductor-End-User-Id: {{END_USER_ID}}"`).
discount_days: The number of days within which payment must be received to qualify for the
discount specified by `discountPercentage`.
discount_percentage: The discount percentage applied to the payment if received within the number of
days specified by `discountDays`. The value is between 0 and 100.
due_days: The number of days until payment is due.
is_active: Indicates whether this standard term is active. Inactive objects are typically
hidden from views and reports in QuickBooks.
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
"""
extra_headers = {"Conductor-End-User-Id": conductor_end_user_id, **(extra_headers or {})}
return self._post(
"/quickbooks-desktop/standard-terms",
body=maybe_transform(
{
"name": name,
"discount_days": discount_days,
"discount_percentage": discount_percentage,
"due_days": due_days,
"is_active": is_active,
},
standard_term_create_params.StandardTermCreateParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=QbdStandardTerm,
)

def retrieve(
self,
id: str,
Expand Down Expand Up @@ -219,6 +283,70 @@ def with_streaming_response(self) -> AsyncStandardTermsResourceWithStreamingResp
"""
return AsyncStandardTermsResourceWithStreamingResponse(self)

async def create(
self,
*,
name: str,
conductor_end_user_id: str,
discount_days: float | NotGiven = NOT_GIVEN,
discount_percentage: str | NotGiven = NOT_GIVEN,
due_days: float | NotGiven = NOT_GIVEN,
is_active: bool | NotGiven = NOT_GIVEN,
# 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,
) -> QbdStandardTerm:
"""
Creates a standard term.
Args:
name: The case-insensitive unique name of this standard term, unique across all
standard terms.
conductor_end_user_id: The ID of the EndUser to receive this request (e.g.,
`"Conductor-End-User-Id: {{END_USER_ID}}"`).
discount_days: The number of days within which payment must be received to qualify for the
discount specified by `discountPercentage`.
discount_percentage: The discount percentage applied to the payment if received within the number of
days specified by `discountDays`. The value is between 0 and 100.
due_days: The number of days until payment is due.
is_active: Indicates whether this standard term is active. Inactive objects are typically
hidden from views and reports in QuickBooks.
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
"""
extra_headers = {"Conductor-End-User-Id": conductor_end_user_id, **(extra_headers or {})}
return await self._post(
"/quickbooks-desktop/standard-terms",
body=await async_maybe_transform(
{
"name": name,
"discount_days": discount_days,
"discount_percentage": discount_percentage,
"due_days": due_days,
"is_active": is_active,
},
standard_term_create_params.StandardTermCreateParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=QbdStandardTerm,
)

async def retrieve(
self,
id: str,
Expand Down Expand Up @@ -375,6 +503,9 @@ class StandardTermsResourceWithRawResponse:
def __init__(self, standard_terms: StandardTermsResource) -> None:
self._standard_terms = standard_terms

self.create = to_raw_response_wrapper(
standard_terms.create,
)
self.retrieve = to_raw_response_wrapper(
standard_terms.retrieve,
)
Expand All @@ -387,6 +518,9 @@ class AsyncStandardTermsResourceWithRawResponse:
def __init__(self, standard_terms: AsyncStandardTermsResource) -> None:
self._standard_terms = standard_terms

self.create = async_to_raw_response_wrapper(
standard_terms.create,
)
self.retrieve = async_to_raw_response_wrapper(
standard_terms.retrieve,
)
Expand All @@ -399,6 +533,9 @@ class StandardTermsResourceWithStreamingResponse:
def __init__(self, standard_terms: StandardTermsResource) -> None:
self._standard_terms = standard_terms

self.create = to_streamed_response_wrapper(
standard_terms.create,
)
self.retrieve = to_streamed_response_wrapper(
standard_terms.retrieve,
)
Expand All @@ -411,6 +548,9 @@ class AsyncStandardTermsResourceWithStreamingResponse:
def __init__(self, standard_terms: AsyncStandardTermsResource) -> None:
self._standard_terms = standard_terms

self.create = async_to_streamed_response_wrapper(
standard_terms.create,
)
self.retrieve = async_to_streamed_response_wrapper(
standard_terms.retrieve,
)
Expand Down
1 change: 1 addition & 0 deletions src/conductor/types/qbd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
from .sales_tax_code_list_params import SalesTaxCodeListParams as SalesTaxCodeListParams
from .sales_tax_item_list_params import SalesTaxItemListParams as SalesTaxItemListParams
from .service_item_create_params import ServiceItemCreateParams as ServiceItemCreateParams
from .standard_term_create_params import StandardTermCreateParams as StandardTermCreateParams
from .standard_term_list_response import StandardTermListResponse as StandardTermListResponse
from .date_driven_term_list_params import DateDrivenTermListParams as DateDrivenTermListParams
from .inventory_item_create_params import InventoryItemCreateParams as InventoryItemCreateParams
Expand Down
6 changes: 3 additions & 3 deletions src/conductor/types/qbd/date_driven_term.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ class DateDrivenTerm(BaseModel):
discount_day_of_month: Optional[float] = FieldInfo(alias="discountDayOfMonth", default=None)
"""
The day of the month within which payment must be received to qualify for the
discount defined by `discountPercentage`.
discount specified by `discountPercentage`.
"""

discount_percentage: Optional[str] = FieldInfo(alias="discountPercentage", default=None)
"""
The discount percentage applied to the payment if received by the
`discountDayOfMonth`. The value is between 0 and 100.
The discount percentage applied to the payment if received on or before the
specified `discountDayOfMonth`. The value is between 0 and 100.
"""

due_day_of_month: float = FieldInfo(alias="dueDayOfMonth")
Expand Down
6 changes: 3 additions & 3 deletions src/conductor/types/qbd/date_driven_term_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ class DateDrivenTermCreateParams(TypedDict, total=False):
discount_day_of_month: Annotated[float, PropertyInfo(alias="discountDayOfMonth")]
"""
The day of the month within which payment must be received to qualify for the
discount defined by `discountPercentage`.
discount specified by `discountPercentage`.
"""

discount_percentage: Annotated[str, PropertyInfo(alias="discountPercentage")]
"""
The discount percentage applied to the payment if received by the
`discountDayOfMonth`. The value is between 0 and 100.
The discount percentage applied to the payment if received on or before the
specified `discountDayOfMonth`. The value is between 0 and 100.
"""

grace_period_days: Annotated[float, PropertyInfo(alias="gracePeriodDays")]
Expand Down
6 changes: 3 additions & 3 deletions src/conductor/types/qbd/qbd_standard_term.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ class QbdStandardTerm(BaseModel):
discount_days: Optional[float] = FieldInfo(alias="discountDays", default=None)
"""
The number of days within which payment must be received to qualify for the
discount defined by `discountPercentage`.
discount specified by `discountPercentage`.
"""

discount_percentage: Optional[str] = FieldInfo(alias="discountPercentage", default=None)
"""
The discount percentage applied to the payment if received within `discountDays`
number of days. The value is between 0 and 100.
The discount percentage applied to the payment if received within the number of
days specified by `discountDays`. The value is between 0 and 100.
"""

due_days: Optional[float] = FieldInfo(alias="dueDays", default=None)
Expand Down
44 changes: 44 additions & 0 deletions src/conductor/types/qbd/standard_term_create_params.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from typing_extensions import Required, Annotated, TypedDict

from ..._utils import PropertyInfo

__all__ = ["StandardTermCreateParams"]


class StandardTermCreateParams(TypedDict, total=False):
name: Required[str]
"""
The case-insensitive unique name of this standard term, unique across all
standard terms.
"""

conductor_end_user_id: Required[Annotated[str, PropertyInfo(alias="Conductor-End-User-Id")]]
"""
The ID of the EndUser to receive this request (e.g.,
`"Conductor-End-User-Id: {{END_USER_ID}}"`).
"""

discount_days: Annotated[float, PropertyInfo(alias="discountDays")]
"""
The number of days within which payment must be received to qualify for the
discount specified by `discountPercentage`.
"""

discount_percentage: Annotated[str, PropertyInfo(alias="discountPercentage")]
"""
The discount percentage applied to the payment if received within the number of
days specified by `discountDays`. The value is between 0 and 100.
"""

due_days: Annotated[float, PropertyInfo(alias="dueDays")]
"""The number of days until payment is due."""

is_active: Annotated[bool, PropertyInfo(alias="isActive")]
"""Indicates whether this standard term is active.
Inactive objects are typically hidden from views and reports in QuickBooks.
"""
Loading

0 comments on commit 028221b

Please sign in to comment.