paid-python 1.6.0__tar.gz → 1.7.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {paid_python-1.6.0 → paid_python-1.7.0}/PKG-INFO +3 -1
- {paid_python-1.6.0 → paid_python-1.7.0}/README.md +2 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/pyproject.toml +2 -2
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/__init__.py +51 -1
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/client.py +19 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/core/client_wrapper.py +2 -2
- paid_python-1.7.0/src/paid/customer_portals/client.py +152 -0
- paid_python-1.7.0/src/paid/customer_portals/raw_client.py +242 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/orders/client.py +8 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/orders/raw_client.py +8 -0
- paid_python-1.7.0/src/paid/signals/__init__.py +4 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/tracing/gemini_patches/patches.py +8 -7
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/__init__.py +74 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/create_order_line_attribute_request.py +2 -1
- paid_python-1.7.0/src/paid/types/create_order_line_attribute_request_pricing.py +85 -0
- paid_python-1.7.0/src/paid/types/create_order_line_attribute_request_pricing_billing_frequency.py +7 -0
- paid_python-1.7.0/src/paid/types/create_order_line_attribute_request_pricing_billing_type.py +5 -0
- paid_python-1.7.0/src/paid/types/create_order_line_attribute_request_pricing_charge_type.py +7 -0
- paid_python-1.7.0/src/paid/types/create_order_line_attribute_request_pricing_credit_benefits_item.py +59 -0
- paid_python-1.7.0/src/paid/types/create_order_line_attribute_request_pricing_credit_benefits_item_allocation_cadence.py +7 -0
- paid_python-1.7.0/src/paid/types/create_order_line_attribute_request_pricing_credit_benefits_item_credit_grant_timing.py +7 -0
- paid_python-1.7.0/src/paid/types/create_order_line_attribute_request_pricing_credit_benefits_item_recipient.py +7 -0
- paid_python-1.7.0/src/paid/types/create_order_line_attribute_request_pricing_credit_benefits_item_rollover_duration_unit.py +7 -0
- paid_python-1.7.0/src/paid/types/create_order_line_attribute_request_pricing_price_points.py +32 -0
- paid_python-1.7.0/src/paid/types/create_order_line_attribute_request_pricing_price_points_tiers_item.py +42 -0
- paid_python-1.7.0/src/paid/types/create_order_line_attribute_request_pricing_price_points_tiers_item_tier_billing_type.py +7 -0
- paid_python-1.7.0/src/paid/types/create_order_line_attribute_request_pricing_pricing_model.py +7 -0
- paid_python-1.7.0/src/paid/types/create_order_line_attribute_request_pricing_signal_type.py +5 -0
- paid_python-1.7.0/src/paid/types/customer_portal.py +35 -0
- paid_python-1.7.0/src/paid/types/customer_portal_status.py +5 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/LICENSE +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/checkouts/__init__.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/checkouts/client.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/checkouts/raw_client.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/checkouts/types/__init__.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/checkouts/types/list_checkouts_request_status.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/contacts/__init__.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/contacts/client.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/contacts/raw_client.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/contacts/types/__init__.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/contacts/types/create_contact_request_roles_item.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/core/__init__.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/core/api_error.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/core/datetime_utils.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/core/file.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/core/force_multipart.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/core/http_client.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/core/http_response.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/core/http_sse/__init__.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/core/http_sse/_api.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/core/http_sse/_decoders.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/core/http_sse/_exceptions.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/core/http_sse/_models.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/core/jsonable_encoder.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/core/pydantic_utilities.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/core/query_encoder.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/core/remove_none_from_dict.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/core/request_options.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/core/serialization.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/credits/__init__.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/credits/client.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/credits/raw_client.py +0 -0
- {paid_python-1.6.0/src/paid/customers → paid_python-1.7.0/src/paid/customer_portals}/__init__.py +0 -0
- {paid_python-1.6.0/src/paid/invoices → paid_python-1.7.0/src/paid/customers}/__init__.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/customers/client.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/customers/raw_client.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/environment.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/errors/__init__.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/errors/bad_request_error.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/errors/forbidden_error.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/errors/internal_server_error.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/errors/not_found_error.py +0 -0
- {paid_python-1.6.0/src/paid/orders → paid_python-1.7.0/src/paid/invoices}/__init__.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/invoices/client.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/invoices/raw_client.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/logger.py +0 -0
- {paid_python-1.6.0/src/paid/products → paid_python-1.7.0/src/paid/orders}/__init__.py +0 -0
- {paid_python-1.6.0/src/paid/signals → paid_python-1.7.0/src/paid/products}/__init__.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/products/client.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/products/raw_client.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/py.typed +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/signals/client.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/signals/raw_client.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/tracing/__init__.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/tracing/anthropic_patches/__init__.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/tracing/anthropic_patches/patches.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/tracing/autoinstrumentation.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/tracing/context_data.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/tracing/context_manager.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/tracing/distributed_tracing.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/tracing/gemini_patches/__init__.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/tracing/openai_agents_patches/__init__.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/tracing/openai_agents_patches/patches.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/tracing/openai_patches/__init__.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/tracing/openai_patches/patches.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/tracing/signal.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/tracing/tracing.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/tracing/wrappers/__init__.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/tracing/wrappers/anthropic/__init__.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/tracing/wrappers/anthropic/anthropicWrapper.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/tracing/wrappers/bedrock/__init__.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/tracing/wrappers/bedrock/bedrockWrapper.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/tracing/wrappers/gemini/__init__.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/tracing/wrappers/gemini/geminiWrapper.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/tracing/wrappers/langchain/__init__.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/tracing/wrappers/langchain/paidLangChainCallback.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/tracing/wrappers/mistral/__init__.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/tracing/wrappers/mistral/mistralWrapper.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/tracing/wrappers/openai/__init__.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/tracing/wrappers/openai/openAiWrapper.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/tracing/wrappers/openai_agents/__init__.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/tracing/wrappers/openai_agents/openaiAgentsHook.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/tracing/wrappers/utils.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/attribution.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/bulk_signals_response.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/checkout.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/checkout_list_response.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/checkout_product.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/checkout_product_input.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/checkout_status.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/contact.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/contact_billing_address.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/contact_list_response.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/contact_roles_item.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/create_order_line_request.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/credit_balance.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/credit_balance_list_response.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/credit_balance_recipient.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/credit_currency.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/credit_currency_list_response.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/customer.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/customer_attribution.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/customer_billing_address.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/customer_by_external_id.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/customer_by_id.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/customer_creation_state.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/customer_list_response.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/empty_response.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/error_response.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/invoice.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/invoice_line.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/invoice_line_payment_status.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/invoice_lines_response.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/invoice_list_response.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/invoice_payment_status.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/invoice_source.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/invoice_status.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/invoice_tax_status.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/order.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/order_creation_state.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/order_line.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/order_lines_response.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/order_list_response.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/pagination.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/product.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/product_by_external_id.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/product_by_id.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/product_list_response.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/signal.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/update_contact_request.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/update_contact_request_roles_item.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/update_customer_request.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/types/update_product_request.py +0 -0
- {paid_python-1.6.0 → paid_python-1.7.0}/src/paid/version.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: paid-python
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.7.0
|
|
4
4
|
Summary:
|
|
5
5
|
Requires-Python: >=3.10,<3.14
|
|
6
6
|
Classifier: Intended Audience :: Developers
|
|
@@ -651,6 +651,7 @@ signal = Signal(
|
|
|
651
651
|
"gen_ai.usage.input_tokens": 100,
|
|
652
652
|
"gen_ai.usage.output_tokens": 300,
|
|
653
653
|
"gen_ai.usage.cached_input_tokens": 600,
|
|
654
|
+
"gen_ai.usage.cache_creation_input_tokens": 200,
|
|
654
655
|
},
|
|
655
656
|
}
|
|
656
657
|
}
|
|
@@ -680,6 +681,7 @@ def do_work():
|
|
|
680
681
|
"gen_ai.usage.input_tokens": 100,
|
|
681
682
|
"gen_ai.usage.output_tokens": 300,
|
|
682
683
|
"gen_ai.usage.cached_input_tokens": 600,
|
|
684
|
+
"gen_ai.usage.cache_creation_input_tokens": 200,
|
|
683
685
|
},
|
|
684
686
|
}
|
|
685
687
|
}
|
|
@@ -613,6 +613,7 @@ signal = Signal(
|
|
|
613
613
|
"gen_ai.usage.input_tokens": 100,
|
|
614
614
|
"gen_ai.usage.output_tokens": 300,
|
|
615
615
|
"gen_ai.usage.cached_input_tokens": 600,
|
|
616
|
+
"gen_ai.usage.cache_creation_input_tokens": 200,
|
|
616
617
|
},
|
|
617
618
|
}
|
|
618
619
|
}
|
|
@@ -642,6 +643,7 @@ def do_work():
|
|
|
642
643
|
"gen_ai.usage.input_tokens": 100,
|
|
643
644
|
"gen_ai.usage.output_tokens": 300,
|
|
644
645
|
"gen_ai.usage.cached_input_tokens": 600,
|
|
646
|
+
"gen_ai.usage.cache_creation_input_tokens": 200,
|
|
645
647
|
},
|
|
646
648
|
}
|
|
647
649
|
}
|
|
@@ -4,7 +4,7 @@ dynamic = ["version"]
|
|
|
4
4
|
|
|
5
5
|
[tool.poetry]
|
|
6
6
|
name = "paid-python"
|
|
7
|
-
version = "1.
|
|
7
|
+
version = "1.7.0"
|
|
8
8
|
description = ""
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = []
|
|
@@ -64,7 +64,7 @@ claude-agent-sdk = ">=0.1.0,<0.1.49"
|
|
|
64
64
|
google-genai = ">=1.19.0"
|
|
65
65
|
instructor = ">=1.0.0"
|
|
66
66
|
langchain-core = ">=0.1.0"
|
|
67
|
-
mistralai = ">=1.9.0
|
|
67
|
+
mistralai = ">=1.9.0 <2.0.0"
|
|
68
68
|
openai = ">=1.12.0"
|
|
69
69
|
openai-agents = ">=0.2.0"
|
|
70
70
|
pydantic-ai = ">=1.41.0"
|
|
@@ -19,6 +19,20 @@ if typing.TYPE_CHECKING:
|
|
|
19
19
|
ContactListResponse,
|
|
20
20
|
ContactRolesItem,
|
|
21
21
|
CreateOrderLineAttributeRequest,
|
|
22
|
+
CreateOrderLineAttributeRequestPricing,
|
|
23
|
+
CreateOrderLineAttributeRequestPricingBillingFrequency,
|
|
24
|
+
CreateOrderLineAttributeRequestPricingBillingType,
|
|
25
|
+
CreateOrderLineAttributeRequestPricingChargeType,
|
|
26
|
+
CreateOrderLineAttributeRequestPricingCreditBenefitsItem,
|
|
27
|
+
CreateOrderLineAttributeRequestPricingCreditBenefitsItemAllocationCadence,
|
|
28
|
+
CreateOrderLineAttributeRequestPricingCreditBenefitsItemCreditGrantTiming,
|
|
29
|
+
CreateOrderLineAttributeRequestPricingCreditBenefitsItemRecipient,
|
|
30
|
+
CreateOrderLineAttributeRequestPricingCreditBenefitsItemRolloverDurationUnit,
|
|
31
|
+
CreateOrderLineAttributeRequestPricingPricePoints,
|
|
32
|
+
CreateOrderLineAttributeRequestPricingPricePointsTiersItem,
|
|
33
|
+
CreateOrderLineAttributeRequestPricingPricePointsTiersItemTierBillingType,
|
|
34
|
+
CreateOrderLineAttributeRequestPricingPricingModel,
|
|
35
|
+
CreateOrderLineAttributeRequestPricingSignalType,
|
|
22
36
|
CreateOrderLineRequest,
|
|
23
37
|
CreditBalance,
|
|
24
38
|
CreditBalanceListResponse,
|
|
@@ -32,6 +46,8 @@ if typing.TYPE_CHECKING:
|
|
|
32
46
|
CustomerById,
|
|
33
47
|
CustomerCreationState,
|
|
34
48
|
CustomerListResponse,
|
|
49
|
+
CustomerPortal,
|
|
50
|
+
CustomerPortalStatus,
|
|
35
51
|
EmptyResponse,
|
|
36
52
|
ErrorResponse,
|
|
37
53
|
Invoice,
|
|
@@ -60,7 +76,7 @@ if typing.TYPE_CHECKING:
|
|
|
60
76
|
UpdateProductRequest,
|
|
61
77
|
)
|
|
62
78
|
from .errors import BadRequestError, ForbiddenError, InternalServerError, NotFoundError
|
|
63
|
-
from . import checkouts, contacts, credits, customers, invoices, orders, products, signals
|
|
79
|
+
from . import checkouts, contacts, credits, customer_portals, customers, invoices, orders, products, signals
|
|
64
80
|
from .checkouts import ListCheckoutsRequestStatus
|
|
65
81
|
from .client import AsyncPaid, Paid
|
|
66
82
|
from .contacts import CreateContactRequestRolesItem
|
|
@@ -82,6 +98,20 @@ _dynamic_imports: typing.Dict[str, str] = {
|
|
|
82
98
|
"ContactRolesItem": ".types",
|
|
83
99
|
"CreateContactRequestRolesItem": ".contacts",
|
|
84
100
|
"CreateOrderLineAttributeRequest": ".types",
|
|
101
|
+
"CreateOrderLineAttributeRequestPricing": ".types",
|
|
102
|
+
"CreateOrderLineAttributeRequestPricingBillingFrequency": ".types",
|
|
103
|
+
"CreateOrderLineAttributeRequestPricingBillingType": ".types",
|
|
104
|
+
"CreateOrderLineAttributeRequestPricingChargeType": ".types",
|
|
105
|
+
"CreateOrderLineAttributeRequestPricingCreditBenefitsItem": ".types",
|
|
106
|
+
"CreateOrderLineAttributeRequestPricingCreditBenefitsItemAllocationCadence": ".types",
|
|
107
|
+
"CreateOrderLineAttributeRequestPricingCreditBenefitsItemCreditGrantTiming": ".types",
|
|
108
|
+
"CreateOrderLineAttributeRequestPricingCreditBenefitsItemRecipient": ".types",
|
|
109
|
+
"CreateOrderLineAttributeRequestPricingCreditBenefitsItemRolloverDurationUnit": ".types",
|
|
110
|
+
"CreateOrderLineAttributeRequestPricingPricePoints": ".types",
|
|
111
|
+
"CreateOrderLineAttributeRequestPricingPricePointsTiersItem": ".types",
|
|
112
|
+
"CreateOrderLineAttributeRequestPricingPricePointsTiersItemTierBillingType": ".types",
|
|
113
|
+
"CreateOrderLineAttributeRequestPricingPricingModel": ".types",
|
|
114
|
+
"CreateOrderLineAttributeRequestPricingSignalType": ".types",
|
|
85
115
|
"CreateOrderLineRequest": ".types",
|
|
86
116
|
"CreditBalance": ".types",
|
|
87
117
|
"CreditBalanceListResponse": ".types",
|
|
@@ -95,6 +125,8 @@ _dynamic_imports: typing.Dict[str, str] = {
|
|
|
95
125
|
"CustomerById": ".types",
|
|
96
126
|
"CustomerCreationState": ".types",
|
|
97
127
|
"CustomerListResponse": ".types",
|
|
128
|
+
"CustomerPortal": ".types",
|
|
129
|
+
"CustomerPortalStatus": ".types",
|
|
98
130
|
"EmptyResponse": ".types",
|
|
99
131
|
"ErrorResponse": ".types",
|
|
100
132
|
"ForbiddenError": ".errors",
|
|
@@ -131,6 +163,7 @@ _dynamic_imports: typing.Dict[str, str] = {
|
|
|
131
163
|
"checkouts": ".checkouts",
|
|
132
164
|
"contacts": ".contacts",
|
|
133
165
|
"credits": ".credits",
|
|
166
|
+
"customer_portals": ".customer_portals",
|
|
134
167
|
"customers": ".customers",
|
|
135
168
|
"invoices": ".invoices",
|
|
136
169
|
"orders": ".orders",
|
|
@@ -176,6 +209,20 @@ __all__ = [
|
|
|
176
209
|
"ContactRolesItem",
|
|
177
210
|
"CreateContactRequestRolesItem",
|
|
178
211
|
"CreateOrderLineAttributeRequest",
|
|
212
|
+
"CreateOrderLineAttributeRequestPricing",
|
|
213
|
+
"CreateOrderLineAttributeRequestPricingBillingFrequency",
|
|
214
|
+
"CreateOrderLineAttributeRequestPricingBillingType",
|
|
215
|
+
"CreateOrderLineAttributeRequestPricingChargeType",
|
|
216
|
+
"CreateOrderLineAttributeRequestPricingCreditBenefitsItem",
|
|
217
|
+
"CreateOrderLineAttributeRequestPricingCreditBenefitsItemAllocationCadence",
|
|
218
|
+
"CreateOrderLineAttributeRequestPricingCreditBenefitsItemCreditGrantTiming",
|
|
219
|
+
"CreateOrderLineAttributeRequestPricingCreditBenefitsItemRecipient",
|
|
220
|
+
"CreateOrderLineAttributeRequestPricingCreditBenefitsItemRolloverDurationUnit",
|
|
221
|
+
"CreateOrderLineAttributeRequestPricingPricePoints",
|
|
222
|
+
"CreateOrderLineAttributeRequestPricingPricePointsTiersItem",
|
|
223
|
+
"CreateOrderLineAttributeRequestPricingPricePointsTiersItemTierBillingType",
|
|
224
|
+
"CreateOrderLineAttributeRequestPricingPricingModel",
|
|
225
|
+
"CreateOrderLineAttributeRequestPricingSignalType",
|
|
179
226
|
"CreateOrderLineRequest",
|
|
180
227
|
"CreditBalance",
|
|
181
228
|
"CreditBalanceListResponse",
|
|
@@ -189,6 +236,8 @@ __all__ = [
|
|
|
189
236
|
"CustomerById",
|
|
190
237
|
"CustomerCreationState",
|
|
191
238
|
"CustomerListResponse",
|
|
239
|
+
"CustomerPortal",
|
|
240
|
+
"CustomerPortalStatus",
|
|
192
241
|
"EmptyResponse",
|
|
193
242
|
"ErrorResponse",
|
|
194
243
|
"ForbiddenError",
|
|
@@ -225,6 +274,7 @@ __all__ = [
|
|
|
225
274
|
"checkouts",
|
|
226
275
|
"contacts",
|
|
227
276
|
"credits",
|
|
277
|
+
"customer_portals",
|
|
228
278
|
"customers",
|
|
229
279
|
"invoices",
|
|
230
280
|
"orders",
|
|
@@ -12,6 +12,7 @@ if typing.TYPE_CHECKING:
|
|
|
12
12
|
from .checkouts.client import AsyncCheckoutsClient, CheckoutsClient
|
|
13
13
|
from .contacts.client import AsyncContactsClient, ContactsClient
|
|
14
14
|
from .credits.client import AsyncCreditsClient, CreditsClient
|
|
15
|
+
from .customer_portals.client import AsyncCustomerPortalsClient, CustomerPortalsClient
|
|
15
16
|
from .customers.client import AsyncCustomersClient, CustomersClient
|
|
16
17
|
from .invoices.client import AsyncInvoicesClient, InvoicesClient
|
|
17
18
|
from .orders.client import AsyncOrdersClient, OrdersClient
|
|
@@ -92,6 +93,7 @@ class Paid:
|
|
|
92
93
|
self._signals: typing.Optional[SignalsClient] = None
|
|
93
94
|
self._credits: typing.Optional[CreditsClient] = None
|
|
94
95
|
self._checkouts: typing.Optional[CheckoutsClient] = None
|
|
96
|
+
self._customer_portals: typing.Optional[CustomerPortalsClient] = None
|
|
95
97
|
|
|
96
98
|
@property
|
|
97
99
|
def products(self):
|
|
@@ -157,6 +159,14 @@ class Paid:
|
|
|
157
159
|
self._checkouts = CheckoutsClient(client_wrapper=self._client_wrapper)
|
|
158
160
|
return self._checkouts
|
|
159
161
|
|
|
162
|
+
@property
|
|
163
|
+
def customer_portals(self):
|
|
164
|
+
if self._customer_portals is None:
|
|
165
|
+
from .customer_portals.client import CustomerPortalsClient # noqa: E402
|
|
166
|
+
|
|
167
|
+
self._customer_portals = CustomerPortalsClient(client_wrapper=self._client_wrapper)
|
|
168
|
+
return self._customer_portals
|
|
169
|
+
|
|
160
170
|
|
|
161
171
|
class AsyncPaid:
|
|
162
172
|
"""
|
|
@@ -231,6 +241,7 @@ class AsyncPaid:
|
|
|
231
241
|
self._signals: typing.Optional[AsyncSignalsClient] = None
|
|
232
242
|
self._credits: typing.Optional[AsyncCreditsClient] = None
|
|
233
243
|
self._checkouts: typing.Optional[AsyncCheckoutsClient] = None
|
|
244
|
+
self._customer_portals: typing.Optional[AsyncCustomerPortalsClient] = None
|
|
234
245
|
|
|
235
246
|
@property
|
|
236
247
|
def products(self):
|
|
@@ -296,6 +307,14 @@ class AsyncPaid:
|
|
|
296
307
|
self._checkouts = AsyncCheckoutsClient(client_wrapper=self._client_wrapper)
|
|
297
308
|
return self._checkouts
|
|
298
309
|
|
|
310
|
+
@property
|
|
311
|
+
def customer_portals(self):
|
|
312
|
+
if self._customer_portals is None:
|
|
313
|
+
from .customer_portals.client import AsyncCustomerPortalsClient # noqa: E402
|
|
314
|
+
|
|
315
|
+
self._customer_portals = AsyncCustomerPortalsClient(client_wrapper=self._client_wrapper)
|
|
316
|
+
return self._customer_portals
|
|
317
|
+
|
|
299
318
|
|
|
300
319
|
def _get_base_url(*, base_url: typing.Optional[str] = None, environment: PaidEnvironment) -> str:
|
|
301
320
|
if base_url is not None:
|
|
@@ -24,12 +24,12 @@ class BaseClientWrapper:
|
|
|
24
24
|
import platform
|
|
25
25
|
|
|
26
26
|
headers: typing.Dict[str, str] = {
|
|
27
|
-
"User-Agent": "paid-python/1.
|
|
27
|
+
"User-Agent": "paid-python/1.7.0",
|
|
28
28
|
"X-Fern-Language": "Python",
|
|
29
29
|
"X-Fern-Runtime": f"python/{platform.python_version()}",
|
|
30
30
|
"X-Fern-Platform": f"{platform.system().lower()}/{platform.release()}",
|
|
31
31
|
"X-Fern-SDK-Name": "paid-python",
|
|
32
|
-
"X-Fern-SDK-Version": "1.
|
|
32
|
+
"X-Fern-SDK-Version": "1.7.0",
|
|
33
33
|
**(self.get_custom_headers() or {}),
|
|
34
34
|
}
|
|
35
35
|
headers["Authorization"] = f"Bearer {self._get_token()}"
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
7
|
+
from ..core.request_options import RequestOptions
|
|
8
|
+
from ..types.customer_portal import CustomerPortal
|
|
9
|
+
from .raw_client import AsyncRawCustomerPortalsClient, RawCustomerPortalsClient
|
|
10
|
+
|
|
11
|
+
# this is used as the default value for optional parameters
|
|
12
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class CustomerPortalsClient:
|
|
16
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
17
|
+
self._raw_client = RawCustomerPortalsClient(client_wrapper=client_wrapper)
|
|
18
|
+
|
|
19
|
+
@property
|
|
20
|
+
def with_raw_response(self) -> RawCustomerPortalsClient:
|
|
21
|
+
"""
|
|
22
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
23
|
+
|
|
24
|
+
Returns
|
|
25
|
+
-------
|
|
26
|
+
RawCustomerPortalsClient
|
|
27
|
+
"""
|
|
28
|
+
return self._raw_client
|
|
29
|
+
|
|
30
|
+
def create_customer_portal(
|
|
31
|
+
self,
|
|
32
|
+
*,
|
|
33
|
+
customer_id: typing.Optional[str] = OMIT,
|
|
34
|
+
external_customer_id: typing.Optional[str] = OMIT,
|
|
35
|
+
return_url: typing.Optional[str] = OMIT,
|
|
36
|
+
expires_at: typing.Optional[dt.datetime] = OMIT,
|
|
37
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
38
|
+
) -> CustomerPortal:
|
|
39
|
+
"""
|
|
40
|
+
Creates a portal session for the customer. Returns a short-lived URL to the customer portal.
|
|
41
|
+
|
|
42
|
+
Parameters
|
|
43
|
+
----------
|
|
44
|
+
customer_id : typing.Optional[str]
|
|
45
|
+
The Paid customer ID (display ID or UUID). Either this or externalCustomerId must be provided.
|
|
46
|
+
|
|
47
|
+
external_customer_id : typing.Optional[str]
|
|
48
|
+
Your external customer ID. Either this or customerId must be provided.
|
|
49
|
+
|
|
50
|
+
return_url : typing.Optional[str]
|
|
51
|
+
|
|
52
|
+
expires_at : typing.Optional[dt.datetime]
|
|
53
|
+
|
|
54
|
+
request_options : typing.Optional[RequestOptions]
|
|
55
|
+
Request-specific configuration.
|
|
56
|
+
|
|
57
|
+
Returns
|
|
58
|
+
-------
|
|
59
|
+
CustomerPortal
|
|
60
|
+
201
|
|
61
|
+
|
|
62
|
+
Examples
|
|
63
|
+
--------
|
|
64
|
+
from paid import Paid
|
|
65
|
+
|
|
66
|
+
client = Paid(
|
|
67
|
+
token="YOUR_TOKEN",
|
|
68
|
+
)
|
|
69
|
+
client.customer_portals.create_customer_portal()
|
|
70
|
+
"""
|
|
71
|
+
_response = self._raw_client.create_customer_portal(
|
|
72
|
+
customer_id=customer_id,
|
|
73
|
+
external_customer_id=external_customer_id,
|
|
74
|
+
return_url=return_url,
|
|
75
|
+
expires_at=expires_at,
|
|
76
|
+
request_options=request_options,
|
|
77
|
+
)
|
|
78
|
+
return _response.data
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
class AsyncCustomerPortalsClient:
|
|
82
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
83
|
+
self._raw_client = AsyncRawCustomerPortalsClient(client_wrapper=client_wrapper)
|
|
84
|
+
|
|
85
|
+
@property
|
|
86
|
+
def with_raw_response(self) -> AsyncRawCustomerPortalsClient:
|
|
87
|
+
"""
|
|
88
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
89
|
+
|
|
90
|
+
Returns
|
|
91
|
+
-------
|
|
92
|
+
AsyncRawCustomerPortalsClient
|
|
93
|
+
"""
|
|
94
|
+
return self._raw_client
|
|
95
|
+
|
|
96
|
+
async def create_customer_portal(
|
|
97
|
+
self,
|
|
98
|
+
*,
|
|
99
|
+
customer_id: typing.Optional[str] = OMIT,
|
|
100
|
+
external_customer_id: typing.Optional[str] = OMIT,
|
|
101
|
+
return_url: typing.Optional[str] = OMIT,
|
|
102
|
+
expires_at: typing.Optional[dt.datetime] = OMIT,
|
|
103
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
104
|
+
) -> CustomerPortal:
|
|
105
|
+
"""
|
|
106
|
+
Creates a portal session for the customer. Returns a short-lived URL to the customer portal.
|
|
107
|
+
|
|
108
|
+
Parameters
|
|
109
|
+
----------
|
|
110
|
+
customer_id : typing.Optional[str]
|
|
111
|
+
The Paid customer ID (display ID or UUID). Either this or externalCustomerId must be provided.
|
|
112
|
+
|
|
113
|
+
external_customer_id : typing.Optional[str]
|
|
114
|
+
Your external customer ID. Either this or customerId must be provided.
|
|
115
|
+
|
|
116
|
+
return_url : typing.Optional[str]
|
|
117
|
+
|
|
118
|
+
expires_at : typing.Optional[dt.datetime]
|
|
119
|
+
|
|
120
|
+
request_options : typing.Optional[RequestOptions]
|
|
121
|
+
Request-specific configuration.
|
|
122
|
+
|
|
123
|
+
Returns
|
|
124
|
+
-------
|
|
125
|
+
CustomerPortal
|
|
126
|
+
201
|
|
127
|
+
|
|
128
|
+
Examples
|
|
129
|
+
--------
|
|
130
|
+
import asyncio
|
|
131
|
+
|
|
132
|
+
from paid import AsyncPaid
|
|
133
|
+
|
|
134
|
+
client = AsyncPaid(
|
|
135
|
+
token="YOUR_TOKEN",
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
async def main() -> None:
|
|
140
|
+
await client.customer_portals.create_customer_portal()
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
asyncio.run(main())
|
|
144
|
+
"""
|
|
145
|
+
_response = await self._raw_client.create_customer_portal(
|
|
146
|
+
customer_id=customer_id,
|
|
147
|
+
external_customer_id=external_customer_id,
|
|
148
|
+
return_url=return_url,
|
|
149
|
+
expires_at=expires_at,
|
|
150
|
+
request_options=request_options,
|
|
151
|
+
)
|
|
152
|
+
return _response.data
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
from json.decoder import JSONDecodeError
|
|
6
|
+
|
|
7
|
+
from ..core.api_error import ApiError
|
|
8
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
9
|
+
from ..core.http_response import AsyncHttpResponse, HttpResponse
|
|
10
|
+
from ..core.pydantic_utilities import parse_obj_as
|
|
11
|
+
from ..core.request_options import RequestOptions
|
|
12
|
+
from ..errors.bad_request_error import BadRequestError
|
|
13
|
+
from ..errors.forbidden_error import ForbiddenError
|
|
14
|
+
from ..errors.internal_server_error import InternalServerError
|
|
15
|
+
from ..errors.not_found_error import NotFoundError
|
|
16
|
+
from ..types.customer_portal import CustomerPortal
|
|
17
|
+
from ..types.error_response import ErrorResponse
|
|
18
|
+
|
|
19
|
+
# this is used as the default value for optional parameters
|
|
20
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class RawCustomerPortalsClient:
|
|
24
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
25
|
+
self._client_wrapper = client_wrapper
|
|
26
|
+
|
|
27
|
+
def create_customer_portal(
|
|
28
|
+
self,
|
|
29
|
+
*,
|
|
30
|
+
customer_id: typing.Optional[str] = OMIT,
|
|
31
|
+
external_customer_id: typing.Optional[str] = OMIT,
|
|
32
|
+
return_url: typing.Optional[str] = OMIT,
|
|
33
|
+
expires_at: typing.Optional[dt.datetime] = OMIT,
|
|
34
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
35
|
+
) -> HttpResponse[CustomerPortal]:
|
|
36
|
+
"""
|
|
37
|
+
Creates a portal session for the customer. Returns a short-lived URL to the customer portal.
|
|
38
|
+
|
|
39
|
+
Parameters
|
|
40
|
+
----------
|
|
41
|
+
customer_id : typing.Optional[str]
|
|
42
|
+
The Paid customer ID (display ID or UUID). Either this or externalCustomerId must be provided.
|
|
43
|
+
|
|
44
|
+
external_customer_id : typing.Optional[str]
|
|
45
|
+
Your external customer ID. Either this or customerId must be provided.
|
|
46
|
+
|
|
47
|
+
return_url : typing.Optional[str]
|
|
48
|
+
|
|
49
|
+
expires_at : typing.Optional[dt.datetime]
|
|
50
|
+
|
|
51
|
+
request_options : typing.Optional[RequestOptions]
|
|
52
|
+
Request-specific configuration.
|
|
53
|
+
|
|
54
|
+
Returns
|
|
55
|
+
-------
|
|
56
|
+
HttpResponse[CustomerPortal]
|
|
57
|
+
201
|
|
58
|
+
"""
|
|
59
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
60
|
+
"customer-portals/",
|
|
61
|
+
method="POST",
|
|
62
|
+
json={
|
|
63
|
+
"customerId": customer_id,
|
|
64
|
+
"externalCustomerId": external_customer_id,
|
|
65
|
+
"returnUrl": return_url,
|
|
66
|
+
"expiresAt": expires_at,
|
|
67
|
+
},
|
|
68
|
+
headers={
|
|
69
|
+
"content-type": "application/json",
|
|
70
|
+
},
|
|
71
|
+
request_options=request_options,
|
|
72
|
+
omit=OMIT,
|
|
73
|
+
)
|
|
74
|
+
try:
|
|
75
|
+
if 200 <= _response.status_code < 300:
|
|
76
|
+
_data = typing.cast(
|
|
77
|
+
CustomerPortal,
|
|
78
|
+
parse_obj_as(
|
|
79
|
+
type_=CustomerPortal, # type: ignore
|
|
80
|
+
object_=_response.json(),
|
|
81
|
+
),
|
|
82
|
+
)
|
|
83
|
+
return HttpResponse(response=_response, data=_data)
|
|
84
|
+
if _response.status_code == 400:
|
|
85
|
+
raise BadRequestError(
|
|
86
|
+
headers=dict(_response.headers),
|
|
87
|
+
body=typing.cast(
|
|
88
|
+
ErrorResponse,
|
|
89
|
+
parse_obj_as(
|
|
90
|
+
type_=ErrorResponse, # type: ignore
|
|
91
|
+
object_=_response.json(),
|
|
92
|
+
),
|
|
93
|
+
),
|
|
94
|
+
)
|
|
95
|
+
if _response.status_code == 403:
|
|
96
|
+
raise ForbiddenError(
|
|
97
|
+
headers=dict(_response.headers),
|
|
98
|
+
body=typing.cast(
|
|
99
|
+
ErrorResponse,
|
|
100
|
+
parse_obj_as(
|
|
101
|
+
type_=ErrorResponse, # type: ignore
|
|
102
|
+
object_=_response.json(),
|
|
103
|
+
),
|
|
104
|
+
),
|
|
105
|
+
)
|
|
106
|
+
if _response.status_code == 404:
|
|
107
|
+
raise NotFoundError(
|
|
108
|
+
headers=dict(_response.headers),
|
|
109
|
+
body=typing.cast(
|
|
110
|
+
ErrorResponse,
|
|
111
|
+
parse_obj_as(
|
|
112
|
+
type_=ErrorResponse, # type: ignore
|
|
113
|
+
object_=_response.json(),
|
|
114
|
+
),
|
|
115
|
+
),
|
|
116
|
+
)
|
|
117
|
+
if _response.status_code == 500:
|
|
118
|
+
raise InternalServerError(
|
|
119
|
+
headers=dict(_response.headers),
|
|
120
|
+
body=typing.cast(
|
|
121
|
+
ErrorResponse,
|
|
122
|
+
parse_obj_as(
|
|
123
|
+
type_=ErrorResponse, # type: ignore
|
|
124
|
+
object_=_response.json(),
|
|
125
|
+
),
|
|
126
|
+
),
|
|
127
|
+
)
|
|
128
|
+
_response_json = _response.json()
|
|
129
|
+
except JSONDecodeError:
|
|
130
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
131
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
class AsyncRawCustomerPortalsClient:
|
|
135
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
136
|
+
self._client_wrapper = client_wrapper
|
|
137
|
+
|
|
138
|
+
async def create_customer_portal(
|
|
139
|
+
self,
|
|
140
|
+
*,
|
|
141
|
+
customer_id: typing.Optional[str] = OMIT,
|
|
142
|
+
external_customer_id: typing.Optional[str] = OMIT,
|
|
143
|
+
return_url: typing.Optional[str] = OMIT,
|
|
144
|
+
expires_at: typing.Optional[dt.datetime] = OMIT,
|
|
145
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
146
|
+
) -> AsyncHttpResponse[CustomerPortal]:
|
|
147
|
+
"""
|
|
148
|
+
Creates a portal session for the customer. Returns a short-lived URL to the customer portal.
|
|
149
|
+
|
|
150
|
+
Parameters
|
|
151
|
+
----------
|
|
152
|
+
customer_id : typing.Optional[str]
|
|
153
|
+
The Paid customer ID (display ID or UUID). Either this or externalCustomerId must be provided.
|
|
154
|
+
|
|
155
|
+
external_customer_id : typing.Optional[str]
|
|
156
|
+
Your external customer ID. Either this or customerId must be provided.
|
|
157
|
+
|
|
158
|
+
return_url : typing.Optional[str]
|
|
159
|
+
|
|
160
|
+
expires_at : typing.Optional[dt.datetime]
|
|
161
|
+
|
|
162
|
+
request_options : typing.Optional[RequestOptions]
|
|
163
|
+
Request-specific configuration.
|
|
164
|
+
|
|
165
|
+
Returns
|
|
166
|
+
-------
|
|
167
|
+
AsyncHttpResponse[CustomerPortal]
|
|
168
|
+
201
|
|
169
|
+
"""
|
|
170
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
171
|
+
"customer-portals/",
|
|
172
|
+
method="POST",
|
|
173
|
+
json={
|
|
174
|
+
"customerId": customer_id,
|
|
175
|
+
"externalCustomerId": external_customer_id,
|
|
176
|
+
"returnUrl": return_url,
|
|
177
|
+
"expiresAt": expires_at,
|
|
178
|
+
},
|
|
179
|
+
headers={
|
|
180
|
+
"content-type": "application/json",
|
|
181
|
+
},
|
|
182
|
+
request_options=request_options,
|
|
183
|
+
omit=OMIT,
|
|
184
|
+
)
|
|
185
|
+
try:
|
|
186
|
+
if 200 <= _response.status_code < 300:
|
|
187
|
+
_data = typing.cast(
|
|
188
|
+
CustomerPortal,
|
|
189
|
+
parse_obj_as(
|
|
190
|
+
type_=CustomerPortal, # type: ignore
|
|
191
|
+
object_=_response.json(),
|
|
192
|
+
),
|
|
193
|
+
)
|
|
194
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
195
|
+
if _response.status_code == 400:
|
|
196
|
+
raise BadRequestError(
|
|
197
|
+
headers=dict(_response.headers),
|
|
198
|
+
body=typing.cast(
|
|
199
|
+
ErrorResponse,
|
|
200
|
+
parse_obj_as(
|
|
201
|
+
type_=ErrorResponse, # type: ignore
|
|
202
|
+
object_=_response.json(),
|
|
203
|
+
),
|
|
204
|
+
),
|
|
205
|
+
)
|
|
206
|
+
if _response.status_code == 403:
|
|
207
|
+
raise ForbiddenError(
|
|
208
|
+
headers=dict(_response.headers),
|
|
209
|
+
body=typing.cast(
|
|
210
|
+
ErrorResponse,
|
|
211
|
+
parse_obj_as(
|
|
212
|
+
type_=ErrorResponse, # type: ignore
|
|
213
|
+
object_=_response.json(),
|
|
214
|
+
),
|
|
215
|
+
),
|
|
216
|
+
)
|
|
217
|
+
if _response.status_code == 404:
|
|
218
|
+
raise NotFoundError(
|
|
219
|
+
headers=dict(_response.headers),
|
|
220
|
+
body=typing.cast(
|
|
221
|
+
ErrorResponse,
|
|
222
|
+
parse_obj_as(
|
|
223
|
+
type_=ErrorResponse, # type: ignore
|
|
224
|
+
object_=_response.json(),
|
|
225
|
+
),
|
|
226
|
+
),
|
|
227
|
+
)
|
|
228
|
+
if _response.status_code == 500:
|
|
229
|
+
raise InternalServerError(
|
|
230
|
+
headers=dict(_response.headers),
|
|
231
|
+
body=typing.cast(
|
|
232
|
+
ErrorResponse,
|
|
233
|
+
parse_obj_as(
|
|
234
|
+
type_=ErrorResponse, # type: ignore
|
|
235
|
+
object_=_response.json(),
|
|
236
|
+
),
|
|
237
|
+
),
|
|
238
|
+
)
|
|
239
|
+
_response_json = _response.json()
|
|
240
|
+
except JSONDecodeError:
|
|
241
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
242
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
@@ -83,6 +83,7 @@ class OrdersClient:
|
|
|
83
83
|
payment_terms: typing.Optional[str] = OMIT,
|
|
84
84
|
external_id: typing.Optional[str] = OMIT,
|
|
85
85
|
metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
|
|
86
|
+
currency: typing.Optional[str] = OMIT,
|
|
86
87
|
lines: typing.Optional[typing.Sequence[CreateOrderLineRequest]] = OMIT,
|
|
87
88
|
request_options: typing.Optional[RequestOptions] = None,
|
|
88
89
|
) -> Order:
|
|
@@ -116,6 +117,8 @@ class OrdersClient:
|
|
|
116
117
|
|
|
117
118
|
metadata : typing.Optional[typing.Dict[str, typing.Any]]
|
|
118
119
|
|
|
120
|
+
currency : typing.Optional[str]
|
|
121
|
+
|
|
119
122
|
lines : typing.Optional[typing.Sequence[CreateOrderLineRequest]]
|
|
120
123
|
|
|
121
124
|
request_options : typing.Optional[RequestOptions]
|
|
@@ -150,6 +153,7 @@ class OrdersClient:
|
|
|
150
153
|
payment_terms=payment_terms,
|
|
151
154
|
external_id=external_id,
|
|
152
155
|
metadata=metadata,
|
|
156
|
+
currency=currency,
|
|
153
157
|
lines=lines,
|
|
154
158
|
request_options=request_options,
|
|
155
159
|
)
|
|
@@ -414,6 +418,7 @@ class AsyncOrdersClient:
|
|
|
414
418
|
payment_terms: typing.Optional[str] = OMIT,
|
|
415
419
|
external_id: typing.Optional[str] = OMIT,
|
|
416
420
|
metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
|
|
421
|
+
currency: typing.Optional[str] = OMIT,
|
|
417
422
|
lines: typing.Optional[typing.Sequence[CreateOrderLineRequest]] = OMIT,
|
|
418
423
|
request_options: typing.Optional[RequestOptions] = None,
|
|
419
424
|
) -> Order:
|
|
@@ -447,6 +452,8 @@ class AsyncOrdersClient:
|
|
|
447
452
|
|
|
448
453
|
metadata : typing.Optional[typing.Dict[str, typing.Any]]
|
|
449
454
|
|
|
455
|
+
currency : typing.Optional[str]
|
|
456
|
+
|
|
450
457
|
lines : typing.Optional[typing.Sequence[CreateOrderLineRequest]]
|
|
451
458
|
|
|
452
459
|
request_options : typing.Optional[RequestOptions]
|
|
@@ -489,6 +496,7 @@ class AsyncOrdersClient:
|
|
|
489
496
|
payment_terms=payment_terms,
|
|
490
497
|
external_id=external_id,
|
|
491
498
|
metadata=metadata,
|
|
499
|
+
currency=currency,
|
|
492
500
|
lines=lines,
|
|
493
501
|
request_options=request_options,
|
|
494
502
|
)
|