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,27 @@
|
|
|
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
|
+
from .transaction_relationships import TransactionRelationships
|
|
8
|
+
from .valid_transaction_attributes import ValidTransactionAttributes
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class ValidTransactionData(UniversalBaseModel):
|
|
12
|
+
id: str = pydantic.Field()
|
|
13
|
+
"""
|
|
14
|
+
The internal ID of the notification
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
attributes: ValidTransactionAttributes
|
|
18
|
+
relationships: TransactionRelationships
|
|
19
|
+
|
|
20
|
+
if IS_PYDANTIC_V2:
|
|
21
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
22
|
+
else:
|
|
23
|
+
|
|
24
|
+
class Config:
|
|
25
|
+
frozen = True
|
|
26
|
+
smart_union = True
|
|
27
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
import pydantic
|
|
7
|
+
import typing_extensions
|
|
8
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
9
|
+
from ...core.serialization import FieldMetadata
|
|
10
|
+
from .broker_operation_hours import BrokerOperationHours
|
|
11
|
+
from .location_address import LocationAddress
|
|
12
|
+
from .location_coordinates import LocationCoordinates
|
|
13
|
+
from .location_status import LocationStatus
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class WebhookLocationsAttributes(UniversalBaseModel):
|
|
17
|
+
location_id: typing_extensions.Annotated[str, FieldMetadata(alias="locationId")] = pydantic.Field()
|
|
18
|
+
"""
|
|
19
|
+
The Kard location ID
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
name: str = pydantic.Field()
|
|
23
|
+
"""
|
|
24
|
+
The name of the location
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
status: LocationStatus = pydantic.Field()
|
|
28
|
+
"""
|
|
29
|
+
The status of the location
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
address: LocationAddress = pydantic.Field()
|
|
33
|
+
"""
|
|
34
|
+
The physical address of the location
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
coordinates: LocationCoordinates = pydantic.Field()
|
|
38
|
+
"""
|
|
39
|
+
The geographic coordinates of the location
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
phone: str = pydantic.Field()
|
|
43
|
+
"""
|
|
44
|
+
The phone number of the location
|
|
45
|
+
"""
|
|
46
|
+
|
|
47
|
+
operation_hours: typing_extensions.Annotated[BrokerOperationHours, FieldMetadata(alias="operationHours")] = (
|
|
48
|
+
pydantic.Field()
|
|
49
|
+
)
|
|
50
|
+
"""
|
|
51
|
+
The hours of operation for the location
|
|
52
|
+
"""
|
|
53
|
+
|
|
54
|
+
created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field()
|
|
55
|
+
"""
|
|
56
|
+
When the location was created
|
|
57
|
+
"""
|
|
58
|
+
|
|
59
|
+
updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field()
|
|
60
|
+
"""
|
|
61
|
+
When the location was last updated
|
|
62
|
+
"""
|
|
63
|
+
|
|
64
|
+
if IS_PYDANTIC_V2:
|
|
65
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
66
|
+
else:
|
|
67
|
+
|
|
68
|
+
class Config:
|
|
69
|
+
frozen = True
|
|
70
|
+
smart_union = True
|
|
71
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
from .webhook_locations_attributes import WebhookLocationsAttributes
|
|
8
|
+
from .webhook_locations_relationships import WebhookLocationsRelationships
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class WebhookLocationsData(UniversalBaseModel):
|
|
12
|
+
id: str = pydantic.Field()
|
|
13
|
+
"""
|
|
14
|
+
The internal ID of the notification
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
attributes: WebhookLocationsAttributes
|
|
18
|
+
relationships: WebhookLocationsRelationships
|
|
19
|
+
|
|
20
|
+
if IS_PYDANTIC_V2:
|
|
21
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
22
|
+
else:
|
|
23
|
+
|
|
24
|
+
class Config:
|
|
25
|
+
frozen = True
|
|
26
|
+
smart_union = True
|
|
27
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import pydantic
|
|
6
|
+
from ...commons.types.relationship_single import RelationshipSingle
|
|
7
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class WebhookLocationsRelationships(UniversalBaseModel):
|
|
11
|
+
merchant: RelationshipSingle
|
|
12
|
+
|
|
13
|
+
if IS_PYDANTIC_V2:
|
|
14
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
15
|
+
else:
|
|
16
|
+
|
|
17
|
+
class Config:
|
|
18
|
+
frozen = True
|
|
19
|
+
smart_union = True
|
|
20
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
import pydantic
|
|
7
|
+
import typing_extensions
|
|
8
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
9
|
+
from ...core.serialization import FieldMetadata
|
|
10
|
+
from .broker_asset import BrokerAsset
|
|
11
|
+
from .merchant_source import MerchantSource
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class WebhookMerchantAttributes(UniversalBaseModel):
|
|
15
|
+
merchant_id: typing_extensions.Annotated[str, FieldMetadata(alias="merchantId")] = pydantic.Field()
|
|
16
|
+
"""
|
|
17
|
+
The Kard merchant ID
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
name: str = pydantic.Field()
|
|
21
|
+
"""
|
|
22
|
+
The name of the merchant
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
description: str = pydantic.Field()
|
|
26
|
+
"""
|
|
27
|
+
The description of the merchant
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
website_url: typing_extensions.Annotated[str, FieldMetadata(alias="websiteUrl")] = pydantic.Field()
|
|
31
|
+
"""
|
|
32
|
+
The URL of the merchant's website
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
assets: typing.List[BrokerAsset] = pydantic.Field()
|
|
36
|
+
"""
|
|
37
|
+
Media assets associated with the merchant
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
source: MerchantSource = pydantic.Field()
|
|
41
|
+
"""
|
|
42
|
+
The source of the merchant data
|
|
43
|
+
"""
|
|
44
|
+
|
|
45
|
+
category: str = pydantic.Field()
|
|
46
|
+
"""
|
|
47
|
+
The category of the merchant
|
|
48
|
+
"""
|
|
49
|
+
|
|
50
|
+
updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field()
|
|
51
|
+
"""
|
|
52
|
+
When the merchant was last updated
|
|
53
|
+
"""
|
|
54
|
+
|
|
55
|
+
created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field()
|
|
56
|
+
"""
|
|
57
|
+
When the merchant was created
|
|
58
|
+
"""
|
|
59
|
+
|
|
60
|
+
if IS_PYDANTIC_V2:
|
|
61
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
62
|
+
else:
|
|
63
|
+
|
|
64
|
+
class Config:
|
|
65
|
+
frozen = True
|
|
66
|
+
smart_union = True
|
|
67
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
from .webhook_merchant_attributes import WebhookMerchantAttributes
|
|
8
|
+
from .webhook_merchant_relationships import WebhookMerchantRelationships
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class WebhookMerchantData(UniversalBaseModel):
|
|
12
|
+
id: str = pydantic.Field()
|
|
13
|
+
"""
|
|
14
|
+
The internal ID of the notification
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
attributes: WebhookMerchantAttributes
|
|
18
|
+
relationships: WebhookMerchantRelationships
|
|
19
|
+
|
|
20
|
+
if IS_PYDANTIC_V2:
|
|
21
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
22
|
+
else:
|
|
23
|
+
|
|
24
|
+
class Config:
|
|
25
|
+
frozen = True
|
|
26
|
+
smart_union = True
|
|
27
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import pydantic
|
|
6
|
+
from ...commons.types.relationship_multiple import RelationshipMultiple
|
|
7
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class WebhookMerchantRelationships(UniversalBaseModel):
|
|
11
|
+
offer: typing.Optional[RelationshipMultiple] = None
|
|
12
|
+
|
|
13
|
+
if IS_PYDANTIC_V2:
|
|
14
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
15
|
+
else:
|
|
16
|
+
|
|
17
|
+
class Config:
|
|
18
|
+
frozen = True
|
|
19
|
+
smart_union = True
|
|
20
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
import pydantic
|
|
7
|
+
import typing_extensions
|
|
8
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
9
|
+
from ...core.serialization import FieldMetadata
|
|
10
|
+
from .broker_amount import BrokerAmount
|
|
11
|
+
from .broker_purchase_channel import BrokerPurchaseChannel
|
|
12
|
+
from .broker_reward import BrokerReward
|
|
13
|
+
from .offer_status import OfferStatus
|
|
14
|
+
from .offer_type import OfferType
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class WebhookOfferAttributes(UniversalBaseModel):
|
|
18
|
+
offer_id: typing_extensions.Annotated[str, FieldMetadata(alias="offerId")] = pydantic.Field()
|
|
19
|
+
"""
|
|
20
|
+
The Kard offer ID
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
offer_type: typing_extensions.Annotated[OfferType, FieldMetadata(alias="offerType")] = pydantic.Field()
|
|
24
|
+
"""
|
|
25
|
+
The type of kard platform offer (e.g., "standardOffer")
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
name: str = pydantic.Field()
|
|
29
|
+
"""
|
|
30
|
+
The name of the offer
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
terms: str = pydantic.Field()
|
|
34
|
+
"""
|
|
35
|
+
Terms and conditions for the offer
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
status: OfferStatus = pydantic.Field()
|
|
39
|
+
"""
|
|
40
|
+
Current status of the offer
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
purchase_channel: typing_extensions.Annotated[
|
|
44
|
+
typing.List[BrokerPurchaseChannel], FieldMetadata(alias="purchaseChannel")
|
|
45
|
+
] = pydantic.Field()
|
|
46
|
+
"""
|
|
47
|
+
Channels where the offer can be redeemed
|
|
48
|
+
"""
|
|
49
|
+
|
|
50
|
+
user_reward: typing_extensions.Annotated[BrokerReward, FieldMetadata(alias="userReward")] = pydantic.Field()
|
|
51
|
+
"""
|
|
52
|
+
Reward details for the user
|
|
53
|
+
"""
|
|
54
|
+
|
|
55
|
+
start_date: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="startDate")] = pydantic.Field()
|
|
56
|
+
"""
|
|
57
|
+
When the offer becomes active
|
|
58
|
+
"""
|
|
59
|
+
|
|
60
|
+
expiration_date: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="expirationDate")] = pydantic.Field()
|
|
61
|
+
"""
|
|
62
|
+
When the offer expires
|
|
63
|
+
"""
|
|
64
|
+
|
|
65
|
+
min_reward_amount: typing_extensions.Annotated[
|
|
66
|
+
typing.Optional[BrokerAmount], FieldMetadata(alias="minRewardAmount")
|
|
67
|
+
] = pydantic.Field(default=None)
|
|
68
|
+
"""
|
|
69
|
+
Minimum reward amount
|
|
70
|
+
"""
|
|
71
|
+
|
|
72
|
+
max_reward_amount: typing_extensions.Annotated[
|
|
73
|
+
typing.Optional[BrokerAmount], FieldMetadata(alias="maxRewardAmount")
|
|
74
|
+
] = pydantic.Field(default=None)
|
|
75
|
+
"""
|
|
76
|
+
Maximum reward amount
|
|
77
|
+
"""
|
|
78
|
+
|
|
79
|
+
min_user_reward_amount: typing_extensions.Annotated[
|
|
80
|
+
typing.Optional[BrokerAmount], FieldMetadata(alias="minUserRewardAmount")
|
|
81
|
+
] = pydantic.Field(default=None)
|
|
82
|
+
"""
|
|
83
|
+
Minimum user reward amount
|
|
84
|
+
"""
|
|
85
|
+
|
|
86
|
+
max_user_reward_amount: typing_extensions.Annotated[
|
|
87
|
+
typing.Optional[BrokerAmount], FieldMetadata(alias="maxUserRewardAmount")
|
|
88
|
+
] = pydantic.Field(default=None)
|
|
89
|
+
"""
|
|
90
|
+
Maximum user reward amount
|
|
91
|
+
"""
|
|
92
|
+
|
|
93
|
+
min_transaction_amount: typing_extensions.Annotated[
|
|
94
|
+
typing.Optional[BrokerAmount], FieldMetadata(alias="minTransactionAmount")
|
|
95
|
+
] = pydantic.Field(default=None)
|
|
96
|
+
"""
|
|
97
|
+
Minimum transaction amount
|
|
98
|
+
"""
|
|
99
|
+
|
|
100
|
+
max_transaction_amount: typing_extensions.Annotated[
|
|
101
|
+
typing.Optional[BrokerAmount], FieldMetadata(alias="maxTransactionAmount")
|
|
102
|
+
] = pydantic.Field(default=None)
|
|
103
|
+
"""
|
|
104
|
+
Maximum transaction amount
|
|
105
|
+
"""
|
|
106
|
+
|
|
107
|
+
max_redemptions: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="maxRedemptions")] = (
|
|
108
|
+
pydantic.Field(default=None)
|
|
109
|
+
)
|
|
110
|
+
"""
|
|
111
|
+
Maximum number of times the offer can be redeemed
|
|
112
|
+
"""
|
|
113
|
+
|
|
114
|
+
valid_mc_cs: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="validMCCs")] = (
|
|
115
|
+
pydantic.Field(default=None)
|
|
116
|
+
)
|
|
117
|
+
"""
|
|
118
|
+
Required MCCs to redeem the offer. If this is empty or not present no MCCs are required.
|
|
119
|
+
"""
|
|
120
|
+
|
|
121
|
+
is_targeted: typing_extensions.Annotated[bool, FieldMetadata(alias="isTargeted")] = pydantic.Field()
|
|
122
|
+
"""
|
|
123
|
+
Whether the offer is targeted to specific users
|
|
124
|
+
"""
|
|
125
|
+
|
|
126
|
+
updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field()
|
|
127
|
+
"""
|
|
128
|
+
When the offer was last updated
|
|
129
|
+
"""
|
|
130
|
+
|
|
131
|
+
created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field()
|
|
132
|
+
"""
|
|
133
|
+
When the offer was created
|
|
134
|
+
"""
|
|
135
|
+
|
|
136
|
+
if IS_PYDANTIC_V2:
|
|
137
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
138
|
+
else:
|
|
139
|
+
|
|
140
|
+
class Config:
|
|
141
|
+
frozen = True
|
|
142
|
+
smart_union = True
|
|
143
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
from .webhook_offer_attributes import WebhookOfferAttributes
|
|
8
|
+
from .webhook_offer_relationships import WebhookOfferRelationships
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class WebhookOfferData(UniversalBaseModel):
|
|
12
|
+
id: str = pydantic.Field()
|
|
13
|
+
"""
|
|
14
|
+
The internal ID of the notification
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
attributes: WebhookOfferAttributes
|
|
18
|
+
relationships: WebhookOfferRelationships
|
|
19
|
+
|
|
20
|
+
if IS_PYDANTIC_V2:
|
|
21
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
22
|
+
else:
|
|
23
|
+
|
|
24
|
+
class Config:
|
|
25
|
+
frozen = True
|
|
26
|
+
smart_union = True
|
|
27
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import pydantic
|
|
6
|
+
from ...commons.types.relationship_single import RelationshipSingle
|
|
7
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class WebhookOfferRelationships(UniversalBaseModel):
|
|
11
|
+
merchant: RelationshipSingle
|
|
12
|
+
|
|
13
|
+
if IS_PYDANTIC_V2:
|
|
14
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
15
|
+
else:
|
|
16
|
+
|
|
17
|
+
class Config:
|
|
18
|
+
frozen = True
|
|
19
|
+
smart_union = True
|
|
20
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
import pydantic
|
|
7
|
+
import typing_extensions
|
|
8
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
9
|
+
from ...core.serialization import FieldMetadata
|
|
10
|
+
from .user_offer_status import UserOfferStatus
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class WebhookUserOfferAttributes(UniversalBaseModel):
|
|
14
|
+
status: UserOfferStatus = pydantic.Field()
|
|
15
|
+
"""
|
|
16
|
+
Current status of the user offer
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field()
|
|
20
|
+
"""
|
|
21
|
+
When the user offer was last updated
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field()
|
|
25
|
+
"""
|
|
26
|
+
When the user offer was created
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
event_priority: typing_extensions.Annotated[float, FieldMetadata(alias="eventPriority")] = pydantic.Field()
|
|
30
|
+
"""
|
|
31
|
+
The priority of the notification event. This will be a number between 1-10 with 1 being the highest priority.
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
if IS_PYDANTIC_V2:
|
|
35
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
36
|
+
else:
|
|
37
|
+
|
|
38
|
+
class Config:
|
|
39
|
+
frozen = True
|
|
40
|
+
smart_union = True
|
|
41
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
from .webhook_user_offer_attributes import WebhookUserOfferAttributes
|
|
8
|
+
from .webhook_user_offer_relationships import WebhookUserOfferRelationships
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class WebhookUserOfferData(UniversalBaseModel):
|
|
12
|
+
id: str = pydantic.Field()
|
|
13
|
+
"""
|
|
14
|
+
The internal ID of the notification
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
attributes: WebhookUserOfferAttributes
|
|
18
|
+
relationships: WebhookUserOfferRelationships
|
|
19
|
+
|
|
20
|
+
if IS_PYDANTIC_V2:
|
|
21
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
22
|
+
else:
|
|
23
|
+
|
|
24
|
+
class Config:
|
|
25
|
+
frozen = True
|
|
26
|
+
smart_union = True
|
|
27
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import pydantic
|
|
6
|
+
from ...commons.types.relationship_single import RelationshipSingle
|
|
7
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class WebhookUserOfferRelationships(UniversalBaseModel):
|
|
11
|
+
offer: RelationshipSingle
|
|
12
|
+
user: RelationshipSingle
|
|
13
|
+
|
|
14
|
+
if IS_PYDANTIC_V2:
|
|
15
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
16
|
+
else:
|
|
17
|
+
|
|
18
|
+
class Config:
|
|
19
|
+
frozen = True
|
|
20
|
+
smart_union = True
|
|
21
|
+
extra = pydantic.Extra.allow
|
kard/ping/__init__.py
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
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 NetworkBlockedErrorBody, PingResponseObject
|
|
10
|
+
from .errors import NetworkBlockedError
|
|
11
|
+
_dynamic_imports: typing.Dict[str, str] = {
|
|
12
|
+
"NetworkBlockedError": ".errors",
|
|
13
|
+
"NetworkBlockedErrorBody": ".types",
|
|
14
|
+
"PingResponseObject": ".types",
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def __getattr__(attr_name: str) -> typing.Any:
|
|
19
|
+
module_name = _dynamic_imports.get(attr_name)
|
|
20
|
+
if module_name is None:
|
|
21
|
+
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
|
|
22
|
+
try:
|
|
23
|
+
module = import_module(module_name, __package__)
|
|
24
|
+
if module_name == f".{attr_name}":
|
|
25
|
+
return module
|
|
26
|
+
else:
|
|
27
|
+
return getattr(module, attr_name)
|
|
28
|
+
except ImportError as e:
|
|
29
|
+
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
|
|
30
|
+
except AttributeError as e:
|
|
31
|
+
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def __dir__():
|
|
35
|
+
lazy_attrs = list(_dynamic_imports.keys())
|
|
36
|
+
return sorted(lazy_attrs)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
__all__ = ["NetworkBlockedError", "NetworkBlockedErrorBody", "PingResponseObject"]
|
kard/ping/client.py
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
6
|
+
from ..core.request_options import RequestOptions
|
|
7
|
+
from .raw_client import AsyncRawPingClient, RawPingClient
|
|
8
|
+
from .types.ping_response_object import PingResponseObject
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class PingClient:
|
|
12
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
13
|
+
self._raw_client = RawPingClient(client_wrapper=client_wrapper)
|
|
14
|
+
|
|
15
|
+
@property
|
|
16
|
+
def with_raw_response(self) -> RawPingClient:
|
|
17
|
+
"""
|
|
18
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
19
|
+
|
|
20
|
+
Returns
|
|
21
|
+
-------
|
|
22
|
+
RawPingClient
|
|
23
|
+
"""
|
|
24
|
+
return self._raw_client
|
|
25
|
+
|
|
26
|
+
def ping(self, *, request_options: typing.Optional[RequestOptions] = None) -> PingResponseObject:
|
|
27
|
+
"""
|
|
28
|
+
Call this endpoint to verify network connectivity and service availability.
|
|
29
|
+
|
|
30
|
+
Parameters
|
|
31
|
+
----------
|
|
32
|
+
request_options : typing.Optional[RequestOptions]
|
|
33
|
+
Request-specific configuration.
|
|
34
|
+
|
|
35
|
+
Returns
|
|
36
|
+
-------
|
|
37
|
+
PingResponseObject
|
|
38
|
+
|
|
39
|
+
Examples
|
|
40
|
+
--------
|
|
41
|
+
from kard import KardApi
|
|
42
|
+
|
|
43
|
+
client = KardApi(
|
|
44
|
+
client_id="YOUR_CLIENT_ID",
|
|
45
|
+
client_secret="YOUR_CLIENT_SECRET",
|
|
46
|
+
)
|
|
47
|
+
client.ping.ping()
|
|
48
|
+
"""
|
|
49
|
+
_response = self._raw_client.ping(request_options=request_options)
|
|
50
|
+
return _response.data
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class AsyncPingClient:
|
|
54
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
55
|
+
self._raw_client = AsyncRawPingClient(client_wrapper=client_wrapper)
|
|
56
|
+
|
|
57
|
+
@property
|
|
58
|
+
def with_raw_response(self) -> AsyncRawPingClient:
|
|
59
|
+
"""
|
|
60
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
61
|
+
|
|
62
|
+
Returns
|
|
63
|
+
-------
|
|
64
|
+
AsyncRawPingClient
|
|
65
|
+
"""
|
|
66
|
+
return self._raw_client
|
|
67
|
+
|
|
68
|
+
async def ping(self, *, request_options: typing.Optional[RequestOptions] = None) -> PingResponseObject:
|
|
69
|
+
"""
|
|
70
|
+
Call this endpoint to verify network connectivity and service availability.
|
|
71
|
+
|
|
72
|
+
Parameters
|
|
73
|
+
----------
|
|
74
|
+
request_options : typing.Optional[RequestOptions]
|
|
75
|
+
Request-specific configuration.
|
|
76
|
+
|
|
77
|
+
Returns
|
|
78
|
+
-------
|
|
79
|
+
PingResponseObject
|
|
80
|
+
|
|
81
|
+
Examples
|
|
82
|
+
--------
|
|
83
|
+
import asyncio
|
|
84
|
+
|
|
85
|
+
from kard import AsyncKardApi
|
|
86
|
+
|
|
87
|
+
client = AsyncKardApi(
|
|
88
|
+
client_id="YOUR_CLIENT_ID",
|
|
89
|
+
client_secret="YOUR_CLIENT_SECRET",
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
async def main() -> None:
|
|
94
|
+
await client.ping.ping()
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
asyncio.run(main())
|
|
98
|
+
"""
|
|
99
|
+
_response = await self._raw_client.ping(request_options=request_options)
|
|
100
|
+
return _response.data
|