Skip to content

Commit

Permalink
feat(api): api update (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Oct 11, 2024
1 parent 9e1cfc5 commit b8500c9
Show file tree
Hide file tree
Showing 14 changed files with 434 additions and 43 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: 50
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/conductor%2Fconductor-7a0ba1541be8ca6fb246837deacc440c0f3dc1cfaf255dcec474b2f728d58272.yml
configured_endpoints: 51
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/conductor%2Fconductor-ff32725cb96be72b97d4411a1d1be06ceef77e12be1a71f66cda11260502a735.yml
1 change: 1 addition & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ from conductor.types.qbd import QbdSalesTaxItem

Methods:

- <code title="post /quickbooks-desktop/sales-tax-items">client.qbd.sales_tax_items.<a href="./src/conductor/resources/qbd/sales_tax_items.py">create</a>(\*\*<a href="src/conductor/types/qbd/sales_tax_item_create_params.py">params</a>) -> <a href="./src/conductor/types/qbd/qbd_sales_tax_item.py">QbdSalesTaxItem</a></code>
- <code title="get /quickbooks-desktop/sales-tax-items/{id}">client.qbd.sales_tax_items.<a href="./src/conductor/resources/qbd/sales_tax_items.py">retrieve</a>(id) -> <a href="./src/conductor/types/qbd/qbd_sales_tax_item.py">QbdSalesTaxItem</a></code>
- <code title="get /quickbooks-desktop/sales-tax-items">client.qbd.sales_tax_items.<a href="./src/conductor/resources/qbd/sales_tax_items.py">list</a>(\*\*<a href="src/conductor/types/qbd/sales_tax_item_list_params.py">params</a>) -> <a href="./src/conductor/types/qbd/qbd_sales_tax_item.py">SyncCursorPage[QbdSalesTaxItem]</a></code>

Expand Down
16 changes: 8 additions & 8 deletions src/conductor/resources/qbd/customers.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,10 @@ def create(
is_active: Indicates whether this customer is active. Inactive objects are typically hidden
from views and reports in QuickBooks.
item_sales_tax_id: The specific sales-tax item used to calculate the actual tax amount for this
customer's transactions. It represents a single tax rate collected for a single
tax agency. This is more specific than `salesTaxCode`, which only indicates
taxability, and is used for the actual tax calculation and reporting.
item_sales_tax_id: The sales-tax item used to calculate the actual tax amount for this customer's
transactions by applying a specific tax rate collected for a single tax agency.
Unlike `salesTaxCode`, which only indicates general taxability, this field
drives the actual tax calculation and reporting.
job_description: A brief description of this customer's job, if this object is a job (i.e.,
sub-customer).
Expand Down Expand Up @@ -679,10 +679,10 @@ async def create(
is_active: Indicates whether this customer is active. Inactive objects are typically hidden
from views and reports in QuickBooks.
item_sales_tax_id: The specific sales-tax item used to calculate the actual tax amount for this
customer's transactions. It represents a single tax rate collected for a single
tax agency. This is more specific than `salesTaxCode`, which only indicates
taxability, and is used for the actual tax calculation and reporting.
item_sales_tax_id: The sales-tax item used to calculate the actual tax amount for this customer's
transactions by applying a specific tax rate collected for a single tax agency.
Unlike `salesTaxCode`, which only indicates general taxability, this field
drives the actual tax calculation and reporting.
job_description: A brief description of this customer's job, if this object is a job (i.e.,
sub-customer).
Expand Down
16 changes: 8 additions & 8 deletions src/conductor/resources/qbd/sales_tax_codes.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ def create(
is_active: Indicates whether this sales-tax code is active. Inactive objects are typically
hidden from views and reports in QuickBooks.
item_sales_tax_id: The specific sales-tax item used to calculate the actual tax amount for this
sales-tax code's transactions. It represents a single tax rate collected for a
single tax agency. This is more specific than `salesTaxCode`, which only
indicates taxability, and is used for the actual tax calculation and reporting.
item_sales_tax_id: The sales-tax item used to calculate the actual tax amount for this sales-tax
code's transactions by applying a specific tax rate collected for a single tax
agency. Unlike `salesTaxCode`, which only indicates general taxability, this
field drives the actual tax calculation and reporting.
extra_headers: Send extra headers
Expand Down Expand Up @@ -323,10 +323,10 @@ async def create(
is_active: Indicates whether this sales-tax code is active. Inactive objects are typically
hidden from views and reports in QuickBooks.
item_sales_tax_id: The specific sales-tax item used to calculate the actual tax amount for this
sales-tax code's transactions. It represents a single tax rate collected for a
single tax agency. This is more specific than `salesTaxCode`, which only
indicates taxability, and is used for the actual tax calculation and reporting.
item_sales_tax_id: The sales-tax item used to calculate the actual tax amount for this sales-tax
code's transactions by applying a specific tax rate collected for a single tax
agency. Unlike `salesTaxCode`, which only indicates general taxability, this
field drives the actual tax calculation and reporting.
extra_headers: Send extra headers
Expand Down
199 changes: 197 additions & 2 deletions src/conductor/resources/qbd/sales_tax_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
import httpx

from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._utils import maybe_transform
from ..._utils import (
maybe_transform,
async_maybe_transform,
)
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
Expand All @@ -16,7 +19,7 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
from ...types.qbd import sales_tax_item_list_params
from ...types.qbd import sales_tax_item_list_params, sales_tax_item_create_params
from ...pagination import SyncCursorPage, AsyncCursorPage
from ..._base_client import AsyncPaginator, make_request_options
from ...types.qbd.qbd_sales_tax_item import QbdSalesTaxItem
Expand Down Expand Up @@ -44,6 +47,96 @@ def with_streaming_response(self) -> SalesTaxItemsResourceWithStreamingResponse:
"""
return SalesTaxItemsResourceWithStreamingResponse(self)

def create(
self,
*,
name: str,
conductor_end_user_id: str,
barcode: sales_tax_item_create_params.Barcode | NotGiven = NOT_GIVEN,
class_id: str | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
external_id: str | NotGiven = NOT_GIVEN,
is_active: bool | NotGiven = NOT_GIVEN,
sales_tax_return_line_id: str | NotGiven = NOT_GIVEN,
tax_rate: str | NotGiven = NOT_GIVEN,
tax_vendor_id: str | 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,
) -> QbdSalesTaxItem:
"""
Creates a sales-tax item.
Args:
name: The case-insensitive unique name of this sales-tax item, unique across all
sales-tax items.
conductor_end_user_id: The ID of the EndUser to receive this request (e.g.,
`"Conductor-End-User-Id: {{END_USER_ID}}"`).
barcode: The sales-tax item's barcode.
class_id: The sales-tax item's class. Classes can be used to categorize objects into
meaningful segments, such as department, location, or type of work. In
QuickBooks, class tracking is off by default.
description: The sales-tax item's description that will appear on sales forms that include
this item.
external_id: A developer-assigned globally unique identifier (GUID) for tracking this object
in external systems. Must be formatted as a valid GUID; otherwise, QuickBooks
will return an error.
is_active: Indicates whether this sales-tax item is active. Inactive objects are typically
hidden from views and reports in QuickBooks.
sales_tax_return_line_id: The specific line on the sales tax return form where the tax collected using
this sales-tax item should be reported.
tax_rate: The tax rate defined by this sales-tax item, represented as a decimal string.
For example, "7.5" represents a 7.5% tax rate. This rate determines the amount
of sales tax applied when this item is used in transactions. If a non-zero
`taxRate` is specified, then the `taxVendor` field is required.
tax_vendor_id: The tax agency (vendor) to whom collected sales taxes are owed for this
sales-tax item. This field refers to a vendor in QuickBooks that represents the
tax authority. If a non-zero `taxRate` is specified, then `taxVendor` is
required.
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/sales-tax-items",
body=maybe_transform(
{
"name": name,
"barcode": barcode,
"class_id": class_id,
"description": description,
"external_id": external_id,
"is_active": is_active,
"sales_tax_return_line_id": sales_tax_return_line_id,
"tax_rate": tax_rate,
"tax_vendor_id": tax_vendor_id,
},
sales_tax_item_create_params.SalesTaxItemCreateParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=QbdSalesTaxItem,
)

def retrieve(
self,
id: str,
Expand Down Expand Up @@ -229,6 +322,96 @@ def with_streaming_response(self) -> AsyncSalesTaxItemsResourceWithStreamingResp
"""
return AsyncSalesTaxItemsResourceWithStreamingResponse(self)

async def create(
self,
*,
name: str,
conductor_end_user_id: str,
barcode: sales_tax_item_create_params.Barcode | NotGiven = NOT_GIVEN,
class_id: str | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
external_id: str | NotGiven = NOT_GIVEN,
is_active: bool | NotGiven = NOT_GIVEN,
sales_tax_return_line_id: str | NotGiven = NOT_GIVEN,
tax_rate: str | NotGiven = NOT_GIVEN,
tax_vendor_id: str | 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,
) -> QbdSalesTaxItem:
"""
Creates a sales-tax item.
Args:
name: The case-insensitive unique name of this sales-tax item, unique across all
sales-tax items.
conductor_end_user_id: The ID of the EndUser to receive this request (e.g.,
`"Conductor-End-User-Id: {{END_USER_ID}}"`).
barcode: The sales-tax item's barcode.
class_id: The sales-tax item's class. Classes can be used to categorize objects into
meaningful segments, such as department, location, or type of work. In
QuickBooks, class tracking is off by default.
description: The sales-tax item's description that will appear on sales forms that include
this item.
external_id: A developer-assigned globally unique identifier (GUID) for tracking this object
in external systems. Must be formatted as a valid GUID; otherwise, QuickBooks
will return an error.
is_active: Indicates whether this sales-tax item is active. Inactive objects are typically
hidden from views and reports in QuickBooks.
sales_tax_return_line_id: The specific line on the sales tax return form where the tax collected using
this sales-tax item should be reported.
tax_rate: The tax rate defined by this sales-tax item, represented as a decimal string.
For example, "7.5" represents a 7.5% tax rate. This rate determines the amount
of sales tax applied when this item is used in transactions. If a non-zero
`taxRate` is specified, then the `taxVendor` field is required.
tax_vendor_id: The tax agency (vendor) to whom collected sales taxes are owed for this
sales-tax item. This field refers to a vendor in QuickBooks that represents the
tax authority. If a non-zero `taxRate` is specified, then `taxVendor` is
required.
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/sales-tax-items",
body=await async_maybe_transform(
{
"name": name,
"barcode": barcode,
"class_id": class_id,
"description": description,
"external_id": external_id,
"is_active": is_active,
"sales_tax_return_line_id": sales_tax_return_line_id,
"tax_rate": tax_rate,
"tax_vendor_id": tax_vendor_id,
},
sales_tax_item_create_params.SalesTaxItemCreateParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=QbdSalesTaxItem,
)

async def retrieve(
self,
id: str,
Expand Down Expand Up @@ -398,6 +581,9 @@ class SalesTaxItemsResourceWithRawResponse:
def __init__(self, sales_tax_items: SalesTaxItemsResource) -> None:
self._sales_tax_items = sales_tax_items

self.create = to_raw_response_wrapper(
sales_tax_items.create,
)
self.retrieve = to_raw_response_wrapper(
sales_tax_items.retrieve,
)
Expand All @@ -410,6 +596,9 @@ class AsyncSalesTaxItemsResourceWithRawResponse:
def __init__(self, sales_tax_items: AsyncSalesTaxItemsResource) -> None:
self._sales_tax_items = sales_tax_items

self.create = async_to_raw_response_wrapper(
sales_tax_items.create,
)
self.retrieve = async_to_raw_response_wrapper(
sales_tax_items.retrieve,
)
Expand All @@ -422,6 +611,9 @@ class SalesTaxItemsResourceWithStreamingResponse:
def __init__(self, sales_tax_items: SalesTaxItemsResource) -> None:
self._sales_tax_items = sales_tax_items

self.create = to_streamed_response_wrapper(
sales_tax_items.create,
)
self.retrieve = to_streamed_response_wrapper(
sales_tax_items.retrieve,
)
Expand All @@ -434,6 +626,9 @@ class AsyncSalesTaxItemsResourceWithStreamingResponse:
def __init__(self, sales_tax_items: AsyncSalesTaxItemsResource) -> None:
self._sales_tax_items = sales_tax_items

self.create = async_to_streamed_response_wrapper(
sales_tax_items.create,
)
self.retrieve = async_to_streamed_response_wrapper(
sales_tax_items.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 @@ -42,6 +42,7 @@
from .inventory_item_create_params import InventoryItemCreateParams as InventoryItemCreateParams
from .sales_tax_code_create_params import SalesTaxCodeCreateParams as SalesTaxCodeCreateParams
from .sales_tax_code_list_response import SalesTaxCodeListResponse as SalesTaxCodeListResponse
from .sales_tax_item_create_params import SalesTaxItemCreateParams as SalesTaxItemCreateParams
from .credit_card_charge_list_params import CreditCardChargeListParams as CreditCardChargeListParams
from .date_driven_term_create_params import DateDrivenTermCreateParams as DateDrivenTermCreateParams
from .date_driven_term_list_response import DateDrivenTermListResponse as DateDrivenTermListResponse
Expand Down
8 changes: 4 additions & 4 deletions src/conductor/types/qbd/customer_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ class CustomerCreateParams(TypedDict, total=False):

item_sales_tax_id: Annotated[str, PropertyInfo(alias="itemSalesTaxId")]
"""
The specific sales-tax item used to calculate the actual tax amount for this
customer's transactions. It represents a single tax rate collected for a single
tax agency. This is more specific than `salesTaxCode`, which only indicates
taxability, and is used for the actual tax calculation and reporting.
The sales-tax item used to calculate the actual tax amount for this customer's
transactions by applying a specific tax rate collected for a single tax agency.
Unlike `salesTaxCode`, which only indicates general taxability, this field
drives the actual tax calculation and reporting.
"""

job_description: Annotated[str, PropertyInfo(alias="jobDescription")]
Expand Down
8 changes: 4 additions & 4 deletions src/conductor/types/qbd/qbd_customer.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,10 +580,10 @@ class QbdCustomer(BaseModel):

item_sales_tax: Optional[ItemSalesTax] = FieldInfo(alias="itemSalesTax", default=None)
"""
The specific sales-tax item used to calculate the actual tax amount for this
customer's transactions. It represents a single tax rate collected for a single
tax agency. This is more specific than `salesTaxCode`, which only indicates
taxability, and is used for the actual tax calculation and reporting.
The sales-tax item used to calculate the actual tax amount for this customer's
transactions by applying a specific tax rate collected for a single tax agency.
Unlike `salesTaxCode`, which only indicates general taxability, this field
drives the actual tax calculation and reporting.
"""

job_description: Optional[str] = FieldInfo(alias="jobDescription", default=None)
Expand Down
8 changes: 4 additions & 4 deletions src/conductor/types/qbd/qbd_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -1168,10 +1168,10 @@ class QbdInvoice(BaseModel):

item_sales_tax: Optional[ItemSalesTax] = FieldInfo(alias="itemSalesTax", default=None)
"""
The specific sales-tax item used to calculate the actual tax amount for this
invoice's transactions. It represents a single tax rate collected for a single
tax agency. This is more specific than `salesTaxCode`, which only indicates
taxability, and is used for the actual tax calculation and reporting.
The sales-tax item used to calculate the actual tax amount for this invoice's
transactions by applying a specific tax rate collected for a single tax agency.
Unlike `salesTaxCode`, which only indicates general taxability, this field
drives the actual tax calculation and reporting.
"""

linked_transactions: List[LinkedTransaction] = FieldInfo(alias="linkedTransactions")
Expand Down
Loading

0 comments on commit b8500c9

Please sign in to comment.