tolt 0.1.0__py3-none-any.whl

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.
Files changed (158) hide show
  1. tolt/CONTRIBUTING.md +125 -0
  2. tolt/README.md +188 -0
  3. tolt/__init__.py +315 -0
  4. tolt/_default_clients.py +30 -0
  5. tolt/clicks/__init__.py +38 -0
  6. tolt/clicks/client.py +246 -0
  7. tolt/clicks/raw_client.py +354 -0
  8. tolt/clicks/types/__init__.py +40 -0
  9. tolt/clicks/types/get_click_response.py +22 -0
  10. tolt/clicks/types/list_clicks_request_order.py +5 -0
  11. tolt/clicks/types/list_clicks_response.py +23 -0
  12. tolt/client.py +423 -0
  13. tolt/commissions/__init__.py +64 -0
  14. tolt/commissions/client.py +680 -0
  15. tolt/commissions/raw_client.py +1278 -0
  16. tolt/commissions/types/__init__.py +62 -0
  17. tolt/commissions/types/approve_commission_response.py +22 -0
  18. tolt/commissions/types/create_commission_request.py +5 -0
  19. tolt/commissions/types/create_commission_response.py +22 -0
  20. tolt/commissions/types/decline_commission_response.py +22 -0
  21. tolt/commissions/types/delete_commission_response.py +22 -0
  22. tolt/commissions/types/get_commission_response.py +22 -0
  23. tolt/commissions/types/list_commissions_request_order.py +5 -0
  24. tolt/commissions/types/list_commissions_response.py +23 -0
  25. tolt/commissions/types/update_commission_response.py +22 -0
  26. tolt/core/__init__.py +127 -0
  27. tolt/core/api_error.py +23 -0
  28. tolt/core/client_wrapper.py +144 -0
  29. tolt/core/datetime_utils.py +70 -0
  30. tolt/core/file.py +67 -0
  31. tolt/core/force_multipart.py +18 -0
  32. tolt/core/http_client.py +940 -0
  33. tolt/core/http_response.py +63 -0
  34. tolt/core/http_sse/__init__.py +42 -0
  35. tolt/core/http_sse/_api.py +455 -0
  36. tolt/core/http_sse/_decoders.py +74 -0
  37. tolt/core/http_sse/_exceptions.py +7 -0
  38. tolt/core/http_sse/_models.py +17 -0
  39. tolt/core/jsonable_encoder.py +133 -0
  40. tolt/core/logging.py +107 -0
  41. tolt/core/parse_error.py +36 -0
  42. tolt/core/pydantic_utilities.py +508 -0
  43. tolt/core/query_encoder.py +58 -0
  44. tolt/core/remove_none_from_dict.py +11 -0
  45. tolt/core/request_options.py +40 -0
  46. tolt/core/serialization.py +347 -0
  47. tolt/customers/__init__.py +58 -0
  48. tolt/customers/client.py +536 -0
  49. tolt/customers/raw_client.py +847 -0
  50. tolt/customers/types/__init__.py +56 -0
  51. tolt/customers/types/create_customer_request.py +5 -0
  52. tolt/customers/types/create_customer_response.py +22 -0
  53. tolt/customers/types/delete_customer_response.py +22 -0
  54. tolt/customers/types/get_customer_response.py +22 -0
  55. tolt/customers/types/list_customers_request_order.py +5 -0
  56. tolt/customers/types/list_customers_response.py +23 -0
  57. tolt/customers/types/update_customer_response.py +22 -0
  58. tolt/environment.py +7 -0
  59. tolt/errors/__init__.py +42 -0
  60. tolt/errors/bad_request_error.py +11 -0
  61. tolt/errors/conflict_error.py +11 -0
  62. tolt/errors/not_found_error.py +11 -0
  63. tolt/errors/unauthorized_error.py +11 -0
  64. tolt/flows/__init__.py +39 -0
  65. tolt/flows/client.py +247 -0
  66. tolt/flows/raw_client.py +355 -0
  67. tolt/flows/types/__init__.py +42 -0
  68. tolt/flows/types/get_flow_response.py +22 -0
  69. tolt/flows/types/list_flows_request_active.py +5 -0
  70. tolt/flows/types/list_flows_request_order.py +5 -0
  71. tolt/flows/types/list_flows_response.py +23 -0
  72. tolt/groups/__init__.py +39 -0
  73. tolt/groups/client.py +223 -0
  74. tolt/groups/raw_client.py +331 -0
  75. tolt/groups/types/__init__.py +42 -0
  76. tolt/groups/types/get_group_response.py +22 -0
  77. tolt/groups/types/list_groups_request_default.py +5 -0
  78. tolt/groups/types/list_groups_request_order.py +5 -0
  79. tolt/groups/types/list_groups_response.py +23 -0
  80. tolt/links/__init__.py +55 -0
  81. tolt/links/client.py +472 -0
  82. tolt/links/raw_client.py +800 -0
  83. tolt/links/types/__init__.py +53 -0
  84. tolt/links/types/create_link_response.py +22 -0
  85. tolt/links/types/delete_link_response.py +22 -0
  86. tolt/links/types/get_link_response.py +22 -0
  87. tolt/links/types/list_links_request_order.py +5 -0
  88. tolt/links/types/list_links_response.py +23 -0
  89. tolt/links/types/update_link_response.py +22 -0
  90. tolt/partners/__init__.py +58 -0
  91. tolt/partners/client.py +473 -0
  92. tolt/partners/raw_client.py +813 -0
  93. tolt/partners/types/__init__.py +56 -0
  94. tolt/partners/types/approve_partner_response.py +22 -0
  95. tolt/partners/types/get_partner_response.py +22 -0
  96. tolt/partners/types/list_partners_request_order.py +5 -0
  97. tolt/partners/types/list_partners_request_status.py +5 -0
  98. tolt/partners/types/list_partners_response.py +23 -0
  99. tolt/partners/types/reject_partner_response.py +22 -0
  100. tolt/partners/types/suspend_partner_response.py +22 -0
  101. tolt/programs/__init__.py +38 -0
  102. tolt/programs/client.py +200 -0
  103. tolt/programs/raw_client.py +314 -0
  104. tolt/programs/types/__init__.py +40 -0
  105. tolt/programs/types/get_program_response.py +22 -0
  106. tolt/programs/types/list_programs_request_order.py +5 -0
  107. tolt/programs/types/list_programs_response.py +23 -0
  108. tolt/promotion_codes/__init__.py +55 -0
  109. tolt/promotion_codes/client.py +502 -0
  110. tolt/promotion_codes/raw_client.py +824 -0
  111. tolt/promotion_codes/types/__init__.py +53 -0
  112. tolt/promotion_codes/types/create_promotion_code_response.py +22 -0
  113. tolt/promotion_codes/types/delete_promotion_code_response.py +22 -0
  114. tolt/promotion_codes/types/get_promotion_code_response.py +22 -0
  115. tolt/promotion_codes/types/list_promotion_codes_request_order.py +5 -0
  116. tolt/promotion_codes/types/list_promotion_codes_response.py +23 -0
  117. tolt/promotion_codes/types/update_promotion_code_response.py +22 -0
  118. tolt/reference.md +3422 -0
  119. tolt/reports/__init__.py +34 -0
  120. tolt/reports/client.py +131 -0
  121. tolt/reports/raw_client.py +183 -0
  122. tolt/reports/types/__init__.py +34 -0
  123. tolt/reports/types/reports_overview_response.py +22 -0
  124. tolt/tests/conftest.py +21 -0
  125. tolt/tests/test_aiohttp_autodetect.py +113 -0
  126. tolt/transactions/__init__.py +61 -0
  127. tolt/transactions/client.py +737 -0
  128. tolt/transactions/raw_client.py +1244 -0
  129. tolt/transactions/types/__init__.py +59 -0
  130. tolt/transactions/types/create_transaction_response.py +22 -0
  131. tolt/transactions/types/delete_transaction_response.py +22 -0
  132. tolt/transactions/types/get_transaction_response.py +22 -0
  133. tolt/transactions/types/list_transactions_request_order.py +5 -0
  134. tolt/transactions/types/list_transactions_response.py +23 -0
  135. tolt/transactions/types/refund_transaction_response.py +22 -0
  136. tolt/transactions/types/rerun_transaction_flows_response.py +22 -0
  137. tolt/transactions/types/update_transaction_response.py +22 -0
  138. tolt/types/__init__.py +80 -0
  139. tolt/types/click.py +43 -0
  140. tolt/types/commission.py +75 -0
  141. tolt/types/customer.py +58 -0
  142. tolt/types/error.py +20 -0
  143. tolt/types/flow.py +53 -0
  144. tolt/types/group.py +53 -0
  145. tolt/types/link.py +40 -0
  146. tolt/types/partner.py +48 -0
  147. tolt/types/program.py +50 -0
  148. tolt/types/promotion_code.py +51 -0
  149. tolt/types/reports_overview.py +47 -0
  150. tolt/types/reports_overview_commissions_item.py +27 -0
  151. tolt/types/reports_overview_revenue_item.py +27 -0
  152. tolt/types/rerun_flows_result.py +22 -0
  153. tolt/types/transaction.py +112 -0
  154. tolt-0.1.0.dist-info/METADATA +210 -0
  155. tolt-0.1.0.dist-info/RECORD +158 -0
  156. tolt-0.1.0.dist-info/WHEEL +4 -0
  157. tolt-0.1.0.dist-info/licenses/LICENSE +201 -0
  158. tolt-0.1.0.dist-info/licenses/NOTICE +2 -0
