kard-financial-sdk 0.0.82__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.
- kard/__init__.py +579 -0
- kard/auth/__init__.py +34 -0
- kard/auth/client.py +121 -0
- kard/auth/raw_client.py +108 -0
- kard/auth/types/__init__.py +34 -0
- kard/auth/types/token_response.py +25 -0
- kard/client.py +416 -0
- kard/commons/__init__.py +120 -0
- kard/commons/errors/__init__.py +44 -0
- kard/commons/errors/conflict_error.py +11 -0
- kard/commons/errors/does_not_exist_error.py +11 -0
- kard/commons/errors/internal_server_error.py +11 -0
- kard/commons/errors/invalid_request.py +11 -0
- kard/commons/errors/unauthorized_error.py +11 -0
- kard/commons/types/__init__.py +107 -0
- kard/commons/types/category_option.py +26 -0
- kard/commons/types/commission_type.py +5 -0
- kard/commons/types/commission_value.py +28 -0
- kard/commons/types/commission_value_type.py +5 -0
- kard/commons/types/empty_object.py +17 -0
- kard/commons/types/enrolled_rewards_type.py +5 -0
- kard/commons/types/error_object.py +43 -0
- kard/commons/types/error_response.py +20 -0
- kard/commons/types/error_source.py +32 -0
- kard/commons/types/job.py +24 -0
- kard/commons/types/job_response.py +27 -0
- kard/commons/types/job_status.py +5 -0
- kard/commons/types/links.py +27 -0
- kard/commons/types/mongo_id.py +3 -0
- kard/commons/types/notification_type.py +19 -0
- kard/commons/types/organization_id.py +3 -0
- kard/commons/types/purchase_channel.py +5 -0
- kard/commons/types/relationship_data.py +24 -0
- kard/commons/types/relationship_multiple.py +20 -0
- kard/commons/types/relationship_single.py +20 -0
- kard/commons/types/resource_type.py +3 -0
- kard/commons/types/state.py +68 -0
- kard/commons/types/subscription_id.py +3 -0
- kard/commons/types/user_id.py +3 -0
- kard/core/__init__.py +105 -0
- kard/core/api_error.py +23 -0
- kard/core/client_wrapper.py +97 -0
- kard/core/datetime_utils.py +28 -0
- kard/core/file.py +67 -0
- kard/core/force_multipart.py +18 -0
- kard/core/http_client.py +613 -0
- kard/core/http_response.py +55 -0
- kard/core/http_sse/__init__.py +42 -0
- kard/core/http_sse/_api.py +112 -0
- kard/core/http_sse/_decoders.py +61 -0
- kard/core/http_sse/_exceptions.py +7 -0
- kard/core/http_sse/_models.py +17 -0
- kard/core/jsonable_encoder.py +100 -0
- kard/core/oauth_token_provider.py +73 -0
- kard/core/pydantic_utilities.py +260 -0
- kard/core/query_encoder.py +58 -0
- kard/core/remove_none_from_dict.py +11 -0
- kard/core/request_options.py +35 -0
- kard/core/serialization.py +276 -0
- kard/environment.py +8 -0
- kard/files/__init__.py +58 -0
- kard/files/client.py +213 -0
- kard/files/errors/__init__.py +34 -0
- kard/files/errors/forbidden_error.py +11 -0
- kard/files/raw_client.py +278 -0
- kard/files/types/__init__.py +53 -0
- kard/files/types/file_metadata_attribute.py +39 -0
- kard/files/types/file_metadata_with_url.py +34 -0
- kard/files/types/file_type.py +13 -0
- kard/files/types/files_metadata_sort_options.py +5 -0
- kard/files/types/get_files_metadata_response.py +71 -0
- kard/files/types/pagination_meta.py +29 -0
- kard/notifications/__init__.py +279 -0
- kard/notifications/client.py +63 -0
- kard/notifications/raw_client.py +13 -0
- kard/notifications/subscriptions/__init__.py +97 -0
- kard/notifications/subscriptions/client.py +372 -0
- kard/notifications/subscriptions/raw_client.py +581 -0
- kard/notifications/subscriptions/types/__init__.py +94 -0
- kard/notifications/subscriptions/types/create_subscription_union.py +27 -0
- kard/notifications/subscriptions/types/create_subscriptions_response_object.py +43 -0
- kard/notifications/subscriptions/types/created_subscription.py +23 -0
- kard/notifications/subscriptions/types/subscription.py +25 -0
- kard/notifications/subscriptions/types/subscription_attributes.py +35 -0
- kard/notifications/subscriptions/types/subscription_request.py +20 -0
- kard/notifications/subscriptions/types/subscription_request_attributes.py +35 -0
- kard/notifications/subscriptions/types/subscription_request_body.py +42 -0
- kard/notifications/subscriptions/types/subscription_request_union.py +26 -0
- kard/notifications/subscriptions/types/subscription_union.py +27 -0
- kard/notifications/subscriptions/types/subscriptions_response_object.py +43 -0
- kard/notifications/subscriptions/types/update_subscription_request.py +20 -0
- kard/notifications/subscriptions/types/update_subscription_request_attributes.py +39 -0
- kard/notifications/subscriptions/types/update_subscription_request_body.py +40 -0
- kard/notifications/subscriptions/types/update_subscription_request_union.py +26 -0
- kard/notifications/subscriptions/types/update_subscriptions_response_object.py +41 -0
- kard/notifications/types/__init__.py +214 -0
- kard/notifications/types/audit_update_attributes.py +88 -0
- kard/notifications/types/audit_update_data.py +27 -0
- kard/notifications/types/audit_update_relationships.py +21 -0
- kard/notifications/types/broker_amount.py +28 -0
- kard/notifications/types/broker_amount_type.py +5 -0
- kard/notifications/types/broker_asset.py +33 -0
- kard/notifications/types/broker_asset_type.py +5 -0
- kard/notifications/types/broker_operation_hours.py +30 -0
- kard/notifications/types/broker_operation_period.py +28 -0
- kard/notifications/types/broker_purchase_channel.py +5 -0
- kard/notifications/types/broker_reward.py +28 -0
- kard/notifications/types/broker_reward_type.py +5 -0
- kard/notifications/types/clawback_data.py +27 -0
- kard/notifications/types/earned_reward_approved_data.py +27 -0
- kard/notifications/types/earned_reward_attributes.py +18 -0
- kard/notifications/types/earned_reward_relationships.py +21 -0
- kard/notifications/types/earned_reward_settled_attributes.py +23 -0
- kard/notifications/types/earned_reward_settled_data.py +27 -0
- kard/notifications/types/failed_transaction_attributes.py +41 -0
- kard/notifications/types/failed_transaction_data.py +27 -0
- kard/notifications/types/failed_transaction_relationships.py +22 -0
- kard/notifications/types/location_address.py +39 -0
- kard/notifications/types/location_coordinates.py +27 -0
- kard/notifications/types/location_status.py +5 -0
- kard/notifications/types/merchant_source.py +5 -0
- kard/notifications/types/notification_data_union.py +203 -0
- kard/notifications/types/notification_metadata.py +22 -0
- kard/notifications/types/notification_payload.py +65 -0
- kard/notifications/types/offer_status.py +5 -0
- kard/notifications/types/offer_type.py +5 -0
- kard/notifications/types/reward_notification_attributes.py +48 -0
- kard/notifications/types/time_period.py +27 -0
- kard/notifications/types/transaction_relationships.py +22 -0
- kard/notifications/types/user_offer_status.py +5 -0
- kard/notifications/types/valid_transaction_attributes.py +25 -0
- kard/notifications/types/valid_transaction_commission_earned.py +21 -0
- kard/notifications/types/valid_transaction_data.py +27 -0
- kard/notifications/types/webhook_locations_attributes.py +71 -0
- kard/notifications/types/webhook_locations_data.py +27 -0
- kard/notifications/types/webhook_locations_relationships.py +20 -0
- kard/notifications/types/webhook_merchant_attributes.py +67 -0
- kard/notifications/types/webhook_merchant_data.py +27 -0
- kard/notifications/types/webhook_merchant_relationships.py +20 -0
- kard/notifications/types/webhook_offer_attributes.py +143 -0
- kard/notifications/types/webhook_offer_data.py +27 -0
- kard/notifications/types/webhook_offer_relationships.py +20 -0
- kard/notifications/types/webhook_user_offer_attributes.py +41 -0
- kard/notifications/types/webhook_user_offer_data.py +27 -0
- kard/notifications/types/webhook_user_offer_relationships.py +21 -0
- kard/ping/__init__.py +39 -0
- kard/ping/client.py +100 -0
- kard/ping/errors/__init__.py +34 -0
- kard/ping/errors/network_blocked_error.py +11 -0
- kard/ping/raw_client.py +113 -0
- kard/ping/types/__init__.py +38 -0
- kard/ping/types/network_blocked_error_body.py +34 -0
- kard/ping/types/ping_response_object.py +46 -0
- kard/py.typed +0 -0
- kard/transactions/__init__.py +212 -0
- kard/transactions/client.py +639 -0
- kard/transactions/errors/__init__.py +40 -0
- kard/transactions/errors/create_audit_multi_status.py +11 -0
- kard/transactions/errors/create_incoming_transactions_multi_status.py +11 -0
- kard/transactions/errors/fraud_multi_status.py +11 -0
- kard/transactions/raw_client.py +925 -0
- kard/transactions/types/__init__.py +199 -0
- kard/transactions/types/audit_attributes.py +44 -0
- kard/transactions/types/audit_request_data.py +20 -0
- kard/transactions/types/audit_response_attributes.py +24 -0
- kard/transactions/types/audit_response_data.py +25 -0
- kard/transactions/types/audit_status.py +5 -0
- kard/transactions/types/card_network.py +5 -0
- kard/transactions/types/commission_earned_details.py +21 -0
- kard/transactions/types/create_audit_multi_status_response.py +21 -0
- kard/transactions/types/create_audit_request_body.py +43 -0
- kard/transactions/types/create_audit_request_data_union.py +26 -0
- kard/transactions/types/create_audit_response_body.py +41 -0
- kard/transactions/types/create_audit_response_data_union.py +27 -0
- kard/transactions/types/direction_type.py +5 -0
- kard/transactions/types/fraudulent_transaction_attributes.py +24 -0
- kard/transactions/types/fraudulent_transaction_data.py +30 -0
- kard/transactions/types/fraudulent_transaction_object.py +42 -0
- kard/transactions/types/fraudulent_transaction_request_body.py +45 -0
- kard/transactions/types/fraudulent_transaction_response.py +21 -0
- kard/transactions/types/get_earned_rewards_response.py +133 -0
- kard/transactions/types/matched_transactions_attributes.py +156 -0
- kard/transactions/types/matched_transactions_request.py +25 -0
- kard/transactions/types/merchant.py +82 -0
- kard/transactions/types/payment_status.py +5 -0
- kard/transactions/types/payment_type.py +5 -0
- kard/transactions/types/processor_mid.py +26 -0
- kard/transactions/types/receipt_medium_type.py +5 -0
- kard/transactions/types/rewarded_transaction.py +27 -0
- kard/transactions/types/rewarded_transaction_attributes.py +74 -0
- kard/transactions/types/rewarded_transaction_relationships.py +22 -0
- kard/transactions/types/rewarded_transaction_status.py +5 -0
- kard/transactions/types/rewarded_transaction_union.py +29 -0
- kard/transactions/types/states.py +68 -0
- kard/transactions/types/transaction_included_resource.py +47 -0
- kard/transactions/types/transaction_merchant_attributes.py +22 -0
- kard/transactions/types/transaction_merchant_resource.py +28 -0
- kard/transactions/types/transaction_offer_attributes.py +26 -0
- kard/transactions/types/transaction_offer_resource.py +28 -0
- kard/transactions/types/transaction_payment_type.py +5 -0
- kard/transactions/types/transaction_status.py +5 -0
- kard/transactions/types/transactions.py +46 -0
- kard/transactions/types/transactions_attributes.py +198 -0
- kard/transactions/types/transactions_multi_response.py +21 -0
- kard/transactions/types/transactions_request.py +25 -0
- kard/transactions/types/transactions_request_body.py +90 -0
- kard/transactions/types/transactions_response.py +38 -0
- kard/transactions/types/transactions_response_data.py +27 -0
- kard/transactions/types/visa_mid.py +23 -0
- kard/transactions/types/visa_mid_details.py +27 -0
- kard/users/__init__.py +293 -0
- kard/users/attributions/__init__.py +73 -0
- kard/users/attributions/client.py +229 -0
- kard/users/attributions/raw_client.py +215 -0
- kard/users/attributions/types/__init__.py +73 -0
- kard/users/attributions/types/create_attribution_request_object.py +75 -0
- kard/users/attributions/types/create_attribution_request_union.py +45 -0
- kard/users/attributions/types/create_attribution_response.py +38 -0
- kard/users/attributions/types/event_code.py +5 -0
- kard/users/attributions/types/notification_attribution_attributes.py +35 -0
- kard/users/attributions/types/notification_attribution_request.py +20 -0
- kard/users/attributions/types/notification_medium.py +5 -0
- kard/users/attributions/types/offer_attribution_attributes.py +35 -0
- kard/users/attributions/types/offer_attribution_request.py +20 -0
- kard/users/attributions/types/offer_medium.py +5 -0
- kard/users/client.py +512 -0
- kard/users/errors/__init__.py +34 -0
- kard/users/errors/multi_status.py +11 -0
- kard/users/raw_client.py +783 -0
- kard/users/rewards/__init__.py +133 -0
- kard/users/rewards/client.py +448 -0
- kard/users/rewards/raw_client.py +587 -0
- kard/users/rewards/types/__init__.py +130 -0
- kard/users/rewards/types/amount.py +21 -0
- kard/users/rewards/types/amount_type.py +5 -0
- kard/users/rewards/types/asset.py +28 -0
- kard/users/rewards/types/category_data.py +18 -0
- kard/users/rewards/types/category_fields.py +23 -0
- kard/users/rewards/types/category_identifier.py +24 -0
- kard/users/rewards/types/category_included.py +21 -0
- kard/users/rewards/types/category_relationship.py +20 -0
- kard/users/rewards/types/category_relationship_object.py +20 -0
- kard/users/rewards/types/commission.py +21 -0
- kard/users/rewards/types/coordinates.py +20 -0
- kard/users/rewards/types/eligibility_location_address.py +24 -0
- kard/users/rewards/types/eligibility_location_included.py +8 -0
- kard/users/rewards/types/eligibility_offer_included.py +7 -0
- kard/users/rewards/types/eligibility_offer_relationship.py +7 -0
- kard/users/rewards/types/location_attributes.py +28 -0
- kard/users/rewards/types/location_data.py +32 -0
- kard/users/rewards/types/location_relationships.py +18 -0
- kard/users/rewards/types/location_sort_options.py +5 -0
- kard/users/rewards/types/locations_response_object.py +215 -0
- kard/users/rewards/types/offer_common_fields.py +103 -0
- kard/users/rewards/types/offer_data_union.py +30 -0
- kard/users/rewards/types/offer_relationship.py +21 -0
- kard/users/rewards/types/offer_sort_options.py +7 -0
- kard/users/rewards/types/offers_response_object.py +130 -0
- kard/users/rewards/types/operation_hours.py +23 -0
- kard/users/rewards/types/operation_period.py +21 -0
- kard/users/rewards/types/operation_time.py +20 -0
- kard/users/rewards/types/standard_offer.py +21 -0
- kard/users/rewards/types/standard_offer_core.py +26 -0
- kard/users/rewards/types/standard_offer_fields.py +18 -0
- kard/users/types/__init__.py +66 -0
- kard/users/types/create_users_multi_status_response.py +21 -0
- kard/users/types/create_users_object.py +42 -0
- kard/users/types/delete_user_response_object.py +34 -0
- kard/users/types/update_user_object.py +40 -0
- kard/users/types/user_request_attributes.py +60 -0
- kard/users/types/user_request_data.py +22 -0
- kard/users/types/user_request_data_union.py +28 -0
- kard/users/types/user_response_no_data.py +22 -0
- kard/users/types/user_response_union_no_data.py +28 -0
- kard/users/uploads/__init__.py +112 -0
- kard/users/uploads/client.py +484 -0
- kard/users/uploads/errors/__init__.py +34 -0
- kard/users/uploads/errors/upload_part_multi_status.py +13 -0
- kard/users/uploads/raw_client.py +625 -0
- kard/users/uploads/types/__init__.py +119 -0
- kard/users/uploads/types/create_upload_part_data_union.py +27 -0
- kard/users/uploads/types/create_upload_part_multi_status_response.py +21 -0
- kard/users/uploads/types/create_upload_part_request_object.py +74 -0
- kard/users/uploads/types/create_upload_part_response_data.py +25 -0
- kard/users/uploads/types/create_upload_part_response_data_union.py +27 -0
- kard/users/uploads/types/create_upload_part_response_object.py +39 -0
- kard/users/uploads/types/create_upload_request_data_union.py +26 -0
- kard/users/uploads/types/create_upload_request_object.py +36 -0
- kard/users/uploads/types/create_upload_response_data.py +25 -0
- kard/users/uploads/types/create_upload_response_data_union.py +27 -0
- kard/users/uploads/types/create_upload_response_object.py +37 -0
- kard/users/uploads/types/historical_transaction_complete_no_data.py +25 -0
- kard/users/uploads/types/start_historical_upload_no_data.py +20 -0
- kard/users/uploads/types/update_upload_request_data_union.py +27 -0
- kard/users/uploads/types/update_upload_request_object.py +37 -0
- kard/users/uploads/types/update_upload_response_data.py +25 -0
- kard/users/uploads/types/update_upload_response_data_union.py +27 -0
- kard/users/uploads/types/update_upload_response_object.py +37 -0
- kard/version.py +3 -0
- kard_financial_sdk-0.0.82.dist-info/METADATA +238 -0
- kard_financial_sdk-0.0.82.dist-info/RECORD +302 -0
- kard_financial_sdk-0.0.82.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,34 @@
|
|
|
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 .network_blocked_error import NetworkBlockedError
|
|
10
|
+
_dynamic_imports: typing.Dict[str, str] = {"NetworkBlockedError": ".network_blocked_error"}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def __getattr__(attr_name: str) -> typing.Any:
|
|
14
|
+
module_name = _dynamic_imports.get(attr_name)
|
|
15
|
+
if module_name is None:
|
|
16
|
+
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
|
|
17
|
+
try:
|
|
18
|
+
module = import_module(module_name, __package__)
|
|
19
|
+
if module_name == f".{attr_name}":
|
|
20
|
+
return module
|
|
21
|
+
else:
|
|
22
|
+
return getattr(module, attr_name)
|
|
23
|
+
except ImportError as e:
|
|
24
|
+
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
|
|
25
|
+
except AttributeError as e:
|
|
26
|
+
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def __dir__():
|
|
30
|
+
lazy_attrs = list(_dynamic_imports.keys())
|
|
31
|
+
return sorted(lazy_attrs)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
__all__ = ["NetworkBlockedError"]
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
from ...core.api_error import ApiError
|
|
6
|
+
from ..types.network_blocked_error_body import NetworkBlockedErrorBody
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class NetworkBlockedError(ApiError):
|
|
10
|
+
def __init__(self, body: NetworkBlockedErrorBody, headers: typing.Optional[typing.Dict[str, str]] = None):
|
|
11
|
+
super().__init__(status_code=403, headers=headers, body=body)
|
kard/ping/raw_client.py
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
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.network_blocked_error import NetworkBlockedError
|
|
12
|
+
from .types.network_blocked_error_body import NetworkBlockedErrorBody
|
|
13
|
+
from .types.ping_response_object import PingResponseObject
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class RawPingClient:
|
|
17
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
18
|
+
self._client_wrapper = client_wrapper
|
|
19
|
+
|
|
20
|
+
def ping(self, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[PingResponseObject]:
|
|
21
|
+
"""
|
|
22
|
+
Call this endpoint to verify network connectivity and service availability.
|
|
23
|
+
|
|
24
|
+
Parameters
|
|
25
|
+
----------
|
|
26
|
+
request_options : typing.Optional[RequestOptions]
|
|
27
|
+
Request-specific configuration.
|
|
28
|
+
|
|
29
|
+
Returns
|
|
30
|
+
-------
|
|
31
|
+
HttpResponse[PingResponseObject]
|
|
32
|
+
"""
|
|
33
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
34
|
+
"v2/ping",
|
|
35
|
+
method="GET",
|
|
36
|
+
request_options=request_options,
|
|
37
|
+
)
|
|
38
|
+
try:
|
|
39
|
+
if 200 <= _response.status_code < 300:
|
|
40
|
+
_data = typing.cast(
|
|
41
|
+
PingResponseObject,
|
|
42
|
+
parse_obj_as(
|
|
43
|
+
type_=PingResponseObject, # type: ignore
|
|
44
|
+
object_=_response.json(),
|
|
45
|
+
),
|
|
46
|
+
)
|
|
47
|
+
return HttpResponse(response=_response, data=_data)
|
|
48
|
+
if _response.status_code == 403:
|
|
49
|
+
raise NetworkBlockedError(
|
|
50
|
+
headers=dict(_response.headers),
|
|
51
|
+
body=typing.cast(
|
|
52
|
+
NetworkBlockedErrorBody,
|
|
53
|
+
parse_obj_as(
|
|
54
|
+
type_=NetworkBlockedErrorBody, # type: ignore
|
|
55
|
+
object_=_response.json(),
|
|
56
|
+
),
|
|
57
|
+
),
|
|
58
|
+
)
|
|
59
|
+
_response_json = _response.json()
|
|
60
|
+
except JSONDecodeError:
|
|
61
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
62
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
class AsyncRawPingClient:
|
|
66
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
67
|
+
self._client_wrapper = client_wrapper
|
|
68
|
+
|
|
69
|
+
async def ping(
|
|
70
|
+
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
71
|
+
) -> AsyncHttpResponse[PingResponseObject]:
|
|
72
|
+
"""
|
|
73
|
+
Call this endpoint to verify network connectivity and service availability.
|
|
74
|
+
|
|
75
|
+
Parameters
|
|
76
|
+
----------
|
|
77
|
+
request_options : typing.Optional[RequestOptions]
|
|
78
|
+
Request-specific configuration.
|
|
79
|
+
|
|
80
|
+
Returns
|
|
81
|
+
-------
|
|
82
|
+
AsyncHttpResponse[PingResponseObject]
|
|
83
|
+
"""
|
|
84
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
85
|
+
"v2/ping",
|
|
86
|
+
method="GET",
|
|
87
|
+
request_options=request_options,
|
|
88
|
+
)
|
|
89
|
+
try:
|
|
90
|
+
if 200 <= _response.status_code < 300:
|
|
91
|
+
_data = typing.cast(
|
|
92
|
+
PingResponseObject,
|
|
93
|
+
parse_obj_as(
|
|
94
|
+
type_=PingResponseObject, # type: ignore
|
|
95
|
+
object_=_response.json(),
|
|
96
|
+
),
|
|
97
|
+
)
|
|
98
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
99
|
+
if _response.status_code == 403:
|
|
100
|
+
raise NetworkBlockedError(
|
|
101
|
+
headers=dict(_response.headers),
|
|
102
|
+
body=typing.cast(
|
|
103
|
+
NetworkBlockedErrorBody,
|
|
104
|
+
parse_obj_as(
|
|
105
|
+
type_=NetworkBlockedErrorBody, # type: ignore
|
|
106
|
+
object_=_response.json(),
|
|
107
|
+
),
|
|
108
|
+
),
|
|
109
|
+
)
|
|
110
|
+
_response_json = _response.json()
|
|
111
|
+
except JSONDecodeError:
|
|
112
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
113
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
@@ -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 .network_blocked_error_body import NetworkBlockedErrorBody
|
|
10
|
+
from .ping_response_object import PingResponseObject
|
|
11
|
+
_dynamic_imports: typing.Dict[str, str] = {
|
|
12
|
+
"NetworkBlockedErrorBody": ".network_blocked_error_body",
|
|
13
|
+
"PingResponseObject": ".ping_response_object",
|
|
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__ = ["NetworkBlockedErrorBody", "PingResponseObject"]
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import pydantic
|
|
6
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class NetworkBlockedErrorBody(UniversalBaseModel):
|
|
10
|
+
"""
|
|
11
|
+
Error response indicating that the network is blocked.
|
|
12
|
+
|
|
13
|
+
Examples
|
|
14
|
+
--------
|
|
15
|
+
from kard.ping import NetworkBlockedErrorBody
|
|
16
|
+
|
|
17
|
+
NetworkBlockedErrorBody(
|
|
18
|
+
message="Unauthorized",
|
|
19
|
+
)
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
message: str = pydantic.Field()
|
|
23
|
+
"""
|
|
24
|
+
A message indicating that the network is blocked.
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
if IS_PYDANTIC_V2:
|
|
28
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
29
|
+
else:
|
|
30
|
+
|
|
31
|
+
class Config:
|
|
32
|
+
frozen = True
|
|
33
|
+
smart_union = True
|
|
34
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import pydantic
|
|
6
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class PingResponseObject(UniversalBaseModel):
|
|
10
|
+
"""
|
|
11
|
+
Response indicating the status of the ping.
|
|
12
|
+
|
|
13
|
+
Examples
|
|
14
|
+
--------
|
|
15
|
+
from kard.ping import PingResponseObject
|
|
16
|
+
|
|
17
|
+
PingResponseObject(
|
|
18
|
+
message="Ping successful",
|
|
19
|
+
status="OK",
|
|
20
|
+
timestamp="02/Oct/2025:17:52:43 +0000",
|
|
21
|
+
)
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
message: str = pydantic.Field()
|
|
25
|
+
"""
|
|
26
|
+
A message indicating the status of the ping.
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
status: str = pydantic.Field()
|
|
30
|
+
"""
|
|
31
|
+
The status of the ping.
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
timestamp: str = pydantic.Field()
|
|
35
|
+
"""
|
|
36
|
+
The timestamp of the ping.
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
if IS_PYDANTIC_V2:
|
|
40
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
41
|
+
else:
|
|
42
|
+
|
|
43
|
+
class Config:
|
|
44
|
+
frozen = True
|
|
45
|
+
smart_union = True
|
|
46
|
+
extra = pydantic.Extra.allow
|
kard/py.typed
ADDED
|
File without changes
|
|
@@ -0,0 +1,212 @@
|
|
|
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
|
+
AuditAttributes,
|
|
11
|
+
AuditRequestData,
|
|
12
|
+
AuditResponseAttributes,
|
|
13
|
+
AuditResponseData,
|
|
14
|
+
AuditStatus,
|
|
15
|
+
CardNetwork,
|
|
16
|
+
CommissionEarnedDetails,
|
|
17
|
+
CreateAuditMultiStatusResponse,
|
|
18
|
+
CreateAuditRequestBody,
|
|
19
|
+
CreateAuditRequestDataUnion,
|
|
20
|
+
CreateAuditRequestDataUnion_Audit,
|
|
21
|
+
CreateAuditResponseBody,
|
|
22
|
+
CreateAuditResponseDataUnion,
|
|
23
|
+
CreateAuditResponseDataUnion_Audit,
|
|
24
|
+
DirectionType,
|
|
25
|
+
FraudulentTransactionAttributes,
|
|
26
|
+
FraudulentTransactionData,
|
|
27
|
+
FraudulentTransactionObject,
|
|
28
|
+
FraudulentTransactionRequestBody,
|
|
29
|
+
FraudulentTransactionResponse,
|
|
30
|
+
GetEarnedRewardsResponse,
|
|
31
|
+
MatchedTransactionsAttributes,
|
|
32
|
+
MatchedTransactionsRequest,
|
|
33
|
+
Merchant,
|
|
34
|
+
PaymentStatus,
|
|
35
|
+
PaymentType,
|
|
36
|
+
ProcessorMid,
|
|
37
|
+
ProcessorMid_Visa,
|
|
38
|
+
ReceiptMediumType,
|
|
39
|
+
RewardedTransaction,
|
|
40
|
+
RewardedTransactionAttributes,
|
|
41
|
+
RewardedTransactionRelationships,
|
|
42
|
+
RewardedTransactionStatus,
|
|
43
|
+
RewardedTransactionUnion,
|
|
44
|
+
RewardedTransactionUnion_RewardedTransaction,
|
|
45
|
+
States,
|
|
46
|
+
TransactionIncludedResource,
|
|
47
|
+
TransactionIncludedResource_Merchant,
|
|
48
|
+
TransactionIncludedResource_Offer,
|
|
49
|
+
TransactionMerchantAttributes,
|
|
50
|
+
TransactionMerchantResource,
|
|
51
|
+
TransactionOfferAttributes,
|
|
52
|
+
TransactionOfferResource,
|
|
53
|
+
TransactionPaymentType,
|
|
54
|
+
TransactionStatus,
|
|
55
|
+
Transactions,
|
|
56
|
+
TransactionsAttributes,
|
|
57
|
+
TransactionsMultiResponse,
|
|
58
|
+
TransactionsRequest,
|
|
59
|
+
TransactionsRequestBody,
|
|
60
|
+
TransactionsResponse,
|
|
61
|
+
TransactionsResponseData,
|
|
62
|
+
Transactions_MatchedTransaction,
|
|
63
|
+
Transactions_Transaction,
|
|
64
|
+
VisaMid,
|
|
65
|
+
VisaMidDetails,
|
|
66
|
+
)
|
|
67
|
+
from .errors import CreateAuditMultiStatus, CreateIncomingTransactionsMultiStatus, FraudMultiStatus
|
|
68
|
+
_dynamic_imports: typing.Dict[str, str] = {
|
|
69
|
+
"AuditAttributes": ".types",
|
|
70
|
+
"AuditRequestData": ".types",
|
|
71
|
+
"AuditResponseAttributes": ".types",
|
|
72
|
+
"AuditResponseData": ".types",
|
|
73
|
+
"AuditStatus": ".types",
|
|
74
|
+
"CardNetwork": ".types",
|
|
75
|
+
"CommissionEarnedDetails": ".types",
|
|
76
|
+
"CreateAuditMultiStatus": ".errors",
|
|
77
|
+
"CreateAuditMultiStatusResponse": ".types",
|
|
78
|
+
"CreateAuditRequestBody": ".types",
|
|
79
|
+
"CreateAuditRequestDataUnion": ".types",
|
|
80
|
+
"CreateAuditRequestDataUnion_Audit": ".types",
|
|
81
|
+
"CreateAuditResponseBody": ".types",
|
|
82
|
+
"CreateAuditResponseDataUnion": ".types",
|
|
83
|
+
"CreateAuditResponseDataUnion_Audit": ".types",
|
|
84
|
+
"CreateIncomingTransactionsMultiStatus": ".errors",
|
|
85
|
+
"DirectionType": ".types",
|
|
86
|
+
"FraudMultiStatus": ".errors",
|
|
87
|
+
"FraudulentTransactionAttributes": ".types",
|
|
88
|
+
"FraudulentTransactionData": ".types",
|
|
89
|
+
"FraudulentTransactionObject": ".types",
|
|
90
|
+
"FraudulentTransactionRequestBody": ".types",
|
|
91
|
+
"FraudulentTransactionResponse": ".types",
|
|
92
|
+
"GetEarnedRewardsResponse": ".types",
|
|
93
|
+
"MatchedTransactionsAttributes": ".types",
|
|
94
|
+
"MatchedTransactionsRequest": ".types",
|
|
95
|
+
"Merchant": ".types",
|
|
96
|
+
"PaymentStatus": ".types",
|
|
97
|
+
"PaymentType": ".types",
|
|
98
|
+
"ProcessorMid": ".types",
|
|
99
|
+
"ProcessorMid_Visa": ".types",
|
|
100
|
+
"ReceiptMediumType": ".types",
|
|
101
|
+
"RewardedTransaction": ".types",
|
|
102
|
+
"RewardedTransactionAttributes": ".types",
|
|
103
|
+
"RewardedTransactionRelationships": ".types",
|
|
104
|
+
"RewardedTransactionStatus": ".types",
|
|
105
|
+
"RewardedTransactionUnion": ".types",
|
|
106
|
+
"RewardedTransactionUnion_RewardedTransaction": ".types",
|
|
107
|
+
"States": ".types",
|
|
108
|
+
"TransactionIncludedResource": ".types",
|
|
109
|
+
"TransactionIncludedResource_Merchant": ".types",
|
|
110
|
+
"TransactionIncludedResource_Offer": ".types",
|
|
111
|
+
"TransactionMerchantAttributes": ".types",
|
|
112
|
+
"TransactionMerchantResource": ".types",
|
|
113
|
+
"TransactionOfferAttributes": ".types",
|
|
114
|
+
"TransactionOfferResource": ".types",
|
|
115
|
+
"TransactionPaymentType": ".types",
|
|
116
|
+
"TransactionStatus": ".types",
|
|
117
|
+
"Transactions": ".types",
|
|
118
|
+
"TransactionsAttributes": ".types",
|
|
119
|
+
"TransactionsMultiResponse": ".types",
|
|
120
|
+
"TransactionsRequest": ".types",
|
|
121
|
+
"TransactionsRequestBody": ".types",
|
|
122
|
+
"TransactionsResponse": ".types",
|
|
123
|
+
"TransactionsResponseData": ".types",
|
|
124
|
+
"Transactions_MatchedTransaction": ".types",
|
|
125
|
+
"Transactions_Transaction": ".types",
|
|
126
|
+
"VisaMid": ".types",
|
|
127
|
+
"VisaMidDetails": ".types",
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
def __getattr__(attr_name: str) -> typing.Any:
|
|
132
|
+
module_name = _dynamic_imports.get(attr_name)
|
|
133
|
+
if module_name is None:
|
|
134
|
+
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
|
|
135
|
+
try:
|
|
136
|
+
module = import_module(module_name, __package__)
|
|
137
|
+
if module_name == f".{attr_name}":
|
|
138
|
+
return module
|
|
139
|
+
else:
|
|
140
|
+
return getattr(module, attr_name)
|
|
141
|
+
except ImportError as e:
|
|
142
|
+
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
|
|
143
|
+
except AttributeError as e:
|
|
144
|
+
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
def __dir__():
|
|
148
|
+
lazy_attrs = list(_dynamic_imports.keys())
|
|
149
|
+
return sorted(lazy_attrs)
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
__all__ = [
|
|
153
|
+
"AuditAttributes",
|
|
154
|
+
"AuditRequestData",
|
|
155
|
+
"AuditResponseAttributes",
|
|
156
|
+
"AuditResponseData",
|
|
157
|
+
"AuditStatus",
|
|
158
|
+
"CardNetwork",
|
|
159
|
+
"CommissionEarnedDetails",
|
|
160
|
+
"CreateAuditMultiStatus",
|
|
161
|
+
"CreateAuditMultiStatusResponse",
|
|
162
|
+
"CreateAuditRequestBody",
|
|
163
|
+
"CreateAuditRequestDataUnion",
|
|
164
|
+
"CreateAuditRequestDataUnion_Audit",
|
|
165
|
+
"CreateAuditResponseBody",
|
|
166
|
+
"CreateAuditResponseDataUnion",
|
|
167
|
+
"CreateAuditResponseDataUnion_Audit",
|
|
168
|
+
"CreateIncomingTransactionsMultiStatus",
|
|
169
|
+
"DirectionType",
|
|
170
|
+
"FraudMultiStatus",
|
|
171
|
+
"FraudulentTransactionAttributes",
|
|
172
|
+
"FraudulentTransactionData",
|
|
173
|
+
"FraudulentTransactionObject",
|
|
174
|
+
"FraudulentTransactionRequestBody",
|
|
175
|
+
"FraudulentTransactionResponse",
|
|
176
|
+
"GetEarnedRewardsResponse",
|
|
177
|
+
"MatchedTransactionsAttributes",
|
|
178
|
+
"MatchedTransactionsRequest",
|
|
179
|
+
"Merchant",
|
|
180
|
+
"PaymentStatus",
|
|
181
|
+
"PaymentType",
|
|
182
|
+
"ProcessorMid",
|
|
183
|
+
"ProcessorMid_Visa",
|
|
184
|
+
"ReceiptMediumType",
|
|
185
|
+
"RewardedTransaction",
|
|
186
|
+
"RewardedTransactionAttributes",
|
|
187
|
+
"RewardedTransactionRelationships",
|
|
188
|
+
"RewardedTransactionStatus",
|
|
189
|
+
"RewardedTransactionUnion",
|
|
190
|
+
"RewardedTransactionUnion_RewardedTransaction",
|
|
191
|
+
"States",
|
|
192
|
+
"TransactionIncludedResource",
|
|
193
|
+
"TransactionIncludedResource_Merchant",
|
|
194
|
+
"TransactionIncludedResource_Offer",
|
|
195
|
+
"TransactionMerchantAttributes",
|
|
196
|
+
"TransactionMerchantResource",
|
|
197
|
+
"TransactionOfferAttributes",
|
|
198
|
+
"TransactionOfferResource",
|
|
199
|
+
"TransactionPaymentType",
|
|
200
|
+
"TransactionStatus",
|
|
201
|
+
"Transactions",
|
|
202
|
+
"TransactionsAttributes",
|
|
203
|
+
"TransactionsMultiResponse",
|
|
204
|
+
"TransactionsRequest",
|
|
205
|
+
"TransactionsRequestBody",
|
|
206
|
+
"TransactionsResponse",
|
|
207
|
+
"TransactionsResponseData",
|
|
208
|
+
"Transactions_MatchedTransaction",
|
|
209
|
+
"Transactions_Transaction",
|
|
210
|
+
"VisaMid",
|
|
211
|
+
"VisaMidDetails",
|
|
212
|
+
]
|