api-sdk-py 1.11.66__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.
- api_sdk_py/__init__.py +312 -0
- api_sdk_py/api/__init__.py +18 -0
- api_sdk_py/api/canvases_api.py +1605 -0
- api_sdk_py/api/compositions_api.py +11616 -0
- api_sdk_py/api/credits_api.py +628 -0
- api_sdk_py/api/entitlements_api.py +676 -0
- api_sdk_py/api/invoices_api.py +357 -0
- api_sdk_py/api/managed_users_api.py +5087 -0
- api_sdk_py/api/operations_api.py +305 -0
- api_sdk_py/api/partner_api.py +41365 -0
- api_sdk_py/api/partners_api.py +11156 -0
- api_sdk_py/api/public_embed_api.py +1938 -0
- api_sdk_py/api/tokens_api.py +283 -0
- api_sdk_py/api/uploads_api.py +1507 -0
- api_sdk_py/api/users_api.py +3649 -0
- api_sdk_py/api/widgets_api.py +1300 -0
- api_sdk_py/api_client.py +797 -0
- api_sdk_py/api_response.py +21 -0
- api_sdk_py/configuration.py +526 -0
- api_sdk_py/exceptions.py +199 -0
- api_sdk_py/models/__init__.py +282 -0
- api_sdk_py/models/account_credit_balance.py +96 -0
- api_sdk_py/models/account_credit_balance_response.py +99 -0
- api_sdk_py/models/account_credit_transaction.py +120 -0
- api_sdk_py/models/adapter_connection.py +112 -0
- api_sdk_py/models/adapter_connection_removal.py +87 -0
- api_sdk_py/models/add_ai_answers_knowledge_document201_response.py +99 -0
- api_sdk_py/models/add_ai_answers_knowledge_document_request.py +90 -0
- api_sdk_py/models/add_domain_request.py +87 -0
- api_sdk_py/models/ai_answers_knowledge.py +101 -0
- api_sdk_py/models/ai_answers_knowledge_document.py +113 -0
- api_sdk_py/models/ai_answers_knowledge_removal.py +87 -0
- api_sdk_py/models/ai_answers_knowledge_totals.py +93 -0
- api_sdk_py/models/api_key_scope.py +44 -0
- api_sdk_py/models/canvas.py +112 -0
- api_sdk_py/models/canvas_response.py +99 -0
- api_sdk_py/models/check_composition_access_response.py +99 -0
- api_sdk_py/models/check_composition_access_response_data.py +89 -0
- api_sdk_py/models/composition.py +133 -0
- api_sdk_py/models/composition_data_source.py +90 -0
- api_sdk_py/models/composition_data_source_response.py +99 -0
- api_sdk_py/models/composition_entries_description.py +99 -0
- api_sdk_py/models/composition_entries_description_response.py +99 -0
- api_sdk_py/models/composition_entries_reading.py +126 -0
- api_sdk_py/models/composition_entries_reading_response.py +99 -0
- api_sdk_py/models/composition_entry_aggregate_tally.py +122 -0
- api_sdk_py/models/composition_entry_aggregates_block.py +99 -0
- api_sdk_py/models/composition_entry_column.py +89 -0
- api_sdk_py/models/composition_entry_delete_success.py +93 -0
- api_sdk_py/models/composition_entry_delete_success_data.py +87 -0
- api_sdk_py/models/composition_entry_item.py +111 -0
- api_sdk_py/models/composition_entry_items_meta.py +106 -0
- api_sdk_py/models/composition_entry_items_page_success.py +103 -0
- api_sdk_py/models/composition_entry_table.py +105 -0
- api_sdk_py/models/composition_entry_tally.py +95 -0
- api_sdk_py/models/composition_response.py +99 -0
- api_sdk_py/models/composition_version.py +96 -0
- api_sdk_py/models/content_check_finding.py +93 -0
- api_sdk_py/models/content_item_write_result.py +101 -0
- api_sdk_py/models/content_item_write_result_validation_result.py +91 -0
- api_sdk_py/models/copy_partner_preset_request.py +88 -0
- api_sdk_py/models/create_canvas_request.py +118 -0
- api_sdk_py/models/create_composition_content_item201_response.py +99 -0
- api_sdk_py/models/create_composition_content_item_request.py +101 -0
- api_sdk_py/models/create_composition_database_record201_response.py +95 -0
- api_sdk_py/models/create_composition_from_preset_request.py +100 -0
- api_sdk_py/models/create_composition_from_widget201_response.py +99 -0
- api_sdk_py/models/create_composition_from_widget_request.py +102 -0
- api_sdk_py/models/create_user_api_key_request.py +106 -0
- api_sdk_py/models/create_widget201_response.py +99 -0
- api_sdk_py/models/create_widget201_response_data.py +207 -0
- api_sdk_py/models/created_user_api_key.py +117 -0
- api_sdk_py/models/created_user_api_key_response.py +99 -0
- api_sdk_py/models/delete_composition_content_item_response.py +99 -0
- api_sdk_py/models/delete_composition_content_item_response_data.py +89 -0
- api_sdk_py/models/delete_composition_data_source_response.py +99 -0
- api_sdk_py/models/delete_composition_data_source_response_data.py +87 -0
- api_sdk_py/models/delete_managed_user200_response.py +99 -0
- api_sdk_py/models/delete_personal_workspace_domain_response.py +99 -0
- api_sdk_py/models/delete_personal_workspace_domain_response_data.py +87 -0
- api_sdk_py/models/delete_user_api_key_response.py +99 -0
- api_sdk_py/models/delete_user_api_key_response_data.py +87 -0
- api_sdk_py/models/design_defaults.py +92 -0
- api_sdk_py/models/duplicate_composition202_response.py +99 -0
- api_sdk_py/models/duplicate_composition202_response_data.py +87 -0
- api_sdk_py/models/duplicate_composition_request.py +89 -0
- api_sdk_py/models/editor_session.py +122 -0
- api_sdk_py/models/editor_session_response.py +99 -0
- api_sdk_py/models/entitlement.py +118 -0
- api_sdk_py/models/error_detail.py +104 -0
- api_sdk_py/models/error_response.py +108 -0
- api_sdk_py/models/export_composition_entry_items200_response.py +103 -0
- api_sdk_py/models/export_composition_entry_items200_response_meta.py +89 -0
- api_sdk_py/models/get_ai_answers_knowledge200_response.py +99 -0
- api_sdk_py/models/get_all_canvases_response.py +99 -0
- api_sdk_py/models/get_all_canvases_response_data.py +101 -0
- api_sdk_py/models/get_all_compositions200_response.py +103 -0
- api_sdk_py/models/get_all_managed_users200_response.py +103 -0
- api_sdk_py/models/get_composition_content_response.py +95 -0
- api_sdk_py/models/get_composition_content_schema_response.py +99 -0
- api_sdk_py/models/get_composition_content_schema_response_data.py +97 -0
- api_sdk_py/models/get_composition_data_source_response.py +104 -0
- api_sdk_py/models/get_composition_database_records200_response.py +95 -0
- api_sdk_py/models/get_composition_design_response.py +95 -0
- api_sdk_py/models/get_composition_design_schema_response.py +99 -0
- api_sdk_py/models/get_composition_design_schema_response_data.py +97 -0
- api_sdk_py/models/get_composition_embed_schema_response.py +99 -0
- api_sdk_py/models/get_composition_embed_schema_response_data.py +107 -0
- api_sdk_py/models/get_composition_embed_settings_response.py +95 -0
- api_sdk_py/models/get_composition_preview_response.py +99 -0
- api_sdk_py/models/get_composition_preview_response_data.py +93 -0
- api_sdk_py/models/get_composition_versions200_response.py +103 -0
- api_sdk_py/models/get_compositions_batch_request.py +88 -0
- api_sdk_py/models/get_compositions_batch_response.py +99 -0
- api_sdk_py/models/get_compositions_batch_response_data.py +105 -0
- api_sdk_py/models/get_invoices_by_partner_id200_response.py +103 -0
- api_sdk_py/models/get_managed_user_entitlements_response.py +99 -0
- api_sdk_py/models/get_managed_user_entitlements_response_data.py +97 -0
- api_sdk_py/models/get_managed_user_limits200_response.py +99 -0
- api_sdk_py/models/get_managed_user_storage_usage200_response.py +99 -0
- api_sdk_py/models/get_managed_user_storage_usage200_response_data.py +95 -0
- api_sdk_py/models/get_managed_user_storage_usage200_response_data_by_purpose.py +106 -0
- api_sdk_py/models/get_managed_users_by_manager_id_response.py +99 -0
- api_sdk_py/models/get_managed_users_by_manager_id_response_data.py +101 -0
- api_sdk_py/models/get_partner_billing_overview200_response.py +99 -0
- api_sdk_py/models/get_partner_credit_transactions200_response.py +103 -0
- api_sdk_py/models/get_partner_design_defaults200_response.py +99 -0
- api_sdk_py/models/get_partner_entitlements_response.py +99 -0
- api_sdk_py/models/get_partner_entitlements_response_data.py +97 -0
- api_sdk_py/models/get_personal_workspace_domains200_response.py +103 -0
- api_sdk_py/models/get_public_composition_embed200_response.py +133 -0
- api_sdk_py/models/get_public_composition_embed200_response_data_source.py +89 -0
- api_sdk_py/models/get_public_composition_embed200_response_direct.py +96 -0
- api_sdk_py/models/get_user_adapter_connections200_response.py +103 -0
- api_sdk_py/models/get_user_api_key_usage_logs_response.py +99 -0
- api_sdk_py/models/get_user_api_key_usage_logs_response_data.py +95 -0
- api_sdk_py/models/get_user_api_keys200_response.py +103 -0
- api_sdk_py/models/get_widgets200_response.py +103 -0
- api_sdk_py/models/get_widgets_batch_request.py +87 -0
- api_sdk_py/models/get_widgets_batch_response.py +99 -0
- api_sdk_py/models/get_widgets_batch_response_data.py +105 -0
- api_sdk_py/models/get_widgets_batch_response_data_errors_inner.py +89 -0
- api_sdk_py/models/list_partner_presets200_response.py +103 -0
- api_sdk_py/models/managed_user.py +105 -0
- api_sdk_py/models/managed_user_entries_meta.py +100 -0
- api_sdk_py/models/managed_user_entries_page_success.py +103 -0
- api_sdk_py/models/managed_user_entry_item.py +115 -0
- api_sdk_py/models/managed_user_limits.py +104 -0
- api_sdk_py/models/managed_user_operation_usage.py +95 -0
- api_sdk_py/models/managed_user_removal.py +89 -0
- api_sdk_py/models/managed_user_response.py +99 -0
- api_sdk_py/models/managed_user_usage.py +110 -0
- api_sdk_py/models/managed_user_usage_response.py +99 -0
- api_sdk_py/models/managed_user_usage_totals.py +93 -0
- api_sdk_py/models/my_partner.py +136 -0
- api_sdk_py/models/my_partners.py +112 -0
- api_sdk_py/models/my_partners_response.py +99 -0
- api_sdk_py/models/new_composition.py +108 -0
- api_sdk_py/models/new_editor_session.py +107 -0
- api_sdk_py/models/new_managed_user.py +91 -0
- api_sdk_py/models/new_widget.py +118 -0
- api_sdk_py/models/operations_id_get_response.py +99 -0
- api_sdk_py/models/operations_id_get_response_data.py +113 -0
- api_sdk_py/models/partner_analytics_by_managed_user.py +109 -0
- api_sdk_py/models/partner_analytics_by_managed_user_response.py +99 -0
- api_sdk_py/models/partner_analytics_of_day.py +94 -0
- api_sdk_py/models/partner_analytics_of_managed_user.py +126 -0
- api_sdk_py/models/partner_analytics_of_widget.py +102 -0
- api_sdk_py/models/partner_analytics_summary.py +110 -0
- api_sdk_py/models/partner_analytics_summary_response.py +99 -0
- api_sdk_py/models/partner_analytics_timeline.py +110 -0
- api_sdk_py/models/partner_analytics_timeline_response.py +99 -0
- api_sdk_py/models/partner_analytics_top_widgets.py +110 -0
- api_sdk_py/models/partner_analytics_top_widgets_response.py +99 -0
- api_sdk_py/models/partner_billing_overview.py +114 -0
- api_sdk_py/models/partner_billing_overview_billing_integration.py +100 -0
- api_sdk_py/models/partner_billing_overview_operational_credits.py +101 -0
- api_sdk_py/models/partner_billing_overview_partner.py +100 -0
- api_sdk_py/models/partner_contract.py +158 -0
- api_sdk_py/models/partner_contract_response.py +99 -0
- api_sdk_py/models/partner_customization.py +140 -0
- api_sdk_py/models/partner_data_database.py +112 -0
- api_sdk_py/models/partner_data_database_removal.py +87 -0
- api_sdk_py/models/partner_data_database_removal_response.py +99 -0
- api_sdk_py/models/partner_data_database_response.py +99 -0
- api_sdk_py/models/partner_entry_context_secret.py +93 -0
- api_sdk_py/models/partner_entry_context_secret_response.py +99 -0
- api_sdk_py/models/partner_entry_context_signing.py +108 -0
- api_sdk_py/models/partner_entry_context_signing_response.py +99 -0
- api_sdk_py/models/partner_extra_credits_invoice.py +130 -0
- api_sdk_py/models/partner_extra_credits_invoice_response.py +99 -0
- api_sdk_py/models/partner_invoice.py +234 -0
- api_sdk_py/models/partner_notification.py +108 -0
- api_sdk_py/models/partner_notification_default_recipients.py +89 -0
- api_sdk_py/models/partner_notification_delivery.py +170 -0
- api_sdk_py/models/partner_notification_delivery_log.py +95 -0
- api_sdk_py/models/partner_notification_delivery_log_response.py +99 -0
- api_sdk_py/models/partner_notification_delivery_response.py +99 -0
- api_sdk_py/models/partner_notification_event.py +112 -0
- api_sdk_py/models/partner_notification_event_type.py +51 -0
- api_sdk_py/models/partner_notification_page.py +103 -0
- api_sdk_py/models/partner_notification_page_response.py +99 -0
- api_sdk_py/models/partner_notification_settings.py +139 -0
- api_sdk_py/models/partner_notification_settings_change.py +98 -0
- api_sdk_py/models/partner_notification_settings_change_response.py +99 -0
- api_sdk_py/models/partner_notification_settings_response.py +99 -0
- api_sdk_py/models/partner_notification_test_event_request.py +88 -0
- api_sdk_py/models/partner_notification_test_event_result.py +98 -0
- api_sdk_py/models/partner_notification_test_event_result_response.py +99 -0
- api_sdk_py/models/partner_preset.py +119 -0
- api_sdk_py/models/partner_preset_copy.py +97 -0
- api_sdk_py/models/partner_preset_copy_response.py +99 -0
- api_sdk_py/models/partner_preset_removal.py +87 -0
- api_sdk_py/models/partner_preset_removal_response.py +99 -0
- api_sdk_py/models/partner_preset_response.py +99 -0
- api_sdk_py/models/partner_report_page.py +91 -0
- api_sdk_py/models/partner_report_period.py +90 -0
- api_sdk_py/models/partner_storage_destination.py +120 -0
- api_sdk_py/models/partner_storage_destination_response.py +99 -0
- api_sdk_py/models/partner_storage_removal.py +87 -0
- api_sdk_py/models/partner_storage_removal_response.py +99 -0
- api_sdk_py/models/partner_storage_usage.py +109 -0
- api_sdk_py/models/partner_storage_usage_of_managed_user.py +129 -0
- api_sdk_py/models/partner_storage_usage_response.py +99 -0
- api_sdk_py/models/partner_storage_usage_totals.py +93 -0
- api_sdk_py/models/personal_workspace_domain.py +96 -0
- api_sdk_py/models/personal_workspace_domain_result.py +93 -0
- api_sdk_py/models/personal_workspace_domain_result_response.py +99 -0
- api_sdk_py/models/post_public_composition_embed_status200_response.py +99 -0
- api_sdk_py/models/post_public_composition_embed_status200_response_data.py +97 -0
- api_sdk_py/models/post_public_composition_embed_status_request.py +88 -0
- api_sdk_py/models/public_adapter_call_error.py +93 -0
- api_sdk_py/models/public_adapter_call_request.py +113 -0
- api_sdk_py/models/public_adapter_call_result.py +93 -0
- api_sdk_py/models/public_adapter_call_result_data.py +87 -0
- api_sdk_py/models/public_adapter_file_result.py +93 -0
- api_sdk_py/models/public_adapter_file_result_data.py +91 -0
- api_sdk_py/models/public_adapter_file_result_data_file.py +108 -0
- api_sdk_py/models/public_composition_entry_created.py +93 -0
- api_sdk_py/models/public_composition_entry_created_data.py +92 -0
- api_sdk_py/models/public_composition_entry_request.py +101 -0
- api_sdk_py/models/public_embed_failure.py +105 -0
- api_sdk_py/models/public_embed_failure_details.py +112 -0
- api_sdk_py/models/public_embed_failure_error.py +98 -0
- api_sdk_py/models/purpose_storage_bucket.py +89 -0
- api_sdk_py/models/remove_ai_answers_knowledge_document200_response.py +99 -0
- api_sdk_py/models/remove_user_adapter_connection200_response.py +99 -0
- api_sdk_py/models/request_extra_credits.py +88 -0
- api_sdk_py/models/response_meta.py +121 -0
- api_sdk_py/models/revoke_managed_user_editor_sessions_response.py +99 -0
- api_sdk_py/models/revoke_managed_user_editor_sessions_response_data.py +87 -0
- api_sdk_py/models/set_adapter_connection_request.py +88 -0
- api_sdk_py/models/set_composition_data_source_request.py +90 -0
- api_sdk_py/models/set_dynamic_content_request.py +95 -0
- api_sdk_py/models/set_dynamic_content_response.py +99 -0
- api_sdk_py/models/set_dynamic_content_response_data.py +99 -0
- api_sdk_py/models/set_dynamic_content_response_data_validation_result.py +91 -0
- api_sdk_py/models/set_managed_user_limits_request.py +93 -0
- api_sdk_py/models/set_partner_data_database_request.py +87 -0
- api_sdk_py/models/set_partner_design_defaults_request.py +92 -0
- api_sdk_py/models/set_partner_preset_request.py +104 -0
- api_sdk_py/models/set_partner_storage_destination_request.py +101 -0
- api_sdk_py/models/set_user_adapter_connection200_response.py +99 -0
- api_sdk_py/models/success_response.py +95 -0
- api_sdk_py/models/update_canvas_request.py +96 -0
- api_sdk_py/models/update_composition.py +101 -0
- api_sdk_py/models/update_composition_status_request.py +94 -0
- api_sdk_py/models/update_domain_request.py +87 -0
- api_sdk_py/models/update_managed_user.py +91 -0
- api_sdk_py/models/update_partner_entry_context_signing_request.py +87 -0
- api_sdk_py/models/update_partner_notification_settings_request.py +110 -0
- api_sdk_py/models/update_user_api_key_request.py +90 -0
- api_sdk_py/models/upload.py +167 -0
- api_sdk_py/models/upload_limits.py +97 -0
- api_sdk_py/models/upload_limits_response.py +99 -0
- api_sdk_py/models/upload_response.py +99 -0
- api_sdk_py/models/uploads_get200_response.py +103 -0
- api_sdk_py/models/uploads_id_delete200_response.py +99 -0
- api_sdk_py/models/uploads_id_delete200_response_data.py +87 -0
- api_sdk_py/models/user_api_key.py +122 -0
- api_sdk_py/models/user_api_key_response.py +99 -0
- api_sdk_py/models/user_api_key_usage_log.py +107 -0
- api_sdk_py/models/validate_composition_content_response.py +99 -0
- api_sdk_py/models/validate_composition_content_response_data.py +108 -0
- api_sdk_py/models/validate_token200_response.py +99 -0
- api_sdk_py/models/validate_token200_response_data.py +106 -0
- api_sdk_py/models/widget.py +205 -0
- api_sdk_py/py.typed +0 -0
- api_sdk_py/rest.py +257 -0
- api_sdk_py-1.11.66.dist-info/METADATA +28 -0
- api_sdk_py-1.11.66.dist-info/RECORD +294 -0
- api_sdk_py-1.11.66.dist-info/WHEEL +5 -0
- api_sdk_py-1.11.66.dist-info/licenses/LICENSE +122 -0
- api_sdk_py-1.11.66.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,628 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Widgetic API Gateway
|
|
5
|
+
|
|
6
|
+
API documentation for the Widgetic API Gateway
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
import warnings
|
|
15
|
+
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
|
16
|
+
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
17
|
+
from typing_extensions import Annotated
|
|
18
|
+
|
|
19
|
+
from pydantic import Field, StrictStr
|
|
20
|
+
from typing import Optional
|
|
21
|
+
from typing_extensions import Annotated
|
|
22
|
+
from api_sdk_py.models.account_credit_balance_response import AccountCreditBalanceResponse
|
|
23
|
+
from api_sdk_py.models.get_partner_credit_transactions200_response import GetPartnerCreditTransactions200Response
|
|
24
|
+
|
|
25
|
+
from api_sdk_py.api_client import ApiClient, RequestSerialized
|
|
26
|
+
from api_sdk_py.api_response import ApiResponse
|
|
27
|
+
from api_sdk_py.rest import RESTResponseType
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class CreditsApi:
|
|
31
|
+
"""NOTE: This class is auto generated by OpenAPI Generator
|
|
32
|
+
Ref: https://openapi-generator.tech
|
|
33
|
+
|
|
34
|
+
Do not edit the class manually.
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
def __init__(self, api_client=None) -> None:
|
|
38
|
+
if api_client is None:
|
|
39
|
+
api_client = ApiClient.get_default()
|
|
40
|
+
self.api_client = api_client
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
@validate_call
|
|
44
|
+
def get_user_credit_balance_0(
|
|
45
|
+
self,
|
|
46
|
+
user_id: Annotated[StrictStr, Field(description="The account whose balance to read")],
|
|
47
|
+
_request_timeout: Union[
|
|
48
|
+
None,
|
|
49
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
50
|
+
Tuple[
|
|
51
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
52
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
53
|
+
]
|
|
54
|
+
] = None,
|
|
55
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
56
|
+
_content_type: Optional[StrictStr] = None,
|
|
57
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
58
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
59
|
+
) -> AccountCreditBalanceResponse:
|
|
60
|
+
"""Get an account's credit balance
|
|
61
|
+
|
|
62
|
+
Returns the credits an account holds: the balance, and how much of it is reserved by operations that are still running. An account reads its own balance; with a partner's API key, that is the account of the person who administers the partner. Widgetic administrators can read any account's. An account that has never held credits reads a balance of 0. `getPartnerCreditBalance` reads this same balance by partner id.
|
|
63
|
+
|
|
64
|
+
:param user_id: The account whose balance to read (required)
|
|
65
|
+
:type user_id: str
|
|
66
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
67
|
+
number provided, it will be total request
|
|
68
|
+
timeout. It can also be a pair (tuple) of
|
|
69
|
+
(connection, read) timeouts.
|
|
70
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
71
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
72
|
+
request; this effectively ignores the
|
|
73
|
+
authentication in the spec for a single request.
|
|
74
|
+
:type _request_auth: dict, optional
|
|
75
|
+
:param _content_type: force content-type for the request.
|
|
76
|
+
:type _content_type: str, Optional
|
|
77
|
+
:param _headers: set to override the headers for a single
|
|
78
|
+
request; this effectively ignores the headers
|
|
79
|
+
in the spec for a single request.
|
|
80
|
+
:type _headers: dict, optional
|
|
81
|
+
:param _host_index: set to override the host_index for a single
|
|
82
|
+
request; this effectively ignores the host_index
|
|
83
|
+
in the spec for a single request.
|
|
84
|
+
:type _host_index: int, optional
|
|
85
|
+
:return: Returns the result object.
|
|
86
|
+
""" # noqa: E501
|
|
87
|
+
|
|
88
|
+
_param = self._get_user_credit_balance_0_serialize(
|
|
89
|
+
user_id=user_id,
|
|
90
|
+
_request_auth=_request_auth,
|
|
91
|
+
_content_type=_content_type,
|
|
92
|
+
_headers=_headers,
|
|
93
|
+
_host_index=_host_index
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
97
|
+
'200': "AccountCreditBalanceResponse",
|
|
98
|
+
'401': "ErrorResponse",
|
|
99
|
+
'403': "ErrorResponse",
|
|
100
|
+
'404': "ErrorResponse",
|
|
101
|
+
}
|
|
102
|
+
response_data = self.api_client.call_api(
|
|
103
|
+
*_param,
|
|
104
|
+
_request_timeout=_request_timeout
|
|
105
|
+
)
|
|
106
|
+
response_data.read()
|
|
107
|
+
return self.api_client.response_deserialize(
|
|
108
|
+
response_data=response_data,
|
|
109
|
+
response_types_map=_response_types_map,
|
|
110
|
+
).data
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
@validate_call
|
|
114
|
+
def get_user_credit_balance_0_with_http_info(
|
|
115
|
+
self,
|
|
116
|
+
user_id: Annotated[StrictStr, Field(description="The account whose balance to read")],
|
|
117
|
+
_request_timeout: Union[
|
|
118
|
+
None,
|
|
119
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
120
|
+
Tuple[
|
|
121
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
122
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
123
|
+
]
|
|
124
|
+
] = None,
|
|
125
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
126
|
+
_content_type: Optional[StrictStr] = None,
|
|
127
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
128
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
129
|
+
) -> ApiResponse[AccountCreditBalanceResponse]:
|
|
130
|
+
"""Get an account's credit balance
|
|
131
|
+
|
|
132
|
+
Returns the credits an account holds: the balance, and how much of it is reserved by operations that are still running. An account reads its own balance; with a partner's API key, that is the account of the person who administers the partner. Widgetic administrators can read any account's. An account that has never held credits reads a balance of 0. `getPartnerCreditBalance` reads this same balance by partner id.
|
|
133
|
+
|
|
134
|
+
:param user_id: The account whose balance to read (required)
|
|
135
|
+
:type user_id: str
|
|
136
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
137
|
+
number provided, it will be total request
|
|
138
|
+
timeout. It can also be a pair (tuple) of
|
|
139
|
+
(connection, read) timeouts.
|
|
140
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
141
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
142
|
+
request; this effectively ignores the
|
|
143
|
+
authentication in the spec for a single request.
|
|
144
|
+
:type _request_auth: dict, optional
|
|
145
|
+
:param _content_type: force content-type for the request.
|
|
146
|
+
:type _content_type: str, Optional
|
|
147
|
+
:param _headers: set to override the headers for a single
|
|
148
|
+
request; this effectively ignores the headers
|
|
149
|
+
in the spec for a single request.
|
|
150
|
+
:type _headers: dict, optional
|
|
151
|
+
:param _host_index: set to override the host_index for a single
|
|
152
|
+
request; this effectively ignores the host_index
|
|
153
|
+
in the spec for a single request.
|
|
154
|
+
:type _host_index: int, optional
|
|
155
|
+
:return: Returns the result object.
|
|
156
|
+
""" # noqa: E501
|
|
157
|
+
|
|
158
|
+
_param = self._get_user_credit_balance_0_serialize(
|
|
159
|
+
user_id=user_id,
|
|
160
|
+
_request_auth=_request_auth,
|
|
161
|
+
_content_type=_content_type,
|
|
162
|
+
_headers=_headers,
|
|
163
|
+
_host_index=_host_index
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
167
|
+
'200': "AccountCreditBalanceResponse",
|
|
168
|
+
'401': "ErrorResponse",
|
|
169
|
+
'403': "ErrorResponse",
|
|
170
|
+
'404': "ErrorResponse",
|
|
171
|
+
}
|
|
172
|
+
response_data = self.api_client.call_api(
|
|
173
|
+
*_param,
|
|
174
|
+
_request_timeout=_request_timeout
|
|
175
|
+
)
|
|
176
|
+
response_data.read()
|
|
177
|
+
return self.api_client.response_deserialize(
|
|
178
|
+
response_data=response_data,
|
|
179
|
+
response_types_map=_response_types_map,
|
|
180
|
+
)
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
@validate_call
|
|
184
|
+
def get_user_credit_balance_0_without_preload_content(
|
|
185
|
+
self,
|
|
186
|
+
user_id: Annotated[StrictStr, Field(description="The account whose balance to read")],
|
|
187
|
+
_request_timeout: Union[
|
|
188
|
+
None,
|
|
189
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
190
|
+
Tuple[
|
|
191
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
192
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
193
|
+
]
|
|
194
|
+
] = None,
|
|
195
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
196
|
+
_content_type: Optional[StrictStr] = None,
|
|
197
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
198
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
199
|
+
) -> RESTResponseType:
|
|
200
|
+
"""Get an account's credit balance
|
|
201
|
+
|
|
202
|
+
Returns the credits an account holds: the balance, and how much of it is reserved by operations that are still running. An account reads its own balance; with a partner's API key, that is the account of the person who administers the partner. Widgetic administrators can read any account's. An account that has never held credits reads a balance of 0. `getPartnerCreditBalance` reads this same balance by partner id.
|
|
203
|
+
|
|
204
|
+
:param user_id: The account whose balance to read (required)
|
|
205
|
+
:type user_id: str
|
|
206
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
207
|
+
number provided, it will be total request
|
|
208
|
+
timeout. It can also be a pair (tuple) of
|
|
209
|
+
(connection, read) timeouts.
|
|
210
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
211
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
212
|
+
request; this effectively ignores the
|
|
213
|
+
authentication in the spec for a single request.
|
|
214
|
+
:type _request_auth: dict, optional
|
|
215
|
+
:param _content_type: force content-type for the request.
|
|
216
|
+
:type _content_type: str, Optional
|
|
217
|
+
:param _headers: set to override the headers for a single
|
|
218
|
+
request; this effectively ignores the headers
|
|
219
|
+
in the spec for a single request.
|
|
220
|
+
:type _headers: dict, optional
|
|
221
|
+
:param _host_index: set to override the host_index for a single
|
|
222
|
+
request; this effectively ignores the host_index
|
|
223
|
+
in the spec for a single request.
|
|
224
|
+
:type _host_index: int, optional
|
|
225
|
+
:return: Returns the result object.
|
|
226
|
+
""" # noqa: E501
|
|
227
|
+
|
|
228
|
+
_param = self._get_user_credit_balance_0_serialize(
|
|
229
|
+
user_id=user_id,
|
|
230
|
+
_request_auth=_request_auth,
|
|
231
|
+
_content_type=_content_type,
|
|
232
|
+
_headers=_headers,
|
|
233
|
+
_host_index=_host_index
|
|
234
|
+
)
|
|
235
|
+
|
|
236
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
237
|
+
'200': "AccountCreditBalanceResponse",
|
|
238
|
+
'401': "ErrorResponse",
|
|
239
|
+
'403': "ErrorResponse",
|
|
240
|
+
'404': "ErrorResponse",
|
|
241
|
+
}
|
|
242
|
+
response_data = self.api_client.call_api(
|
|
243
|
+
*_param,
|
|
244
|
+
_request_timeout=_request_timeout
|
|
245
|
+
)
|
|
246
|
+
return response_data.response
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
def _get_user_credit_balance_0_serialize(
|
|
250
|
+
self,
|
|
251
|
+
user_id,
|
|
252
|
+
_request_auth,
|
|
253
|
+
_content_type,
|
|
254
|
+
_headers,
|
|
255
|
+
_host_index,
|
|
256
|
+
) -> RequestSerialized:
|
|
257
|
+
|
|
258
|
+
_host = None
|
|
259
|
+
|
|
260
|
+
_collection_formats: Dict[str, str] = {
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
_path_params: Dict[str, str] = {}
|
|
264
|
+
_query_params: List[Tuple[str, str]] = []
|
|
265
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
266
|
+
_form_params: List[Tuple[str, str]] = []
|
|
267
|
+
_files: Dict[
|
|
268
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
269
|
+
] = {}
|
|
270
|
+
_body_params: Optional[bytes] = None
|
|
271
|
+
|
|
272
|
+
# process the path parameters
|
|
273
|
+
if user_id is not None:
|
|
274
|
+
_path_params['userId'] = user_id
|
|
275
|
+
# process the query parameters
|
|
276
|
+
# process the header parameters
|
|
277
|
+
# process the form parameters
|
|
278
|
+
# process the body parameter
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
# set the HTTP header `Accept`
|
|
282
|
+
if 'Accept' not in _header_params:
|
|
283
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
284
|
+
[
|
|
285
|
+
'application/json'
|
|
286
|
+
]
|
|
287
|
+
)
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
# authentication setting
|
|
291
|
+
_auth_settings: List[str] = [
|
|
292
|
+
'apiKeyAuth'
|
|
293
|
+
]
|
|
294
|
+
|
|
295
|
+
return self.api_client.param_serialize(
|
|
296
|
+
method='GET',
|
|
297
|
+
resource_path='/credits/user/{userId}/balance',
|
|
298
|
+
path_params=_path_params,
|
|
299
|
+
query_params=_query_params,
|
|
300
|
+
header_params=_header_params,
|
|
301
|
+
body=_body_params,
|
|
302
|
+
post_params=_form_params,
|
|
303
|
+
files=_files,
|
|
304
|
+
auth_settings=_auth_settings,
|
|
305
|
+
collection_formats=_collection_formats,
|
|
306
|
+
_host=_host,
|
|
307
|
+
_request_auth=_request_auth
|
|
308
|
+
)
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
@validate_call
|
|
314
|
+
def get_user_credit_transactions_0(
|
|
315
|
+
self,
|
|
316
|
+
user_id: Annotated[StrictStr, Field(description="The account whose ledger to read")],
|
|
317
|
+
transaction_type: Annotated[Optional[StrictStr], Field(description="Only entries of this type, for instance `debit` for the credits spent. The types are listed on `AccountCreditTransaction`. ")] = None,
|
|
318
|
+
limit: Annotated[Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Maximum number of entries to return")] = None,
|
|
319
|
+
offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Number of entries to skip")] = None,
|
|
320
|
+
_request_timeout: Union[
|
|
321
|
+
None,
|
|
322
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
323
|
+
Tuple[
|
|
324
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
325
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
326
|
+
]
|
|
327
|
+
] = None,
|
|
328
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
329
|
+
_content_type: Optional[StrictStr] = None,
|
|
330
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
331
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
332
|
+
) -> GetPartnerCreditTransactions200Response:
|
|
333
|
+
"""List an account's credit ledger
|
|
334
|
+
|
|
335
|
+
Lists the entries of an account's credit ledger, newest first. This is also how an account's usage is read: every operation that spends credits is a `debit` entry, so summing the `debit` entries over a period gives the credits consumed in it, and the other types give what was added. An account reads its own ledger; with a partner's API key, that is the account of the person who administers the partner. Widgetic administrators can read any account's. `getPartnerCreditTransactions` reads this same ledger by partner id. The page is always bounded: `limit` defaults to 100 and is capped at 500, `offset` defaults to 0.
|
|
336
|
+
|
|
337
|
+
:param user_id: The account whose ledger to read (required)
|
|
338
|
+
:type user_id: str
|
|
339
|
+
:param transaction_type: Only entries of this type, for instance `debit` for the credits spent. The types are listed on `AccountCreditTransaction`.
|
|
340
|
+
:type transaction_type: str
|
|
341
|
+
:param limit: Maximum number of entries to return
|
|
342
|
+
:type limit: int
|
|
343
|
+
:param offset: Number of entries to skip
|
|
344
|
+
:type offset: int
|
|
345
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
346
|
+
number provided, it will be total request
|
|
347
|
+
timeout. It can also be a pair (tuple) of
|
|
348
|
+
(connection, read) timeouts.
|
|
349
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
350
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
351
|
+
request; this effectively ignores the
|
|
352
|
+
authentication in the spec for a single request.
|
|
353
|
+
:type _request_auth: dict, optional
|
|
354
|
+
:param _content_type: force content-type for the request.
|
|
355
|
+
:type _content_type: str, Optional
|
|
356
|
+
:param _headers: set to override the headers for a single
|
|
357
|
+
request; this effectively ignores the headers
|
|
358
|
+
in the spec for a single request.
|
|
359
|
+
:type _headers: dict, optional
|
|
360
|
+
:param _host_index: set to override the host_index for a single
|
|
361
|
+
request; this effectively ignores the host_index
|
|
362
|
+
in the spec for a single request.
|
|
363
|
+
:type _host_index: int, optional
|
|
364
|
+
:return: Returns the result object.
|
|
365
|
+
""" # noqa: E501
|
|
366
|
+
|
|
367
|
+
_param = self._get_user_credit_transactions_0_serialize(
|
|
368
|
+
user_id=user_id,
|
|
369
|
+
transaction_type=transaction_type,
|
|
370
|
+
limit=limit,
|
|
371
|
+
offset=offset,
|
|
372
|
+
_request_auth=_request_auth,
|
|
373
|
+
_content_type=_content_type,
|
|
374
|
+
_headers=_headers,
|
|
375
|
+
_host_index=_host_index
|
|
376
|
+
)
|
|
377
|
+
|
|
378
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
379
|
+
'200': "GetPartnerCreditTransactions200Response",
|
|
380
|
+
'401': "ErrorResponse",
|
|
381
|
+
'403': "ErrorResponse",
|
|
382
|
+
}
|
|
383
|
+
response_data = self.api_client.call_api(
|
|
384
|
+
*_param,
|
|
385
|
+
_request_timeout=_request_timeout
|
|
386
|
+
)
|
|
387
|
+
response_data.read()
|
|
388
|
+
return self.api_client.response_deserialize(
|
|
389
|
+
response_data=response_data,
|
|
390
|
+
response_types_map=_response_types_map,
|
|
391
|
+
).data
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
@validate_call
|
|
395
|
+
def get_user_credit_transactions_0_with_http_info(
|
|
396
|
+
self,
|
|
397
|
+
user_id: Annotated[StrictStr, Field(description="The account whose ledger to read")],
|
|
398
|
+
transaction_type: Annotated[Optional[StrictStr], Field(description="Only entries of this type, for instance `debit` for the credits spent. The types are listed on `AccountCreditTransaction`. ")] = None,
|
|
399
|
+
limit: Annotated[Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Maximum number of entries to return")] = None,
|
|
400
|
+
offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Number of entries to skip")] = None,
|
|
401
|
+
_request_timeout: Union[
|
|
402
|
+
None,
|
|
403
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
404
|
+
Tuple[
|
|
405
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
406
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
407
|
+
]
|
|
408
|
+
] = None,
|
|
409
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
410
|
+
_content_type: Optional[StrictStr] = None,
|
|
411
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
412
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
413
|
+
) -> ApiResponse[GetPartnerCreditTransactions200Response]:
|
|
414
|
+
"""List an account's credit ledger
|
|
415
|
+
|
|
416
|
+
Lists the entries of an account's credit ledger, newest first. This is also how an account's usage is read: every operation that spends credits is a `debit` entry, so summing the `debit` entries over a period gives the credits consumed in it, and the other types give what was added. An account reads its own ledger; with a partner's API key, that is the account of the person who administers the partner. Widgetic administrators can read any account's. `getPartnerCreditTransactions` reads this same ledger by partner id. The page is always bounded: `limit` defaults to 100 and is capped at 500, `offset` defaults to 0.
|
|
417
|
+
|
|
418
|
+
:param user_id: The account whose ledger to read (required)
|
|
419
|
+
:type user_id: str
|
|
420
|
+
:param transaction_type: Only entries of this type, for instance `debit` for the credits spent. The types are listed on `AccountCreditTransaction`.
|
|
421
|
+
:type transaction_type: str
|
|
422
|
+
:param limit: Maximum number of entries to return
|
|
423
|
+
:type limit: int
|
|
424
|
+
:param offset: Number of entries to skip
|
|
425
|
+
:type offset: int
|
|
426
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
427
|
+
number provided, it will be total request
|
|
428
|
+
timeout. It can also be a pair (tuple) of
|
|
429
|
+
(connection, read) timeouts.
|
|
430
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
431
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
432
|
+
request; this effectively ignores the
|
|
433
|
+
authentication in the spec for a single request.
|
|
434
|
+
:type _request_auth: dict, optional
|
|
435
|
+
:param _content_type: force content-type for the request.
|
|
436
|
+
:type _content_type: str, Optional
|
|
437
|
+
:param _headers: set to override the headers for a single
|
|
438
|
+
request; this effectively ignores the headers
|
|
439
|
+
in the spec for a single request.
|
|
440
|
+
:type _headers: dict, optional
|
|
441
|
+
:param _host_index: set to override the host_index for a single
|
|
442
|
+
request; this effectively ignores the host_index
|
|
443
|
+
in the spec for a single request.
|
|
444
|
+
:type _host_index: int, optional
|
|
445
|
+
:return: Returns the result object.
|
|
446
|
+
""" # noqa: E501
|
|
447
|
+
|
|
448
|
+
_param = self._get_user_credit_transactions_0_serialize(
|
|
449
|
+
user_id=user_id,
|
|
450
|
+
transaction_type=transaction_type,
|
|
451
|
+
limit=limit,
|
|
452
|
+
offset=offset,
|
|
453
|
+
_request_auth=_request_auth,
|
|
454
|
+
_content_type=_content_type,
|
|
455
|
+
_headers=_headers,
|
|
456
|
+
_host_index=_host_index
|
|
457
|
+
)
|
|
458
|
+
|
|
459
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
460
|
+
'200': "GetPartnerCreditTransactions200Response",
|
|
461
|
+
'401': "ErrorResponse",
|
|
462
|
+
'403': "ErrorResponse",
|
|
463
|
+
}
|
|
464
|
+
response_data = self.api_client.call_api(
|
|
465
|
+
*_param,
|
|
466
|
+
_request_timeout=_request_timeout
|
|
467
|
+
)
|
|
468
|
+
response_data.read()
|
|
469
|
+
return self.api_client.response_deserialize(
|
|
470
|
+
response_data=response_data,
|
|
471
|
+
response_types_map=_response_types_map,
|
|
472
|
+
)
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
@validate_call
|
|
476
|
+
def get_user_credit_transactions_0_without_preload_content(
|
|
477
|
+
self,
|
|
478
|
+
user_id: Annotated[StrictStr, Field(description="The account whose ledger to read")],
|
|
479
|
+
transaction_type: Annotated[Optional[StrictStr], Field(description="Only entries of this type, for instance `debit` for the credits spent. The types are listed on `AccountCreditTransaction`. ")] = None,
|
|
480
|
+
limit: Annotated[Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Maximum number of entries to return")] = None,
|
|
481
|
+
offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Number of entries to skip")] = None,
|
|
482
|
+
_request_timeout: Union[
|
|
483
|
+
None,
|
|
484
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
485
|
+
Tuple[
|
|
486
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
487
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
488
|
+
]
|
|
489
|
+
] = None,
|
|
490
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
491
|
+
_content_type: Optional[StrictStr] = None,
|
|
492
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
493
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
494
|
+
) -> RESTResponseType:
|
|
495
|
+
"""List an account's credit ledger
|
|
496
|
+
|
|
497
|
+
Lists the entries of an account's credit ledger, newest first. This is also how an account's usage is read: every operation that spends credits is a `debit` entry, so summing the `debit` entries over a period gives the credits consumed in it, and the other types give what was added. An account reads its own ledger; with a partner's API key, that is the account of the person who administers the partner. Widgetic administrators can read any account's. `getPartnerCreditTransactions` reads this same ledger by partner id. The page is always bounded: `limit` defaults to 100 and is capped at 500, `offset` defaults to 0.
|
|
498
|
+
|
|
499
|
+
:param user_id: The account whose ledger to read (required)
|
|
500
|
+
:type user_id: str
|
|
501
|
+
:param transaction_type: Only entries of this type, for instance `debit` for the credits spent. The types are listed on `AccountCreditTransaction`.
|
|
502
|
+
:type transaction_type: str
|
|
503
|
+
:param limit: Maximum number of entries to return
|
|
504
|
+
:type limit: int
|
|
505
|
+
:param offset: Number of entries to skip
|
|
506
|
+
:type offset: int
|
|
507
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
508
|
+
number provided, it will be total request
|
|
509
|
+
timeout. It can also be a pair (tuple) of
|
|
510
|
+
(connection, read) timeouts.
|
|
511
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
512
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
513
|
+
request; this effectively ignores the
|
|
514
|
+
authentication in the spec for a single request.
|
|
515
|
+
:type _request_auth: dict, optional
|
|
516
|
+
:param _content_type: force content-type for the request.
|
|
517
|
+
:type _content_type: str, Optional
|
|
518
|
+
:param _headers: set to override the headers for a single
|
|
519
|
+
request; this effectively ignores the headers
|
|
520
|
+
in the spec for a single request.
|
|
521
|
+
:type _headers: dict, optional
|
|
522
|
+
:param _host_index: set to override the host_index for a single
|
|
523
|
+
request; this effectively ignores the host_index
|
|
524
|
+
in the spec for a single request.
|
|
525
|
+
:type _host_index: int, optional
|
|
526
|
+
:return: Returns the result object.
|
|
527
|
+
""" # noqa: E501
|
|
528
|
+
|
|
529
|
+
_param = self._get_user_credit_transactions_0_serialize(
|
|
530
|
+
user_id=user_id,
|
|
531
|
+
transaction_type=transaction_type,
|
|
532
|
+
limit=limit,
|
|
533
|
+
offset=offset,
|
|
534
|
+
_request_auth=_request_auth,
|
|
535
|
+
_content_type=_content_type,
|
|
536
|
+
_headers=_headers,
|
|
537
|
+
_host_index=_host_index
|
|
538
|
+
)
|
|
539
|
+
|
|
540
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
541
|
+
'200': "GetPartnerCreditTransactions200Response",
|
|
542
|
+
'401': "ErrorResponse",
|
|
543
|
+
'403': "ErrorResponse",
|
|
544
|
+
}
|
|
545
|
+
response_data = self.api_client.call_api(
|
|
546
|
+
*_param,
|
|
547
|
+
_request_timeout=_request_timeout
|
|
548
|
+
)
|
|
549
|
+
return response_data.response
|
|
550
|
+
|
|
551
|
+
|
|
552
|
+
def _get_user_credit_transactions_0_serialize(
|
|
553
|
+
self,
|
|
554
|
+
user_id,
|
|
555
|
+
transaction_type,
|
|
556
|
+
limit,
|
|
557
|
+
offset,
|
|
558
|
+
_request_auth,
|
|
559
|
+
_content_type,
|
|
560
|
+
_headers,
|
|
561
|
+
_host_index,
|
|
562
|
+
) -> RequestSerialized:
|
|
563
|
+
|
|
564
|
+
_host = None
|
|
565
|
+
|
|
566
|
+
_collection_formats: Dict[str, str] = {
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
_path_params: Dict[str, str] = {}
|
|
570
|
+
_query_params: List[Tuple[str, str]] = []
|
|
571
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
572
|
+
_form_params: List[Tuple[str, str]] = []
|
|
573
|
+
_files: Dict[
|
|
574
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
575
|
+
] = {}
|
|
576
|
+
_body_params: Optional[bytes] = None
|
|
577
|
+
|
|
578
|
+
# process the path parameters
|
|
579
|
+
if user_id is not None:
|
|
580
|
+
_path_params['userId'] = user_id
|
|
581
|
+
# process the query parameters
|
|
582
|
+
if transaction_type is not None:
|
|
583
|
+
|
|
584
|
+
_query_params.append(('transactionType', transaction_type))
|
|
585
|
+
|
|
586
|
+
if limit is not None:
|
|
587
|
+
|
|
588
|
+
_query_params.append(('limit', limit))
|
|
589
|
+
|
|
590
|
+
if offset is not None:
|
|
591
|
+
|
|
592
|
+
_query_params.append(('offset', offset))
|
|
593
|
+
|
|
594
|
+
# process the header parameters
|
|
595
|
+
# process the form parameters
|
|
596
|
+
# process the body parameter
|
|
597
|
+
|
|
598
|
+
|
|
599
|
+
# set the HTTP header `Accept`
|
|
600
|
+
if 'Accept' not in _header_params:
|
|
601
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
602
|
+
[
|
|
603
|
+
'application/json'
|
|
604
|
+
]
|
|
605
|
+
)
|
|
606
|
+
|
|
607
|
+
|
|
608
|
+
# authentication setting
|
|
609
|
+
_auth_settings: List[str] = [
|
|
610
|
+
'apiKeyAuth'
|
|
611
|
+
]
|
|
612
|
+
|
|
613
|
+
return self.api_client.param_serialize(
|
|
614
|
+
method='GET',
|
|
615
|
+
resource_path='/credits/user/{userId}/transactions',
|
|
616
|
+
path_params=_path_params,
|
|
617
|
+
query_params=_query_params,
|
|
618
|
+
header_params=_header_params,
|
|
619
|
+
body=_body_params,
|
|
620
|
+
post_params=_form_params,
|
|
621
|
+
files=_files,
|
|
622
|
+
auth_settings=_auth_settings,
|
|
623
|
+
collection_formats=_collection_formats,
|
|
624
|
+
_host=_host,
|
|
625
|
+
_request_auth=_request_auth
|
|
626
|
+
)
|
|
627
|
+
|
|
628
|
+
|