BasisTheoryClient 0.0.1__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.
- basis_theory/__init__.py +350 -0
- basis_theory/account_updater/__init__.py +7 -0
- basis_theory/account_updater/client.py +44 -0
- basis_theory/account_updater/jobs/__init__.py +4 -0
- basis_theory/account_updater/jobs/client.py +259 -0
- basis_theory/account_updater/jobs/raw_client.py +450 -0
- basis_theory/account_updater/raw_client.py +13 -0
- basis_theory/account_updater/real_time/__init__.py +4 -0
- basis_theory/account_updater/real_time/client.py +161 -0
- basis_theory/account_updater/real_time/raw_client.py +246 -0
- basis_theory/apple_pay/__init__.py +7 -0
- basis_theory/apple_pay/client.py +267 -0
- basis_theory/apple_pay/domain/__init__.py +4 -0
- basis_theory/apple_pay/domain/client.py +309 -0
- basis_theory/apple_pay/domain/raw_client.py +631 -0
- basis_theory/apple_pay/raw_client.py +499 -0
- basis_theory/apple_pay/session/__init__.py +4 -0
- basis_theory/apple_pay/session/client.py +130 -0
- basis_theory/apple_pay/session/raw_client.py +225 -0
- basis_theory/application_keys/__init__.py +4 -0
- basis_theory/application_keys/client.py +354 -0
- basis_theory/application_keys/raw_client.py +615 -0
- basis_theory/application_templates/__init__.py +4 -0
- basis_theory/application_templates/client.py +166 -0
- basis_theory/application_templates/raw_client.py +253 -0
- basis_theory/applications/__init__.py +4 -0
- basis_theory/applications/client.py +582 -0
- basis_theory/applications/raw_client.py +1030 -0
- basis_theory/client.py +230 -0
- basis_theory/connection/__init__.py +7 -0
- basis_theory/connection/apple_pay/__init__.py +7 -0
- basis_theory/connection/apple_pay/client.py +128 -0
- basis_theory/connection/apple_pay/domain/__init__.py +4 -0
- basis_theory/connection/apple_pay/domain/client.py +309 -0
- basis_theory/connection/apple_pay/domain/raw_client.py +631 -0
- basis_theory/connection/apple_pay/raw_client.py +216 -0
- basis_theory/connection/apple_pay/session/__init__.py +4 -0
- basis_theory/connection/apple_pay/session/client.py +130 -0
- basis_theory/connection/apple_pay/session/raw_client.py +225 -0
- basis_theory/connection/client.py +39 -0
- basis_theory/connection/raw_client.py +13 -0
- basis_theory/core/__init__.py +55 -0
- basis_theory/core/api_error.py +23 -0
- basis_theory/core/client_wrapper.py +89 -0
- basis_theory/core/datetime_utils.py +28 -0
- basis_theory/core/file.py +67 -0
- basis_theory/core/force_multipart.py +16 -0
- basis_theory/core/http_client.py +543 -0
- basis_theory/core/http_response.py +55 -0
- basis_theory/core/jsonable_encoder.py +100 -0
- basis_theory/core/pagination.py +82 -0
- basis_theory/core/pydantic_utilities.py +255 -0
- basis_theory/core/query_encoder.py +58 -0
- basis_theory/core/remove_none_from_dict.py +11 -0
- basis_theory/core/request_options.py +35 -0
- basis_theory/core/serialization.py +276 -0
- basis_theory/documents/__init__.py +7 -0
- basis_theory/documents/client.py +258 -0
- basis_theory/documents/data/__init__.py +4 -0
- basis_theory/documents/data/client.py +78 -0
- basis_theory/documents/data/raw_client.py +173 -0
- basis_theory/documents/raw_client.py +442 -0
- basis_theory/enrichments/__init__.py +4 -0
- basis_theory/enrichments/client.py +135 -0
- basis_theory/enrichments/raw_client.py +203 -0
- basis_theory/environment.py +7 -0
- basis_theory/errors/__init__.py +23 -0
- basis_theory/errors/bad_request_error.py +11 -0
- basis_theory/errors/conflict_error.py +11 -0
- basis_theory/errors/forbidden_error.py +11 -0
- basis_theory/errors/internal_server_error.py +11 -0
- basis_theory/errors/not_found_error.py +10 -0
- basis_theory/errors/service_unavailable_error.py +11 -0
- basis_theory/errors/unauthorized_error.py +11 -0
- basis_theory/errors/unprocessable_entity_error.py +11 -0
- basis_theory/googlepay/__init__.py +4 -0
- basis_theory/googlepay/client.py +120 -0
- basis_theory/googlepay/raw_client.py +239 -0
- basis_theory/keys/__init__.py +4 -0
- basis_theory/keys/client.py +313 -0
- basis_theory/keys/raw_client.py +673 -0
- basis_theory/logs/__init__.py +4 -0
- basis_theory/logs/client.py +240 -0
- basis_theory/logs/raw_client.py +376 -0
- basis_theory/network_tokens/__init__.py +4 -0
- basis_theory/network_tokens/client.py +478 -0
- basis_theory/network_tokens/raw_client.py +1113 -0
- basis_theory/permissions/__init__.py +4 -0
- basis_theory/permissions/client.py +106 -0
- basis_theory/permissions/raw_client.py +170 -0
- basis_theory/proxies/__init__.py +4 -0
- basis_theory/proxies/client.py +751 -0
- basis_theory/proxies/raw_client.py +1255 -0
- basis_theory/py.typed +0 -0
- basis_theory/reactors/__init__.py +7 -0
- basis_theory/reactors/client.py +823 -0
- basis_theory/reactors/raw_client.py +1553 -0
- basis_theory/reactors/results/__init__.py +4 -0
- basis_theory/reactors/results/client.py +115 -0
- basis_theory/reactors/results/raw_client.py +194 -0
- basis_theory/roles/__init__.py +4 -0
- basis_theory/roles/client.py +98 -0
- basis_theory/roles/raw_client.py +134 -0
- basis_theory/sessions/__init__.py +4 -0
- basis_theory/sessions/client.py +222 -0
- basis_theory/sessions/raw_client.py +399 -0
- basis_theory/tenants/__init__.py +7 -0
- basis_theory/tenants/client.py +59 -0
- basis_theory/tenants/connections/__init__.py +4 -0
- basis_theory/tenants/connections/client.py +198 -0
- basis_theory/tenants/connections/raw_client.py +344 -0
- basis_theory/tenants/invitations/__init__.py +4 -0
- basis_theory/tenants/invitations/client.py +458 -0
- basis_theory/tenants/invitations/raw_client.py +805 -0
- basis_theory/tenants/members/__init__.py +4 -0
- basis_theory/tenants/members/client.py +296 -0
- basis_theory/tenants/members/raw_client.py +497 -0
- basis_theory/tenants/owner/__init__.py +4 -0
- basis_theory/tenants/owner/client.py +98 -0
- basis_theory/tenants/owner/raw_client.py +157 -0
- basis_theory/tenants/raw_client.py +13 -0
- basis_theory/tenants/self_/__init__.py +4 -0
- basis_theory/tenants/self_/client.py +308 -0
- basis_theory/tenants/self_/raw_client.py +605 -0
- basis_theory/threeds/__init__.py +7 -0
- basis_theory/threeds/client.py +39 -0
- basis_theory/threeds/raw_client.py +13 -0
- basis_theory/threeds/sessions/__init__.py +4 -0
- basis_theory/threeds/sessions/client.py +521 -0
- basis_theory/threeds/sessions/raw_client.py +808 -0
- basis_theory/token_intents/__init__.py +4 -0
- basis_theory/token_intents/client.py +258 -0
- basis_theory/token_intents/raw_client.py +454 -0
- basis_theory/tokens/__init__.py +4 -0
- basis_theory/tokens/client.py +1015 -0
- basis_theory/tokens/raw_client.py +1861 -0
- basis_theory/types/__init__.py +277 -0
- basis_theory/types/access_rule.py +25 -0
- basis_theory/types/account_updater_job.py +55 -0
- basis_theory/types/account_updater_job_list.py +22 -0
- basis_theory/types/account_updater_job_list_pagination.py +20 -0
- basis_theory/types/account_updater_job_status.py +5 -0
- basis_theory/types/account_updater_real_time_response.py +24 -0
- basis_theory/types/additional_card_details.py +23 -0
- basis_theory/types/address.py +25 -0
- basis_theory/types/apple_pay_create_response.py +20 -0
- basis_theory/types/apple_pay_create_token_response.py +28 -0
- basis_theory/types/apple_pay_domain_deregistration_request.py +19 -0
- basis_theory/types/apple_pay_domain_registration_list_request.py +19 -0
- basis_theory/types/apple_pay_domain_registration_request.py +19 -0
- basis_theory/types/apple_pay_domain_registration_response.py +20 -0
- basis_theory/types/apple_pay_method_token.py +25 -0
- basis_theory/types/apple_pay_session_request.py +21 -0
- basis_theory/types/apple_pay_token.py +33 -0
- basis_theory/types/apple_pay_tokenize_response.py +20 -0
- basis_theory/types/application.py +33 -0
- basis_theory/types/application_key.py +24 -0
- basis_theory/types/application_paginated_list.py +22 -0
- basis_theory/types/application_template.py +27 -0
- basis_theory/types/assurance_details.py +20 -0
- basis_theory/types/async_react_response.py +23 -0
- basis_theory/types/authenticate_three_ds_session_request.py +35 -0
- basis_theory/types/authentication.py +22 -0
- basis_theory/types/authentication_response.py +21 -0
- basis_theory/types/bank_details.py +20 -0
- basis_theory/types/bank_verification_response.py +19 -0
- basis_theory/types/bin_details.py +41 -0
- basis_theory/types/bin_details_bank.py +22 -0
- basis_theory/types/bin_details_country.py +21 -0
- basis_theory/types/bin_details_product.py +20 -0
- basis_theory/types/card.py +22 -0
- basis_theory/types/card_details.py +32 -0
- basis_theory/types/card_issuer.py +20 -0
- basis_theory/types/card_issuer_country.py +21 -0
- basis_theory/types/cardholder_info.py +21 -0
- basis_theory/types/client_encryption_key_metadata_response.py +23 -0
- basis_theory/types/client_encryption_key_response.py +24 -0
- basis_theory/types/condition.py +21 -0
- basis_theory/types/create_account_updater_job_request.py +22 -0
- basis_theory/types/create_document_request.py +19 -0
- basis_theory/types/create_reactor_formula_request.py +28 -0
- basis_theory/types/create_session_response.py +22 -0
- basis_theory/types/create_tenant_connection_response.py +19 -0
- basis_theory/types/create_three_ds_session_response.py +29 -0
- basis_theory/types/create_token_intent_response.py +36 -0
- basis_theory/types/cursor_pagination.py +20 -0
- basis_theory/types/document.py +25 -0
- basis_theory/types/domain_registration_response.py +20 -0
- basis_theory/types/event_types.py +5 -0
- basis_theory/types/get_applications.py +23 -0
- basis_theory/types/get_logs.py +26 -0
- basis_theory/types/get_permissions.py +19 -0
- basis_theory/types/get_proxies.py +23 -0
- basis_theory/types/get_reactor_formulas.py +22 -0
- basis_theory/types/get_reactors.py +23 -0
- basis_theory/types/get_tenant_invitations.py +23 -0
- basis_theory/types/get_tenant_members.py +22 -0
- basis_theory/types/get_tokens.py +23 -0
- basis_theory/types/get_tokens_v2.py +24 -0
- basis_theory/types/google_pay_tokenize_response.py +20 -0
- basis_theory/types/google_payment_method_token.py +27 -0
- basis_theory/types/header.py +26 -0
- basis_theory/types/intermediate_signing_key.py +22 -0
- basis_theory/types/log.py +28 -0
- basis_theory/types/log_entity_type.py +20 -0
- basis_theory/types/log_paginated_list.py +22 -0
- basis_theory/types/network_token.py +38 -0
- basis_theory/types/network_token_cryptogram.py +20 -0
- basis_theory/types/network_token_extras.py +19 -0
- basis_theory/types/pagination.py +24 -0
- basis_theory/types/payment_data.py +23 -0
- basis_theory/types/permission.py +21 -0
- basis_theory/types/privacy.py +21 -0
- basis_theory/types/problem_details.py +23 -0
- basis_theory/types/proxy.py +39 -0
- basis_theory/types/proxy_paginated_list.py +22 -0
- basis_theory/types/proxy_transform.py +23 -0
- basis_theory/types/public_key.py +3 -0
- basis_theory/types/react_response.py +22 -0
- basis_theory/types/reactor.py +32 -0
- basis_theory/types/reactor_formula.py +34 -0
- basis_theory/types/reactor_formula_configuration.py +21 -0
- basis_theory/types/reactor_formula_paginated_list.py +22 -0
- basis_theory/types/reactor_formula_request_parameter.py +22 -0
- basis_theory/types/reactor_paginated_list.py +22 -0
- basis_theory/types/role.py +19 -0
- basis_theory/types/string_string_key_value_pair.py +20 -0
- basis_theory/types/submerchant_authentication_response.py +21 -0
- basis_theory/types/tenant.py +28 -0
- basis_theory/types/tenant_connection_options.py +19 -0
- basis_theory/types/tenant_invitation_response.py +30 -0
- basis_theory/types/tenant_invitation_response_paginated_list.py +22 -0
- basis_theory/types/tenant_invitation_status.py +5 -0
- basis_theory/types/tenant_member_response.py +28 -0
- basis_theory/types/tenant_member_response_paginated_list.py +22 -0
- basis_theory/types/tenant_usage_report.py +19 -0
- basis_theory/types/three_ds_acs_rendering_type.py +22 -0
- basis_theory/types/three_ds_address.py +25 -0
- basis_theory/types/three_ds_authentication.py +53 -0
- basis_theory/types/three_ds_callback_urls.py +20 -0
- basis_theory/types/three_ds_cardholder_account_info.py +33 -0
- basis_theory/types/three_ds_cardholder_authentication_info.py +21 -0
- basis_theory/types/three_ds_cardholder_info.py +36 -0
- basis_theory/types/three_ds_cardholder_phone_number.py +20 -0
- basis_theory/types/three_ds_device_info.py +36 -0
- basis_theory/types/three_ds_merchant_info.py +26 -0
- basis_theory/types/three_ds_merchant_risk_info.py +27 -0
- basis_theory/types/three_ds_message_extension.py +22 -0
- basis_theory/types/three_ds_method.py +20 -0
- basis_theory/types/three_ds_mobile_sdk_render_options.py +20 -0
- basis_theory/types/three_ds_prior_authentication_info.py +22 -0
- basis_theory/types/three_ds_purchase_info.py +26 -0
- basis_theory/types/three_ds_requestor_info.py +25 -0
- basis_theory/types/three_ds_session.py +42 -0
- basis_theory/types/three_ds_version.py +25 -0
- basis_theory/types/token.py +49 -0
- basis_theory/types/token_cursor_paginated_list.py +22 -0
- basis_theory/types/token_enrichments.py +22 -0
- basis_theory/types/token_enrichments_card_details.py +20 -0
- basis_theory/types/token_extras.py +24 -0
- basis_theory/types/token_intent.py +36 -0
- basis_theory/types/token_intent_extras.py +21 -0
- basis_theory/types/token_paginated_list.py +22 -0
- basis_theory/types/token_service_provider_details.py +34 -0
- basis_theory/types/update_privacy.py +20 -0
- basis_theory/types/update_reactor_formula_request.py +27 -0
- basis_theory/types/user.py +25 -0
- basis_theory/types/validation_problem_details.py +24 -0
- basis_theory/types/webhook.py +35 -0
- basis_theory/types/webhook_list.py +22 -0
- basis_theory/types/webhook_list_pagination.py +20 -0
- basis_theory/types/webhook_status.py +5 -0
- basis_theory/version.py +3 -0
- basis_theory/webhooks/__init__.py +7 -0
- basis_theory/webhooks/client.py +543 -0
- basis_theory/webhooks/events/__init__.py +4 -0
- basis_theory/webhooks/events/client.py +102 -0
- basis_theory/webhooks/events/raw_client.py +136 -0
- basis_theory/webhooks/raw_client.py +943 -0
- basistheoryclient-0.0.1.dist-info/LICENSE +201 -0
- basistheoryclient-0.0.1.dist-info/METADATA +213 -0
- basistheoryclient-0.0.1.dist-info/RECORD +283 -0
- basistheoryclient-0.0.1.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,543 @@
|
|
|
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.webhook import Webhook
|
|
8
|
+
from ..types.webhook_list import WebhookList
|
|
9
|
+
from .events.client import AsyncEventsClient, EventsClient
|
|
10
|
+
from .raw_client import AsyncRawWebhooksClient, RawWebhooksClient
|
|
11
|
+
|
|
12
|
+
# this is used as the default value for optional parameters
|
|
13
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class WebhooksClient:
|
|
17
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
18
|
+
self._raw_client = RawWebhooksClient(client_wrapper=client_wrapper)
|
|
19
|
+
self.events = EventsClient(client_wrapper=client_wrapper)
|
|
20
|
+
|
|
21
|
+
@property
|
|
22
|
+
def with_raw_response(self) -> RawWebhooksClient:
|
|
23
|
+
"""
|
|
24
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
25
|
+
|
|
26
|
+
Returns
|
|
27
|
+
-------
|
|
28
|
+
RawWebhooksClient
|
|
29
|
+
"""
|
|
30
|
+
return self._raw_client
|
|
31
|
+
|
|
32
|
+
def ping(self, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
33
|
+
"""
|
|
34
|
+
Simple endpoint that can be utilized to verify the application is running
|
|
35
|
+
|
|
36
|
+
Parameters
|
|
37
|
+
----------
|
|
38
|
+
request_options : typing.Optional[RequestOptions]
|
|
39
|
+
Request-specific configuration.
|
|
40
|
+
|
|
41
|
+
Returns
|
|
42
|
+
-------
|
|
43
|
+
None
|
|
44
|
+
|
|
45
|
+
Examples
|
|
46
|
+
--------
|
|
47
|
+
from basis_theory import BasisTheory
|
|
48
|
+
|
|
49
|
+
client = BasisTheory(
|
|
50
|
+
correlation_id="YOUR_CORRELATION_ID",
|
|
51
|
+
api_key="YOUR_API_KEY",
|
|
52
|
+
)
|
|
53
|
+
client.webhooks.ping()
|
|
54
|
+
"""
|
|
55
|
+
_response = self._raw_client.ping(request_options=request_options)
|
|
56
|
+
return _response.data
|
|
57
|
+
|
|
58
|
+
def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Webhook:
|
|
59
|
+
"""
|
|
60
|
+
Returns the webhook
|
|
61
|
+
|
|
62
|
+
Parameters
|
|
63
|
+
----------
|
|
64
|
+
id : str
|
|
65
|
+
|
|
66
|
+
request_options : typing.Optional[RequestOptions]
|
|
67
|
+
Request-specific configuration.
|
|
68
|
+
|
|
69
|
+
Returns
|
|
70
|
+
-------
|
|
71
|
+
Webhook
|
|
72
|
+
Success
|
|
73
|
+
|
|
74
|
+
Examples
|
|
75
|
+
--------
|
|
76
|
+
from basis_theory import BasisTheory
|
|
77
|
+
|
|
78
|
+
client = BasisTheory(
|
|
79
|
+
correlation_id="YOUR_CORRELATION_ID",
|
|
80
|
+
api_key="YOUR_API_KEY",
|
|
81
|
+
)
|
|
82
|
+
client.webhooks.get(
|
|
83
|
+
id="id",
|
|
84
|
+
)
|
|
85
|
+
"""
|
|
86
|
+
_response = self._raw_client.get(id, request_options=request_options)
|
|
87
|
+
return _response.data
|
|
88
|
+
|
|
89
|
+
def update(
|
|
90
|
+
self,
|
|
91
|
+
id: str,
|
|
92
|
+
*,
|
|
93
|
+
name: str,
|
|
94
|
+
url: str,
|
|
95
|
+
events: typing.Sequence[str],
|
|
96
|
+
notify_email: typing.Optional[str] = OMIT,
|
|
97
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
98
|
+
) -> Webhook:
|
|
99
|
+
"""
|
|
100
|
+
Update a new webhook
|
|
101
|
+
|
|
102
|
+
Parameters
|
|
103
|
+
----------
|
|
104
|
+
id : str
|
|
105
|
+
|
|
106
|
+
name : str
|
|
107
|
+
The name of the webhook
|
|
108
|
+
|
|
109
|
+
url : str
|
|
110
|
+
The URL to which the webhook will send events
|
|
111
|
+
|
|
112
|
+
events : typing.Sequence[str]
|
|
113
|
+
An array of event types that the webhook will listen for
|
|
114
|
+
|
|
115
|
+
notify_email : typing.Optional[str]
|
|
116
|
+
The email address to use for management notification events. Ie: webhook disabled
|
|
117
|
+
|
|
118
|
+
request_options : typing.Optional[RequestOptions]
|
|
119
|
+
Request-specific configuration.
|
|
120
|
+
|
|
121
|
+
Returns
|
|
122
|
+
-------
|
|
123
|
+
Webhook
|
|
124
|
+
Success
|
|
125
|
+
|
|
126
|
+
Examples
|
|
127
|
+
--------
|
|
128
|
+
from basis_theory import BasisTheory
|
|
129
|
+
|
|
130
|
+
client = BasisTheory(
|
|
131
|
+
correlation_id="YOUR_CORRELATION_ID",
|
|
132
|
+
api_key="YOUR_API_KEY",
|
|
133
|
+
)
|
|
134
|
+
client.webhooks.update(
|
|
135
|
+
id="id",
|
|
136
|
+
name="webhook-update",
|
|
137
|
+
url="http://www.example.com",
|
|
138
|
+
events=["token:created"],
|
|
139
|
+
)
|
|
140
|
+
"""
|
|
141
|
+
_response = self._raw_client.update(
|
|
142
|
+
id, name=name, url=url, events=events, notify_email=notify_email, request_options=request_options
|
|
143
|
+
)
|
|
144
|
+
return _response.data
|
|
145
|
+
|
|
146
|
+
def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
147
|
+
"""
|
|
148
|
+
Delete a new webhook
|
|
149
|
+
|
|
150
|
+
Parameters
|
|
151
|
+
----------
|
|
152
|
+
id : str
|
|
153
|
+
|
|
154
|
+
request_options : typing.Optional[RequestOptions]
|
|
155
|
+
Request-specific configuration.
|
|
156
|
+
|
|
157
|
+
Returns
|
|
158
|
+
-------
|
|
159
|
+
None
|
|
160
|
+
|
|
161
|
+
Examples
|
|
162
|
+
--------
|
|
163
|
+
from basis_theory import BasisTheory
|
|
164
|
+
|
|
165
|
+
client = BasisTheory(
|
|
166
|
+
correlation_id="YOUR_CORRELATION_ID",
|
|
167
|
+
api_key="YOUR_API_KEY",
|
|
168
|
+
)
|
|
169
|
+
client.webhooks.delete(
|
|
170
|
+
id="id",
|
|
171
|
+
)
|
|
172
|
+
"""
|
|
173
|
+
_response = self._raw_client.delete(id, request_options=request_options)
|
|
174
|
+
return _response.data
|
|
175
|
+
|
|
176
|
+
def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> WebhookList:
|
|
177
|
+
"""
|
|
178
|
+
Returns the configured webhooks
|
|
179
|
+
|
|
180
|
+
Parameters
|
|
181
|
+
----------
|
|
182
|
+
request_options : typing.Optional[RequestOptions]
|
|
183
|
+
Request-specific configuration.
|
|
184
|
+
|
|
185
|
+
Returns
|
|
186
|
+
-------
|
|
187
|
+
WebhookList
|
|
188
|
+
Success
|
|
189
|
+
|
|
190
|
+
Examples
|
|
191
|
+
--------
|
|
192
|
+
from basis_theory import BasisTheory
|
|
193
|
+
|
|
194
|
+
client = BasisTheory(
|
|
195
|
+
correlation_id="YOUR_CORRELATION_ID",
|
|
196
|
+
api_key="YOUR_API_KEY",
|
|
197
|
+
)
|
|
198
|
+
client.webhooks.list()
|
|
199
|
+
"""
|
|
200
|
+
_response = self._raw_client.list(request_options=request_options)
|
|
201
|
+
return _response.data
|
|
202
|
+
|
|
203
|
+
def create(
|
|
204
|
+
self,
|
|
205
|
+
*,
|
|
206
|
+
name: str,
|
|
207
|
+
url: str,
|
|
208
|
+
events: typing.Sequence[str],
|
|
209
|
+
notify_email: typing.Optional[str] = OMIT,
|
|
210
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
211
|
+
) -> Webhook:
|
|
212
|
+
"""
|
|
213
|
+
Create a new webhook
|
|
214
|
+
|
|
215
|
+
Parameters
|
|
216
|
+
----------
|
|
217
|
+
name : str
|
|
218
|
+
The name of the webhook
|
|
219
|
+
|
|
220
|
+
url : str
|
|
221
|
+
The URL to which the webhook will send events
|
|
222
|
+
|
|
223
|
+
events : typing.Sequence[str]
|
|
224
|
+
An array of event types that the webhook will listen for
|
|
225
|
+
|
|
226
|
+
notify_email : typing.Optional[str]
|
|
227
|
+
The email address to use for management notification events. Ie: webhook disabled
|
|
228
|
+
|
|
229
|
+
request_options : typing.Optional[RequestOptions]
|
|
230
|
+
Request-specific configuration.
|
|
231
|
+
|
|
232
|
+
Returns
|
|
233
|
+
-------
|
|
234
|
+
Webhook
|
|
235
|
+
Success
|
|
236
|
+
|
|
237
|
+
Examples
|
|
238
|
+
--------
|
|
239
|
+
from basis_theory import BasisTheory
|
|
240
|
+
|
|
241
|
+
client = BasisTheory(
|
|
242
|
+
correlation_id="YOUR_CORRELATION_ID",
|
|
243
|
+
api_key="YOUR_API_KEY",
|
|
244
|
+
)
|
|
245
|
+
client.webhooks.create(
|
|
246
|
+
name="webhook-create",
|
|
247
|
+
url="http://www.example.com",
|
|
248
|
+
events=["token:created"],
|
|
249
|
+
)
|
|
250
|
+
"""
|
|
251
|
+
_response = self._raw_client.create(
|
|
252
|
+
name=name, url=url, events=events, notify_email=notify_email, request_options=request_options
|
|
253
|
+
)
|
|
254
|
+
return _response.data
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
class AsyncWebhooksClient:
|
|
258
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
259
|
+
self._raw_client = AsyncRawWebhooksClient(client_wrapper=client_wrapper)
|
|
260
|
+
self.events = AsyncEventsClient(client_wrapper=client_wrapper)
|
|
261
|
+
|
|
262
|
+
@property
|
|
263
|
+
def with_raw_response(self) -> AsyncRawWebhooksClient:
|
|
264
|
+
"""
|
|
265
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
266
|
+
|
|
267
|
+
Returns
|
|
268
|
+
-------
|
|
269
|
+
AsyncRawWebhooksClient
|
|
270
|
+
"""
|
|
271
|
+
return self._raw_client
|
|
272
|
+
|
|
273
|
+
async def ping(self, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
274
|
+
"""
|
|
275
|
+
Simple endpoint that can be utilized to verify the application is running
|
|
276
|
+
|
|
277
|
+
Parameters
|
|
278
|
+
----------
|
|
279
|
+
request_options : typing.Optional[RequestOptions]
|
|
280
|
+
Request-specific configuration.
|
|
281
|
+
|
|
282
|
+
Returns
|
|
283
|
+
-------
|
|
284
|
+
None
|
|
285
|
+
|
|
286
|
+
Examples
|
|
287
|
+
--------
|
|
288
|
+
import asyncio
|
|
289
|
+
|
|
290
|
+
from basis_theory import AsyncBasisTheory
|
|
291
|
+
|
|
292
|
+
client = AsyncBasisTheory(
|
|
293
|
+
correlation_id="YOUR_CORRELATION_ID",
|
|
294
|
+
api_key="YOUR_API_KEY",
|
|
295
|
+
)
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
async def main() -> None:
|
|
299
|
+
await client.webhooks.ping()
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
asyncio.run(main())
|
|
303
|
+
"""
|
|
304
|
+
_response = await self._raw_client.ping(request_options=request_options)
|
|
305
|
+
return _response.data
|
|
306
|
+
|
|
307
|
+
async def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Webhook:
|
|
308
|
+
"""
|
|
309
|
+
Returns the webhook
|
|
310
|
+
|
|
311
|
+
Parameters
|
|
312
|
+
----------
|
|
313
|
+
id : str
|
|
314
|
+
|
|
315
|
+
request_options : typing.Optional[RequestOptions]
|
|
316
|
+
Request-specific configuration.
|
|
317
|
+
|
|
318
|
+
Returns
|
|
319
|
+
-------
|
|
320
|
+
Webhook
|
|
321
|
+
Success
|
|
322
|
+
|
|
323
|
+
Examples
|
|
324
|
+
--------
|
|
325
|
+
import asyncio
|
|
326
|
+
|
|
327
|
+
from basis_theory import AsyncBasisTheory
|
|
328
|
+
|
|
329
|
+
client = AsyncBasisTheory(
|
|
330
|
+
correlation_id="YOUR_CORRELATION_ID",
|
|
331
|
+
api_key="YOUR_API_KEY",
|
|
332
|
+
)
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
async def main() -> None:
|
|
336
|
+
await client.webhooks.get(
|
|
337
|
+
id="id",
|
|
338
|
+
)
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
asyncio.run(main())
|
|
342
|
+
"""
|
|
343
|
+
_response = await self._raw_client.get(id, request_options=request_options)
|
|
344
|
+
return _response.data
|
|
345
|
+
|
|
346
|
+
async def update(
|
|
347
|
+
self,
|
|
348
|
+
id: str,
|
|
349
|
+
*,
|
|
350
|
+
name: str,
|
|
351
|
+
url: str,
|
|
352
|
+
events: typing.Sequence[str],
|
|
353
|
+
notify_email: typing.Optional[str] = OMIT,
|
|
354
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
355
|
+
) -> Webhook:
|
|
356
|
+
"""
|
|
357
|
+
Update a new webhook
|
|
358
|
+
|
|
359
|
+
Parameters
|
|
360
|
+
----------
|
|
361
|
+
id : str
|
|
362
|
+
|
|
363
|
+
name : str
|
|
364
|
+
The name of the webhook
|
|
365
|
+
|
|
366
|
+
url : str
|
|
367
|
+
The URL to which the webhook will send events
|
|
368
|
+
|
|
369
|
+
events : typing.Sequence[str]
|
|
370
|
+
An array of event types that the webhook will listen for
|
|
371
|
+
|
|
372
|
+
notify_email : typing.Optional[str]
|
|
373
|
+
The email address to use for management notification events. Ie: webhook disabled
|
|
374
|
+
|
|
375
|
+
request_options : typing.Optional[RequestOptions]
|
|
376
|
+
Request-specific configuration.
|
|
377
|
+
|
|
378
|
+
Returns
|
|
379
|
+
-------
|
|
380
|
+
Webhook
|
|
381
|
+
Success
|
|
382
|
+
|
|
383
|
+
Examples
|
|
384
|
+
--------
|
|
385
|
+
import asyncio
|
|
386
|
+
|
|
387
|
+
from basis_theory import AsyncBasisTheory
|
|
388
|
+
|
|
389
|
+
client = AsyncBasisTheory(
|
|
390
|
+
correlation_id="YOUR_CORRELATION_ID",
|
|
391
|
+
api_key="YOUR_API_KEY",
|
|
392
|
+
)
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
async def main() -> None:
|
|
396
|
+
await client.webhooks.update(
|
|
397
|
+
id="id",
|
|
398
|
+
name="webhook-update",
|
|
399
|
+
url="http://www.example.com",
|
|
400
|
+
events=["token:created"],
|
|
401
|
+
)
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
asyncio.run(main())
|
|
405
|
+
"""
|
|
406
|
+
_response = await self._raw_client.update(
|
|
407
|
+
id, name=name, url=url, events=events, notify_email=notify_email, request_options=request_options
|
|
408
|
+
)
|
|
409
|
+
return _response.data
|
|
410
|
+
|
|
411
|
+
async def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
412
|
+
"""
|
|
413
|
+
Delete a new webhook
|
|
414
|
+
|
|
415
|
+
Parameters
|
|
416
|
+
----------
|
|
417
|
+
id : str
|
|
418
|
+
|
|
419
|
+
request_options : typing.Optional[RequestOptions]
|
|
420
|
+
Request-specific configuration.
|
|
421
|
+
|
|
422
|
+
Returns
|
|
423
|
+
-------
|
|
424
|
+
None
|
|
425
|
+
|
|
426
|
+
Examples
|
|
427
|
+
--------
|
|
428
|
+
import asyncio
|
|
429
|
+
|
|
430
|
+
from basis_theory import AsyncBasisTheory
|
|
431
|
+
|
|
432
|
+
client = AsyncBasisTheory(
|
|
433
|
+
correlation_id="YOUR_CORRELATION_ID",
|
|
434
|
+
api_key="YOUR_API_KEY",
|
|
435
|
+
)
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
async def main() -> None:
|
|
439
|
+
await client.webhooks.delete(
|
|
440
|
+
id="id",
|
|
441
|
+
)
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
asyncio.run(main())
|
|
445
|
+
"""
|
|
446
|
+
_response = await self._raw_client.delete(id, request_options=request_options)
|
|
447
|
+
return _response.data
|
|
448
|
+
|
|
449
|
+
async def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> WebhookList:
|
|
450
|
+
"""
|
|
451
|
+
Returns the configured webhooks
|
|
452
|
+
|
|
453
|
+
Parameters
|
|
454
|
+
----------
|
|
455
|
+
request_options : typing.Optional[RequestOptions]
|
|
456
|
+
Request-specific configuration.
|
|
457
|
+
|
|
458
|
+
Returns
|
|
459
|
+
-------
|
|
460
|
+
WebhookList
|
|
461
|
+
Success
|
|
462
|
+
|
|
463
|
+
Examples
|
|
464
|
+
--------
|
|
465
|
+
import asyncio
|
|
466
|
+
|
|
467
|
+
from basis_theory import AsyncBasisTheory
|
|
468
|
+
|
|
469
|
+
client = AsyncBasisTheory(
|
|
470
|
+
correlation_id="YOUR_CORRELATION_ID",
|
|
471
|
+
api_key="YOUR_API_KEY",
|
|
472
|
+
)
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
async def main() -> None:
|
|
476
|
+
await client.webhooks.list()
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
asyncio.run(main())
|
|
480
|
+
"""
|
|
481
|
+
_response = await self._raw_client.list(request_options=request_options)
|
|
482
|
+
return _response.data
|
|
483
|
+
|
|
484
|
+
async def create(
|
|
485
|
+
self,
|
|
486
|
+
*,
|
|
487
|
+
name: str,
|
|
488
|
+
url: str,
|
|
489
|
+
events: typing.Sequence[str],
|
|
490
|
+
notify_email: typing.Optional[str] = OMIT,
|
|
491
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
492
|
+
) -> Webhook:
|
|
493
|
+
"""
|
|
494
|
+
Create a new webhook
|
|
495
|
+
|
|
496
|
+
Parameters
|
|
497
|
+
----------
|
|
498
|
+
name : str
|
|
499
|
+
The name of the webhook
|
|
500
|
+
|
|
501
|
+
url : str
|
|
502
|
+
The URL to which the webhook will send events
|
|
503
|
+
|
|
504
|
+
events : typing.Sequence[str]
|
|
505
|
+
An array of event types that the webhook will listen for
|
|
506
|
+
|
|
507
|
+
notify_email : typing.Optional[str]
|
|
508
|
+
The email address to use for management notification events. Ie: webhook disabled
|
|
509
|
+
|
|
510
|
+
request_options : typing.Optional[RequestOptions]
|
|
511
|
+
Request-specific configuration.
|
|
512
|
+
|
|
513
|
+
Returns
|
|
514
|
+
-------
|
|
515
|
+
Webhook
|
|
516
|
+
Success
|
|
517
|
+
|
|
518
|
+
Examples
|
|
519
|
+
--------
|
|
520
|
+
import asyncio
|
|
521
|
+
|
|
522
|
+
from basis_theory import AsyncBasisTheory
|
|
523
|
+
|
|
524
|
+
client = AsyncBasisTheory(
|
|
525
|
+
correlation_id="YOUR_CORRELATION_ID",
|
|
526
|
+
api_key="YOUR_API_KEY",
|
|
527
|
+
)
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
async def main() -> None:
|
|
531
|
+
await client.webhooks.create(
|
|
532
|
+
name="webhook-create",
|
|
533
|
+
url="http://www.example.com",
|
|
534
|
+
events=["token:created"],
|
|
535
|
+
)
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
asyncio.run(main())
|
|
539
|
+
"""
|
|
540
|
+
_response = await self._raw_client.create(
|
|
541
|
+
name=name, url=url, events=events, notify_email=notify_email, request_options=request_options
|
|
542
|
+
)
|
|
543
|
+
return _response.data
|
|
@@ -0,0 +1,102 @@
|
|
|
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.event_types import EventTypes
|
|
8
|
+
from .raw_client import AsyncRawEventsClient, RawEventsClient
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class EventsClient:
|
|
12
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
13
|
+
self._raw_client = RawEventsClient(client_wrapper=client_wrapper)
|
|
14
|
+
|
|
15
|
+
@property
|
|
16
|
+
def with_raw_response(self) -> RawEventsClient:
|
|
17
|
+
"""
|
|
18
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
19
|
+
|
|
20
|
+
Returns
|
|
21
|
+
-------
|
|
22
|
+
RawEventsClient
|
|
23
|
+
"""
|
|
24
|
+
return self._raw_client
|
|
25
|
+
|
|
26
|
+
def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> EventTypes:
|
|
27
|
+
"""
|
|
28
|
+
Return a list of available event types
|
|
29
|
+
|
|
30
|
+
Parameters
|
|
31
|
+
----------
|
|
32
|
+
request_options : typing.Optional[RequestOptions]
|
|
33
|
+
Request-specific configuration.
|
|
34
|
+
|
|
35
|
+
Returns
|
|
36
|
+
-------
|
|
37
|
+
EventTypes
|
|
38
|
+
Success
|
|
39
|
+
|
|
40
|
+
Examples
|
|
41
|
+
--------
|
|
42
|
+
from basis_theory import BasisTheory
|
|
43
|
+
|
|
44
|
+
client = BasisTheory(
|
|
45
|
+
correlation_id="YOUR_CORRELATION_ID",
|
|
46
|
+
api_key="YOUR_API_KEY",
|
|
47
|
+
)
|
|
48
|
+
client.webhooks.events.list()
|
|
49
|
+
"""
|
|
50
|
+
_response = self._raw_client.list(request_options=request_options)
|
|
51
|
+
return _response.data
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
class AsyncEventsClient:
|
|
55
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
56
|
+
self._raw_client = AsyncRawEventsClient(client_wrapper=client_wrapper)
|
|
57
|
+
|
|
58
|
+
@property
|
|
59
|
+
def with_raw_response(self) -> AsyncRawEventsClient:
|
|
60
|
+
"""
|
|
61
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
62
|
+
|
|
63
|
+
Returns
|
|
64
|
+
-------
|
|
65
|
+
AsyncRawEventsClient
|
|
66
|
+
"""
|
|
67
|
+
return self._raw_client
|
|
68
|
+
|
|
69
|
+
async def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> EventTypes:
|
|
70
|
+
"""
|
|
71
|
+
Return a list of available event types
|
|
72
|
+
|
|
73
|
+
Parameters
|
|
74
|
+
----------
|
|
75
|
+
request_options : typing.Optional[RequestOptions]
|
|
76
|
+
Request-specific configuration.
|
|
77
|
+
|
|
78
|
+
Returns
|
|
79
|
+
-------
|
|
80
|
+
EventTypes
|
|
81
|
+
Success
|
|
82
|
+
|
|
83
|
+
Examples
|
|
84
|
+
--------
|
|
85
|
+
import asyncio
|
|
86
|
+
|
|
87
|
+
from basis_theory import AsyncBasisTheory
|
|
88
|
+
|
|
89
|
+
client = AsyncBasisTheory(
|
|
90
|
+
correlation_id="YOUR_CORRELATION_ID",
|
|
91
|
+
api_key="YOUR_API_KEY",
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
async def main() -> None:
|
|
96
|
+
await client.webhooks.events.list()
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
asyncio.run(main())
|
|
100
|
+
"""
|
|
101
|
+
_response = await self._raw_client.list(request_options=request_options)
|
|
102
|
+
return _response.data
|