tolt/CONTRIBUTING.md ADDED
@@ -0,0 +1,125 @@
1
+ # Contributing
2
+
3
+ Thanks for your interest in contributing to this SDK! This document provides guidelines for contributing to the project.
4
+
5
+ ## Getting Started
6
+
7
+ ### Prerequisites
8
+
9
+ - Python 3.9+
10
+ - pip
11
+ - poetry
12
+
13
+ ### Installation
14
+
15
+ Install the project dependencies:
16
+
17
+ ```bash
18
+ poetry install
19
+ ```
20
+
21
+ ### Building
22
+
23
+ Build the project:
24
+
25
+ ```bash
26
+ poetry build
27
+ ```
28
+
29
+ ### Testing
30
+
31
+ Run the test suite:
32
+
33
+ ```bash
34
+ poetry run pytest
35
+ ```
36
+
37
+ ### Linting and Formatting
38
+
39
+ Check code style:
40
+
41
+ ```bash
42
+ poetry run ruff check .
43
+ poetry run ruff format .
44
+ ```
45
+
46
+ ### Type Checking
47
+
48
+ Run the type checker:
49
+
50
+ ```bash
51
+ poetry run mypy .
52
+ ```
53
+
54
+ ## About Generated Code
55
+
56
+ **Important**: Most files in this SDK are automatically generated by [Fern](https://buildwithfern.com) from the API definition. Direct modifications to generated files will be overwritten the next time the SDK is generated.
57
+
58
+ ### Generated Files
59
+
60
+ The following directories contain generated code:
61
+ - `src/` - API client classes and types
62
+ - Most Python files in the project
63
+
64
+ ### How to Customize
65
+
66
+ If you need to customize the SDK, you have two options:
67
+
68
+ #### Option 1: Use `.fernignore`
69
+
70
+ For custom code that should persist across SDK regenerations:
71
+
72
+ 1. Create a `.fernignore` file in the project root
73
+ 2. Add file patterns for files you want to preserve (similar to `.gitignore` syntax)
74
+ 3. Add your custom code to those files
75
+
76
+ Files listed in `.fernignore` will not be overwritten when the SDK is regenerated.
77
+
78
+ For more information, see the [Fern documentation on custom code](https://buildwithfern.com/learn/sdks/overview/custom-code).
79
+
80
+ #### Option 2: Contribute to the Generator
81
+
82
+ If you want to change how code is generated for all users of this SDK:
83
+
84
+ 1. The Python SDK generator lives in the [Fern repository](https://github.com/fern-api/fern)
85
+ 2. Generator code is located at `generators/python-v2/`
86
+ 3. Follow the [Fern contributing guidelines](https://github.com/fern-api/fern/blob/main/CONTRIBUTING.md)
87
+ 4. Submit a pull request with your changes to the generator
88
+
89
+ This approach is best for:
90
+ - Bug fixes in generated code
91
+ - New features that would benefit all users
92
+ - Improvements to code generation patterns
93
+
94
+ ## Making Changes
95
+
96
+ ### Workflow
97
+
98
+ 1. Create a new branch for your changes
99
+ 2. Make your modifications
100
+ 3. Run tests to ensure nothing breaks: `poetry run pytest`
101
+ 4. Run linting and formatting: `poetry run ruff check .` and `poetry run ruff format .`
102
+ 5. Run type checking: `poetry run mypy .`
103
+ 6. Build the project: `poetry build`
104
+ 7. Commit your changes with a clear commit message
105
+ 8. Push your branch and create a pull request
106
+
107
+ ### Commit Messages
108
+
109
+ Write clear, descriptive commit messages that explain what changed and why.
110
+
111
+ ### Code Style
112
+
113
+ This project uses automated code formatting and linting. Run `poetry run ruff format .` and `poetry run ruff check .` before committing to ensure your code meets the project's style guidelines.
114
+
115
+ ## Questions or Issues?
116
+
117
+ If you have questions or run into issues:
118
+
119
+ 1. Check the [Fern documentation](https://buildwithfern.com)
120
+ 2. Search existing [GitHub issues](https://github.com/fern-api/fern/issues)
121
+ 3. Open a new issue if your question hasn't been addressed
122
+
123
+ ## License
124
+
125
+ By contributing to this project, you agree that your contributions will be licensed under the same license as the project.
tolt/README.md ADDED
@@ -0,0 +1,188 @@
1
+ # Tolt Python Library
2
+
3
+ [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=Tolt%2FPython)
4
+ [![pypi](https://img.shields.io/pypi/v/tolt)](https://pypi.python.org/pypi/tolt)
5
+
6
+ The Tolt Python library provides convenient access to the Tolt APIs from Python.
7
+
8
+ ## Table of Contents
9
+
10
+ - [Installation](#installation)
11
+ - [Reference](#reference)
12
+ - [Usage](#usage)
13
+ - [Environments](#environments)
14
+ - [Async Client](#async-client)
15
+ - [Exception Handling](#exception-handling)
16
+ - [Advanced](#advanced)
17
+ - [Access Raw Response Data](#access-raw-response-data)
18
+ - [Retries](#retries)
19
+ - [Timeouts](#timeouts)
20
+ - [Custom Client](#custom-client)
21
+ - [Contributing](#contributing)
22
+
23
+ ## Installation
24
+
25
+ ```sh
26
+ pip install tolt
27
+ ```
28
+
29
+ ## Reference
30
+
31
+ A full reference for this library is available [here](./reference.md).
32
+
33
+ ## Usage
34
+
35
+ Instantiate and use the client with the following:
36
+
37
+ ```python
38
+ from tolt import ToltApi
39
+
40
+ client = ToltApi(
41
+ token="<token>",
42
+ )
43
+
44
+ client.partners.approve_partner(
45
+ id="id",
46
+ )
47
+ ```
48
+
49
+ ## Environments
50
+
51
+ This SDK allows you to configure different environments for API requests.
52
+
53
+ ```python
54
+ from tolt import ToltApi
55
+ from tolt.environment import ToltApiEnvironment
56
+
57
+ client = ToltApi(
58
+ environment=ToltApiEnvironment.PRODUCTION,
59
+ )
60
+ ```
61
+
62
+ ## Async Client
63
+
64
+ The SDK also exports an `async` client so that you can make non-blocking calls to our API. Note that if you are constructing an Async httpx client class to pass into this client, use `httpx.AsyncClient()` instead of `httpx.Client()` (e.g. for the `httpx_client` parameter of this client).
65
+
66
+ ```python
67
+ import asyncio
68
+
69
+ from tolt import AsyncToltApi
70
+
71
+ client = AsyncToltApi(
72
+ token="<token>",
73
+ )
74
+
75
+
76
+ async def main() -> None:
77
+ await client.partners.approve_partner(
78
+ id="id",
79
+ )
80
+
81
+
82
+ asyncio.run(main())
83
+ ```
84
+
85
+ ## Exception Handling
86
+
87
+ When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
88
+ will be thrown.
89
+
90
+ ```python
91
+ from tolt.core.api_error import ApiError
92
+
93
+ try:
94
+ client.partners.approve_partner(...)
95
+ except ApiError as e:
96
+ print(e.status_code)
97
+ print(e.body)
98
+ ```
99
+
100
+ ## Advanced
101
+
102
+ ### Access Raw Response Data
103
+
104
+ The SDK provides access to raw response data, including headers, through the `.with_raw_response` property.
105
+ The `.with_raw_response` property returns a "raw" client that can be used to access the `.headers` and `.data` attributes.
106
+
107
+ ```python
108
+ from tolt import ToltApi
109
+
110
+ client = ToltApi(...)
111
+ response = client.partners.with_raw_response.approve_partner(...)
112
+ print(response.headers) # access the response headers
113
+ print(response.status_code) # access the response status code
114
+ print(response.data) # access the underlying object
115
+ ```
116
+
117
+ ### Retries
118
+
119
+ The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
120
+ as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
121
+ retry limit (default: 2).
122
+
123
+ Which status codes are retried depends on the `retryStatusCodes` generator configuration:
124
+
125
+ **`legacy`** (current default): retries on
126
+ - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
127
+ - [409](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409) (Conflict)
128
+ - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
129
+ - [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#server_error_responses) (All server errors, including 500)
130
+
131
+ **`recommended`**: retries on
132
+ - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
133
+ - [409](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409) (Conflict)
134
+ - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
135
+ - [502](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502) (Bad Gateway)
136
+ - [503](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503) (Service Unavailable)
137
+ - [504](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/504) (Gateway Timeout)
138
+
139
+ Use the `max_retries` request option to configure this behavior.
140
+
141
+ ```python
142
+ client.partners.approve_partner(..., request_options={
143
+ "max_retries": 1
144
+ })
145
+ ```
146
+
147
+ ### Timeouts
148
+
149
+ The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level.
150
+
151
+ ```python
152
+ from tolt import ToltApi
153
+
154
+ client = ToltApi(..., timeout=20.0)
155
+
156
+ # Override timeout for a specific method
157
+ client.partners.approve_partner(..., request_options={
158
+ "timeout": 1
159
+ })
160
+ ```
161
+
162
+ ### Custom Client
163
+
164
+ You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies
165
+ and transports.
166
+
167
+ ```python
168
+ import httpx
169
+ from tolt import ToltApi
170
+
171
+ client = ToltApi(
172
+ ...,
173
+ httpx_client=httpx.Client(
174
+ proxy="http://my.test.proxy.example.com",
175
+ transport=httpx.HTTPTransport(local_address="0.0.0.0"),
176
+ ),
177
+ )
178
+ ```
179
+
180
+ ## Contributing
181
+
182
+ While we value open-source contributions to this SDK, this library is generated programmatically.
183
+ Additions made directly to this library would have to be moved over to our generation code,
184
+ otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
185
+ a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
186
+ an issue first to discuss with us!
187
+
188
+ On the other hand, contributions to the README are always very welcome!
tolt/__init__.py ADDED
@@ -0,0 +1,315 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
5
+ import typing
6
+ from importlib import import_module
7
+
8
+ if typing.TYPE_CHECKING:
9
+ from .types import (
10
+ Click,
11
+ Commission,
12
+ Customer,
13
+ Error,
14
+ Flow,
15
+ Group,
16
+ Link,
17
+ Partner,
18
+ Program,
19
+ PromotionCode,
20
+ ReportsOverview,
21
+ ReportsOverviewCommissionsItem,
22
+ ReportsOverviewRevenueItem,
23
+ RerunFlowsResult,
24
+ Transaction,
25
+ )
26
+ from .errors import BadRequestError, ConflictError, NotFoundError, UnauthorizedError
27
+ from . import (
28
+ clicks,
29
+ commissions,
30
+ customers,
31
+ flows,
32
+ groups,
33
+ links,
34
+ partners,
35
+ programs,
36
+ promotion_codes,
37
+ reports,
38
+ transactions,
39
+ )
40
+ from ._default_clients import DefaultAioHttpClient, DefaultAsyncHttpxClient
41
+ from .clicks import GetClickResponse, ListClicksRequestOrder, ListClicksResponse
42
+ from .client import AsyncToltApi, ToltApi
43
+ from .commissions import (
44
+ ApproveCommissionResponse,
45
+ CreateCommissionRequest,
46
+ CreateCommissionResponse,
47
+ DeclineCommissionResponse,
48
+ DeleteCommissionResponse,
49
+ GetCommissionResponse,
50
+ ListCommissionsRequestOrder,
51
+ ListCommissionsResponse,
52
+ UpdateCommissionResponse,
53
+ )
54
+ from .customers import (
55
+ CreateCustomerRequest,
56
+ CreateCustomerResponse,
57
+ DeleteCustomerResponse,
58
+ GetCustomerResponse,
59
+ ListCustomersRequestOrder,
60
+ ListCustomersResponse,
61
+ UpdateCustomerResponse,
62
+ )
63
+ from .environment import ToltApiEnvironment
64
+ from .flows import GetFlowResponse, ListFlowsRequestActive, ListFlowsRequestOrder, ListFlowsResponse
65
+ from .groups import GetGroupResponse, ListGroupsRequestDefault, ListGroupsRequestOrder, ListGroupsResponse
66
+ from .links import (
67
+ CreateLinkResponse,
68
+ DeleteLinkResponse,
69
+ GetLinkResponse,
70
+ ListLinksRequestOrder,
71
+ ListLinksResponse,
72
+ UpdateLinkResponse,
73
+ )
74
+ from .partners import (
75
+ ApprovePartnerResponse,
76
+ GetPartnerResponse,
77
+ ListPartnersRequestOrder,
78
+ ListPartnersRequestStatus,
79
+ ListPartnersResponse,
80
+ RejectPartnerResponse,
81
+ SuspendPartnerResponse,
82
+ )
83
+ from .programs import GetProgramResponse, ListProgramsRequestOrder, ListProgramsResponse
84
+ from .promotion_codes import (
85
+ CreatePromotionCodeResponse,
86
+ DeletePromotionCodeResponse,
87
+ GetPromotionCodeResponse,
88
+ ListPromotionCodesRequestOrder,
89
+ ListPromotionCodesResponse,
90
+ UpdatePromotionCodeResponse,
91
+ )
92
+ from .reports import ReportsOverviewResponse
93
+ from .transactions import (
94
+ CreateTransactionResponse,
95
+ DeleteTransactionResponse,
96
+ GetTransactionResponse,
97
+ ListTransactionsRequestOrder,
98
+ ListTransactionsResponse,
99
+ RefundTransactionResponse,
100
+ RerunTransactionFlowsResponse,
101
+ UpdateTransactionResponse,
102
+ )
103
+ _dynamic_imports: typing.Dict[str, str] = {
104
+ "ApproveCommissionResponse": ".commissions",
105
+ "ApprovePartnerResponse": ".partners",
106
+ "AsyncToltApi": ".client",
107
+ "BadRequestError": ".errors",
108
+ "Click": ".types",
109
+ "Commission": ".types",
110
+ "ConflictError": ".errors",
111
+ "CreateCommissionRequest": ".commissions",
112
+ "CreateCommissionResponse": ".commissions",
113
+ "CreateCustomerRequest": ".customers",
114
+ "CreateCustomerResponse": ".customers",
115
+ "CreateLinkResponse": ".links",
116
+ "CreatePromotionCodeResponse": ".promotion_codes",
117
+ "CreateTransactionResponse": ".transactions",
118
+ "Customer": ".types",
119
+ "DeclineCommissionResponse": ".commissions",
120
+ "DefaultAioHttpClient": "._default_clients",
121
+ "DefaultAsyncHttpxClient": "._default_clients",
122
+ "DeleteCommissionResponse": ".commissions",
123
+ "DeleteCustomerResponse": ".customers",
124
+ "DeleteLinkResponse": ".links",
125
+ "DeletePromotionCodeResponse": ".promotion_codes",
126
+ "DeleteTransactionResponse": ".transactions",
127
+ "Error": ".types",
128
+ "Flow": ".types",
129
+ "GetClickResponse": ".clicks",
130
+ "GetCommissionResponse": ".commissions",
131
+ "GetCustomerResponse": ".customers",
132
+ "GetFlowResponse": ".flows",
133
+ "GetGroupResponse": ".groups",
134
+ "GetLinkResponse": ".links",
135
+ "GetPartnerResponse": ".partners",
136
+ "GetProgramResponse": ".programs",
137
+ "GetPromotionCodeResponse": ".promotion_codes",
138
+ "GetTransactionResponse": ".transactions",
139
+ "Group": ".types",
140
+ "Link": ".types",
141
+ "ListClicksRequestOrder": ".clicks",
142
+ "ListClicksResponse": ".clicks",
143
+ "ListCommissionsRequestOrder": ".commissions",
144
+ "ListCommissionsResponse": ".commissions",
145
+ "ListCustomersRequestOrder": ".customers",
146
+ "ListCustomersResponse": ".customers",
147
+ "ListFlowsRequestActive": ".flows",
148
+ "ListFlowsRequestOrder": ".flows",
149
+ "ListFlowsResponse": ".flows",
150
+ "ListGroupsRequestDefault": ".groups",
151
+ "ListGroupsRequestOrder": ".groups",
152
+ "ListGroupsResponse": ".groups",
153
+ "ListLinksRequestOrder": ".links",
154
+ "ListLinksResponse": ".links",
155
+ "ListPartnersRequestOrder": ".partners",
156
+ "ListPartnersRequestStatus": ".partners",
157
+ "ListPartnersResponse": ".partners",
158
+ "ListProgramsRequestOrder": ".programs",
159
+ "ListProgramsResponse": ".programs",
160
+ "ListPromotionCodesRequestOrder": ".promotion_codes",
161
+ "ListPromotionCodesResponse": ".promotion_codes",
162
+ "ListTransactionsRequestOrder": ".transactions",
163
+ "ListTransactionsResponse": ".transactions",
164
+ "NotFoundError": ".errors",
165
+ "Partner": ".types",
166
+ "Program": ".types",
167
+ "PromotionCode": ".types",
168
+ "RefundTransactionResponse": ".transactions",
169
+ "RejectPartnerResponse": ".partners",
170
+ "ReportsOverview": ".types",
171
+ "ReportsOverviewCommissionsItem": ".types",
172
+ "ReportsOverviewResponse": ".reports",
173
+ "ReportsOverviewRevenueItem": ".types",
174
+ "RerunFlowsResult": ".types",
175
+ "RerunTransactionFlowsResponse": ".transactions",
176
+ "SuspendPartnerResponse": ".partners",
177
+ "ToltApi": ".client",
178
+ "ToltApiEnvironment": ".environment",
179
+ "Transaction": ".types",
180
+ "UnauthorizedError": ".errors",
181
+ "UpdateCommissionResponse": ".commissions",
182
+ "UpdateCustomerResponse": ".customers",
183
+ "UpdateLinkResponse": ".links",
184
+ "UpdatePromotionCodeResponse": ".promotion_codes",
185
+ "UpdateTransactionResponse": ".transactions",
186
+ "clicks": ".clicks",
187
+ "commissions": ".commissions",
188
+ "customers": ".customers",
189
+ "flows": ".flows",
190
+ "groups": ".groups",
191
+ "links": ".links",
192
+ "partners": ".partners",
193
+ "programs": ".programs",
194
+ "promotion_codes": ".promotion_codes",
195
+ "reports": ".reports",
196
+ "transactions": ".transactions",
197
+ }
198
+
199
+
200
+ def __getattr__(attr_name: str) -> typing.Any:
201
+ module_name = _dynamic_imports.get(attr_name)
202
+ if module_name is None:
203
+ raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
204
+ try:
205
+ module = import_module(module_name, __package__)
206
+ if module_name == f".{attr_name}":
207
+ return module
208
+ else:
209
+ return getattr(module, attr_name)
210
+ except ImportError as e:
211
+ raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
212
+ except AttributeError as e:
213
+ raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
214
+
215
+
216
+ def __dir__():
217
+ lazy_attrs = list(_dynamic_imports.keys())
218
+ return sorted(lazy_attrs)
219
+
220
+
221
+ __all__ = [
222
+ "ApproveCommissionResponse",
223
+ "ApprovePartnerResponse",
224
+ "AsyncToltApi",
225
+ "BadRequestError",
226
+ "Click",
227
+ "Commission",
228
+ "ConflictError",
229
+ "CreateCommissionRequest",
230
+ "CreateCommissionResponse",
231
+ "CreateCustomerRequest",
232
+ "CreateCustomerResponse",
233
+ "CreateLinkResponse",
234
+ "CreatePromotionCodeResponse",
235
+ "CreateTransactionResponse",
236
+ "Customer",
237
+ "DeclineCommissionResponse",
238
+ "DefaultAioHttpClient",
239
+ "DefaultAsyncHttpxClient",
240
+ "DeleteCommissionResponse",
241
+ "DeleteCustomerResponse",
242
+ "DeleteLinkResponse",
243
+ "DeletePromotionCodeResponse",
244
+ "DeleteTransactionResponse",
245
+ "Error",
246
+ "Flow",
247
+ "GetClickResponse",
248
+ "GetCommissionResponse",
249
+ "GetCustomerResponse",
250
+ "GetFlowResponse",
251
+ "GetGroupResponse",
252
+ "GetLinkResponse",
253
+ "GetPartnerResponse",
254
+ "GetProgramResponse",
255
+ "GetPromotionCodeResponse",
256
+ "GetTransactionResponse",
257
+ "Group",
258
+ "Link",
259
+ "ListClicksRequestOrder",
260
+ "ListClicksResponse",
261
+ "ListCommissionsRequestOrder",
262
+ "ListCommissionsResponse",
263
+ "ListCustomersRequestOrder",
264
+ "ListCustomersResponse",
265
+ "ListFlowsRequestActive",
266
+ "ListFlowsRequestOrder",
267
+ "ListFlowsResponse",
268
+ "ListGroupsRequestDefault",
269
+ "ListGroupsRequestOrder",
270
+ "ListGroupsResponse",
271
+ "ListLinksRequestOrder",
272
+ "ListLinksResponse",
273
+ "ListPartnersRequestOrder",
274
+ "ListPartnersRequestStatus",
275
+ "ListPartnersResponse",
276
+ "ListProgramsRequestOrder",
277
+ "ListProgramsResponse",
278
+ "ListPromotionCodesRequestOrder",
279
+ "ListPromotionCodesResponse",
280
+ "ListTransactionsRequestOrder",
281
+ "ListTransactionsResponse",
282
+ "NotFoundError",
283
+ "Partner",
284
+ "Program",
285
+ "PromotionCode",
286
+ "RefundTransactionResponse",
287
+ "RejectPartnerResponse",
288
+ "ReportsOverview",
289
+ "ReportsOverviewCommissionsItem",
290
+ "ReportsOverviewResponse",
291
+ "ReportsOverviewRevenueItem",
292
+ "RerunFlowsResult",
293
+ "RerunTransactionFlowsResponse",
294
+ "SuspendPartnerResponse",
295
+ "ToltApi",
296
+ "ToltApiEnvironment",
297
+ "Transaction",
298
+ "UnauthorizedError",
299
+ "UpdateCommissionResponse",
300
+ "UpdateCustomerResponse",
301
+ "UpdateLinkResponse",
302
+ "UpdatePromotionCodeResponse",
303
+ "UpdateTransactionResponse",
304
+ "clicks",
305
+ "commissions",
306
+ "customers",
307
+ "flows",
308
+ "groups",
309
+ "links",
310
+ "partners",
311
+ "programs",
312
+ "promotion_codes",
313
+ "reports",
314
+ "transactions",
315
+ ]
@@ -0,0 +1,30 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import httpx
6
+
7
+ SDK_DEFAULT_TIMEOUT = 60
8
+
9
+ try:
10
+ import httpx_aiohttp # type: ignore[import-not-found]
11
+ except ImportError:
12
+
13
+ class DefaultAioHttpClient(httpx.AsyncClient): # type: ignore
14
+ def __init__(self, **kwargs: typing.Any) -> None:
15
+ raise RuntimeError("To use the aiohttp client, install the aiohttp extra: pip install tolt[aiohttp]")
16
+
17
+ else:
18
+
19
+ class DefaultAioHttpClient(httpx_aiohttp.HttpxAiohttpClient): # type: ignore
20
+ def __init__(self, **kwargs: typing.Any) -> None:
21
+ kwargs.setdefault("timeout", SDK_DEFAULT_TIMEOUT)
22
+ kwargs.setdefault("follow_redirects", True)
23
+ super().__init__(**kwargs)
24
+
25
+
26
+ class DefaultAsyncHttpxClient(httpx.AsyncClient):
27
+ def __init__(self, **kwargs: typing.Any) -> None:
28
+ kwargs.setdefault("timeout", SDK_DEFAULT_TIMEOUT)
29
+ kwargs.setdefault("follow_redirects", True)
30
+ super().__init__(**kwargs)
@@ -0,0 +1,38 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
5
+ import typing
6
+ from importlib import import_module
7
+
8
+ if typing.TYPE_CHECKING:
9
+ from .types import GetClickResponse, ListClicksRequestOrder, ListClicksResponse
10
+ _dynamic_imports: typing.Dict[str, str] = {
11
+ "GetClickResponse": ".types",
12
+ "ListClicksRequestOrder": ".types",
13
+ "ListClicksResponse": ".types",
14
+ }
15
+
16
+
17
+ def __getattr__(attr_name: str) -> typing.Any:
18
+ module_name = _dynamic_imports.get(attr_name)
19
+ if module_name is None:
20
+ raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
21
+ try:
22
+ module = import_module(module_name, __package__)
23
+ if module_name == f".{attr_name}":
24
+ return module
25
+ else:
26
+ return getattr(module, attr_name)
27
+ except ImportError as e:
28
+ raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
29
+ except AttributeError as e:
30
+ raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
31
+
32
+
33
+ def __dir__():
34
+ lazy_attrs = list(_dynamic_imports.keys())
35
+ return sorted(lazy_attrs)
36
+
37
+
38
+ __all__ = ["GetClickResponse", "ListClicksRequestOrder", "ListClicksResponse"]