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,234 @@
|
|
|
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
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from datetime import datetime
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class PartnerInvoice(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
An invoice issued to a partner. Money is in dollars (not cents). Administrator notes, billing-provider identifiers and Widgetic account ids are not part of what a partner is sent.
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
id: Optional[StrictStr] = None
|
|
31
|
+
partner_id: Optional[StrictStr] = Field(default=None, alias="partnerId")
|
|
32
|
+
number: Optional[StrictStr] = Field(default=None, description="The number printed on the invoice, once it has been issued")
|
|
33
|
+
description: Optional[StrictStr] = Field(default=None, description="What the invoice is for")
|
|
34
|
+
amount: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Total, in dollars. The price plus the tax (the same number as `total`)")
|
|
35
|
+
subtotal: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The price, before tax, in dollars")
|
|
36
|
+
tax_amount: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The tax on the price, in dollars. 0 when there is none, for example under the EU reverse charge", alias="taxAmount")
|
|
37
|
+
total: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="What the partner pays, in dollars. The price plus the tax")
|
|
38
|
+
amount_due: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="What is still owed, in dollars", alias="amountDue")
|
|
39
|
+
amount_paid: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="What has been paid, in dollars", alias="amountPaid")
|
|
40
|
+
currency: Optional[StrictStr] = None
|
|
41
|
+
failure_reason: Optional[StrictStr] = Field(default=None, description="Why the last attempt to pay failed, in the payment provider's words for the card holder. Null unless the status is `failed`; the invoice stays payable from `hostedInvoiceUrl`", alias="failureReason")
|
|
42
|
+
status: Optional[StrictStr] = Field(default=None, description="`open` waits for payment, `failed` waits for payment after an attempt was refused, `paid` is settled (a payment received outside the payment provider counts), `void` was cancelled and owes nothing, and `uncollectible` was written off ")
|
|
43
|
+
invoice_date: Optional[datetime] = Field(default=None, alias="invoiceDate")
|
|
44
|
+
due_date: Optional[datetime] = Field(default=None, alias="dueDate")
|
|
45
|
+
paid_date: Optional[datetime] = Field(default=None, alias="paidDate")
|
|
46
|
+
period_start: Optional[datetime] = Field(default=None, alias="periodStart")
|
|
47
|
+
period_end: Optional[datetime] = Field(default=None, alias="periodEnd")
|
|
48
|
+
payment_method: Optional[StrictStr] = Field(default=None, description="How it was paid, once it was", alias="paymentMethod")
|
|
49
|
+
hosted_invoice_url: Optional[StrictStr] = Field(default=None, description="The page where the invoice can be viewed and paid, once it has been issued", alias="hostedInvoiceUrl")
|
|
50
|
+
pdf_url: Optional[StrictStr] = Field(default=None, description="A PDF of the invoice, once it has been issued", alias="pdfUrl")
|
|
51
|
+
line_items: Optional[List[Dict[str, Any]]] = Field(default=None, alias="lineItems")
|
|
52
|
+
created_at: Optional[datetime] = Field(default=None, alias="createdAt")
|
|
53
|
+
updated_at: Optional[datetime] = Field(default=None, alias="updatedAt")
|
|
54
|
+
__properties: ClassVar[List[str]] = ["id", "partnerId", "number", "description", "amount", "subtotal", "taxAmount", "total", "amountDue", "amountPaid", "currency", "failureReason", "status", "invoiceDate", "dueDate", "paidDate", "periodStart", "periodEnd", "paymentMethod", "hostedInvoiceUrl", "pdfUrl", "lineItems", "createdAt", "updatedAt"]
|
|
55
|
+
|
|
56
|
+
@field_validator('status')
|
|
57
|
+
def status_validate_enum(cls, value):
|
|
58
|
+
"""Validates the enum"""
|
|
59
|
+
if value is None:
|
|
60
|
+
return value
|
|
61
|
+
|
|
62
|
+
if value not in set(['draft', 'open', 'pending', 'paid', 'failed', 'void', 'uncollectible', 'refunded', 'canceled']):
|
|
63
|
+
raise ValueError("must be one of enum values ('draft', 'open', 'pending', 'paid', 'failed', 'void', 'uncollectible', 'refunded', 'canceled')")
|
|
64
|
+
return value
|
|
65
|
+
|
|
66
|
+
model_config = ConfigDict(
|
|
67
|
+
populate_by_name=True,
|
|
68
|
+
validate_assignment=True,
|
|
69
|
+
protected_namespaces=(),
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def to_str(self) -> str:
|
|
74
|
+
"""Returns the string representation of the model using alias"""
|
|
75
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
76
|
+
|
|
77
|
+
def to_json(self) -> str:
|
|
78
|
+
"""Returns the JSON representation of the model using alias"""
|
|
79
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
80
|
+
return json.dumps(self.to_dict())
|
|
81
|
+
|
|
82
|
+
@classmethod
|
|
83
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
84
|
+
"""Create an instance of PartnerInvoice from a JSON string"""
|
|
85
|
+
return cls.from_dict(json.loads(json_str))
|
|
86
|
+
|
|
87
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
88
|
+
"""Return the dictionary representation of the model using alias.
|
|
89
|
+
|
|
90
|
+
This has the following differences from calling pydantic's
|
|
91
|
+
`self.model_dump(by_alias=True)`:
|
|
92
|
+
|
|
93
|
+
* `None` is only added to the output dict for nullable fields that
|
|
94
|
+
were set at model initialization. Other fields with value `None`
|
|
95
|
+
are ignored.
|
|
96
|
+
"""
|
|
97
|
+
excluded_fields: Set[str] = set([
|
|
98
|
+
])
|
|
99
|
+
|
|
100
|
+
_dict = self.model_dump(
|
|
101
|
+
by_alias=True,
|
|
102
|
+
exclude=excluded_fields,
|
|
103
|
+
exclude_none=True,
|
|
104
|
+
)
|
|
105
|
+
# set to None if partner_id (nullable) is None
|
|
106
|
+
# and model_fields_set contains the field
|
|
107
|
+
if self.partner_id is None and "partner_id" in self.model_fields_set:
|
|
108
|
+
_dict['partnerId'] = None
|
|
109
|
+
|
|
110
|
+
# set to None if number (nullable) is None
|
|
111
|
+
# and model_fields_set contains the field
|
|
112
|
+
if self.number is None and "number" in self.model_fields_set:
|
|
113
|
+
_dict['number'] = None
|
|
114
|
+
|
|
115
|
+
# set to None if description (nullable) is None
|
|
116
|
+
# and model_fields_set contains the field
|
|
117
|
+
if self.description is None and "description" in self.model_fields_set:
|
|
118
|
+
_dict['description'] = None
|
|
119
|
+
|
|
120
|
+
# set to None if amount_due (nullable) is None
|
|
121
|
+
# and model_fields_set contains the field
|
|
122
|
+
if self.amount_due is None and "amount_due" in self.model_fields_set:
|
|
123
|
+
_dict['amountDue'] = None
|
|
124
|
+
|
|
125
|
+
# set to None if amount_paid (nullable) is None
|
|
126
|
+
# and model_fields_set contains the field
|
|
127
|
+
if self.amount_paid is None and "amount_paid" in self.model_fields_set:
|
|
128
|
+
_dict['amountPaid'] = None
|
|
129
|
+
|
|
130
|
+
# set to None if currency (nullable) is None
|
|
131
|
+
# and model_fields_set contains the field
|
|
132
|
+
if self.currency is None and "currency" in self.model_fields_set:
|
|
133
|
+
_dict['currency'] = None
|
|
134
|
+
|
|
135
|
+
# set to None if failure_reason (nullable) is None
|
|
136
|
+
# and model_fields_set contains the field
|
|
137
|
+
if self.failure_reason is None and "failure_reason" in self.model_fields_set:
|
|
138
|
+
_dict['failureReason'] = None
|
|
139
|
+
|
|
140
|
+
# set to None if invoice_date (nullable) is None
|
|
141
|
+
# and model_fields_set contains the field
|
|
142
|
+
if self.invoice_date is None and "invoice_date" in self.model_fields_set:
|
|
143
|
+
_dict['invoiceDate'] = None
|
|
144
|
+
|
|
145
|
+
# set to None if due_date (nullable) is None
|
|
146
|
+
# and model_fields_set contains the field
|
|
147
|
+
if self.due_date is None and "due_date" in self.model_fields_set:
|
|
148
|
+
_dict['dueDate'] = None
|
|
149
|
+
|
|
150
|
+
# set to None if paid_date (nullable) is None
|
|
151
|
+
# and model_fields_set contains the field
|
|
152
|
+
if self.paid_date is None and "paid_date" in self.model_fields_set:
|
|
153
|
+
_dict['paidDate'] = None
|
|
154
|
+
|
|
155
|
+
# set to None if period_start (nullable) is None
|
|
156
|
+
# and model_fields_set contains the field
|
|
157
|
+
if self.period_start is None and "period_start" in self.model_fields_set:
|
|
158
|
+
_dict['periodStart'] = None
|
|
159
|
+
|
|
160
|
+
# set to None if period_end (nullable) is None
|
|
161
|
+
# and model_fields_set contains the field
|
|
162
|
+
if self.period_end is None and "period_end" in self.model_fields_set:
|
|
163
|
+
_dict['periodEnd'] = None
|
|
164
|
+
|
|
165
|
+
# set to None if payment_method (nullable) is None
|
|
166
|
+
# and model_fields_set contains the field
|
|
167
|
+
if self.payment_method is None and "payment_method" in self.model_fields_set:
|
|
168
|
+
_dict['paymentMethod'] = None
|
|
169
|
+
|
|
170
|
+
# set to None if hosted_invoice_url (nullable) is None
|
|
171
|
+
# and model_fields_set contains the field
|
|
172
|
+
if self.hosted_invoice_url is None and "hosted_invoice_url" in self.model_fields_set:
|
|
173
|
+
_dict['hostedInvoiceUrl'] = None
|
|
174
|
+
|
|
175
|
+
# set to None if pdf_url (nullable) is None
|
|
176
|
+
# and model_fields_set contains the field
|
|
177
|
+
if self.pdf_url is None and "pdf_url" in self.model_fields_set:
|
|
178
|
+
_dict['pdfUrl'] = None
|
|
179
|
+
|
|
180
|
+
# set to None if line_items (nullable) is None
|
|
181
|
+
# and model_fields_set contains the field
|
|
182
|
+
if self.line_items is None and "line_items" in self.model_fields_set:
|
|
183
|
+
_dict['lineItems'] = None
|
|
184
|
+
|
|
185
|
+
# set to None if created_at (nullable) is None
|
|
186
|
+
# and model_fields_set contains the field
|
|
187
|
+
if self.created_at is None and "created_at" in self.model_fields_set:
|
|
188
|
+
_dict['createdAt'] = None
|
|
189
|
+
|
|
190
|
+
# set to None if updated_at (nullable) is None
|
|
191
|
+
# and model_fields_set contains the field
|
|
192
|
+
if self.updated_at is None and "updated_at" in self.model_fields_set:
|
|
193
|
+
_dict['updatedAt'] = None
|
|
194
|
+
|
|
195
|
+
return _dict
|
|
196
|
+
|
|
197
|
+
@classmethod
|
|
198
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
199
|
+
"""Create an instance of PartnerInvoice from a dict"""
|
|
200
|
+
if obj is None:
|
|
201
|
+
return None
|
|
202
|
+
|
|
203
|
+
if not isinstance(obj, dict):
|
|
204
|
+
return cls.model_validate(obj)
|
|
205
|
+
|
|
206
|
+
_obj = cls.model_validate({
|
|
207
|
+
"id": obj.get("id"),
|
|
208
|
+
"partnerId": obj.get("partnerId"),
|
|
209
|
+
"number": obj.get("number"),
|
|
210
|
+
"description": obj.get("description"),
|
|
211
|
+
"amount": obj.get("amount"),
|
|
212
|
+
"subtotal": obj.get("subtotal"),
|
|
213
|
+
"taxAmount": obj.get("taxAmount"),
|
|
214
|
+
"total": obj.get("total"),
|
|
215
|
+
"amountDue": obj.get("amountDue"),
|
|
216
|
+
"amountPaid": obj.get("amountPaid"),
|
|
217
|
+
"currency": obj.get("currency"),
|
|
218
|
+
"failureReason": obj.get("failureReason"),
|
|
219
|
+
"status": obj.get("status"),
|
|
220
|
+
"invoiceDate": obj.get("invoiceDate"),
|
|
221
|
+
"dueDate": obj.get("dueDate"),
|
|
222
|
+
"paidDate": obj.get("paidDate"),
|
|
223
|
+
"periodStart": obj.get("periodStart"),
|
|
224
|
+
"periodEnd": obj.get("periodEnd"),
|
|
225
|
+
"paymentMethod": obj.get("paymentMethod"),
|
|
226
|
+
"hostedInvoiceUrl": obj.get("hostedInvoiceUrl"),
|
|
227
|
+
"pdfUrl": obj.get("pdfUrl"),
|
|
228
|
+
"lineItems": obj.get("lineItems"),
|
|
229
|
+
"createdAt": obj.get("createdAt"),
|
|
230
|
+
"updatedAt": obj.get("updatedAt")
|
|
231
|
+
})
|
|
232
|
+
return _obj
|
|
233
|
+
|
|
234
|
+
|
|
@@ -0,0 +1,108 @@
|
|
|
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
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from datetime import datetime
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
23
|
+
from api_sdk_py.models.partner_notification_event_type import PartnerNotificationEventType
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class PartnerNotification(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
One thing that happened to your partner account. The same object is what your webhook receives as `data` of a call (beside `id`, `type`, `createdAt` and `partnerId`), and what the list in your dashboard shows.
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
id: StrictStr
|
|
32
|
+
type: PartnerNotificationEventType
|
|
33
|
+
title: StrictStr = Field(description="One line that says what happened")
|
|
34
|
+
body: StrictStr = Field(description="A few sentences that say what happened and what to do about it")
|
|
35
|
+
tone: StrictStr = Field(description="How serious it is")
|
|
36
|
+
data: Dict[str, Any] = Field(description="The facts of the event, named in camelCase. An invoice event carries `invoiceNumber`, `subtotal`, `taxAmount`, `total`, `currency`, `dueDate`, `hostedInvoiceUrl` (the page where it is paid) and `purpose` (`contract`, or `extra_credits` for credits you bought on top of the contract: an unpaid invoice for extra credits never stops the account, the credits are just not added until it is paid); a payment adds `paidAt`, a failed payment `reason`, a reminder `daysUntilDue` or `daysOverdue`. A credits event carries `band` (`low` or `empty`), `balance` and `threshold`. `credits.managed_user_cap_reached` (one of your managed users used its monthly credits and a request was refused) goes to your webhook only when subscribed, once per managed user each month, and carries `managedUserId`, `externalId`, `monthlyCredits`, `creditsUsed`, `resetsAt` and `reachedAt`. A standing event carries `status`, `previousStatus` and `reason`; `partner.paused` with `status: payment_arrears` means that an overdue invoice stopped the account (nobody paused it, and `reason` names the invoice), and `partner.resumed` with `previousStatus: payment_arrears` means that its payment ended that. A storage event carries `reason` and `checkedAt`. Content events (`composition.created`, `composition.updated`, `widget.published`, `upload.created`, `entry.created`) go to your webhook only when subscribed; they do not appear in the dashboard list. `composition.created` carries `compositionId`, `widgetId`, `name`, `managedUserId`, `externalId` and `createdAt`; `composition.updated` carries `compositionId`, `widgetId`, `name`, `managedUserId`, `externalId`, `contentVersion` and `savedAt`, and is sent for the first save of a composition in each five minutes (read the composition for its current state); `widget.published` carries `widgetId`, `name`, `managedUserId`, `externalId`, `version` and `publishedAt`; `upload.created` carries `uploadId`, `name`, `mimeType`, `sizeBytes`, `address`, `managedUserId`, `externalId`, `purpose` and `createdAt`; `entry.created` carries `compositionId`, `table`, `entryId`, `createdAt` and `context` (the host attribution of the embedding page, or null), and none of the values the visitor entered: read those with the entries routes. Ignore an event type you do not know: more may be added. `sendPartnerNotificationTestEvent` sends a sample of every one of them.")
|
|
37
|
+
created_at: datetime = Field(alias="createdAt")
|
|
38
|
+
__properties: ClassVar[List[str]] = ["id", "type", "title", "body", "tone", "data", "createdAt"]
|
|
39
|
+
|
|
40
|
+
@field_validator('tone')
|
|
41
|
+
def tone_validate_enum(cls, value):
|
|
42
|
+
"""Validates the enum"""
|
|
43
|
+
if value not in set(['info', 'success', 'warning', 'error']):
|
|
44
|
+
raise ValueError("must be one of enum values ('info', 'success', 'warning', 'error')")
|
|
45
|
+
return value
|
|
46
|
+
|
|
47
|
+
model_config = ConfigDict(
|
|
48
|
+
populate_by_name=True,
|
|
49
|
+
validate_assignment=True,
|
|
50
|
+
protected_namespaces=(),
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def to_str(self) -> str:
|
|
55
|
+
"""Returns the string representation of the model using alias"""
|
|
56
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
57
|
+
|
|
58
|
+
def to_json(self) -> str:
|
|
59
|
+
"""Returns the JSON representation of the model using alias"""
|
|
60
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
61
|
+
return json.dumps(self.to_dict())
|
|
62
|
+
|
|
63
|
+
@classmethod
|
|
64
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
65
|
+
"""Create an instance of PartnerNotification from a JSON string"""
|
|
66
|
+
return cls.from_dict(json.loads(json_str))
|
|
67
|
+
|
|
68
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
69
|
+
"""Return the dictionary representation of the model using alias.
|
|
70
|
+
|
|
71
|
+
This has the following differences from calling pydantic's
|
|
72
|
+
`self.model_dump(by_alias=True)`:
|
|
73
|
+
|
|
74
|
+
* `None` is only added to the output dict for nullable fields that
|
|
75
|
+
were set at model initialization. Other fields with value `None`
|
|
76
|
+
are ignored.
|
|
77
|
+
"""
|
|
78
|
+
excluded_fields: Set[str] = set([
|
|
79
|
+
])
|
|
80
|
+
|
|
81
|
+
_dict = self.model_dump(
|
|
82
|
+
by_alias=True,
|
|
83
|
+
exclude=excluded_fields,
|
|
84
|
+
exclude_none=True,
|
|
85
|
+
)
|
|
86
|
+
return _dict
|
|
87
|
+
|
|
88
|
+
@classmethod
|
|
89
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
90
|
+
"""Create an instance of PartnerNotification from a dict"""
|
|
91
|
+
if obj is None:
|
|
92
|
+
return None
|
|
93
|
+
|
|
94
|
+
if not isinstance(obj, dict):
|
|
95
|
+
return cls.model_validate(obj)
|
|
96
|
+
|
|
97
|
+
_obj = cls.model_validate({
|
|
98
|
+
"id": obj.get("id"),
|
|
99
|
+
"type": obj.get("type"),
|
|
100
|
+
"title": obj.get("title"),
|
|
101
|
+
"body": obj.get("body"),
|
|
102
|
+
"tone": obj.get("tone"),
|
|
103
|
+
"data": obj.get("data"),
|
|
104
|
+
"createdAt": obj.get("createdAt")
|
|
105
|
+
})
|
|
106
|
+
return _obj
|
|
107
|
+
|
|
108
|
+
|
|
@@ -0,0 +1,89 @@
|
|
|
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
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class PartnerNotificationDefaultRecipients(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
Who gets the emails while you have given no addresses of your own.
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
payments: List[StrictStr] = Field(description="For the invoice events, the billing emails of your billing profile, or your contact email when there are none")
|
|
30
|
+
other: List[StrictStr] = Field(description="For every other event, your contact email")
|
|
31
|
+
__properties: ClassVar[List[str]] = ["payments", "other"]
|
|
32
|
+
|
|
33
|
+
model_config = ConfigDict(
|
|
34
|
+
populate_by_name=True,
|
|
35
|
+
validate_assignment=True,
|
|
36
|
+
protected_namespaces=(),
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def to_str(self) -> str:
|
|
41
|
+
"""Returns the string representation of the model using alias"""
|
|
42
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
43
|
+
|
|
44
|
+
def to_json(self) -> str:
|
|
45
|
+
"""Returns the JSON representation of the model using alias"""
|
|
46
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
47
|
+
return json.dumps(self.to_dict())
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
51
|
+
"""Create an instance of PartnerNotificationDefaultRecipients from a JSON string"""
|
|
52
|
+
return cls.from_dict(json.loads(json_str))
|
|
53
|
+
|
|
54
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
55
|
+
"""Return the dictionary representation of the model using alias.
|
|
56
|
+
|
|
57
|
+
This has the following differences from calling pydantic's
|
|
58
|
+
`self.model_dump(by_alias=True)`:
|
|
59
|
+
|
|
60
|
+
* `None` is only added to the output dict for nullable fields that
|
|
61
|
+
were set at model initialization. Other fields with value `None`
|
|
62
|
+
are ignored.
|
|
63
|
+
"""
|
|
64
|
+
excluded_fields: Set[str] = set([
|
|
65
|
+
])
|
|
66
|
+
|
|
67
|
+
_dict = self.model_dump(
|
|
68
|
+
by_alias=True,
|
|
69
|
+
exclude=excluded_fields,
|
|
70
|
+
exclude_none=True,
|
|
71
|
+
)
|
|
72
|
+
return _dict
|
|
73
|
+
|
|
74
|
+
@classmethod
|
|
75
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
76
|
+
"""Create an instance of PartnerNotificationDefaultRecipients from a dict"""
|
|
77
|
+
if obj is None:
|
|
78
|
+
return None
|
|
79
|
+
|
|
80
|
+
if not isinstance(obj, dict):
|
|
81
|
+
return cls.model_validate(obj)
|
|
82
|
+
|
|
83
|
+
_obj = cls.model_validate({
|
|
84
|
+
"payments": obj.get("payments"),
|
|
85
|
+
"other": obj.get("other")
|
|
86
|
+
})
|
|
87
|
+
return _obj
|
|
88
|
+
|
|
89
|
+
|
|
@@ -0,0 +1,170 @@
|
|
|
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
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from datetime import datetime
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class PartnerNotificationDelivery(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
One send of one notification, to one email address or to your webhook. It stays `pending` while it is being tried again, and ends `delivered`, `failed` (given up on) or `cancelled` (nobody wanted it any more, for example because the webhook was switched off).
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
delivery_id: StrictStr = Field(alias="deliveryId")
|
|
31
|
+
notification_id: StrictStr = Field(alias="notificationId")
|
|
32
|
+
event_type: Optional[StrictStr] = Field(description="What the notification was about. Null when the notification has been removed.", alias="eventType")
|
|
33
|
+
title: Optional[StrictStr]
|
|
34
|
+
channel: StrictStr
|
|
35
|
+
target: StrictStr = Field(description="The email address, or the host of your webhook (never the whole address, which may hold a token)")
|
|
36
|
+
status: StrictStr
|
|
37
|
+
attempt_count: StrictInt = Field(alias="attemptCount")
|
|
38
|
+
next_attempt_at: Optional[datetime] = Field(description="When the next attempt is made. Null once the delivery has ended.", alias="nextAttemptAt")
|
|
39
|
+
last_attempt_at: Optional[datetime] = Field(alias="lastAttemptAt")
|
|
40
|
+
delivered_at: Optional[datetime] = Field(alias="deliveredAt")
|
|
41
|
+
last_status_code: Optional[StrictInt] = Field(description="The HTTP status your webhook answered with at the last attempt, when it answered", alias="lastStatusCode")
|
|
42
|
+
last_error: Optional[StrictStr] = Field(description="Why the last attempt failed, in a few words. Never what your endpoint replied.", alias="lastError")
|
|
43
|
+
created_at: datetime = Field(alias="createdAt")
|
|
44
|
+
replay_of_delivery_id: Optional[StrictStr] = Field(description="When this row is a manual replay, the earlier delivery it sent again", alias="replayOfDeliveryId")
|
|
45
|
+
__properties: ClassVar[List[str]] = ["deliveryId", "notificationId", "eventType", "title", "channel", "target", "status", "attemptCount", "nextAttemptAt", "lastAttemptAt", "deliveredAt", "lastStatusCode", "lastError", "createdAt", "replayOfDeliveryId"]
|
|
46
|
+
|
|
47
|
+
@field_validator('channel')
|
|
48
|
+
def channel_validate_enum(cls, value):
|
|
49
|
+
"""Validates the enum"""
|
|
50
|
+
if value not in set(['email', 'webhook']):
|
|
51
|
+
raise ValueError("must be one of enum values ('email', 'webhook')")
|
|
52
|
+
return value
|
|
53
|
+
|
|
54
|
+
@field_validator('status')
|
|
55
|
+
def status_validate_enum(cls, value):
|
|
56
|
+
"""Validates the enum"""
|
|
57
|
+
if value not in set(['pending', 'delivered', 'failed', 'cancelled']):
|
|
58
|
+
raise ValueError("must be one of enum values ('pending', 'delivered', 'failed', 'cancelled')")
|
|
59
|
+
return value
|
|
60
|
+
|
|
61
|
+
model_config = ConfigDict(
|
|
62
|
+
populate_by_name=True,
|
|
63
|
+
validate_assignment=True,
|
|
64
|
+
protected_namespaces=(),
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def to_str(self) -> str:
|
|
69
|
+
"""Returns the string representation of the model using alias"""
|
|
70
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
71
|
+
|
|
72
|
+
def to_json(self) -> str:
|
|
73
|
+
"""Returns the JSON representation of the model using alias"""
|
|
74
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
75
|
+
return json.dumps(self.to_dict())
|
|
76
|
+
|
|
77
|
+
@classmethod
|
|
78
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
79
|
+
"""Create an instance of PartnerNotificationDelivery from a JSON string"""
|
|
80
|
+
return cls.from_dict(json.loads(json_str))
|
|
81
|
+
|
|
82
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
83
|
+
"""Return the dictionary representation of the model using alias.
|
|
84
|
+
|
|
85
|
+
This has the following differences from calling pydantic's
|
|
86
|
+
`self.model_dump(by_alias=True)`:
|
|
87
|
+
|
|
88
|
+
* `None` is only added to the output dict for nullable fields that
|
|
89
|
+
were set at model initialization. Other fields with value `None`
|
|
90
|
+
are ignored.
|
|
91
|
+
"""
|
|
92
|
+
excluded_fields: Set[str] = set([
|
|
93
|
+
])
|
|
94
|
+
|
|
95
|
+
_dict = self.model_dump(
|
|
96
|
+
by_alias=True,
|
|
97
|
+
exclude=excluded_fields,
|
|
98
|
+
exclude_none=True,
|
|
99
|
+
)
|
|
100
|
+
# set to None if event_type (nullable) is None
|
|
101
|
+
# and model_fields_set contains the field
|
|
102
|
+
if self.event_type is None and "event_type" in self.model_fields_set:
|
|
103
|
+
_dict['eventType'] = None
|
|
104
|
+
|
|
105
|
+
# set to None if title (nullable) is None
|
|
106
|
+
# and model_fields_set contains the field
|
|
107
|
+
if self.title is None and "title" in self.model_fields_set:
|
|
108
|
+
_dict['title'] = None
|
|
109
|
+
|
|
110
|
+
# set to None if next_attempt_at (nullable) is None
|
|
111
|
+
# and model_fields_set contains the field
|
|
112
|
+
if self.next_attempt_at is None and "next_attempt_at" in self.model_fields_set:
|
|
113
|
+
_dict['nextAttemptAt'] = None
|
|
114
|
+
|
|
115
|
+
# set to None if last_attempt_at (nullable) is None
|
|
116
|
+
# and model_fields_set contains the field
|
|
117
|
+
if self.last_attempt_at is None and "last_attempt_at" in self.model_fields_set:
|
|
118
|
+
_dict['lastAttemptAt'] = None
|
|
119
|
+
|
|
120
|
+
# set to None if delivered_at (nullable) is None
|
|
121
|
+
# and model_fields_set contains the field
|
|
122
|
+
if self.delivered_at is None and "delivered_at" in self.model_fields_set:
|
|
123
|
+
_dict['deliveredAt'] = None
|
|
124
|
+
|
|
125
|
+
# set to None if last_status_code (nullable) is None
|
|
126
|
+
# and model_fields_set contains the field
|
|
127
|
+
if self.last_status_code is None and "last_status_code" in self.model_fields_set:
|
|
128
|
+
_dict['lastStatusCode'] = None
|
|
129
|
+
|
|
130
|
+
# set to None if last_error (nullable) is None
|
|
131
|
+
# and model_fields_set contains the field
|
|
132
|
+
if self.last_error is None and "last_error" in self.model_fields_set:
|
|
133
|
+
_dict['lastError'] = None
|
|
134
|
+
|
|
135
|
+
# set to None if replay_of_delivery_id (nullable) is None
|
|
136
|
+
# and model_fields_set contains the field
|
|
137
|
+
if self.replay_of_delivery_id is None and "replay_of_delivery_id" in self.model_fields_set:
|
|
138
|
+
_dict['replayOfDeliveryId'] = None
|
|
139
|
+
|
|
140
|
+
return _dict
|
|
141
|
+
|
|
142
|
+
@classmethod
|
|
143
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
144
|
+
"""Create an instance of PartnerNotificationDelivery from a dict"""
|
|
145
|
+
if obj is None:
|
|
146
|
+
return None
|
|
147
|
+
|
|
148
|
+
if not isinstance(obj, dict):
|
|
149
|
+
return cls.model_validate(obj)
|
|
150
|
+
|
|
151
|
+
_obj = cls.model_validate({
|
|
152
|
+
"deliveryId": obj.get("deliveryId"),
|
|
153
|
+
"notificationId": obj.get("notificationId"),
|
|
154
|
+
"eventType": obj.get("eventType"),
|
|
155
|
+
"title": obj.get("title"),
|
|
156
|
+
"channel": obj.get("channel"),
|
|
157
|
+
"target": obj.get("target"),
|
|
158
|
+
"status": obj.get("status"),
|
|
159
|
+
"attemptCount": obj.get("attemptCount"),
|
|
160
|
+
"nextAttemptAt": obj.get("nextAttemptAt"),
|
|
161
|
+
"lastAttemptAt": obj.get("lastAttemptAt"),
|
|
162
|
+
"deliveredAt": obj.get("deliveredAt"),
|
|
163
|
+
"lastStatusCode": obj.get("lastStatusCode"),
|
|
164
|
+
"lastError": obj.get("lastError"),
|
|
165
|
+
"createdAt": obj.get("createdAt"),
|
|
166
|
+
"replayOfDeliveryId": obj.get("replayOfDeliveryId")
|
|
167
|
+
})
|
|
168
|
+
return _obj
|
|
169
|
+
|
|
170
|
+
|