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,581 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
from json.decoder import JSONDecodeError
|
|
5
|
+
|
|
6
|
+
from ...commons.errors.conflict_error import ConflictError
|
|
7
|
+
from ...commons.errors.does_not_exist_error import DoesNotExistError
|
|
8
|
+
from ...commons.errors.internal_server_error import InternalServerError
|
|
9
|
+
from ...commons.errors.invalid_request import InvalidRequest
|
|
10
|
+
from ...commons.errors.unauthorized_error import UnauthorizedError
|
|
11
|
+
from ...commons.types.error_response import ErrorResponse
|
|
12
|
+
from ...commons.types.notification_type import NotificationType
|
|
13
|
+
from ...commons.types.organization_id import OrganizationId
|
|
14
|
+
from ...commons.types.subscription_id import SubscriptionId
|
|
15
|
+
from ...core.api_error import ApiError
|
|
16
|
+
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
17
|
+
from ...core.http_response import AsyncHttpResponse, HttpResponse
|
|
18
|
+
from ...core.jsonable_encoder import jsonable_encoder
|
|
19
|
+
from ...core.pydantic_utilities import parse_obj_as
|
|
20
|
+
from ...core.request_options import RequestOptions
|
|
21
|
+
from ...core.serialization import convert_and_respect_annotation_metadata
|
|
22
|
+
from .types.create_subscriptions_response_object import CreateSubscriptionsResponseObject
|
|
23
|
+
from .types.subscription_request_union import SubscriptionRequestUnion
|
|
24
|
+
from .types.subscriptions_response_object import SubscriptionsResponseObject
|
|
25
|
+
from .types.update_subscription_request_union import UpdateSubscriptionRequestUnion
|
|
26
|
+
from .types.update_subscriptions_response_object import UpdateSubscriptionsResponseObject
|
|
27
|
+
|
|
28
|
+
# this is used as the default value for optional parameters
|
|
29
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class RawSubscriptionsClient:
|
|
33
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
34
|
+
self._client_wrapper = client_wrapper
|
|
35
|
+
|
|
36
|
+
def get(
|
|
37
|
+
self,
|
|
38
|
+
organization_id: OrganizationId,
|
|
39
|
+
*,
|
|
40
|
+
filter_event_name: typing.Optional[NotificationType] = None,
|
|
41
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
42
|
+
) -> HttpResponse[SubscriptionsResponseObject]:
|
|
43
|
+
"""
|
|
44
|
+
Call this endpoint to fetch the subscriptions of the provided issuer.<br/>
|
|
45
|
+
<b>Required scopes:</b> `notifications:read`
|
|
46
|
+
|
|
47
|
+
Parameters
|
|
48
|
+
----------
|
|
49
|
+
organization_id : OrganizationId
|
|
50
|
+
|
|
51
|
+
filter_event_name : typing.Optional[NotificationType]
|
|
52
|
+
|
|
53
|
+
request_options : typing.Optional[RequestOptions]
|
|
54
|
+
Request-specific configuration.
|
|
55
|
+
|
|
56
|
+
Returns
|
|
57
|
+
-------
|
|
58
|
+
HttpResponse[SubscriptionsResponseObject]
|
|
59
|
+
"""
|
|
60
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
61
|
+
f"v2/issuers/{jsonable_encoder(organization_id)}/subscriptions",
|
|
62
|
+
method="GET",
|
|
63
|
+
params={
|
|
64
|
+
"filter[eventName]": filter_event_name,
|
|
65
|
+
},
|
|
66
|
+
request_options=request_options,
|
|
67
|
+
)
|
|
68
|
+
try:
|
|
69
|
+
if 200 <= _response.status_code < 300:
|
|
70
|
+
_data = typing.cast(
|
|
71
|
+
SubscriptionsResponseObject,
|
|
72
|
+
parse_obj_as(
|
|
73
|
+
type_=SubscriptionsResponseObject, # type: ignore
|
|
74
|
+
object_=_response.json(),
|
|
75
|
+
),
|
|
76
|
+
)
|
|
77
|
+
return HttpResponse(response=_response, data=_data)
|
|
78
|
+
if _response.status_code == 400:
|
|
79
|
+
raise InvalidRequest(
|
|
80
|
+
headers=dict(_response.headers),
|
|
81
|
+
body=typing.cast(
|
|
82
|
+
ErrorResponse,
|
|
83
|
+
parse_obj_as(
|
|
84
|
+
type_=ErrorResponse, # type: ignore
|
|
85
|
+
object_=_response.json(),
|
|
86
|
+
),
|
|
87
|
+
),
|
|
88
|
+
)
|
|
89
|
+
if _response.status_code == 401:
|
|
90
|
+
raise UnauthorizedError(
|
|
91
|
+
headers=dict(_response.headers),
|
|
92
|
+
body=typing.cast(
|
|
93
|
+
ErrorResponse,
|
|
94
|
+
parse_obj_as(
|
|
95
|
+
type_=ErrorResponse, # type: ignore
|
|
96
|
+
object_=_response.json(),
|
|
97
|
+
),
|
|
98
|
+
),
|
|
99
|
+
)
|
|
100
|
+
if _response.status_code == 500:
|
|
101
|
+
raise InternalServerError(
|
|
102
|
+
headers=dict(_response.headers),
|
|
103
|
+
body=typing.cast(
|
|
104
|
+
ErrorResponse,
|
|
105
|
+
parse_obj_as(
|
|
106
|
+
type_=ErrorResponse, # type: ignore
|
|
107
|
+
object_=_response.json(),
|
|
108
|
+
),
|
|
109
|
+
),
|
|
110
|
+
)
|
|
111
|
+
_response_json = _response.json()
|
|
112
|
+
except JSONDecodeError:
|
|
113
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
114
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
115
|
+
|
|
116
|
+
def create(
|
|
117
|
+
self,
|
|
118
|
+
organization_id: OrganizationId,
|
|
119
|
+
*,
|
|
120
|
+
data: typing.Sequence[SubscriptionRequestUnion],
|
|
121
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
122
|
+
) -> HttpResponse[CreateSubscriptionsResponseObject]:
|
|
123
|
+
"""
|
|
124
|
+
Call this endpoint to subscribe to notification events.<br/>
|
|
125
|
+
<b>Required scopes:</b> `notifications:write`
|
|
126
|
+
|
|
127
|
+
Parameters
|
|
128
|
+
----------
|
|
129
|
+
organization_id : OrganizationId
|
|
130
|
+
|
|
131
|
+
data : typing.Sequence[SubscriptionRequestUnion]
|
|
132
|
+
|
|
133
|
+
request_options : typing.Optional[RequestOptions]
|
|
134
|
+
Request-specific configuration.
|
|
135
|
+
|
|
136
|
+
Returns
|
|
137
|
+
-------
|
|
138
|
+
HttpResponse[CreateSubscriptionsResponseObject]
|
|
139
|
+
"""
|
|
140
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
141
|
+
f"v2/issuers/{jsonable_encoder(organization_id)}/subscriptions",
|
|
142
|
+
method="POST",
|
|
143
|
+
json={
|
|
144
|
+
"data": convert_and_respect_annotation_metadata(
|
|
145
|
+
object_=data, annotation=typing.Sequence[SubscriptionRequestUnion], direction="write"
|
|
146
|
+
),
|
|
147
|
+
},
|
|
148
|
+
request_options=request_options,
|
|
149
|
+
omit=OMIT,
|
|
150
|
+
)
|
|
151
|
+
try:
|
|
152
|
+
if 200 <= _response.status_code < 300:
|
|
153
|
+
_data = typing.cast(
|
|
154
|
+
CreateSubscriptionsResponseObject,
|
|
155
|
+
parse_obj_as(
|
|
156
|
+
type_=CreateSubscriptionsResponseObject, # type: ignore
|
|
157
|
+
object_=_response.json(),
|
|
158
|
+
),
|
|
159
|
+
)
|
|
160
|
+
return HttpResponse(response=_response, data=_data)
|
|
161
|
+
if _response.status_code == 401:
|
|
162
|
+
raise UnauthorizedError(
|
|
163
|
+
headers=dict(_response.headers),
|
|
164
|
+
body=typing.cast(
|
|
165
|
+
ErrorResponse,
|
|
166
|
+
parse_obj_as(
|
|
167
|
+
type_=ErrorResponse, # type: ignore
|
|
168
|
+
object_=_response.json(),
|
|
169
|
+
),
|
|
170
|
+
),
|
|
171
|
+
)
|
|
172
|
+
if _response.status_code == 500:
|
|
173
|
+
raise InternalServerError(
|
|
174
|
+
headers=dict(_response.headers),
|
|
175
|
+
body=typing.cast(
|
|
176
|
+
ErrorResponse,
|
|
177
|
+
parse_obj_as(
|
|
178
|
+
type_=ErrorResponse, # type: ignore
|
|
179
|
+
object_=_response.json(),
|
|
180
|
+
),
|
|
181
|
+
),
|
|
182
|
+
)
|
|
183
|
+
if _response.status_code == 400:
|
|
184
|
+
raise InvalidRequest(
|
|
185
|
+
headers=dict(_response.headers),
|
|
186
|
+
body=typing.cast(
|
|
187
|
+
ErrorResponse,
|
|
188
|
+
parse_obj_as(
|
|
189
|
+
type_=ErrorResponse, # type: ignore
|
|
190
|
+
object_=_response.json(),
|
|
191
|
+
),
|
|
192
|
+
),
|
|
193
|
+
)
|
|
194
|
+
if _response.status_code == 409:
|
|
195
|
+
raise ConflictError(
|
|
196
|
+
headers=dict(_response.headers),
|
|
197
|
+
body=typing.cast(
|
|
198
|
+
ErrorResponse,
|
|
199
|
+
parse_obj_as(
|
|
200
|
+
type_=ErrorResponse, # type: ignore
|
|
201
|
+
object_=_response.json(),
|
|
202
|
+
),
|
|
203
|
+
),
|
|
204
|
+
)
|
|
205
|
+
_response_json = _response.json()
|
|
206
|
+
except JSONDecodeError:
|
|
207
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
208
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
209
|
+
|
|
210
|
+
def update(
|
|
211
|
+
self,
|
|
212
|
+
organization_id: OrganizationId,
|
|
213
|
+
subscription_id: SubscriptionId,
|
|
214
|
+
*,
|
|
215
|
+
data: UpdateSubscriptionRequestUnion,
|
|
216
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
217
|
+
) -> HttpResponse[UpdateSubscriptionsResponseObject]:
|
|
218
|
+
"""
|
|
219
|
+
Call this endpoint to update existing notification subscriptions.<br/>
|
|
220
|
+
<b>Required scopes:</b> `notifications:write`
|
|
221
|
+
|
|
222
|
+
Parameters
|
|
223
|
+
----------
|
|
224
|
+
organization_id : OrganizationId
|
|
225
|
+
|
|
226
|
+
subscription_id : SubscriptionId
|
|
227
|
+
|
|
228
|
+
data : UpdateSubscriptionRequestUnion
|
|
229
|
+
|
|
230
|
+
request_options : typing.Optional[RequestOptions]
|
|
231
|
+
Request-specific configuration.
|
|
232
|
+
|
|
233
|
+
Returns
|
|
234
|
+
-------
|
|
235
|
+
HttpResponse[UpdateSubscriptionsResponseObject]
|
|
236
|
+
"""
|
|
237
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
238
|
+
f"v2/issuers/{jsonable_encoder(organization_id)}/subscriptions/{jsonable_encoder(subscription_id)}",
|
|
239
|
+
method="PATCH",
|
|
240
|
+
json={
|
|
241
|
+
"data": convert_and_respect_annotation_metadata(
|
|
242
|
+
object_=data, annotation=UpdateSubscriptionRequestUnion, direction="write"
|
|
243
|
+
),
|
|
244
|
+
},
|
|
245
|
+
request_options=request_options,
|
|
246
|
+
omit=OMIT,
|
|
247
|
+
)
|
|
248
|
+
try:
|
|
249
|
+
if 200 <= _response.status_code < 300:
|
|
250
|
+
_data = typing.cast(
|
|
251
|
+
UpdateSubscriptionsResponseObject,
|
|
252
|
+
parse_obj_as(
|
|
253
|
+
type_=UpdateSubscriptionsResponseObject, # type: ignore
|
|
254
|
+
object_=_response.json(),
|
|
255
|
+
),
|
|
256
|
+
)
|
|
257
|
+
return HttpResponse(response=_response, data=_data)
|
|
258
|
+
if _response.status_code == 401:
|
|
259
|
+
raise UnauthorizedError(
|
|
260
|
+
headers=dict(_response.headers),
|
|
261
|
+
body=typing.cast(
|
|
262
|
+
ErrorResponse,
|
|
263
|
+
parse_obj_as(
|
|
264
|
+
type_=ErrorResponse, # type: ignore
|
|
265
|
+
object_=_response.json(),
|
|
266
|
+
),
|
|
267
|
+
),
|
|
268
|
+
)
|
|
269
|
+
if _response.status_code == 500:
|
|
270
|
+
raise InternalServerError(
|
|
271
|
+
headers=dict(_response.headers),
|
|
272
|
+
body=typing.cast(
|
|
273
|
+
ErrorResponse,
|
|
274
|
+
parse_obj_as(
|
|
275
|
+
type_=ErrorResponse, # type: ignore
|
|
276
|
+
object_=_response.json(),
|
|
277
|
+
),
|
|
278
|
+
),
|
|
279
|
+
)
|
|
280
|
+
if _response.status_code == 400:
|
|
281
|
+
raise InvalidRequest(
|
|
282
|
+
headers=dict(_response.headers),
|
|
283
|
+
body=typing.cast(
|
|
284
|
+
ErrorResponse,
|
|
285
|
+
parse_obj_as(
|
|
286
|
+
type_=ErrorResponse, # type: ignore
|
|
287
|
+
object_=_response.json(),
|
|
288
|
+
),
|
|
289
|
+
),
|
|
290
|
+
)
|
|
291
|
+
if _response.status_code == 404:
|
|
292
|
+
raise DoesNotExistError(
|
|
293
|
+
headers=dict(_response.headers),
|
|
294
|
+
body=typing.cast(
|
|
295
|
+
ErrorResponse,
|
|
296
|
+
parse_obj_as(
|
|
297
|
+
type_=ErrorResponse, # type: ignore
|
|
298
|
+
object_=_response.json(),
|
|
299
|
+
),
|
|
300
|
+
),
|
|
301
|
+
)
|
|
302
|
+
_response_json = _response.json()
|
|
303
|
+
except JSONDecodeError:
|
|
304
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
305
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
class AsyncRawSubscriptionsClient:
|
|
309
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
310
|
+
self._client_wrapper = client_wrapper
|
|
311
|
+
|
|
312
|
+
async def get(
|
|
313
|
+
self,
|
|
314
|
+
organization_id: OrganizationId,
|
|
315
|
+
*,
|
|
316
|
+
filter_event_name: typing.Optional[NotificationType] = None,
|
|
317
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
318
|
+
) -> AsyncHttpResponse[SubscriptionsResponseObject]:
|
|
319
|
+
"""
|
|
320
|
+
Call this endpoint to fetch the subscriptions of the provided issuer.<br/>
|
|
321
|
+
<b>Required scopes:</b> `notifications:read`
|
|
322
|
+
|
|
323
|
+
Parameters
|
|
324
|
+
----------
|
|
325
|
+
organization_id : OrganizationId
|
|
326
|
+
|
|
327
|
+
filter_event_name : typing.Optional[NotificationType]
|
|
328
|
+
|
|
329
|
+
request_options : typing.Optional[RequestOptions]
|
|
330
|
+
Request-specific configuration.
|
|
331
|
+
|
|
332
|
+
Returns
|
|
333
|
+
-------
|
|
334
|
+
AsyncHttpResponse[SubscriptionsResponseObject]
|
|
335
|
+
"""
|
|
336
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
337
|
+
f"v2/issuers/{jsonable_encoder(organization_id)}/subscriptions",
|
|
338
|
+
method="GET",
|
|
339
|
+
params={
|
|
340
|
+
"filter[eventName]": filter_event_name,
|
|
341
|
+
},
|
|
342
|
+
request_options=request_options,
|
|
343
|
+
)
|
|
344
|
+
try:
|
|
345
|
+
if 200 <= _response.status_code < 300:
|
|
346
|
+
_data = typing.cast(
|
|
347
|
+
SubscriptionsResponseObject,
|
|
348
|
+
parse_obj_as(
|
|
349
|
+
type_=SubscriptionsResponseObject, # type: ignore
|
|
350
|
+
object_=_response.json(),
|
|
351
|
+
),
|
|
352
|
+
)
|
|
353
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
354
|
+
if _response.status_code == 400:
|
|
355
|
+
raise InvalidRequest(
|
|
356
|
+
headers=dict(_response.headers),
|
|
357
|
+
body=typing.cast(
|
|
358
|
+
ErrorResponse,
|
|
359
|
+
parse_obj_as(
|
|
360
|
+
type_=ErrorResponse, # type: ignore
|
|
361
|
+
object_=_response.json(),
|
|
362
|
+
),
|
|
363
|
+
),
|
|
364
|
+
)
|
|
365
|
+
if _response.status_code == 401:
|
|
366
|
+
raise UnauthorizedError(
|
|
367
|
+
headers=dict(_response.headers),
|
|
368
|
+
body=typing.cast(
|
|
369
|
+
ErrorResponse,
|
|
370
|
+
parse_obj_as(
|
|
371
|
+
type_=ErrorResponse, # type: ignore
|
|
372
|
+
object_=_response.json(),
|
|
373
|
+
),
|
|
374
|
+
),
|
|
375
|
+
)
|
|
376
|
+
if _response.status_code == 500:
|
|
377
|
+
raise InternalServerError(
|
|
378
|
+
headers=dict(_response.headers),
|
|
379
|
+
body=typing.cast(
|
|
380
|
+
ErrorResponse,
|
|
381
|
+
parse_obj_as(
|
|
382
|
+
type_=ErrorResponse, # type: ignore
|
|
383
|
+
object_=_response.json(),
|
|
384
|
+
),
|
|
385
|
+
),
|
|
386
|
+
)
|
|
387
|
+
_response_json = _response.json()
|
|
388
|
+
except JSONDecodeError:
|
|
389
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
390
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
391
|
+
|
|
392
|
+
async def create(
|
|
393
|
+
self,
|
|
394
|
+
organization_id: OrganizationId,
|
|
395
|
+
*,
|
|
396
|
+
data: typing.Sequence[SubscriptionRequestUnion],
|
|
397
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
398
|
+
) -> AsyncHttpResponse[CreateSubscriptionsResponseObject]:
|
|
399
|
+
"""
|
|
400
|
+
Call this endpoint to subscribe to notification events.<br/>
|
|
401
|
+
<b>Required scopes:</b> `notifications:write`
|
|
402
|
+
|
|
403
|
+
Parameters
|
|
404
|
+
----------
|
|
405
|
+
organization_id : OrganizationId
|
|
406
|
+
|
|
407
|
+
data : typing.Sequence[SubscriptionRequestUnion]
|
|
408
|
+
|
|
409
|
+
request_options : typing.Optional[RequestOptions]
|
|
410
|
+
Request-specific configuration.
|
|
411
|
+
|
|
412
|
+
Returns
|
|
413
|
+
-------
|
|
414
|
+
AsyncHttpResponse[CreateSubscriptionsResponseObject]
|
|
415
|
+
"""
|
|
416
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
417
|
+
f"v2/issuers/{jsonable_encoder(organization_id)}/subscriptions",
|
|
418
|
+
method="POST",
|
|
419
|
+
json={
|
|
420
|
+
"data": convert_and_respect_annotation_metadata(
|
|
421
|
+
object_=data, annotation=typing.Sequence[SubscriptionRequestUnion], direction="write"
|
|
422
|
+
),
|
|
423
|
+
},
|
|
424
|
+
request_options=request_options,
|
|
425
|
+
omit=OMIT,
|
|
426
|
+
)
|
|
427
|
+
try:
|
|
428
|
+
if 200 <= _response.status_code < 300:
|
|
429
|
+
_data = typing.cast(
|
|
430
|
+
CreateSubscriptionsResponseObject,
|
|
431
|
+
parse_obj_as(
|
|
432
|
+
type_=CreateSubscriptionsResponseObject, # type: ignore
|
|
433
|
+
object_=_response.json(),
|
|
434
|
+
),
|
|
435
|
+
)
|
|
436
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
437
|
+
if _response.status_code == 401:
|
|
438
|
+
raise UnauthorizedError(
|
|
439
|
+
headers=dict(_response.headers),
|
|
440
|
+
body=typing.cast(
|
|
441
|
+
ErrorResponse,
|
|
442
|
+
parse_obj_as(
|
|
443
|
+
type_=ErrorResponse, # type: ignore
|
|
444
|
+
object_=_response.json(),
|
|
445
|
+
),
|
|
446
|
+
),
|
|
447
|
+
)
|
|
448
|
+
if _response.status_code == 500:
|
|
449
|
+
raise InternalServerError(
|
|
450
|
+
headers=dict(_response.headers),
|
|
451
|
+
body=typing.cast(
|
|
452
|
+
ErrorResponse,
|
|
453
|
+
parse_obj_as(
|
|
454
|
+
type_=ErrorResponse, # type: ignore
|
|
455
|
+
object_=_response.json(),
|
|
456
|
+
),
|
|
457
|
+
),
|
|
458
|
+
)
|
|
459
|
+
if _response.status_code == 400:
|
|
460
|
+
raise InvalidRequest(
|
|
461
|
+
headers=dict(_response.headers),
|
|
462
|
+
body=typing.cast(
|
|
463
|
+
ErrorResponse,
|
|
464
|
+
parse_obj_as(
|
|
465
|
+
type_=ErrorResponse, # type: ignore
|
|
466
|
+
object_=_response.json(),
|
|
467
|
+
),
|
|
468
|
+
),
|
|
469
|
+
)
|
|
470
|
+
if _response.status_code == 409:
|
|
471
|
+
raise ConflictError(
|
|
472
|
+
headers=dict(_response.headers),
|
|
473
|
+
body=typing.cast(
|
|
474
|
+
ErrorResponse,
|
|
475
|
+
parse_obj_as(
|
|
476
|
+
type_=ErrorResponse, # type: ignore
|
|
477
|
+
object_=_response.json(),
|
|
478
|
+
),
|
|
479
|
+
),
|
|
480
|
+
)
|
|
481
|
+
_response_json = _response.json()
|
|
482
|
+
except JSONDecodeError:
|
|
483
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
484
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
485
|
+
|
|
486
|
+
async def update(
|
|
487
|
+
self,
|
|
488
|
+
organization_id: OrganizationId,
|
|
489
|
+
subscription_id: SubscriptionId,
|
|
490
|
+
*,
|
|
491
|
+
data: UpdateSubscriptionRequestUnion,
|
|
492
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
493
|
+
) -> AsyncHttpResponse[UpdateSubscriptionsResponseObject]:
|
|
494
|
+
"""
|
|
495
|
+
Call this endpoint to update existing notification subscriptions.<br/>
|
|
496
|
+
<b>Required scopes:</b> `notifications:write`
|
|
497
|
+
|
|
498
|
+
Parameters
|
|
499
|
+
----------
|
|
500
|
+
organization_id : OrganizationId
|
|
501
|
+
|
|
502
|
+
subscription_id : SubscriptionId
|
|
503
|
+
|
|
504
|
+
data : UpdateSubscriptionRequestUnion
|
|
505
|
+
|
|
506
|
+
request_options : typing.Optional[RequestOptions]
|
|
507
|
+
Request-specific configuration.
|
|
508
|
+
|
|
509
|
+
Returns
|
|
510
|
+
-------
|
|
511
|
+
AsyncHttpResponse[UpdateSubscriptionsResponseObject]
|
|
512
|
+
"""
|
|
513
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
514
|
+
f"v2/issuers/{jsonable_encoder(organization_id)}/subscriptions/{jsonable_encoder(subscription_id)}",
|
|
515
|
+
method="PATCH",
|
|
516
|
+
json={
|
|
517
|
+
"data": convert_and_respect_annotation_metadata(
|
|
518
|
+
object_=data, annotation=UpdateSubscriptionRequestUnion, direction="write"
|
|
519
|
+
),
|
|
520
|
+
},
|
|
521
|
+
request_options=request_options,
|
|
522
|
+
omit=OMIT,
|
|
523
|
+
)
|
|
524
|
+
try:
|
|
525
|
+
if 200 <= _response.status_code < 300:
|
|
526
|
+
_data = typing.cast(
|
|
527
|
+
UpdateSubscriptionsResponseObject,
|
|
528
|
+
parse_obj_as(
|
|
529
|
+
type_=UpdateSubscriptionsResponseObject, # type: ignore
|
|
530
|
+
object_=_response.json(),
|
|
531
|
+
),
|
|
532
|
+
)
|
|
533
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
534
|
+
if _response.status_code == 401:
|
|
535
|
+
raise UnauthorizedError(
|
|
536
|
+
headers=dict(_response.headers),
|
|
537
|
+
body=typing.cast(
|
|
538
|
+
ErrorResponse,
|
|
539
|
+
parse_obj_as(
|
|
540
|
+
type_=ErrorResponse, # type: ignore
|
|
541
|
+
object_=_response.json(),
|
|
542
|
+
),
|
|
543
|
+
),
|
|
544
|
+
)
|
|
545
|
+
if _response.status_code == 500:
|
|
546
|
+
raise InternalServerError(
|
|
547
|
+
headers=dict(_response.headers),
|
|
548
|
+
body=typing.cast(
|
|
549
|
+
ErrorResponse,
|
|
550
|
+
parse_obj_as(
|
|
551
|
+
type_=ErrorResponse, # type: ignore
|
|
552
|
+
object_=_response.json(),
|
|
553
|
+
),
|
|
554
|
+
),
|
|
555
|
+
)
|
|
556
|
+
if _response.status_code == 400:
|
|
557
|
+
raise InvalidRequest(
|
|
558
|
+
headers=dict(_response.headers),
|
|
559
|
+
body=typing.cast(
|
|
560
|
+
ErrorResponse,
|
|
561
|
+
parse_obj_as(
|
|
562
|
+
type_=ErrorResponse, # type: ignore
|
|
563
|
+
object_=_response.json(),
|
|
564
|
+
),
|
|
565
|
+
),
|
|
566
|
+
)
|
|
567
|
+
if _response.status_code == 404:
|
|
568
|
+
raise DoesNotExistError(
|
|
569
|
+
headers=dict(_response.headers),
|
|
570
|
+
body=typing.cast(
|
|
571
|
+
ErrorResponse,
|
|
572
|
+
parse_obj_as(
|
|
573
|
+
type_=ErrorResponse, # type: ignore
|
|
574
|
+
object_=_response.json(),
|
|
575
|
+
),
|
|
576
|
+
),
|
|
577
|
+
)
|
|
578
|
+
_response_json = _response.json()
|
|
579
|
+
except JSONDecodeError:
|
|
580
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
581
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
@@ -0,0 +1,94 @@
|
|
|
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 .create_subscription_union import CreateSubscriptionUnion, CreateSubscriptionUnion_Subscription
|
|
10
|
+
from .create_subscriptions_response_object import CreateSubscriptionsResponseObject
|
|
11
|
+
from .created_subscription import CreatedSubscription
|
|
12
|
+
from .subscription import Subscription
|
|
13
|
+
from .subscription_attributes import SubscriptionAttributes
|
|
14
|
+
from .subscription_request import SubscriptionRequest
|
|
15
|
+
from .subscription_request_attributes import SubscriptionRequestAttributes
|
|
16
|
+
from .subscription_request_body import SubscriptionRequestBody
|
|
17
|
+
from .subscription_request_union import SubscriptionRequestUnion, SubscriptionRequestUnion_Subscription
|
|
18
|
+
from .subscription_union import SubscriptionUnion, SubscriptionUnion_Subscription
|
|
19
|
+
from .subscriptions_response_object import SubscriptionsResponseObject
|
|
20
|
+
from .update_subscription_request import UpdateSubscriptionRequest
|
|
21
|
+
from .update_subscription_request_attributes import UpdateSubscriptionRequestAttributes
|
|
22
|
+
from .update_subscription_request_body import UpdateSubscriptionRequestBody
|
|
23
|
+
from .update_subscription_request_union import (
|
|
24
|
+
UpdateSubscriptionRequestUnion,
|
|
25
|
+
UpdateSubscriptionRequestUnion_Subscription,
|
|
26
|
+
)
|
|
27
|
+
from .update_subscriptions_response_object import UpdateSubscriptionsResponseObject
|
|
28
|
+
_dynamic_imports: typing.Dict[str, str] = {
|
|
29
|
+
"CreateSubscriptionUnion": ".create_subscription_union",
|
|
30
|
+
"CreateSubscriptionUnion_Subscription": ".create_subscription_union",
|
|
31
|
+
"CreateSubscriptionsResponseObject": ".create_subscriptions_response_object",
|
|
32
|
+
"CreatedSubscription": ".created_subscription",
|
|
33
|
+
"Subscription": ".subscription",
|
|
34
|
+
"SubscriptionAttributes": ".subscription_attributes",
|
|
35
|
+
"SubscriptionRequest": ".subscription_request",
|
|
36
|
+
"SubscriptionRequestAttributes": ".subscription_request_attributes",
|
|
37
|
+
"SubscriptionRequestBody": ".subscription_request_body",
|
|
38
|
+
"SubscriptionRequestUnion": ".subscription_request_union",
|
|
39
|
+
"SubscriptionRequestUnion_Subscription": ".subscription_request_union",
|
|
40
|
+
"SubscriptionUnion": ".subscription_union",
|
|
41
|
+
"SubscriptionUnion_Subscription": ".subscription_union",
|
|
42
|
+
"SubscriptionsResponseObject": ".subscriptions_response_object",
|
|
43
|
+
"UpdateSubscriptionRequest": ".update_subscription_request",
|
|
44
|
+
"UpdateSubscriptionRequestAttributes": ".update_subscription_request_attributes",
|
|
45
|
+
"UpdateSubscriptionRequestBody": ".update_subscription_request_body",
|
|
46
|
+
"UpdateSubscriptionRequestUnion": ".update_subscription_request_union",
|
|
47
|
+
"UpdateSubscriptionRequestUnion_Subscription": ".update_subscription_request_union",
|
|
48
|
+
"UpdateSubscriptionsResponseObject": ".update_subscriptions_response_object",
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def __getattr__(attr_name: str) -> typing.Any:
|
|
53
|
+
module_name = _dynamic_imports.get(attr_name)
|
|
54
|
+
if module_name is None:
|
|
55
|
+
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
|
|
56
|
+
try:
|
|
57
|
+
module = import_module(module_name, __package__)
|
|
58
|
+
if module_name == f".{attr_name}":
|
|
59
|
+
return module
|
|
60
|
+
else:
|
|
61
|
+
return getattr(module, attr_name)
|
|
62
|
+
except ImportError as e:
|
|
63
|
+
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
|
|
64
|
+
except AttributeError as e:
|
|
65
|
+
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def __dir__():
|
|
69
|
+
lazy_attrs = list(_dynamic_imports.keys())
|
|
70
|
+
return sorted(lazy_attrs)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
__all__ = [
|
|
74
|
+
"CreateSubscriptionUnion",
|
|
75
|
+
"CreateSubscriptionUnion_Subscription",
|
|
76
|
+
"CreateSubscriptionsResponseObject",
|
|
77
|
+
"CreatedSubscription",
|
|
78
|
+
"Subscription",
|
|
79
|
+
"SubscriptionAttributes",
|
|
80
|
+
"SubscriptionRequest",
|
|
81
|
+
"SubscriptionRequestAttributes",
|
|
82
|
+
"SubscriptionRequestBody",
|
|
83
|
+
"SubscriptionRequestUnion",
|
|
84
|
+
"SubscriptionRequestUnion_Subscription",
|
|
85
|
+
"SubscriptionUnion",
|
|
86
|
+
"SubscriptionUnion_Subscription",
|
|
87
|
+
"SubscriptionsResponseObject",
|
|
88
|
+
"UpdateSubscriptionRequest",
|
|
89
|
+
"UpdateSubscriptionRequestAttributes",
|
|
90
|
+
"UpdateSubscriptionRequestBody",
|
|
91
|
+
"UpdateSubscriptionRequestUnion",
|
|
92
|
+
"UpdateSubscriptionRequestUnion_Subscription",
|
|
93
|
+
"UpdateSubscriptionsResponseObject",
|
|
94
|
+
]
|