paid-python 1.5.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.5.0 → paid_python-1.7.0}/PKG-INFO +3 -1
- {paid_python-1.5.0 → paid_python-1.7.0}/README.md +2 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/pyproject.toml +2 -2
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/__init__.py +68 -1
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/client.py +38 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/core/client_wrapper.py +2 -2
- paid_python-1.7.0/src/paid/credits/client.py +104 -0
- paid_python-1.7.0/src/paid/credits/raw_client.py +140 -0
- 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.5.0 → paid_python-1.7.0}/src/paid/customers/client.py +149 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/customers/raw_client.py +285 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/orders/client.py +8 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/orders/raw_client.py +8 -0
- paid_python-1.7.0/src/paid/products/__init__.py +4 -0
- paid_python-1.7.0/src/paid/signals/__init__.py +4 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/tracing/gemini_patches/patches.py +8 -7
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/__init__.py +89 -0
- {paid_python-1.5.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/credit_balance.py +44 -0
- paid_python-1.7.0/src/paid/types/credit_balance_list_response.py +20 -0
- paid_python-1.7.0/src/paid/types/credit_balance_recipient.py +5 -0
- paid_python-1.7.0/src/paid/types/credit_currency.py +34 -0
- paid_python-1.7.0/src/paid/types/credit_currency_list_response.py +20 -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.5.0 → paid_python-1.7.0}/LICENSE +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/checkouts/__init__.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/checkouts/client.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/checkouts/raw_client.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/checkouts/types/__init__.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/checkouts/types/list_checkouts_request_status.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/contacts/__init__.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/contacts/client.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/contacts/raw_client.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/contacts/types/__init__.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/contacts/types/create_contact_request_roles_item.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/core/__init__.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/core/api_error.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/core/datetime_utils.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/core/file.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/core/force_multipart.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/core/http_client.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/core/http_response.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/core/http_sse/__init__.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/core/http_sse/_api.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/core/http_sse/_decoders.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/core/http_sse/_exceptions.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/core/http_sse/_models.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/core/jsonable_encoder.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/core/pydantic_utilities.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/core/query_encoder.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/core/remove_none_from_dict.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/core/request_options.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/core/serialization.py +0 -0
- {paid_python-1.5.0/src/paid/customers → paid_python-1.7.0/src/paid/credits}/__init__.py +0 -0
- {paid_python-1.5.0/src/paid/invoices → paid_python-1.7.0/src/paid/customer_portals}/__init__.py +0 -0
- {paid_python-1.5.0/src/paid/orders → paid_python-1.7.0/src/paid/customers}/__init__.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/environment.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/errors/__init__.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/errors/bad_request_error.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/errors/forbidden_error.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/errors/internal_server_error.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/errors/not_found_error.py +0 -0
- {paid_python-1.5.0/src/paid/products → paid_python-1.7.0/src/paid/invoices}/__init__.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/invoices/client.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/invoices/raw_client.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/logger.py +0 -0
- {paid_python-1.5.0/src/paid/signals → paid_python-1.7.0/src/paid/orders}/__init__.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/products/client.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/products/raw_client.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/py.typed +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/signals/client.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/signals/raw_client.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/tracing/__init__.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/tracing/anthropic_patches/__init__.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/tracing/anthropic_patches/patches.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/tracing/autoinstrumentation.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/tracing/context_data.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/tracing/context_manager.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/tracing/distributed_tracing.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/tracing/gemini_patches/__init__.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/tracing/openai_agents_patches/__init__.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/tracing/openai_agents_patches/patches.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/tracing/openai_patches/__init__.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/tracing/openai_patches/patches.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/tracing/signal.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/tracing/tracing.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/tracing/wrappers/__init__.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/tracing/wrappers/anthropic/__init__.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/tracing/wrappers/anthropic/anthropicWrapper.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/tracing/wrappers/bedrock/__init__.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/tracing/wrappers/bedrock/bedrockWrapper.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/tracing/wrappers/gemini/__init__.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/tracing/wrappers/gemini/geminiWrapper.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/tracing/wrappers/langchain/__init__.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/tracing/wrappers/langchain/paidLangChainCallback.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/tracing/wrappers/mistral/__init__.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/tracing/wrappers/mistral/mistralWrapper.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/tracing/wrappers/openai/__init__.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/tracing/wrappers/openai/openAiWrapper.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/tracing/wrappers/openai_agents/__init__.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/tracing/wrappers/openai_agents/openaiAgentsHook.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/tracing/wrappers/utils.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/attribution.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/bulk_signals_response.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/checkout.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/checkout_list_response.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/checkout_product.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/checkout_product_input.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/checkout_status.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/contact.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/contact_billing_address.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/contact_list_response.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/contact_roles_item.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/create_order_line_request.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/customer.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/customer_attribution.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/customer_billing_address.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/customer_by_external_id.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/customer_by_id.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/customer_creation_state.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/customer_list_response.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/empty_response.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/error_response.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/invoice.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/invoice_line.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/invoice_line_payment_status.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/invoice_lines_response.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/invoice_list_response.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/invoice_payment_status.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/invoice_source.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/invoice_status.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/invoice_tax_status.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/order.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/order_creation_state.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/order_line.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/order_lines_response.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/order_list_response.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/pagination.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/product.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/product_by_external_id.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/product_by_id.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/product_list_response.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/signal.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/update_contact_request.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/update_contact_request_roles_item.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/update_customer_request.py +0 -0
- {paid_python-1.5.0 → paid_python-1.7.0}/src/paid/types/update_product_request.py +0 -0
- {paid_python-1.5.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,7 +19,26 @@ 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,
|
|
37
|
+
CreditBalance,
|
|
38
|
+
CreditBalanceListResponse,
|
|
39
|
+
CreditBalanceRecipient,
|
|
40
|
+
CreditCurrency,
|
|
41
|
+
CreditCurrencyListResponse,
|
|
23
42
|
Customer,
|
|
24
43
|
CustomerAttribution,
|
|
25
44
|
CustomerBillingAddress,
|
|
@@ -27,6 +46,8 @@ if typing.TYPE_CHECKING:
|
|
|
27
46
|
CustomerById,
|
|
28
47
|
CustomerCreationState,
|
|
29
48
|
CustomerListResponse,
|
|
49
|
+
CustomerPortal,
|
|
50
|
+
CustomerPortalStatus,
|
|
30
51
|
EmptyResponse,
|
|
31
52
|
ErrorResponse,
|
|
32
53
|
Invoice,
|
|
@@ -55,7 +76,7 @@ if typing.TYPE_CHECKING:
|
|
|
55
76
|
UpdateProductRequest,
|
|
56
77
|
)
|
|
57
78
|
from .errors import BadRequestError, ForbiddenError, InternalServerError, NotFoundError
|
|
58
|
-
from . import checkouts, contacts, customers, invoices, orders, products, signals
|
|
79
|
+
from . import checkouts, contacts, credits, customer_portals, customers, invoices, orders, products, signals
|
|
59
80
|
from .checkouts import ListCheckoutsRequestStatus
|
|
60
81
|
from .client import AsyncPaid, Paid
|
|
61
82
|
from .contacts import CreateContactRequestRolesItem
|
|
@@ -77,7 +98,26 @@ _dynamic_imports: typing.Dict[str, str] = {
|
|
|
77
98
|
"ContactRolesItem": ".types",
|
|
78
99
|
"CreateContactRequestRolesItem": ".contacts",
|
|
79
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",
|
|
80
115
|
"CreateOrderLineRequest": ".types",
|
|
116
|
+
"CreditBalance": ".types",
|
|
117
|
+
"CreditBalanceListResponse": ".types",
|
|
118
|
+
"CreditBalanceRecipient": ".types",
|
|
119
|
+
"CreditCurrency": ".types",
|
|
120
|
+
"CreditCurrencyListResponse": ".types",
|
|
81
121
|
"Customer": ".types",
|
|
82
122
|
"CustomerAttribution": ".types",
|
|
83
123
|
"CustomerBillingAddress": ".types",
|
|
@@ -85,6 +125,8 @@ _dynamic_imports: typing.Dict[str, str] = {
|
|
|
85
125
|
"CustomerById": ".types",
|
|
86
126
|
"CustomerCreationState": ".types",
|
|
87
127
|
"CustomerListResponse": ".types",
|
|
128
|
+
"CustomerPortal": ".types",
|
|
129
|
+
"CustomerPortalStatus": ".types",
|
|
88
130
|
"EmptyResponse": ".types",
|
|
89
131
|
"ErrorResponse": ".types",
|
|
90
132
|
"ForbiddenError": ".errors",
|
|
@@ -120,6 +162,8 @@ _dynamic_imports: typing.Dict[str, str] = {
|
|
|
120
162
|
"__version__": ".version",
|
|
121
163
|
"checkouts": ".checkouts",
|
|
122
164
|
"contacts": ".contacts",
|
|
165
|
+
"credits": ".credits",
|
|
166
|
+
"customer_portals": ".customer_portals",
|
|
123
167
|
"customers": ".customers",
|
|
124
168
|
"invoices": ".invoices",
|
|
125
169
|
"orders": ".orders",
|
|
@@ -165,7 +209,26 @@ __all__ = [
|
|
|
165
209
|
"ContactRolesItem",
|
|
166
210
|
"CreateContactRequestRolesItem",
|
|
167
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",
|
|
168
226
|
"CreateOrderLineRequest",
|
|
227
|
+
"CreditBalance",
|
|
228
|
+
"CreditBalanceListResponse",
|
|
229
|
+
"CreditBalanceRecipient",
|
|
230
|
+
"CreditCurrency",
|
|
231
|
+
"CreditCurrencyListResponse",
|
|
169
232
|
"Customer",
|
|
170
233
|
"CustomerAttribution",
|
|
171
234
|
"CustomerBillingAddress",
|
|
@@ -173,6 +236,8 @@ __all__ = [
|
|
|
173
236
|
"CustomerById",
|
|
174
237
|
"CustomerCreationState",
|
|
175
238
|
"CustomerListResponse",
|
|
239
|
+
"CustomerPortal",
|
|
240
|
+
"CustomerPortalStatus",
|
|
176
241
|
"EmptyResponse",
|
|
177
242
|
"ErrorResponse",
|
|
178
243
|
"ForbiddenError",
|
|
@@ -208,6 +273,8 @@ __all__ = [
|
|
|
208
273
|
"__version__",
|
|
209
274
|
"checkouts",
|
|
210
275
|
"contacts",
|
|
276
|
+
"credits",
|
|
277
|
+
"customer_portals",
|
|
211
278
|
"customers",
|
|
212
279
|
"invoices",
|
|
213
280
|
"orders",
|
|
@@ -11,6 +11,8 @@ from .environment import PaidEnvironment
|
|
|
11
11
|
if typing.TYPE_CHECKING:
|
|
12
12
|
from .checkouts.client import AsyncCheckoutsClient, CheckoutsClient
|
|
13
13
|
from .contacts.client import AsyncContactsClient, ContactsClient
|
|
14
|
+
from .credits.client import AsyncCreditsClient, CreditsClient
|
|
15
|
+
from .customer_portals.client import AsyncCustomerPortalsClient, CustomerPortalsClient
|
|
14
16
|
from .customers.client import AsyncCustomersClient, CustomersClient
|
|
15
17
|
from .invoices.client import AsyncInvoicesClient, InvoicesClient
|
|
16
18
|
from .orders.client import AsyncOrdersClient, OrdersClient
|
|
@@ -89,7 +91,9 @@ class Paid:
|
|
|
89
91
|
self._orders: typing.Optional[OrdersClient] = None
|
|
90
92
|
self._invoices: typing.Optional[InvoicesClient] = None
|
|
91
93
|
self._signals: typing.Optional[SignalsClient] = None
|
|
94
|
+
self._credits: typing.Optional[CreditsClient] = None
|
|
92
95
|
self._checkouts: typing.Optional[CheckoutsClient] = None
|
|
96
|
+
self._customer_portals: typing.Optional[CustomerPortalsClient] = None
|
|
93
97
|
|
|
94
98
|
@property
|
|
95
99
|
def products(self):
|
|
@@ -139,6 +143,14 @@ class Paid:
|
|
|
139
143
|
self._signals = SignalsClient(client_wrapper=self._client_wrapper)
|
|
140
144
|
return self._signals
|
|
141
145
|
|
|
146
|
+
@property
|
|
147
|
+
def credits(self):
|
|
148
|
+
if self._credits is None:
|
|
149
|
+
from .credits.client import CreditsClient # noqa: E402
|
|
150
|
+
|
|
151
|
+
self._credits = CreditsClient(client_wrapper=self._client_wrapper)
|
|
152
|
+
return self._credits
|
|
153
|
+
|
|
142
154
|
@property
|
|
143
155
|
def checkouts(self):
|
|
144
156
|
if self._checkouts is None:
|
|
@@ -147,6 +159,14 @@ class Paid:
|
|
|
147
159
|
self._checkouts = CheckoutsClient(client_wrapper=self._client_wrapper)
|
|
148
160
|
return self._checkouts
|
|
149
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
|
+
|
|
150
170
|
|
|
151
171
|
class AsyncPaid:
|
|
152
172
|
"""
|
|
@@ -219,7 +239,9 @@ class AsyncPaid:
|
|
|
219
239
|
self._orders: typing.Optional[AsyncOrdersClient] = None
|
|
220
240
|
self._invoices: typing.Optional[AsyncInvoicesClient] = None
|
|
221
241
|
self._signals: typing.Optional[AsyncSignalsClient] = None
|
|
242
|
+
self._credits: typing.Optional[AsyncCreditsClient] = None
|
|
222
243
|
self._checkouts: typing.Optional[AsyncCheckoutsClient] = None
|
|
244
|
+
self._customer_portals: typing.Optional[AsyncCustomerPortalsClient] = None
|
|
223
245
|
|
|
224
246
|
@property
|
|
225
247
|
def products(self):
|
|
@@ -269,6 +291,14 @@ class AsyncPaid:
|
|
|
269
291
|
self._signals = AsyncSignalsClient(client_wrapper=self._client_wrapper)
|
|
270
292
|
return self._signals
|
|
271
293
|
|
|
294
|
+
@property
|
|
295
|
+
def credits(self):
|
|
296
|
+
if self._credits is None:
|
|
297
|
+
from .credits.client import AsyncCreditsClient # noqa: E402
|
|
298
|
+
|
|
299
|
+
self._credits = AsyncCreditsClient(client_wrapper=self._client_wrapper)
|
|
300
|
+
return self._credits
|
|
301
|
+
|
|
272
302
|
@property
|
|
273
303
|
def checkouts(self):
|
|
274
304
|
if self._checkouts is None:
|
|
@@ -277,6 +307,14 @@ class AsyncPaid:
|
|
|
277
307
|
self._checkouts = AsyncCheckoutsClient(client_wrapper=self._client_wrapper)
|
|
278
308
|
return self._checkouts
|
|
279
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
|
+
|
|
280
318
|
|
|
281
319
|
def _get_base_url(*, base_url: typing.Optional[str] = None, environment: PaidEnvironment) -> str:
|
|
282
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,104 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
6
|
+
from ..core.request_options import RequestOptions
|
|
7
|
+
from ..types.credit_currency_list_response import CreditCurrencyListResponse
|
|
8
|
+
from .raw_client import AsyncRawCreditsClient, RawCreditsClient
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class CreditsClient:
|
|
12
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
13
|
+
self._raw_client = RawCreditsClient(client_wrapper=client_wrapper)
|
|
14
|
+
|
|
15
|
+
@property
|
|
16
|
+
def with_raw_response(self) -> RawCreditsClient:
|
|
17
|
+
"""
|
|
18
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
19
|
+
|
|
20
|
+
Returns
|
|
21
|
+
-------
|
|
22
|
+
RawCreditsClient
|
|
23
|
+
"""
|
|
24
|
+
return self._raw_client
|
|
25
|
+
|
|
26
|
+
def list_credit_currencies(
|
|
27
|
+
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
28
|
+
) -> CreditCurrencyListResponse:
|
|
29
|
+
"""
|
|
30
|
+
List credit currencies for the organization
|
|
31
|
+
|
|
32
|
+
Parameters
|
|
33
|
+
----------
|
|
34
|
+
request_options : typing.Optional[RequestOptions]
|
|
35
|
+
Request-specific configuration.
|
|
36
|
+
|
|
37
|
+
Returns
|
|
38
|
+
-------
|
|
39
|
+
CreditCurrencyListResponse
|
|
40
|
+
200
|
|
41
|
+
|
|
42
|
+
Examples
|
|
43
|
+
--------
|
|
44
|
+
from paid import Paid
|
|
45
|
+
|
|
46
|
+
client = Paid(
|
|
47
|
+
token="YOUR_TOKEN",
|
|
48
|
+
)
|
|
49
|
+
client.credits.list_credit_currencies()
|
|
50
|
+
"""
|
|
51
|
+
_response = self._raw_client.list_credit_currencies(request_options=request_options)
|
|
52
|
+
return _response.data
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
class AsyncCreditsClient:
|
|
56
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
57
|
+
self._raw_client = AsyncRawCreditsClient(client_wrapper=client_wrapper)
|
|
58
|
+
|
|
59
|
+
@property
|
|
60
|
+
def with_raw_response(self) -> AsyncRawCreditsClient:
|
|
61
|
+
"""
|
|
62
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
63
|
+
|
|
64
|
+
Returns
|
|
65
|
+
-------
|
|
66
|
+
AsyncRawCreditsClient
|
|
67
|
+
"""
|
|
68
|
+
return self._raw_client
|
|
69
|
+
|
|
70
|
+
async def list_credit_currencies(
|
|
71
|
+
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
72
|
+
) -> CreditCurrencyListResponse:
|
|
73
|
+
"""
|
|
74
|
+
List credit currencies for the organization
|
|
75
|
+
|
|
76
|
+
Parameters
|
|
77
|
+
----------
|
|
78
|
+
request_options : typing.Optional[RequestOptions]
|
|
79
|
+
Request-specific configuration.
|
|
80
|
+
|
|
81
|
+
Returns
|
|
82
|
+
-------
|
|
83
|
+
CreditCurrencyListResponse
|
|
84
|
+
200
|
|
85
|
+
|
|
86
|
+
Examples
|
|
87
|
+
--------
|
|
88
|
+
import asyncio
|
|
89
|
+
|
|
90
|
+
from paid import AsyncPaid
|
|
91
|
+
|
|
92
|
+
client = AsyncPaid(
|
|
93
|
+
token="YOUR_TOKEN",
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
async def main() -> None:
|
|
98
|
+
await client.credits.list_credit_currencies()
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
asyncio.run(main())
|
|
102
|
+
"""
|
|
103
|
+
_response = await self._raw_client.list_credit_currencies(request_options=request_options)
|
|
104
|
+
return _response.data
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
from json.decoder import JSONDecodeError
|
|
5
|
+
|
|
6
|
+
from ..core.api_error import ApiError
|
|
7
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
8
|
+
from ..core.http_response import AsyncHttpResponse, HttpResponse
|
|
9
|
+
from ..core.pydantic_utilities import parse_obj_as
|
|
10
|
+
from ..core.request_options import RequestOptions
|
|
11
|
+
from ..errors.forbidden_error import ForbiddenError
|
|
12
|
+
from ..errors.internal_server_error import InternalServerError
|
|
13
|
+
from ..types.credit_currency_list_response import CreditCurrencyListResponse
|
|
14
|
+
from ..types.error_response import ErrorResponse
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class RawCreditsClient:
|
|
18
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
19
|
+
self._client_wrapper = client_wrapper
|
|
20
|
+
|
|
21
|
+
def list_credit_currencies(
|
|
22
|
+
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
23
|
+
) -> HttpResponse[CreditCurrencyListResponse]:
|
|
24
|
+
"""
|
|
25
|
+
List credit currencies for the organization
|
|
26
|
+
|
|
27
|
+
Parameters
|
|
28
|
+
----------
|
|
29
|
+
request_options : typing.Optional[RequestOptions]
|
|
30
|
+
Request-specific configuration.
|
|
31
|
+
|
|
32
|
+
Returns
|
|
33
|
+
-------
|
|
34
|
+
HttpResponse[CreditCurrencyListResponse]
|
|
35
|
+
200
|
|
36
|
+
"""
|
|
37
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
38
|
+
"credits/currencies",
|
|
39
|
+
method="GET",
|
|
40
|
+
request_options=request_options,
|
|
41
|
+
)
|
|
42
|
+
try:
|
|
43
|
+
if 200 <= _response.status_code < 300:
|
|
44
|
+
_data = typing.cast(
|
|
45
|
+
CreditCurrencyListResponse,
|
|
46
|
+
parse_obj_as(
|
|
47
|
+
type_=CreditCurrencyListResponse, # type: ignore
|
|
48
|
+
object_=_response.json(),
|
|
49
|
+
),
|
|
50
|
+
)
|
|
51
|
+
return HttpResponse(response=_response, data=_data)
|
|
52
|
+
if _response.status_code == 403:
|
|
53
|
+
raise ForbiddenError(
|
|
54
|
+
headers=dict(_response.headers),
|
|
55
|
+
body=typing.cast(
|
|
56
|
+
ErrorResponse,
|
|
57
|
+
parse_obj_as(
|
|
58
|
+
type_=ErrorResponse, # type: ignore
|
|
59
|
+
object_=_response.json(),
|
|
60
|
+
),
|
|
61
|
+
),
|
|
62
|
+
)
|
|
63
|
+
if _response.status_code == 500:
|
|
64
|
+
raise InternalServerError(
|
|
65
|
+
headers=dict(_response.headers),
|
|
66
|
+
body=typing.cast(
|
|
67
|
+
ErrorResponse,
|
|
68
|
+
parse_obj_as(
|
|
69
|
+
type_=ErrorResponse, # type: ignore
|
|
70
|
+
object_=_response.json(),
|
|
71
|
+
),
|
|
72
|
+
),
|
|
73
|
+
)
|
|
74
|
+
_response_json = _response.json()
|
|
75
|
+
except JSONDecodeError:
|
|
76
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
77
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
class AsyncRawCreditsClient:
|
|
81
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
82
|
+
self._client_wrapper = client_wrapper
|
|
83
|
+
|
|
84
|
+
async def list_credit_currencies(
|
|
85
|
+
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
86
|
+
) -> AsyncHttpResponse[CreditCurrencyListResponse]:
|
|
87
|
+
"""
|
|
88
|
+
List credit currencies for the organization
|
|
89
|
+
|
|
90
|
+
Parameters
|
|
91
|
+
----------
|
|
92
|
+
request_options : typing.Optional[RequestOptions]
|
|
93
|
+
Request-specific configuration.
|
|
94
|
+
|
|
95
|
+
Returns
|
|
96
|
+
-------
|
|
97
|
+
AsyncHttpResponse[CreditCurrencyListResponse]
|
|
98
|
+
200
|
|
99
|
+
"""
|
|
100
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
101
|
+
"credits/currencies",
|
|
102
|
+
method="GET",
|
|
103
|
+
request_options=request_options,
|
|
104
|
+
)
|
|
105
|
+
try:
|
|
106
|
+
if 200 <= _response.status_code < 300:
|
|
107
|
+
_data = typing.cast(
|
|
108
|
+
CreditCurrencyListResponse,
|
|
109
|
+
parse_obj_as(
|
|
110
|
+
type_=CreditCurrencyListResponse, # type: ignore
|
|
111
|
+
object_=_response.json(),
|
|
112
|
+
),
|
|
113
|
+
)
|
|
114
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
115
|
+
if _response.status_code == 403:
|
|
116
|
+
raise ForbiddenError(
|
|
117
|
+
headers=dict(_response.headers),
|
|
118
|
+
body=typing.cast(
|
|
119
|
+
ErrorResponse,
|
|
120
|
+
parse_obj_as(
|
|
121
|
+
type_=ErrorResponse, # type: ignore
|
|
122
|
+
object_=_response.json(),
|
|
123
|
+
),
|
|
124
|
+
),
|
|
125
|
+
)
|
|
126
|
+
if _response.status_code == 500:
|
|
127
|
+
raise InternalServerError(
|
|
128
|
+
headers=dict(_response.headers),
|
|
129
|
+
body=typing.cast(
|
|
130
|
+
ErrorResponse,
|
|
131
|
+
parse_obj_as(
|
|
132
|
+
type_=ErrorResponse, # type: ignore
|
|
133
|
+
object_=_response.json(),
|
|
134
|
+
),
|
|
135
|
+
),
|
|
136
|
+
)
|
|
137
|
+
_response_json = _response.json()
|
|
138
|
+
except JSONDecodeError:
|
|
139
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
140
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
@@ -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
|