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,133 @@
|
|
|
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
|
+
Amount,
|
|
11
|
+
AmountType,
|
|
12
|
+
Asset,
|
|
13
|
+
CategoryData,
|
|
14
|
+
CategoryFields,
|
|
15
|
+
CategoryIdentifier,
|
|
16
|
+
CategoryIncluded,
|
|
17
|
+
CategoryRelationship,
|
|
18
|
+
CategoryRelationshipObject,
|
|
19
|
+
Commission,
|
|
20
|
+
Coordinates,
|
|
21
|
+
EligibilityLocationAddress,
|
|
22
|
+
EligibilityLocationIncluded,
|
|
23
|
+
EligibilityOfferIncluded,
|
|
24
|
+
EligibilityOfferRelationship,
|
|
25
|
+
LocationAttributes,
|
|
26
|
+
LocationData,
|
|
27
|
+
LocationRelationships,
|
|
28
|
+
LocationSortOptions,
|
|
29
|
+
LocationsResponseObject,
|
|
30
|
+
OfferCommonFields,
|
|
31
|
+
OfferDataUnion,
|
|
32
|
+
OfferDataUnion_StandardOffer,
|
|
33
|
+
OfferRelationship,
|
|
34
|
+
OfferSortOptions,
|
|
35
|
+
OffersResponseObject,
|
|
36
|
+
OperationHours,
|
|
37
|
+
OperationPeriod,
|
|
38
|
+
OperationTime,
|
|
39
|
+
StandardOffer,
|
|
40
|
+
StandardOfferCore,
|
|
41
|
+
StandardOfferFields,
|
|
42
|
+
)
|
|
43
|
+
_dynamic_imports: typing.Dict[str, str] = {
|
|
44
|
+
"Amount": ".types",
|
|
45
|
+
"AmountType": ".types",
|
|
46
|
+
"Asset": ".types",
|
|
47
|
+
"CategoryData": ".types",
|
|
48
|
+
"CategoryFields": ".types",
|
|
49
|
+
"CategoryIdentifier": ".types",
|
|
50
|
+
"CategoryIncluded": ".types",
|
|
51
|
+
"CategoryRelationship": ".types",
|
|
52
|
+
"CategoryRelationshipObject": ".types",
|
|
53
|
+
"Commission": ".types",
|
|
54
|
+
"Coordinates": ".types",
|
|
55
|
+
"EligibilityLocationAddress": ".types",
|
|
56
|
+
"EligibilityLocationIncluded": ".types",
|
|
57
|
+
"EligibilityOfferIncluded": ".types",
|
|
58
|
+
"EligibilityOfferRelationship": ".types",
|
|
59
|
+
"LocationAttributes": ".types",
|
|
60
|
+
"LocationData": ".types",
|
|
61
|
+
"LocationRelationships": ".types",
|
|
62
|
+
"LocationSortOptions": ".types",
|
|
63
|
+
"LocationsResponseObject": ".types",
|
|
64
|
+
"OfferCommonFields": ".types",
|
|
65
|
+
"OfferDataUnion": ".types",
|
|
66
|
+
"OfferDataUnion_StandardOffer": ".types",
|
|
67
|
+
"OfferRelationship": ".types",
|
|
68
|
+
"OfferSortOptions": ".types",
|
|
69
|
+
"OffersResponseObject": ".types",
|
|
70
|
+
"OperationHours": ".types",
|
|
71
|
+
"OperationPeriod": ".types",
|
|
72
|
+
"OperationTime": ".types",
|
|
73
|
+
"StandardOffer": ".types",
|
|
74
|
+
"StandardOfferCore": ".types",
|
|
75
|
+
"StandardOfferFields": ".types",
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def __getattr__(attr_name: str) -> typing.Any:
|
|
80
|
+
module_name = _dynamic_imports.get(attr_name)
|
|
81
|
+
if module_name is None:
|
|
82
|
+
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
|
|
83
|
+
try:
|
|
84
|
+
module = import_module(module_name, __package__)
|
|
85
|
+
if module_name == f".{attr_name}":
|
|
86
|
+
return module
|
|
87
|
+
else:
|
|
88
|
+
return getattr(module, attr_name)
|
|
89
|
+
except ImportError as e:
|
|
90
|
+
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
|
|
91
|
+
except AttributeError as e:
|
|
92
|
+
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def __dir__():
|
|
96
|
+
lazy_attrs = list(_dynamic_imports.keys())
|
|
97
|
+
return sorted(lazy_attrs)
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
__all__ = [
|
|
101
|
+
"Amount",
|
|
102
|
+
"AmountType",
|
|
103
|
+
"Asset",
|
|
104
|
+
"CategoryData",
|
|
105
|
+
"CategoryFields",
|
|
106
|
+
"CategoryIdentifier",
|
|
107
|
+
"CategoryIncluded",
|
|
108
|
+
"CategoryRelationship",
|
|
109
|
+
"CategoryRelationshipObject",
|
|
110
|
+
"Commission",
|
|
111
|
+
"Coordinates",
|
|
112
|
+
"EligibilityLocationAddress",
|
|
113
|
+
"EligibilityLocationIncluded",
|
|
114
|
+
"EligibilityOfferIncluded",
|
|
115
|
+
"EligibilityOfferRelationship",
|
|
116
|
+
"LocationAttributes",
|
|
117
|
+
"LocationData",
|
|
118
|
+
"LocationRelationships",
|
|
119
|
+
"LocationSortOptions",
|
|
120
|
+
"LocationsResponseObject",
|
|
121
|
+
"OfferCommonFields",
|
|
122
|
+
"OfferDataUnion",
|
|
123
|
+
"OfferDataUnion_StandardOffer",
|
|
124
|
+
"OfferRelationship",
|
|
125
|
+
"OfferSortOptions",
|
|
126
|
+
"OffersResponseObject",
|
|
127
|
+
"OperationHours",
|
|
128
|
+
"OperationPeriod",
|
|
129
|
+
"OperationTime",
|
|
130
|
+
"StandardOffer",
|
|
131
|
+
"StandardOfferCore",
|
|
132
|
+
"StandardOfferFields",
|
|
133
|
+
]
|
|
@@ -0,0 +1,448 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
from ...commons.types.category_option import CategoryOption
|
|
6
|
+
from ...commons.types.organization_id import OrganizationId
|
|
7
|
+
from ...commons.types.purchase_channel import PurchaseChannel
|
|
8
|
+
from ...commons.types.state import State
|
|
9
|
+
from ...commons.types.user_id import UserId
|
|
10
|
+
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
11
|
+
from ...core.request_options import RequestOptions
|
|
12
|
+
from .raw_client import AsyncRawRewardsClient, RawRewardsClient
|
|
13
|
+
from .types.location_sort_options import LocationSortOptions
|
|
14
|
+
from .types.locations_response_object import LocationsResponseObject
|
|
15
|
+
from .types.offer_sort_options import OfferSortOptions
|
|
16
|
+
from .types.offers_response_object import OffersResponseObject
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class RewardsClient:
|
|
20
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
21
|
+
self._raw_client = RawRewardsClient(client_wrapper=client_wrapper)
|
|
22
|
+
|
|
23
|
+
@property
|
|
24
|
+
def with_raw_response(self) -> RawRewardsClient:
|
|
25
|
+
"""
|
|
26
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
27
|
+
|
|
28
|
+
Returns
|
|
29
|
+
-------
|
|
30
|
+
RawRewardsClient
|
|
31
|
+
"""
|
|
32
|
+
return self._raw_client
|
|
33
|
+
|
|
34
|
+
def offers(
|
|
35
|
+
self,
|
|
36
|
+
organization_id: OrganizationId,
|
|
37
|
+
user_id: UserId,
|
|
38
|
+
*,
|
|
39
|
+
page_size: typing.Optional[int] = None,
|
|
40
|
+
page_after: typing.Optional[str] = None,
|
|
41
|
+
page_before: typing.Optional[str] = None,
|
|
42
|
+
filter_purchase_channel: typing.Optional[typing.Sequence[PurchaseChannel]] = None,
|
|
43
|
+
filter_category: typing.Optional[CategoryOption] = None,
|
|
44
|
+
filter_is_targeted: typing.Optional[bool] = None,
|
|
45
|
+
sort: typing.Optional[typing.Union[OfferSortOptions, typing.Sequence[OfferSortOptions]]] = None,
|
|
46
|
+
include: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
47
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
48
|
+
) -> OffersResponseObject:
|
|
49
|
+
"""
|
|
50
|
+
Retrieve national brand offers that a specified user is eligible for. Call this endpoint to build out your
|
|
51
|
+
[targeted offers UX experience](/2024-10-01/api/getting-started#b-discover-a-lapsed-customer-clo). Local offers details
|
|
52
|
+
can be found by calling the [Get Eligible Locations](/2024-10-01/api/rewards/locations) endpoint with the
|
|
53
|
+
`includeLocal` query parameter.<br/>
|
|
54
|
+
<b>Required scopes:</b> `rewards:read`
|
|
55
|
+
|
|
56
|
+
Parameters
|
|
57
|
+
----------
|
|
58
|
+
organization_id : OrganizationId
|
|
59
|
+
|
|
60
|
+
user_id : UserId
|
|
61
|
+
|
|
62
|
+
page_size : typing.Optional[int]
|
|
63
|
+
|
|
64
|
+
page_after : typing.Optional[str]
|
|
65
|
+
|
|
66
|
+
page_before : typing.Optional[str]
|
|
67
|
+
|
|
68
|
+
filter_purchase_channel : typing.Optional[typing.Sequence[PurchaseChannel]]
|
|
69
|
+
|
|
70
|
+
filter_category : typing.Optional[CategoryOption]
|
|
71
|
+
|
|
72
|
+
filter_is_targeted : typing.Optional[bool]
|
|
73
|
+
|
|
74
|
+
sort : typing.Optional[typing.Union[OfferSortOptions, typing.Sequence[OfferSortOptions]]]
|
|
75
|
+
If provided, response will be sorted by the specified fields
|
|
76
|
+
|
|
77
|
+
include : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
78
|
+
CSV list of included resources in the response (e.g "categories"). Allowed value is `categories`.
|
|
79
|
+
|
|
80
|
+
request_options : typing.Optional[RequestOptions]
|
|
81
|
+
Request-specific configuration.
|
|
82
|
+
|
|
83
|
+
Returns
|
|
84
|
+
-------
|
|
85
|
+
OffersResponseObject
|
|
86
|
+
|
|
87
|
+
Examples
|
|
88
|
+
--------
|
|
89
|
+
from kard import KardApi
|
|
90
|
+
|
|
91
|
+
client = KardApi(
|
|
92
|
+
client_id="YOUR_CLIENT_ID",
|
|
93
|
+
client_secret="YOUR_CLIENT_SECRET",
|
|
94
|
+
)
|
|
95
|
+
client.users.rewards.offers(
|
|
96
|
+
organization_id="organization-123",
|
|
97
|
+
user_id="user-123",
|
|
98
|
+
page_size=1,
|
|
99
|
+
filter_is_targeted=True,
|
|
100
|
+
sort="-startDate",
|
|
101
|
+
)
|
|
102
|
+
"""
|
|
103
|
+
_response = self._raw_client.offers(
|
|
104
|
+
organization_id,
|
|
105
|
+
user_id,
|
|
106
|
+
page_size=page_size,
|
|
107
|
+
page_after=page_after,
|
|
108
|
+
page_before=page_before,
|
|
109
|
+
filter_purchase_channel=filter_purchase_channel,
|
|
110
|
+
filter_category=filter_category,
|
|
111
|
+
filter_is_targeted=filter_is_targeted,
|
|
112
|
+
sort=sort,
|
|
113
|
+
include=include,
|
|
114
|
+
request_options=request_options,
|
|
115
|
+
)
|
|
116
|
+
return _response.data
|
|
117
|
+
|
|
118
|
+
def locations(
|
|
119
|
+
self,
|
|
120
|
+
organization_id: OrganizationId,
|
|
121
|
+
user_id: UserId,
|
|
122
|
+
*,
|
|
123
|
+
page_size: typing.Optional[int] = None,
|
|
124
|
+
page_after: typing.Optional[str] = None,
|
|
125
|
+
page_before: typing.Optional[str] = None,
|
|
126
|
+
filter_name: typing.Optional[str] = None,
|
|
127
|
+
filter_city: typing.Optional[str] = None,
|
|
128
|
+
filter_zip_code: typing.Optional[str] = None,
|
|
129
|
+
filter_state: typing.Optional[State] = None,
|
|
130
|
+
filter_category: typing.Optional[CategoryOption] = None,
|
|
131
|
+
filter_longitude: typing.Optional[float] = None,
|
|
132
|
+
filter_latitude: typing.Optional[float] = None,
|
|
133
|
+
filter_radius: typing.Optional[int] = None,
|
|
134
|
+
sort: typing.Optional[typing.Union[LocationSortOptions, typing.Sequence[LocationSortOptions]]] = None,
|
|
135
|
+
include: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
136
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
137
|
+
) -> LocationsResponseObject:
|
|
138
|
+
"""
|
|
139
|
+
Retrieve national and local geographic locations that a specified user has eligible in-store offers at. To
|
|
140
|
+
include local locations, add the `includeLocal` query parameter to your api call. Use this endpoint to build
|
|
141
|
+
out your [map-specific UX experiences](/2024-10-01/api/getting-started#c-discover-clos-near-you-map-view). Please note
|
|
142
|
+
that Longitude and Latitude fields are prioritized over State, City and Zipcode and are the recommended search
|
|
143
|
+
pattern.<br/>
|
|
144
|
+
<br/>
|
|
145
|
+
<b>Required scopes:</b> `rewards:read`
|
|
146
|
+
|
|
147
|
+
Parameters
|
|
148
|
+
----------
|
|
149
|
+
organization_id : OrganizationId
|
|
150
|
+
|
|
151
|
+
user_id : UserId
|
|
152
|
+
|
|
153
|
+
page_size : typing.Optional[int]
|
|
154
|
+
|
|
155
|
+
page_after : typing.Optional[str]
|
|
156
|
+
|
|
157
|
+
page_before : typing.Optional[str]
|
|
158
|
+
|
|
159
|
+
filter_name : typing.Optional[str]
|
|
160
|
+
|
|
161
|
+
filter_city : typing.Optional[str]
|
|
162
|
+
|
|
163
|
+
filter_zip_code : typing.Optional[str]
|
|
164
|
+
|
|
165
|
+
filter_state : typing.Optional[State]
|
|
166
|
+
|
|
167
|
+
filter_category : typing.Optional[CategoryOption]
|
|
168
|
+
|
|
169
|
+
filter_longitude : typing.Optional[float]
|
|
170
|
+
|
|
171
|
+
filter_latitude : typing.Optional[float]
|
|
172
|
+
|
|
173
|
+
filter_radius : typing.Optional[int]
|
|
174
|
+
|
|
175
|
+
sort : typing.Optional[typing.Union[LocationSortOptions, typing.Sequence[LocationSortOptions]]]
|
|
176
|
+
If provided, response will be sorted by the specified fields
|
|
177
|
+
|
|
178
|
+
include : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
179
|
+
CSV list of included resources in the response (e.g "offers,categories"). Allowed values are `offers` and `categories`.
|
|
180
|
+
|
|
181
|
+
request_options : typing.Optional[RequestOptions]
|
|
182
|
+
Request-specific configuration.
|
|
183
|
+
|
|
184
|
+
Returns
|
|
185
|
+
-------
|
|
186
|
+
LocationsResponseObject
|
|
187
|
+
|
|
188
|
+
Examples
|
|
189
|
+
--------
|
|
190
|
+
from kard import KardApi
|
|
191
|
+
|
|
192
|
+
client = KardApi(
|
|
193
|
+
client_id="YOUR_CLIENT_ID",
|
|
194
|
+
client_secret="YOUR_CLIENT_SECRET",
|
|
195
|
+
)
|
|
196
|
+
client.users.rewards.locations(
|
|
197
|
+
organization_id="organization-123",
|
|
198
|
+
user_id="user-123",
|
|
199
|
+
page_size=1,
|
|
200
|
+
filter_latitude=39.9419429,
|
|
201
|
+
filter_longitude=-75.1446869,
|
|
202
|
+
filter_radius=10,
|
|
203
|
+
include="offers,categories",
|
|
204
|
+
)
|
|
205
|
+
"""
|
|
206
|
+
_response = self._raw_client.locations(
|
|
207
|
+
organization_id,
|
|
208
|
+
user_id,
|
|
209
|
+
page_size=page_size,
|
|
210
|
+
page_after=page_after,
|
|
211
|
+
page_before=page_before,
|
|
212
|
+
filter_name=filter_name,
|
|
213
|
+
filter_city=filter_city,
|
|
214
|
+
filter_zip_code=filter_zip_code,
|
|
215
|
+
filter_state=filter_state,
|
|
216
|
+
filter_category=filter_category,
|
|
217
|
+
filter_longitude=filter_longitude,
|
|
218
|
+
filter_latitude=filter_latitude,
|
|
219
|
+
filter_radius=filter_radius,
|
|
220
|
+
sort=sort,
|
|
221
|
+
include=include,
|
|
222
|
+
request_options=request_options,
|
|
223
|
+
)
|
|
224
|
+
return _response.data
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
class AsyncRewardsClient:
|
|
228
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
229
|
+
self._raw_client = AsyncRawRewardsClient(client_wrapper=client_wrapper)
|
|
230
|
+
|
|
231
|
+
@property
|
|
232
|
+
def with_raw_response(self) -> AsyncRawRewardsClient:
|
|
233
|
+
"""
|
|
234
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
235
|
+
|
|
236
|
+
Returns
|
|
237
|
+
-------
|
|
238
|
+
AsyncRawRewardsClient
|
|
239
|
+
"""
|
|
240
|
+
return self._raw_client
|
|
241
|
+
|
|
242
|
+
async def offers(
|
|
243
|
+
self,
|
|
244
|
+
organization_id: OrganizationId,
|
|
245
|
+
user_id: UserId,
|
|
246
|
+
*,
|
|
247
|
+
page_size: typing.Optional[int] = None,
|
|
248
|
+
page_after: typing.Optional[str] = None,
|
|
249
|
+
page_before: typing.Optional[str] = None,
|
|
250
|
+
filter_purchase_channel: typing.Optional[typing.Sequence[PurchaseChannel]] = None,
|
|
251
|
+
filter_category: typing.Optional[CategoryOption] = None,
|
|
252
|
+
filter_is_targeted: typing.Optional[bool] = None,
|
|
253
|
+
sort: typing.Optional[typing.Union[OfferSortOptions, typing.Sequence[OfferSortOptions]]] = None,
|
|
254
|
+
include: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
255
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
256
|
+
) -> OffersResponseObject:
|
|
257
|
+
"""
|
|
258
|
+
Retrieve national brand offers that a specified user is eligible for. Call this endpoint to build out your
|
|
259
|
+
[targeted offers UX experience](/2024-10-01/api/getting-started#b-discover-a-lapsed-customer-clo). Local offers details
|
|
260
|
+
can be found by calling the [Get Eligible Locations](/2024-10-01/api/rewards/locations) endpoint with the
|
|
261
|
+
`includeLocal` query parameter.<br/>
|
|
262
|
+
<b>Required scopes:</b> `rewards:read`
|
|
263
|
+
|
|
264
|
+
Parameters
|
|
265
|
+
----------
|
|
266
|
+
organization_id : OrganizationId
|
|
267
|
+
|
|
268
|
+
user_id : UserId
|
|
269
|
+
|
|
270
|
+
page_size : typing.Optional[int]
|
|
271
|
+
|
|
272
|
+
page_after : typing.Optional[str]
|
|
273
|
+
|
|
274
|
+
page_before : typing.Optional[str]
|
|
275
|
+
|
|
276
|
+
filter_purchase_channel : typing.Optional[typing.Sequence[PurchaseChannel]]
|
|
277
|
+
|
|
278
|
+
filter_category : typing.Optional[CategoryOption]
|
|
279
|
+
|
|
280
|
+
filter_is_targeted : typing.Optional[bool]
|
|
281
|
+
|
|
282
|
+
sort : typing.Optional[typing.Union[OfferSortOptions, typing.Sequence[OfferSortOptions]]]
|
|
283
|
+
If provided, response will be sorted by the specified fields
|
|
284
|
+
|
|
285
|
+
include : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
286
|
+
CSV list of included resources in the response (e.g "categories"). Allowed value is `categories`.
|
|
287
|
+
|
|
288
|
+
request_options : typing.Optional[RequestOptions]
|
|
289
|
+
Request-specific configuration.
|
|
290
|
+
|
|
291
|
+
Returns
|
|
292
|
+
-------
|
|
293
|
+
OffersResponseObject
|
|
294
|
+
|
|
295
|
+
Examples
|
|
296
|
+
--------
|
|
297
|
+
import asyncio
|
|
298
|
+
|
|
299
|
+
from kard import AsyncKardApi
|
|
300
|
+
|
|
301
|
+
client = AsyncKardApi(
|
|
302
|
+
client_id="YOUR_CLIENT_ID",
|
|
303
|
+
client_secret="YOUR_CLIENT_SECRET",
|
|
304
|
+
)
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
async def main() -> None:
|
|
308
|
+
await client.users.rewards.offers(
|
|
309
|
+
organization_id="organization-123",
|
|
310
|
+
user_id="user-123",
|
|
311
|
+
page_size=1,
|
|
312
|
+
filter_is_targeted=True,
|
|
313
|
+
sort="-startDate",
|
|
314
|
+
)
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
asyncio.run(main())
|
|
318
|
+
"""
|
|
319
|
+
_response = await self._raw_client.offers(
|
|
320
|
+
organization_id,
|
|
321
|
+
user_id,
|
|
322
|
+
page_size=page_size,
|
|
323
|
+
page_after=page_after,
|
|
324
|
+
page_before=page_before,
|
|
325
|
+
filter_purchase_channel=filter_purchase_channel,
|
|
326
|
+
filter_category=filter_category,
|
|
327
|
+
filter_is_targeted=filter_is_targeted,
|
|
328
|
+
sort=sort,
|
|
329
|
+
include=include,
|
|
330
|
+
request_options=request_options,
|
|
331
|
+
)
|
|
332
|
+
return _response.data
|
|
333
|
+
|
|
334
|
+
async def locations(
|
|
335
|
+
self,
|
|
336
|
+
organization_id: OrganizationId,
|
|
337
|
+
user_id: UserId,
|
|
338
|
+
*,
|
|
339
|
+
page_size: typing.Optional[int] = None,
|
|
340
|
+
page_after: typing.Optional[str] = None,
|
|
341
|
+
page_before: typing.Optional[str] = None,
|
|
342
|
+
filter_name: typing.Optional[str] = None,
|
|
343
|
+
filter_city: typing.Optional[str] = None,
|
|
344
|
+
filter_zip_code: typing.Optional[str] = None,
|
|
345
|
+
filter_state: typing.Optional[State] = None,
|
|
346
|
+
filter_category: typing.Optional[CategoryOption] = None,
|
|
347
|
+
filter_longitude: typing.Optional[float] = None,
|
|
348
|
+
filter_latitude: typing.Optional[float] = None,
|
|
349
|
+
filter_radius: typing.Optional[int] = None,
|
|
350
|
+
sort: typing.Optional[typing.Union[LocationSortOptions, typing.Sequence[LocationSortOptions]]] = None,
|
|
351
|
+
include: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
352
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
353
|
+
) -> LocationsResponseObject:
|
|
354
|
+
"""
|
|
355
|
+
Retrieve national and local geographic locations that a specified user has eligible in-store offers at. To
|
|
356
|
+
include local locations, add the `includeLocal` query parameter to your api call. Use this endpoint to build
|
|
357
|
+
out your [map-specific UX experiences](/2024-10-01/api/getting-started#c-discover-clos-near-you-map-view). Please note
|
|
358
|
+
that Longitude and Latitude fields are prioritized over State, City and Zipcode and are the recommended search
|
|
359
|
+
pattern.<br/>
|
|
360
|
+
<br/>
|
|
361
|
+
<b>Required scopes:</b> `rewards:read`
|
|
362
|
+
|
|
363
|
+
Parameters
|
|
364
|
+
----------
|
|
365
|
+
organization_id : OrganizationId
|
|
366
|
+
|
|
367
|
+
user_id : UserId
|
|
368
|
+
|
|
369
|
+
page_size : typing.Optional[int]
|
|
370
|
+
|
|
371
|
+
page_after : typing.Optional[str]
|
|
372
|
+
|
|
373
|
+
page_before : typing.Optional[str]
|
|
374
|
+
|
|
375
|
+
filter_name : typing.Optional[str]
|
|
376
|
+
|
|
377
|
+
filter_city : typing.Optional[str]
|
|
378
|
+
|
|
379
|
+
filter_zip_code : typing.Optional[str]
|
|
380
|
+
|
|
381
|
+
filter_state : typing.Optional[State]
|
|
382
|
+
|
|
383
|
+
filter_category : typing.Optional[CategoryOption]
|
|
384
|
+
|
|
385
|
+
filter_longitude : typing.Optional[float]
|
|
386
|
+
|
|
387
|
+
filter_latitude : typing.Optional[float]
|
|
388
|
+
|
|
389
|
+
filter_radius : typing.Optional[int]
|
|
390
|
+
|
|
391
|
+
sort : typing.Optional[typing.Union[LocationSortOptions, typing.Sequence[LocationSortOptions]]]
|
|
392
|
+
If provided, response will be sorted by the specified fields
|
|
393
|
+
|
|
394
|
+
include : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
395
|
+
CSV list of included resources in the response (e.g "offers,categories"). Allowed values are `offers` and `categories`.
|
|
396
|
+
|
|
397
|
+
request_options : typing.Optional[RequestOptions]
|
|
398
|
+
Request-specific configuration.
|
|
399
|
+
|
|
400
|
+
Returns
|
|
401
|
+
-------
|
|
402
|
+
LocationsResponseObject
|
|
403
|
+
|
|
404
|
+
Examples
|
|
405
|
+
--------
|
|
406
|
+
import asyncio
|
|
407
|
+
|
|
408
|
+
from kard import AsyncKardApi
|
|
409
|
+
|
|
410
|
+
client = AsyncKardApi(
|
|
411
|
+
client_id="YOUR_CLIENT_ID",
|
|
412
|
+
client_secret="YOUR_CLIENT_SECRET",
|
|
413
|
+
)
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
async def main() -> None:
|
|
417
|
+
await client.users.rewards.locations(
|
|
418
|
+
organization_id="organization-123",
|
|
419
|
+
user_id="user-123",
|
|
420
|
+
page_size=1,
|
|
421
|
+
filter_latitude=39.9419429,
|
|
422
|
+
filter_longitude=-75.1446869,
|
|
423
|
+
filter_radius=10,
|
|
424
|
+
include="offers,categories",
|
|
425
|
+
)
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
asyncio.run(main())
|
|
429
|
+
"""
|
|
430
|
+
_response = await self._raw_client.locations(
|
|
431
|
+
organization_id,
|
|
432
|
+
user_id,
|
|
433
|
+
page_size=page_size,
|
|
434
|
+
page_after=page_after,
|
|
435
|
+
page_before=page_before,
|
|
436
|
+
filter_name=filter_name,
|
|
437
|
+
filter_city=filter_city,
|
|
438
|
+
filter_zip_code=filter_zip_code,
|
|
439
|
+
filter_state=filter_state,
|
|
440
|
+
filter_category=filter_category,
|
|
441
|
+
filter_longitude=filter_longitude,
|
|
442
|
+
filter_latitude=filter_latitude,
|
|
443
|
+
filter_radius=filter_radius,
|
|
444
|
+
sort=sort,
|
|
445
|
+
include=include,
|
|
446
|
+
request_options=request_options,
|
|
447
|
+
)
|
|
448
|
+
return _response.data
|