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,484 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
from ...commons.types.organization_id import OrganizationId
|
|
6
|
+
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
7
|
+
from ...core.request_options import RequestOptions
|
|
8
|
+
from .raw_client import AsyncRawUploadsClient, RawUploadsClient
|
|
9
|
+
from .types.create_upload_part_data_union import CreateUploadPartDataUnion
|
|
10
|
+
from .types.create_upload_part_response_object import CreateUploadPartResponseObject
|
|
11
|
+
from .types.create_upload_request_data_union import CreateUploadRequestDataUnion
|
|
12
|
+
from .types.create_upload_response_object import CreateUploadResponseObject
|
|
13
|
+
from .types.update_upload_request_data_union import UpdateUploadRequestDataUnion
|
|
14
|
+
from .types.update_upload_response_object import UpdateUploadResponseObject
|
|
15
|
+
|
|
16
|
+
# this is used as the default value for optional parameters
|
|
17
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class UploadsClient:
|
|
21
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
22
|
+
self._raw_client = RawUploadsClient(client_wrapper=client_wrapper)
|
|
23
|
+
|
|
24
|
+
@property
|
|
25
|
+
def with_raw_response(self) -> RawUploadsClient:
|
|
26
|
+
"""
|
|
27
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
28
|
+
|
|
29
|
+
Returns
|
|
30
|
+
-------
|
|
31
|
+
RawUploadsClient
|
|
32
|
+
"""
|
|
33
|
+
return self._raw_client
|
|
34
|
+
|
|
35
|
+
def create(
|
|
36
|
+
self,
|
|
37
|
+
organization_id: OrganizationId,
|
|
38
|
+
user_id: str,
|
|
39
|
+
*,
|
|
40
|
+
data: CreateUploadRequestDataUnion,
|
|
41
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
42
|
+
) -> CreateUploadResponseObject:
|
|
43
|
+
"""
|
|
44
|
+
Call this endpoint to create an upload session and retrieve an upload ID. Using the upload ID in the [Add Upload
|
|
45
|
+
Part](/api/uploads/create-upload-part) endpoint, historical transactions can be sent in batches for further processing.
|
|
46
|
+
<b>Required scopes:</b> `transaction:write`
|
|
47
|
+
|
|
48
|
+
Parameters
|
|
49
|
+
----------
|
|
50
|
+
organization_id : OrganizationId
|
|
51
|
+
|
|
52
|
+
user_id : str
|
|
53
|
+
The ID of the user as defined on the issuers system
|
|
54
|
+
|
|
55
|
+
data : CreateUploadRequestDataUnion
|
|
56
|
+
|
|
57
|
+
request_options : typing.Optional[RequestOptions]
|
|
58
|
+
Request-specific configuration.
|
|
59
|
+
|
|
60
|
+
Returns
|
|
61
|
+
-------
|
|
62
|
+
CreateUploadResponseObject
|
|
63
|
+
|
|
64
|
+
Examples
|
|
65
|
+
--------
|
|
66
|
+
from kard import KardApi
|
|
67
|
+
from kard.commons import EmptyObject
|
|
68
|
+
from kard.users.uploads import (
|
|
69
|
+
CreateUploadRequestDataUnion_HistoricalTransactionStart,
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
client = KardApi(
|
|
73
|
+
client_id="YOUR_CLIENT_ID",
|
|
74
|
+
client_secret="YOUR_CLIENT_SECRET",
|
|
75
|
+
)
|
|
76
|
+
client.users.uploads.create(
|
|
77
|
+
organization_id="organization-123",
|
|
78
|
+
user_id="user-123",
|
|
79
|
+
data=CreateUploadRequestDataUnion_HistoricalTransactionStart(
|
|
80
|
+
attributes=EmptyObject(),
|
|
81
|
+
),
|
|
82
|
+
)
|
|
83
|
+
"""
|
|
84
|
+
_response = self._raw_client.create(organization_id, user_id, data=data, request_options=request_options)
|
|
85
|
+
return _response.data
|
|
86
|
+
|
|
87
|
+
def create_part(
|
|
88
|
+
self,
|
|
89
|
+
organization_id: OrganizationId,
|
|
90
|
+
user_id: str,
|
|
91
|
+
upload_id: str,
|
|
92
|
+
*,
|
|
93
|
+
data: typing.Sequence[CreateUploadPartDataUnion],
|
|
94
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
95
|
+
) -> CreateUploadPartResponseObject:
|
|
96
|
+
"""
|
|
97
|
+
Call this endpoint using the upload ID provided in the [Create Upload](/api/uploads/create-upload) endpoint to add parts to your upload. Currently, this endpoint supports adding historical transactions.
|
|
98
|
+
<b>Required scopes:</b> `transaction:write`
|
|
99
|
+
<b>Note:</b> `Maximum of 500 transactions can be uploaded per request`.
|
|
100
|
+
|
|
101
|
+
Parameters
|
|
102
|
+
----------
|
|
103
|
+
organization_id : OrganizationId
|
|
104
|
+
|
|
105
|
+
user_id : str
|
|
106
|
+
The ID of the user as defined on the issuers system
|
|
107
|
+
|
|
108
|
+
upload_id : str
|
|
109
|
+
The upload ID identifying the upload session to add parts
|
|
110
|
+
|
|
111
|
+
data : typing.Sequence[CreateUploadPartDataUnion]
|
|
112
|
+
|
|
113
|
+
request_options : typing.Optional[RequestOptions]
|
|
114
|
+
Request-specific configuration.
|
|
115
|
+
|
|
116
|
+
Returns
|
|
117
|
+
-------
|
|
118
|
+
CreateUploadPartResponseObject
|
|
119
|
+
|
|
120
|
+
Examples
|
|
121
|
+
--------
|
|
122
|
+
import datetime
|
|
123
|
+
|
|
124
|
+
from kard import KardApi
|
|
125
|
+
from kard.transactions import Merchant, TransactionsAttributes
|
|
126
|
+
from kard.users.uploads import CreateUploadPartDataUnion_HistoricalTransaction
|
|
127
|
+
|
|
128
|
+
client = KardApi(
|
|
129
|
+
client_id="YOUR_CLIENT_ID",
|
|
130
|
+
client_secret="YOUR_CLIENT_SECRET",
|
|
131
|
+
)
|
|
132
|
+
client.users.uploads.create_part(
|
|
133
|
+
organization_id="organization-123",
|
|
134
|
+
user_id="user-123",
|
|
135
|
+
upload_id="upload-123",
|
|
136
|
+
data=[
|
|
137
|
+
CreateUploadPartDataUnion_HistoricalTransaction(
|
|
138
|
+
id="309rjfoincor3icno3rind093cdow3jciwjdwcm",
|
|
139
|
+
attributes=TransactionsAttributes(
|
|
140
|
+
user_id="6FHt5b6Fnp0qdomMEy5AN6PXcSJIeX69",
|
|
141
|
+
status="APPROVED",
|
|
142
|
+
amount=1000,
|
|
143
|
+
subtotal=800,
|
|
144
|
+
currency="USD",
|
|
145
|
+
direction="DEBIT",
|
|
146
|
+
payment_type="CARD",
|
|
147
|
+
description="ADVANCEAUTO",
|
|
148
|
+
description_2="ADVANCEAUTO",
|
|
149
|
+
mcc="1234",
|
|
150
|
+
card_bin="123456",
|
|
151
|
+
card_last_four="4321",
|
|
152
|
+
authorization_date=datetime.datetime.fromisoformat(
|
|
153
|
+
"2021-07-02 17:47:06+00:00",
|
|
154
|
+
),
|
|
155
|
+
merchant=Merchant(
|
|
156
|
+
id="12345678901234567",
|
|
157
|
+
name="ADVANCEAUTO",
|
|
158
|
+
addr_street="125 Main St",
|
|
159
|
+
addr_city="Philadelphia",
|
|
160
|
+
addr_state="PA",
|
|
161
|
+
addr_zipcode="19147",
|
|
162
|
+
addr_country="United States",
|
|
163
|
+
latitude="37.9419429",
|
|
164
|
+
longitude="-73.1446869",
|
|
165
|
+
store_id="12345",
|
|
166
|
+
),
|
|
167
|
+
authorization_code="123456",
|
|
168
|
+
retrieval_reference_number="100804333919",
|
|
169
|
+
acquirer_reference_number="1234567890123456789012345678",
|
|
170
|
+
system_trace_audit_number="333828",
|
|
171
|
+
transaction_id="2467de37-cbdc-416d-a359-75de87bfffb0",
|
|
172
|
+
),
|
|
173
|
+
)
|
|
174
|
+
],
|
|
175
|
+
)
|
|
176
|
+
"""
|
|
177
|
+
_response = self._raw_client.create_part(
|
|
178
|
+
organization_id, user_id, upload_id, data=data, request_options=request_options
|
|
179
|
+
)
|
|
180
|
+
return _response.data
|
|
181
|
+
|
|
182
|
+
def update(
|
|
183
|
+
self,
|
|
184
|
+
organization_id: OrganizationId,
|
|
185
|
+
user_id: str,
|
|
186
|
+
upload_id: str,
|
|
187
|
+
*,
|
|
188
|
+
data: UpdateUploadRequestDataUnion,
|
|
189
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
190
|
+
) -> UpdateUploadResponseObject:
|
|
191
|
+
"""
|
|
192
|
+
Call this endpoint to update your upload session. Currently, you can signal completing a historical transactions upload.
|
|
193
|
+
<b>Required scopes:</b> `transaction:write`
|
|
194
|
+
|
|
195
|
+
Parameters
|
|
196
|
+
----------
|
|
197
|
+
organization_id : OrganizationId
|
|
198
|
+
|
|
199
|
+
user_id : str
|
|
200
|
+
The ID of the user as defined on the issuers system
|
|
201
|
+
|
|
202
|
+
upload_id : str
|
|
203
|
+
The upload ID identifying the upload session to update
|
|
204
|
+
|
|
205
|
+
data : UpdateUploadRequestDataUnion
|
|
206
|
+
|
|
207
|
+
request_options : typing.Optional[RequestOptions]
|
|
208
|
+
Request-specific configuration.
|
|
209
|
+
|
|
210
|
+
Returns
|
|
211
|
+
-------
|
|
212
|
+
UpdateUploadResponseObject
|
|
213
|
+
|
|
214
|
+
Examples
|
|
215
|
+
--------
|
|
216
|
+
from kard import KardApi
|
|
217
|
+
from kard.commons import EmptyObject
|
|
218
|
+
from kard.users.uploads import (
|
|
219
|
+
UpdateUploadRequestDataUnion_HistoricalTransactionComplete,
|
|
220
|
+
)
|
|
221
|
+
|
|
222
|
+
client = KardApi(
|
|
223
|
+
client_id="YOUR_CLIENT_ID",
|
|
224
|
+
client_secret="YOUR_CLIENT_SECRET",
|
|
225
|
+
)
|
|
226
|
+
client.users.uploads.update(
|
|
227
|
+
organization_id="organization-123",
|
|
228
|
+
user_id="user-123",
|
|
229
|
+
upload_id="upload-123",
|
|
230
|
+
data=UpdateUploadRequestDataUnion_HistoricalTransactionComplete(
|
|
231
|
+
id="7e382223-b9a5-4825-91fb-436c8957a2e7",
|
|
232
|
+
attributes=EmptyObject(),
|
|
233
|
+
),
|
|
234
|
+
)
|
|
235
|
+
"""
|
|
236
|
+
_response = self._raw_client.update(
|
|
237
|
+
organization_id, user_id, upload_id, data=data, request_options=request_options
|
|
238
|
+
)
|
|
239
|
+
return _response.data
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
class AsyncUploadsClient:
|
|
243
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
244
|
+
self._raw_client = AsyncRawUploadsClient(client_wrapper=client_wrapper)
|
|
245
|
+
|
|
246
|
+
@property
|
|
247
|
+
def with_raw_response(self) -> AsyncRawUploadsClient:
|
|
248
|
+
"""
|
|
249
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
250
|
+
|
|
251
|
+
Returns
|
|
252
|
+
-------
|
|
253
|
+
AsyncRawUploadsClient
|
|
254
|
+
"""
|
|
255
|
+
return self._raw_client
|
|
256
|
+
|
|
257
|
+
async def create(
|
|
258
|
+
self,
|
|
259
|
+
organization_id: OrganizationId,
|
|
260
|
+
user_id: str,
|
|
261
|
+
*,
|
|
262
|
+
data: CreateUploadRequestDataUnion,
|
|
263
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
264
|
+
) -> CreateUploadResponseObject:
|
|
265
|
+
"""
|
|
266
|
+
Call this endpoint to create an upload session and retrieve an upload ID. Using the upload ID in the [Add Upload
|
|
267
|
+
Part](/api/uploads/create-upload-part) endpoint, historical transactions can be sent in batches for further processing.
|
|
268
|
+
<b>Required scopes:</b> `transaction:write`
|
|
269
|
+
|
|
270
|
+
Parameters
|
|
271
|
+
----------
|
|
272
|
+
organization_id : OrganizationId
|
|
273
|
+
|
|
274
|
+
user_id : str
|
|
275
|
+
The ID of the user as defined on the issuers system
|
|
276
|
+
|
|
277
|
+
data : CreateUploadRequestDataUnion
|
|
278
|
+
|
|
279
|
+
request_options : typing.Optional[RequestOptions]
|
|
280
|
+
Request-specific configuration.
|
|
281
|
+
|
|
282
|
+
Returns
|
|
283
|
+
-------
|
|
284
|
+
CreateUploadResponseObject
|
|
285
|
+
|
|
286
|
+
Examples
|
|
287
|
+
--------
|
|
288
|
+
import asyncio
|
|
289
|
+
|
|
290
|
+
from kard import AsyncKardApi
|
|
291
|
+
from kard.commons import EmptyObject
|
|
292
|
+
from kard.users.uploads import (
|
|
293
|
+
CreateUploadRequestDataUnion_HistoricalTransactionStart,
|
|
294
|
+
)
|
|
295
|
+
|
|
296
|
+
client = AsyncKardApi(
|
|
297
|
+
client_id="YOUR_CLIENT_ID",
|
|
298
|
+
client_secret="YOUR_CLIENT_SECRET",
|
|
299
|
+
)
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
async def main() -> None:
|
|
303
|
+
await client.users.uploads.create(
|
|
304
|
+
organization_id="organization-123",
|
|
305
|
+
user_id="user-123",
|
|
306
|
+
data=CreateUploadRequestDataUnion_HistoricalTransactionStart(
|
|
307
|
+
attributes=EmptyObject(),
|
|
308
|
+
),
|
|
309
|
+
)
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
asyncio.run(main())
|
|
313
|
+
"""
|
|
314
|
+
_response = await self._raw_client.create(organization_id, user_id, data=data, request_options=request_options)
|
|
315
|
+
return _response.data
|
|
316
|
+
|
|
317
|
+
async def create_part(
|
|
318
|
+
self,
|
|
319
|
+
organization_id: OrganizationId,
|
|
320
|
+
user_id: str,
|
|
321
|
+
upload_id: str,
|
|
322
|
+
*,
|
|
323
|
+
data: typing.Sequence[CreateUploadPartDataUnion],
|
|
324
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
325
|
+
) -> CreateUploadPartResponseObject:
|
|
326
|
+
"""
|
|
327
|
+
Call this endpoint using the upload ID provided in the [Create Upload](/api/uploads/create-upload) endpoint to add parts to your upload. Currently, this endpoint supports adding historical transactions.
|
|
328
|
+
<b>Required scopes:</b> `transaction:write`
|
|
329
|
+
<b>Note:</b> `Maximum of 500 transactions can be uploaded per request`.
|
|
330
|
+
|
|
331
|
+
Parameters
|
|
332
|
+
----------
|
|
333
|
+
organization_id : OrganizationId
|
|
334
|
+
|
|
335
|
+
user_id : str
|
|
336
|
+
The ID of the user as defined on the issuers system
|
|
337
|
+
|
|
338
|
+
upload_id : str
|
|
339
|
+
The upload ID identifying the upload session to add parts
|
|
340
|
+
|
|
341
|
+
data : typing.Sequence[CreateUploadPartDataUnion]
|
|
342
|
+
|
|
343
|
+
request_options : typing.Optional[RequestOptions]
|
|
344
|
+
Request-specific configuration.
|
|
345
|
+
|
|
346
|
+
Returns
|
|
347
|
+
-------
|
|
348
|
+
CreateUploadPartResponseObject
|
|
349
|
+
|
|
350
|
+
Examples
|
|
351
|
+
--------
|
|
352
|
+
import asyncio
|
|
353
|
+
import datetime
|
|
354
|
+
|
|
355
|
+
from kard import AsyncKardApi
|
|
356
|
+
from kard.transactions import Merchant, TransactionsAttributes
|
|
357
|
+
from kard.users.uploads import CreateUploadPartDataUnion_HistoricalTransaction
|
|
358
|
+
|
|
359
|
+
client = AsyncKardApi(
|
|
360
|
+
client_id="YOUR_CLIENT_ID",
|
|
361
|
+
client_secret="YOUR_CLIENT_SECRET",
|
|
362
|
+
)
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
async def main() -> None:
|
|
366
|
+
await client.users.uploads.create_part(
|
|
367
|
+
organization_id="organization-123",
|
|
368
|
+
user_id="user-123",
|
|
369
|
+
upload_id="upload-123",
|
|
370
|
+
data=[
|
|
371
|
+
CreateUploadPartDataUnion_HistoricalTransaction(
|
|
372
|
+
id="309rjfoincor3icno3rind093cdow3jciwjdwcm",
|
|
373
|
+
attributes=TransactionsAttributes(
|
|
374
|
+
user_id="6FHt5b6Fnp0qdomMEy5AN6PXcSJIeX69",
|
|
375
|
+
status="APPROVED",
|
|
376
|
+
amount=1000,
|
|
377
|
+
subtotal=800,
|
|
378
|
+
currency="USD",
|
|
379
|
+
direction="DEBIT",
|
|
380
|
+
payment_type="CARD",
|
|
381
|
+
description="ADVANCEAUTO",
|
|
382
|
+
description_2="ADVANCEAUTO",
|
|
383
|
+
mcc="1234",
|
|
384
|
+
card_bin="123456",
|
|
385
|
+
card_last_four="4321",
|
|
386
|
+
authorization_date=datetime.datetime.fromisoformat(
|
|
387
|
+
"2021-07-02 17:47:06+00:00",
|
|
388
|
+
),
|
|
389
|
+
merchant=Merchant(
|
|
390
|
+
id="12345678901234567",
|
|
391
|
+
name="ADVANCEAUTO",
|
|
392
|
+
addr_street="125 Main St",
|
|
393
|
+
addr_city="Philadelphia",
|
|
394
|
+
addr_state="PA",
|
|
395
|
+
addr_zipcode="19147",
|
|
396
|
+
addr_country="United States",
|
|
397
|
+
latitude="37.9419429",
|
|
398
|
+
longitude="-73.1446869",
|
|
399
|
+
store_id="12345",
|
|
400
|
+
),
|
|
401
|
+
authorization_code="123456",
|
|
402
|
+
retrieval_reference_number="100804333919",
|
|
403
|
+
acquirer_reference_number="1234567890123456789012345678",
|
|
404
|
+
system_trace_audit_number="333828",
|
|
405
|
+
transaction_id="2467de37-cbdc-416d-a359-75de87bfffb0",
|
|
406
|
+
),
|
|
407
|
+
)
|
|
408
|
+
],
|
|
409
|
+
)
|
|
410
|
+
|
|
411
|
+
|
|
412
|
+
asyncio.run(main())
|
|
413
|
+
"""
|
|
414
|
+
_response = await self._raw_client.create_part(
|
|
415
|
+
organization_id, user_id, upload_id, data=data, request_options=request_options
|
|
416
|
+
)
|
|
417
|
+
return _response.data
|
|
418
|
+
|
|
419
|
+
async def update(
|
|
420
|
+
self,
|
|
421
|
+
organization_id: OrganizationId,
|
|
422
|
+
user_id: str,
|
|
423
|
+
upload_id: str,
|
|
424
|
+
*,
|
|
425
|
+
data: UpdateUploadRequestDataUnion,
|
|
426
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
427
|
+
) -> UpdateUploadResponseObject:
|
|
428
|
+
"""
|
|
429
|
+
Call this endpoint to update your upload session. Currently, you can signal completing a historical transactions upload.
|
|
430
|
+
<b>Required scopes:</b> `transaction:write`
|
|
431
|
+
|
|
432
|
+
Parameters
|
|
433
|
+
----------
|
|
434
|
+
organization_id : OrganizationId
|
|
435
|
+
|
|
436
|
+
user_id : str
|
|
437
|
+
The ID of the user as defined on the issuers system
|
|
438
|
+
|
|
439
|
+
upload_id : str
|
|
440
|
+
The upload ID identifying the upload session to update
|
|
441
|
+
|
|
442
|
+
data : UpdateUploadRequestDataUnion
|
|
443
|
+
|
|
444
|
+
request_options : typing.Optional[RequestOptions]
|
|
445
|
+
Request-specific configuration.
|
|
446
|
+
|
|
447
|
+
Returns
|
|
448
|
+
-------
|
|
449
|
+
UpdateUploadResponseObject
|
|
450
|
+
|
|
451
|
+
Examples
|
|
452
|
+
--------
|
|
453
|
+
import asyncio
|
|
454
|
+
|
|
455
|
+
from kard import AsyncKardApi
|
|
456
|
+
from kard.commons import EmptyObject
|
|
457
|
+
from kard.users.uploads import (
|
|
458
|
+
UpdateUploadRequestDataUnion_HistoricalTransactionComplete,
|
|
459
|
+
)
|
|
460
|
+
|
|
461
|
+
client = AsyncKardApi(
|
|
462
|
+
client_id="YOUR_CLIENT_ID",
|
|
463
|
+
client_secret="YOUR_CLIENT_SECRET",
|
|
464
|
+
)
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
async def main() -> None:
|
|
468
|
+
await client.users.uploads.update(
|
|
469
|
+
organization_id="organization-123",
|
|
470
|
+
user_id="user-123",
|
|
471
|
+
upload_id="upload-123",
|
|
472
|
+
data=UpdateUploadRequestDataUnion_HistoricalTransactionComplete(
|
|
473
|
+
id="7e382223-b9a5-4825-91fb-436c8957a2e7",
|
|
474
|
+
attributes=EmptyObject(),
|
|
475
|
+
),
|
|
476
|
+
)
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
asyncio.run(main())
|
|
480
|
+
"""
|
|
481
|
+
_response = await self._raw_client.update(
|
|
482
|
+
organization_id, user_id, upload_id, data=data, request_options=request_options
|
|
483
|
+
)
|
|
484
|
+
return _response.data
|
|
@@ -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 .upload_part_multi_status import UploadPartMultiStatus
|
|
10
|
+
_dynamic_imports: typing.Dict[str, str] = {"UploadPartMultiStatus": ".upload_part_multi_status"}
|
|
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__ = ["UploadPartMultiStatus"]
|
|
@@ -0,0 +1,13 @@
|
|
|
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.create_upload_part_multi_status_response import CreateUploadPartMultiStatusResponse
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class UploadPartMultiStatus(ApiError):
|
|
10
|
+
def __init__(
|
|
11
|
+
self, body: CreateUploadPartMultiStatusResponse, headers: typing.Optional[typing.Dict[str, str]] = None
|
|
12
|
+
):
|
|
13
|
+
super().__init__(status_code=207, headers=headers, body=body)
|