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
20 changes: 20 additions & 0 deletions src/orb/resources/customers/customers.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ def update(
currency: Optional[str] | NotGiven = NOT_GIVEN,
email: Optional[str] | NotGiven = NOT_GIVEN,
email_delivery: Optional[bool] | NotGiven = NOT_GIVEN,
external_customer_id: Optional[str] | NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN,
name: Optional[str] | NotGiven = NOT_GIVEN,
payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]]
Expand Down Expand Up @@ -344,6 +345,9 @@ def update(

email: A valid customer email, to be used for invoicing and notifications.

external_customer_id: The external customer ID. This can only be set if empty and the customer has no
past or current subscriptions.

metadata: User-specified key/value pairs for the resource. Individual keys can be removed
by setting the value to `null`, and the entire metadata mapping can be cleared
by setting `metadata` to `null`.
Expand Down Expand Up @@ -470,6 +474,7 @@ def update(
"currency": currency,
"email": email,
"email_delivery": email_delivery,
"external_customer_id": external_customer_id,
"metadata": metadata,
"name": name,
"payment_provider": payment_provider,
Expand Down Expand Up @@ -695,6 +700,7 @@ def update_by_external_id(
currency: Optional[str] | NotGiven = NOT_GIVEN,
email: Optional[str] | NotGiven = NOT_GIVEN,
email_delivery: Optional[bool] | NotGiven = NOT_GIVEN,
external_customer_id: Optional[str] | NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN,
name: Optional[str] | NotGiven = NOT_GIVEN,
payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]]
Expand Down Expand Up @@ -731,6 +737,9 @@ def update_by_external_id(

email: A valid customer email, to be used for invoicing and notifications.

external_customer_id: The external customer ID. This can only be set if empty and the customer has no
past or current subscriptions.

metadata: User-specified key/value pairs for the resource. Individual keys can be removed
by setting the value to `null`, and the entire metadata mapping can be cleared
by setting `metadata` to `null`.
Expand Down Expand Up @@ -857,6 +866,7 @@ def update_by_external_id(
"currency": currency,
"email": email,
"email_delivery": email_delivery,
"external_customer_id": external_customer_id,
"metadata": metadata,
"name": name,
"payment_provider": payment_provider,
Expand Down Expand Up @@ -1123,6 +1133,7 @@ async def update(
currency: Optional[str] | NotGiven = NOT_GIVEN,
email: Optional[str] | NotGiven = NOT_GIVEN,
email_delivery: Optional[bool] | NotGiven = NOT_GIVEN,
external_customer_id: Optional[str] | NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN,
name: Optional[str] | NotGiven = NOT_GIVEN,
payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]]
Expand Down Expand Up @@ -1159,6 +1170,9 @@ async def update(

email: A valid customer email, to be used for invoicing and notifications.

external_customer_id: The external customer ID. This can only be set if empty and the customer has no
past or current subscriptions.

metadata: User-specified key/value pairs for the resource. Individual keys can be removed
by setting the value to `null`, and the entire metadata mapping can be cleared
by setting `metadata` to `null`.
Expand Down Expand Up @@ -1285,6 +1299,7 @@ async def update(
"currency": currency,
"email": email,
"email_delivery": email_delivery,
"external_customer_id": external_customer_id,
"metadata": metadata,
"name": name,
"payment_provider": payment_provider,
Expand Down Expand Up @@ -1510,6 +1525,7 @@ async def update_by_external_id(
currency: Optional[str] | NotGiven = NOT_GIVEN,
email: Optional[str] | NotGiven = NOT_GIVEN,
email_delivery: Optional[bool] | NotGiven = NOT_GIVEN,
external_customer_id: Optional[str] | NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN,
name: Optional[str] | NotGiven = NOT_GIVEN,
payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]]
Expand Down Expand Up @@ -1546,6 +1562,9 @@ async def update_by_external_id(

email: A valid customer email, to be used for invoicing and notifications.

external_customer_id: The external customer ID. This can only be set if empty and the customer has no
past or current subscriptions.

metadata: User-specified key/value pairs for the resource. Individual keys can be removed
by setting the value to `null`, and the entire metadata mapping can be cleared
by setting `metadata` to `null`.
Expand Down Expand Up @@ -1672,6 +1691,7 @@ async def update_by_external_id(
"currency": currency,
"email": email,
"email_delivery": email_delivery,
"external_customer_id": external_customer_id,
"metadata": metadata,
"name": name,
"payment_provider": payment_provider,
Expand Down
7 changes: 7 additions & 0 deletions src/orb/types/customer_update_by_external_id_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ class CustomerUpdateByExternalIDParams(TypedDict, total=False):

email_delivery: Optional[bool]

external_customer_id: Optional[str]
"""The external customer ID.

This can only be set if empty and the customer has no past or current
subscriptions.
"""

metadata: Optional[Dict[str, Optional[str]]]
"""User-specified key/value pairs for the resource.

Expand Down
7 changes: 7 additions & 0 deletions src/orb/types/customer_update_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ class CustomerUpdateParams(TypedDict, total=False):

email_delivery: Optional[bool]

external_customer_id: Optional[str]
"""The external customer ID.

This can only be set if empty and the customer has no past or current
subscriptions.
"""

metadata: Optional[Dict[str, Optional[str]]]
"""User-specified key/value pairs for the resource.

Expand Down
6 changes: 6 additions & 0 deletions tests/api_resources/test_customers.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ def test_method_update_with_all_params(self, client: Orb) -> None:
currency="string",
email="string",
email_delivery=True,
external_customer_id="string",
metadata={"foo": "string"},
name="string",
payment_provider="quickbooks",
Expand Down Expand Up @@ -396,6 +397,7 @@ def test_method_update_by_external_id_with_all_params(self, client: Orb) -> None
currency="string",
email="string",
email_delivery=True,
external_customer_id="string",
metadata={"foo": "string"},
name="string",
payment_provider="quickbooks",
Expand Down Expand Up @@ -446,6 +448,7 @@ def test_path_params_update_by_external_id(self, client: Orb) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
client.customers.with_raw_response.update_by_external_id(
"",
external_customer_id="",
)


Expand Down Expand Up @@ -583,6 +586,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> No
currency="string",
email="string",
email_delivery=True,
external_customer_id="string",
metadata={"foo": "string"},
name="string",
payment_provider="quickbooks",
Expand Down Expand Up @@ -827,6 +831,7 @@ async def test_method_update_by_external_id_with_all_params(self, async_client:
currency="string",
email="string",
email_delivery=True,
external_customer_id="string",
metadata={"foo": "string"},
name="string",
payment_provider="quickbooks",
Expand Down Expand Up @@ -877,4 +882,5 @@ async def test_path_params_update_by_external_id(self, async_client: AsyncOrb) -
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
await async_client.customers.with_raw_response.update_by_external_id(
"",
external_customer_id="",
)