pingram-python 0.1.0__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.
- pingram/__init__.py +395 -0
- pingram/api/__init__.py +21 -0
- pingram/api/account_api.py +2198 -0
- pingram/api/addresses_api.py +860 -0
- pingram/api/components_api.py +1681 -0
- pingram/api/default_api.py +320 -0
- pingram/api/domains_api.py +849 -0
- pingram/api/editor_api.py +320 -0
- pingram/api/environments_api.py +878 -0
- pingram/api/health_api.py +287 -0
- pingram/api/insights_api.py +321 -0
- pingram/api/keys_api.py +849 -0
- pingram/api/logs_api.py +1632 -0
- pingram/api/members_api.py +1780 -0
- pingram/api/sender_api.py +892 -0
- pingram/api/templates_api.py +1889 -0
- pingram/api/types_api.py +1411 -0
- pingram/api/user_api.py +2534 -0
- pingram/api/users_api.py +936 -0
- pingram/api_client.py +807 -0
- pingram/api_response.py +21 -0
- pingram/client_wrapper.py +357 -0
- pingram/configuration.py +623 -0
- pingram/exceptions.py +219 -0
- pingram/models/__init__.py +173 -0
- pingram/models/account_addresses_response.py +95 -0
- pingram/models/account_addresses_response_addresses_inner.py +104 -0
- pingram/models/account_get_response.py +143 -0
- pingram/models/account_get_response_pending_downgrade_usage_limit.py +99 -0
- pingram/models/address_response.py +91 -0
- pingram/models/auto_join_get_response.py +89 -0
- pingram/models/auto_join_post_response.py +89 -0
- pingram/models/auto_join_request_body.py +87 -0
- pingram/models/bee_token_v2.py +89 -0
- pingram/models/billing_post_request_body.py +91 -0
- pingram/models/billing_post_response_body.py +149 -0
- pingram/models/billing_post_response_body_pending_downgrade_usage_limit.py +99 -0
- pingram/models/channels_enum.py +42 -0
- pingram/models/create_account_request_body.py +87 -0
- pingram/models/create_account_response.py +89 -0
- pingram/models/create_address_request.py +91 -0
- pingram/models/create_key_request.py +98 -0
- pingram/models/create_key_response.py +104 -0
- pingram/models/delete_key_response.py +87 -0
- pingram/models/delete_user_response.py +87 -0
- pingram/models/email_auth_token_post_request.py +87 -0
- pingram/models/email_component_patch_request.py +93 -0
- pingram/models/email_component_post_request.py +95 -0
- pingram/models/email_component_response.py +120 -0
- pingram/models/email_component_response_referenced_by_inner.py +92 -0
- pingram/models/environment.py +96 -0
- pingram/models/environment_create_request.py +87 -0
- pingram/models/environment_patch_request.py +94 -0
- pingram/models/get_account_metadata_response.py +91 -0
- pingram/models/get_account_metadata_response_user_account_metadata.py +91 -0
- pingram/models/get_email_components_response_inner.py +120 -0
- pingram/models/get_environments_response_inner.py +96 -0
- pingram/models/get_inapp_notifications_response.py +95 -0
- pingram/models/get_inapp_notifications_response_notifications_inner.py +137 -0
- pingram/models/get_inapp_notifications_response_notifications_inner_delivery_options.py +106 -0
- pingram/models/get_inapp_notifications_response_notifications_inner_delivery_options_instant.py +93 -0
- pingram/models/get_inapp_notifications_response_notifications_inner_delivery_options_off.py +87 -0
- pingram/models/get_inapp_notifications_response_notifications_inner_replies_inner.py +89 -0
- pingram/models/get_inapp_notifications_response_notifications_inner_template.py +136 -0
- pingram/models/get_inapp_notifications_response_notifications_inner_template_any_of.py +98 -0
- pingram/models/get_keys_response.py +95 -0
- pingram/models/get_keys_response_keys_inner.py +110 -0
- pingram/models/get_logs_response.py +97 -0
- pingram/models/get_logs_response_messages_inner.py +141 -0
- pingram/models/get_logs_response_messages_inner_attachments_inner.py +93 -0
- pingram/models/get_members_response_inner.py +95 -0
- pingram/models/get_metrics_response_inner.py +116 -0
- pingram/models/get_metrics_response_inner_messages_inner.py +89 -0
- pingram/models/get_notifications_response_inner.py +126 -0
- pingram/models/get_notifications_response_inner_deduplication.py +87 -0
- pingram/models/get_notifications_response_inner_options.py +122 -0
- pingram/models/get_notifications_response_inner_options_email.py +128 -0
- pingram/models/get_notifications_response_inner_options_email_daily.py +89 -0
- pingram/models/get_notifications_response_inner_options_email_monthly.py +101 -0
- pingram/models/get_notifications_response_inner_options_email_weekly.py +91 -0
- pingram/models/get_notifications_response_inner_templates_inner.py +90 -0
- pingram/models/get_notifications_response_inner_throttling.py +111 -0
- pingram/models/get_senders_response_inner.py +128 -0
- pingram/models/get_templates_response.py +136 -0
- pingram/models/get_users_response.py +99 -0
- pingram/models/get_users_response_users_inner.py +133 -0
- pingram/models/get_users_response_users_inner_email_suppression_status.py +96 -0
- pingram/models/get_users_response_users_inner_push_tokens_inner.py +104 -0
- pingram/models/get_users_response_users_inner_push_tokens_inner_device.py +97 -0
- pingram/models/get_users_response_users_inner_slack_token.py +140 -0
- pingram/models/get_users_response_users_inner_slack_token_authed_user.py +97 -0
- pingram/models/get_users_response_users_inner_slack_token_enterprise.py +89 -0
- pingram/models/get_users_response_users_inner_slack_token_incoming_webhook.py +93 -0
- pingram/models/get_users_response_users_inner_slack_token_response_metadata.py +97 -0
- pingram/models/get_users_response_users_inner_web_push_tokens_inner.py +91 -0
- pingram/models/get_users_response_users_inner_web_push_tokens_inner_sub.py +93 -0
- pingram/models/get_users_response_users_inner_web_push_tokens_inner_sub_keys.py +89 -0
- pingram/models/in_app_notification_patch_request.py +112 -0
- pingram/models/in_app_notification_unread_clear_request.py +89 -0
- pingram/models/inapp_unread_count_response.py +87 -0
- pingram/models/inbound_request_body.py +138 -0
- pingram/models/inbound_response_body.py +104 -0
- pingram/models/inbound_response_body_results_inner.py +103 -0
- pingram/models/ingishts_post_request.py +121 -0
- pingram/models/ingishts_post_request_label_options.py +87 -0
- pingram/models/ingishts_post_request_metric_data_queries_inner.py +103 -0
- pingram/models/ingishts_post_request_metric_data_queries_inner_metric_stat.py +107 -0
- pingram/models/ingishts_post_request_metric_data_queries_inner_metric_stat_metric.py +99 -0
- pingram/models/ingishts_post_request_metric_data_queries_inner_metric_stat_metric_dimensions_inner.py +89 -0
- pingram/models/intercom_webhook.py +106 -0
- pingram/models/intercom_webhook_data.py +91 -0
- pingram/models/intercom_webhook_data_item.py +136 -0
- pingram/models/intercom_webhook_data_item_any_of.py +140 -0
- pingram/models/intercom_webhook_data_item_any_of_contacts.py +104 -0
- pingram/models/intercom_webhook_data_item_any_of_contacts_contacts_inner.py +91 -0
- pingram/models/intercom_webhook_data_item_any_of_source.py +101 -0
- pingram/models/intercom_webhook_data_item_any_of_source_author.py +93 -0
- pingram/models/invite_post_response.py +89 -0
- pingram/models/log_query_post_body.py +109 -0
- pingram/models/logs_bulk_request.py +87 -0
- pingram/models/logs_get_response.py +95 -0
- pingram/models/logs_get_response_logs_inner.py +627 -0
- pingram/models/logs_query_response.py +87 -0
- pingram/models/logs_query_result_response.py +101 -0
- pingram/models/logs_retention_response.py +87 -0
- pingram/models/logs_tail_response.py +95 -0
- pingram/models/member_invite_request.py +89 -0
- pingram/models/member_update_request.py +87 -0
- pingram/models/message_response.py +87 -0
- pingram/models/notification.py +126 -0
- pingram/models/notification_create_request.py +97 -0
- pingram/models/notification_patch_request.py +112 -0
- pingram/models/post_email_test_request.py +99 -0
- pingram/models/post_email_test_response.py +89 -0
- pingram/models/post_senders_request_body.py +87 -0
- pingram/models/post_user_request.py +121 -0
- pingram/models/sender_post_body.py +166 -0
- pingram/models/sender_post_body_email.py +95 -0
- pingram/models/sender_post_body_inapp.py +91 -0
- pingram/models/sender_post_body_mobile_push.py +89 -0
- pingram/models/sender_post_body_options.py +103 -0
- pingram/models/sender_post_body_options_apn.py +99 -0
- pingram/models/sender_post_body_options_email.py +107 -0
- pingram/models/sender_post_body_options_email_attachments_inner.py +134 -0
- pingram/models/sender_post_body_options_email_attachments_inner_any_of.py +89 -0
- pingram/models/sender_post_body_options_email_attachments_inner_any_of1.py +91 -0
- pingram/models/sender_post_body_options_fcm.py +91 -0
- pingram/models/sender_post_body_options_fcm_android.py +103 -0
- pingram/models/sender_post_body_slack.py +123 -0
- pingram/models/sender_post_body_slack_metadata.py +99 -0
- pingram/models/sender_post_body_slack_metadata_entities_inner.py +99 -0
- pingram/models/sender_post_body_slack_metadata_entities_inner_external_ref.py +89 -0
- pingram/models/sender_post_body_sms.py +93 -0
- pingram/models/sender_post_body_sms_auto_reply.py +87 -0
- pingram/models/sender_post_body_to.py +133 -0
- pingram/models/sender_post_body_user.py +133 -0
- pingram/models/sender_post_body_web_push.py +93 -0
- pingram/models/sender_post_response.py +89 -0
- pingram/models/set_default_template_request.py +97 -0
- pingram/models/slack_interactivity_response.py +87 -0
- pingram/models/slack_oauth_request.py +89 -0
- pingram/models/success_response.py +87 -0
- pingram/models/supabase_configure_request.py +93 -0
- pingram/models/supabase_configure_response.py +89 -0
- pingram/models/supabase_o_auth_request.py +91 -0
- pingram/models/supabase_o_auth_response.py +89 -0
- pingram/models/supabase_projects_response.py +95 -0
- pingram/models/supabase_projects_response_projects_inner.py +95 -0
- pingram/models/supabase_status_response.py +93 -0
- pingram/models/template.py +98 -0
- pingram/models/template_patch_request.py +134 -0
- pingram/models/template_patch_request_any_of.py +97 -0
- pingram/models/template_patch_request_any_of1.py +103 -0
- pingram/models/template_patch_request_any_of1_batch.py +91 -0
- pingram/models/template_patch_request_any_of1_instant.py +91 -0
- pingram/models/template_post_request.py +131 -0
- pingram/models/template_post_request_batch.py +91 -0
- pingram/models/template_post_request_instant.py +91 -0
- pingram/models/update_address_request.py +91 -0
- pingram/models/user.py +133 -0
- pingram/models/user_suppression_delete_response.py +91 -0
- pingram/models/webhook_response.py +104 -0
- pingram/py.typed +0 -0
- pingram/rest.py +199 -0
- pingram_python-0.1.0.dist-info/METADATA +69 -0
- pingram_python-0.1.0.dist-info/RECORD +189 -0
- pingram_python-0.1.0.dist-info/WHEEL +5 -0
- pingram_python-0.1.0.dist-info/licenses/LICENSE +21 -0
- pingram_python-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
NotificationAPI
|
|
5
|
+
|
|
6
|
+
Internal API for notification delivery and management
|
|
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, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from pingram.models.email_component_response_referenced_by_inner import EmailComponentResponseReferencedByInner
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class GetEmailComponentsResponseInner(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
GetEmailComponentsResponseInner
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
env_id: StrictStr = Field(alias="envId")
|
|
31
|
+
component_id: StrictStr = Field(alias="componentId")
|
|
32
|
+
name: StrictStr
|
|
33
|
+
internal: StrictStr
|
|
34
|
+
internal_page: StrictStr = Field(alias="internalPage")
|
|
35
|
+
html: StrictStr
|
|
36
|
+
created_at: StrictStr = Field(alias="createdAt")
|
|
37
|
+
modified_at: StrictStr = Field(alias="modifiedAt")
|
|
38
|
+
referenced_by: List[EmailComponentResponseReferencedByInner] = Field(alias="referencedBy")
|
|
39
|
+
channel: StrictStr
|
|
40
|
+
__properties: ClassVar[List[str]] = ["envId", "componentId", "name", "internal", "internalPage", "html", "createdAt", "modifiedAt", "referencedBy", "channel"]
|
|
41
|
+
|
|
42
|
+
@field_validator('channel')
|
|
43
|
+
def channel_validate_enum(cls, value):
|
|
44
|
+
"""Validates the enum"""
|
|
45
|
+
if value not in set(['EMAIL']):
|
|
46
|
+
raise ValueError("must be one of enum values ('EMAIL')")
|
|
47
|
+
return value
|
|
48
|
+
|
|
49
|
+
model_config = ConfigDict(
|
|
50
|
+
populate_by_name=True,
|
|
51
|
+
validate_assignment=True,
|
|
52
|
+
protected_namespaces=(),
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def to_str(self) -> str:
|
|
57
|
+
"""Returns the string representation of the model using alias"""
|
|
58
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
59
|
+
|
|
60
|
+
def to_json(self) -> str:
|
|
61
|
+
"""Returns the JSON representation of the model using alias"""
|
|
62
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
63
|
+
return json.dumps(self.to_dict())
|
|
64
|
+
|
|
65
|
+
@classmethod
|
|
66
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
67
|
+
"""Create an instance of GetEmailComponentsResponseInner from a JSON string"""
|
|
68
|
+
return cls.from_dict(json.loads(json_str))
|
|
69
|
+
|
|
70
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
71
|
+
"""Return the dictionary representation of the model using alias.
|
|
72
|
+
|
|
73
|
+
This has the following differences from calling pydantic's
|
|
74
|
+
`self.model_dump(by_alias=True)`:
|
|
75
|
+
|
|
76
|
+
* `None` is only added to the output dict for nullable fields that
|
|
77
|
+
were set at model initialization. Other fields with value `None`
|
|
78
|
+
are ignored.
|
|
79
|
+
"""
|
|
80
|
+
excluded_fields: Set[str] = set([
|
|
81
|
+
])
|
|
82
|
+
|
|
83
|
+
_dict = self.model_dump(
|
|
84
|
+
by_alias=True,
|
|
85
|
+
exclude=excluded_fields,
|
|
86
|
+
exclude_none=True,
|
|
87
|
+
)
|
|
88
|
+
# override the default output from pydantic by calling `to_dict()` of each item in referenced_by (list)
|
|
89
|
+
_items = []
|
|
90
|
+
if self.referenced_by:
|
|
91
|
+
for _item_referenced_by in self.referenced_by:
|
|
92
|
+
if _item_referenced_by:
|
|
93
|
+
_items.append(_item_referenced_by.to_dict())
|
|
94
|
+
_dict['referencedBy'] = _items
|
|
95
|
+
return _dict
|
|
96
|
+
|
|
97
|
+
@classmethod
|
|
98
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
99
|
+
"""Create an instance of GetEmailComponentsResponseInner from a dict"""
|
|
100
|
+
if obj is None:
|
|
101
|
+
return None
|
|
102
|
+
|
|
103
|
+
if not isinstance(obj, dict):
|
|
104
|
+
return cls.model_validate(obj)
|
|
105
|
+
|
|
106
|
+
_obj = cls.model_validate({
|
|
107
|
+
"envId": obj.get("envId"),
|
|
108
|
+
"componentId": obj.get("componentId"),
|
|
109
|
+
"name": obj.get("name"),
|
|
110
|
+
"internal": obj.get("internal"),
|
|
111
|
+
"internalPage": obj.get("internalPage"),
|
|
112
|
+
"html": obj.get("html"),
|
|
113
|
+
"createdAt": obj.get("createdAt"),
|
|
114
|
+
"modifiedAt": obj.get("modifiedAt"),
|
|
115
|
+
"referencedBy": [EmailComponentResponseReferencedByInner.from_dict(_item) for _item in obj["referencedBy"]] if obj.get("referencedBy") is not None else None,
|
|
116
|
+
"channel": obj.get("channel")
|
|
117
|
+
})
|
|
118
|
+
return _obj
|
|
119
|
+
|
|
120
|
+
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
NotificationAPI
|
|
5
|
+
|
|
6
|
+
Internal API for notification delivery and management
|
|
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, StrictBool, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from pingram.models.channels_enum import ChannelsEnum
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class GetEnvironmentsResponseInner(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
GetEnvironmentsResponseInner
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
client_id: StrictStr = Field(alias="clientId")
|
|
31
|
+
client_secret: StrictStr = Field(alias="clientSecret")
|
|
32
|
+
title: StrictStr
|
|
33
|
+
disable_sending: List[ChannelsEnum] = Field(alias="disableSending")
|
|
34
|
+
secure_mode: StrictBool = Field(alias="secureMode")
|
|
35
|
+
__properties: ClassVar[List[str]] = ["clientId", "clientSecret", "title", "disableSending", "secureMode"]
|
|
36
|
+
|
|
37
|
+
model_config = ConfigDict(
|
|
38
|
+
populate_by_name=True,
|
|
39
|
+
validate_assignment=True,
|
|
40
|
+
protected_namespaces=(),
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def to_str(self) -> str:
|
|
45
|
+
"""Returns the string representation of the model using alias"""
|
|
46
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
47
|
+
|
|
48
|
+
def to_json(self) -> str:
|
|
49
|
+
"""Returns the JSON representation of the model using alias"""
|
|
50
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
51
|
+
return json.dumps(self.to_dict())
|
|
52
|
+
|
|
53
|
+
@classmethod
|
|
54
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
55
|
+
"""Create an instance of GetEnvironmentsResponseInner from a JSON string"""
|
|
56
|
+
return cls.from_dict(json.loads(json_str))
|
|
57
|
+
|
|
58
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
59
|
+
"""Return the dictionary representation of the model using alias.
|
|
60
|
+
|
|
61
|
+
This has the following differences from calling pydantic's
|
|
62
|
+
`self.model_dump(by_alias=True)`:
|
|
63
|
+
|
|
64
|
+
* `None` is only added to the output dict for nullable fields that
|
|
65
|
+
were set at model initialization. Other fields with value `None`
|
|
66
|
+
are ignored.
|
|
67
|
+
"""
|
|
68
|
+
excluded_fields: Set[str] = set([
|
|
69
|
+
])
|
|
70
|
+
|
|
71
|
+
_dict = self.model_dump(
|
|
72
|
+
by_alias=True,
|
|
73
|
+
exclude=excluded_fields,
|
|
74
|
+
exclude_none=True,
|
|
75
|
+
)
|
|
76
|
+
return _dict
|
|
77
|
+
|
|
78
|
+
@classmethod
|
|
79
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
80
|
+
"""Create an instance of GetEnvironmentsResponseInner from a dict"""
|
|
81
|
+
if obj is None:
|
|
82
|
+
return None
|
|
83
|
+
|
|
84
|
+
if not isinstance(obj, dict):
|
|
85
|
+
return cls.model_validate(obj)
|
|
86
|
+
|
|
87
|
+
_obj = cls.model_validate({
|
|
88
|
+
"clientId": obj.get("clientId"),
|
|
89
|
+
"clientSecret": obj.get("clientSecret"),
|
|
90
|
+
"title": obj.get("title"),
|
|
91
|
+
"disableSending": obj.get("disableSending"),
|
|
92
|
+
"secureMode": obj.get("secureMode")
|
|
93
|
+
})
|
|
94
|
+
return _obj
|
|
95
|
+
|
|
96
|
+
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
NotificationAPI
|
|
5
|
+
|
|
6
|
+
Internal API for notification delivery and management
|
|
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
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from pingram.models.get_inapp_notifications_response_notifications_inner import GetInappNotificationsResponseNotificationsInner
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class GetInappNotificationsResponse(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
GetInappNotificationsResponse
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
notifications: List[GetInappNotificationsResponseNotificationsInner]
|
|
31
|
+
__properties: ClassVar[List[str]] = ["notifications"]
|
|
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 GetInappNotificationsResponse 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
|
+
# override the default output from pydantic by calling `to_dict()` of each item in notifications (list)
|
|
73
|
+
_items = []
|
|
74
|
+
if self.notifications:
|
|
75
|
+
for _item_notifications in self.notifications:
|
|
76
|
+
if _item_notifications:
|
|
77
|
+
_items.append(_item_notifications.to_dict())
|
|
78
|
+
_dict['notifications'] = _items
|
|
79
|
+
return _dict
|
|
80
|
+
|
|
81
|
+
@classmethod
|
|
82
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
83
|
+
"""Create an instance of GetInappNotificationsResponse from a dict"""
|
|
84
|
+
if obj is None:
|
|
85
|
+
return None
|
|
86
|
+
|
|
87
|
+
if not isinstance(obj, dict):
|
|
88
|
+
return cls.model_validate(obj)
|
|
89
|
+
|
|
90
|
+
_obj = cls.model_validate({
|
|
91
|
+
"notifications": [GetInappNotificationsResponseNotificationsInner.from_dict(_item) for _item in obj["notifications"]] if obj.get("notifications") is not None else None
|
|
92
|
+
})
|
|
93
|
+
return _obj
|
|
94
|
+
|
|
95
|
+
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
NotificationAPI
|
|
5
|
+
|
|
6
|
+
Internal API for notification delivery and management
|
|
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, StrictBool, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from pingram.models.get_inapp_notifications_response_notifications_inner_delivery_options import GetInappNotificationsResponseNotificationsInnerDeliveryOptions
|
|
23
|
+
from pingram.models.get_inapp_notifications_response_notifications_inner_replies_inner import GetInappNotificationsResponseNotificationsInnerRepliesInner
|
|
24
|
+
from pingram.models.get_inapp_notifications_response_notifications_inner_template import GetInappNotificationsResponseNotificationsInnerTemplate
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
|
|
28
|
+
class GetInappNotificationsResponseNotificationsInner(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
GetInappNotificationsResponseNotificationsInner
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
id: StrictStr
|
|
33
|
+
notification_id: StrictStr = Field(alias="notificationId")
|
|
34
|
+
sub_notification_id: Optional[StrictStr] = Field(default=None, alias="subNotificationId")
|
|
35
|
+
seen: StrictBool
|
|
36
|
+
title: StrictStr
|
|
37
|
+
redirect_url: Optional[StrictStr] = Field(default=None, alias="redirectURL")
|
|
38
|
+
image_url: Optional[StrictStr] = Field(default=None, alias="imageURL")
|
|
39
|
+
delivery_options: Optional[GetInappNotificationsResponseNotificationsInnerDeliveryOptions] = Field(default=None, alias="deliveryOptions")
|
|
40
|
+
template: Optional[GetInappNotificationsResponseNotificationsInnerTemplate] = None
|
|
41
|
+
parameters: Optional[Dict[str, Any]] = None
|
|
42
|
+
var_date: StrictStr = Field(alias="date")
|
|
43
|
+
opened: Optional[StrictStr] = None
|
|
44
|
+
clicked: Optional[StrictStr] = None
|
|
45
|
+
archived: Optional[StrictStr] = None
|
|
46
|
+
actioned1: Optional[StrictStr] = None
|
|
47
|
+
actioned2: Optional[StrictStr] = None
|
|
48
|
+
replies: Optional[List[GetInappNotificationsResponseNotificationsInnerRepliesInner]] = None
|
|
49
|
+
exp_date: Optional[StrictStr] = Field(default=None, alias="expDate")
|
|
50
|
+
__properties: ClassVar[List[str]] = ["id", "notificationId", "subNotificationId", "seen", "title", "redirectURL", "imageURL", "deliveryOptions", "template", "parameters", "date", "opened", "clicked", "archived", "actioned1", "actioned2", "replies", "expDate"]
|
|
51
|
+
|
|
52
|
+
model_config = ConfigDict(
|
|
53
|
+
populate_by_name=True,
|
|
54
|
+
validate_assignment=True,
|
|
55
|
+
protected_namespaces=(),
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def to_str(self) -> str:
|
|
60
|
+
"""Returns the string representation of the model using alias"""
|
|
61
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
62
|
+
|
|
63
|
+
def to_json(self) -> str:
|
|
64
|
+
"""Returns the JSON representation of the model using alias"""
|
|
65
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
66
|
+
return json.dumps(self.to_dict())
|
|
67
|
+
|
|
68
|
+
@classmethod
|
|
69
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
70
|
+
"""Create an instance of GetInappNotificationsResponseNotificationsInner from a JSON string"""
|
|
71
|
+
return cls.from_dict(json.loads(json_str))
|
|
72
|
+
|
|
73
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
74
|
+
"""Return the dictionary representation of the model using alias.
|
|
75
|
+
|
|
76
|
+
This has the following differences from calling pydantic's
|
|
77
|
+
`self.model_dump(by_alias=True)`:
|
|
78
|
+
|
|
79
|
+
* `None` is only added to the output dict for nullable fields that
|
|
80
|
+
were set at model initialization. Other fields with value `None`
|
|
81
|
+
are ignored.
|
|
82
|
+
"""
|
|
83
|
+
excluded_fields: Set[str] = set([
|
|
84
|
+
])
|
|
85
|
+
|
|
86
|
+
_dict = self.model_dump(
|
|
87
|
+
by_alias=True,
|
|
88
|
+
exclude=excluded_fields,
|
|
89
|
+
exclude_none=True,
|
|
90
|
+
)
|
|
91
|
+
# override the default output from pydantic by calling `to_dict()` of delivery_options
|
|
92
|
+
if self.delivery_options:
|
|
93
|
+
_dict['deliveryOptions'] = self.delivery_options.to_dict()
|
|
94
|
+
# override the default output from pydantic by calling `to_dict()` of template
|
|
95
|
+
if self.template:
|
|
96
|
+
_dict['template'] = self.template.to_dict()
|
|
97
|
+
# override the default output from pydantic by calling `to_dict()` of each item in replies (list)
|
|
98
|
+
_items = []
|
|
99
|
+
if self.replies:
|
|
100
|
+
for _item_replies in self.replies:
|
|
101
|
+
if _item_replies:
|
|
102
|
+
_items.append(_item_replies.to_dict())
|
|
103
|
+
_dict['replies'] = _items
|
|
104
|
+
return _dict
|
|
105
|
+
|
|
106
|
+
@classmethod
|
|
107
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
108
|
+
"""Create an instance of GetInappNotificationsResponseNotificationsInner from a dict"""
|
|
109
|
+
if obj is None:
|
|
110
|
+
return None
|
|
111
|
+
|
|
112
|
+
if not isinstance(obj, dict):
|
|
113
|
+
return cls.model_validate(obj)
|
|
114
|
+
|
|
115
|
+
_obj = cls.model_validate({
|
|
116
|
+
"id": obj.get("id"),
|
|
117
|
+
"notificationId": obj.get("notificationId"),
|
|
118
|
+
"subNotificationId": obj.get("subNotificationId"),
|
|
119
|
+
"seen": obj.get("seen"),
|
|
120
|
+
"title": obj.get("title"),
|
|
121
|
+
"redirectURL": obj.get("redirectURL"),
|
|
122
|
+
"imageURL": obj.get("imageURL"),
|
|
123
|
+
"deliveryOptions": GetInappNotificationsResponseNotificationsInnerDeliveryOptions.from_dict(obj["deliveryOptions"]) if obj.get("deliveryOptions") is not None else None,
|
|
124
|
+
"template": GetInappNotificationsResponseNotificationsInnerTemplate.from_dict(obj["template"]) if obj.get("template") is not None else None,
|
|
125
|
+
"parameters": obj.get("parameters"),
|
|
126
|
+
"date": obj.get("date"),
|
|
127
|
+
"opened": obj.get("opened"),
|
|
128
|
+
"clicked": obj.get("clicked"),
|
|
129
|
+
"archived": obj.get("archived"),
|
|
130
|
+
"actioned1": obj.get("actioned1"),
|
|
131
|
+
"actioned2": obj.get("actioned2"),
|
|
132
|
+
"replies": [GetInappNotificationsResponseNotificationsInnerRepliesInner.from_dict(_item) for _item in obj["replies"]] if obj.get("replies") is not None else None,
|
|
133
|
+
"expDate": obj.get("expDate")
|
|
134
|
+
})
|
|
135
|
+
return _obj
|
|
136
|
+
|
|
137
|
+
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
NotificationAPI
|
|
5
|
+
|
|
6
|
+
Internal API for notification delivery and management
|
|
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, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from pingram.models.get_inapp_notifications_response_notifications_inner_delivery_options_instant import GetInappNotificationsResponseNotificationsInnerDeliveryOptionsInstant
|
|
23
|
+
from pingram.models.get_inapp_notifications_response_notifications_inner_delivery_options_off import GetInappNotificationsResponseNotificationsInnerDeliveryOptionsOff
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class GetInappNotificationsResponseNotificationsInnerDeliveryOptions(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
GetInappNotificationsResponseNotificationsInnerDeliveryOptions
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
default_delivery_option: StrictStr = Field(alias="defaultDeliveryOption")
|
|
32
|
+
off: Optional[GetInappNotificationsResponseNotificationsInnerDeliveryOptionsOff] = None
|
|
33
|
+
instant: Optional[GetInappNotificationsResponseNotificationsInnerDeliveryOptionsInstant] = None
|
|
34
|
+
__properties: ClassVar[List[str]] = ["defaultDeliveryOption", "off", "instant"]
|
|
35
|
+
|
|
36
|
+
@field_validator('default_delivery_option')
|
|
37
|
+
def default_delivery_option_validate_enum(cls, value):
|
|
38
|
+
"""Validates the enum"""
|
|
39
|
+
if value not in set(['off', 'instant']):
|
|
40
|
+
raise ValueError("must be one of enum values ('off', 'instant')")
|
|
41
|
+
return value
|
|
42
|
+
|
|
43
|
+
model_config = ConfigDict(
|
|
44
|
+
populate_by_name=True,
|
|
45
|
+
validate_assignment=True,
|
|
46
|
+
protected_namespaces=(),
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def to_str(self) -> str:
|
|
51
|
+
"""Returns the string representation of the model using alias"""
|
|
52
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
53
|
+
|
|
54
|
+
def to_json(self) -> str:
|
|
55
|
+
"""Returns the JSON representation of the model using alias"""
|
|
56
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
57
|
+
return json.dumps(self.to_dict())
|
|
58
|
+
|
|
59
|
+
@classmethod
|
|
60
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
61
|
+
"""Create an instance of GetInappNotificationsResponseNotificationsInnerDeliveryOptions from a JSON string"""
|
|
62
|
+
return cls.from_dict(json.loads(json_str))
|
|
63
|
+
|
|
64
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
65
|
+
"""Return the dictionary representation of the model using alias.
|
|
66
|
+
|
|
67
|
+
This has the following differences from calling pydantic's
|
|
68
|
+
`self.model_dump(by_alias=True)`:
|
|
69
|
+
|
|
70
|
+
* `None` is only added to the output dict for nullable fields that
|
|
71
|
+
were set at model initialization. Other fields with value `None`
|
|
72
|
+
are ignored.
|
|
73
|
+
"""
|
|
74
|
+
excluded_fields: Set[str] = set([
|
|
75
|
+
])
|
|
76
|
+
|
|
77
|
+
_dict = self.model_dump(
|
|
78
|
+
by_alias=True,
|
|
79
|
+
exclude=excluded_fields,
|
|
80
|
+
exclude_none=True,
|
|
81
|
+
)
|
|
82
|
+
# override the default output from pydantic by calling `to_dict()` of off
|
|
83
|
+
if self.off:
|
|
84
|
+
_dict['off'] = self.off.to_dict()
|
|
85
|
+
# override the default output from pydantic by calling `to_dict()` of instant
|
|
86
|
+
if self.instant:
|
|
87
|
+
_dict['instant'] = self.instant.to_dict()
|
|
88
|
+
return _dict
|
|
89
|
+
|
|
90
|
+
@classmethod
|
|
91
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
92
|
+
"""Create an instance of GetInappNotificationsResponseNotificationsInnerDeliveryOptions from a dict"""
|
|
93
|
+
if obj is None:
|
|
94
|
+
return None
|
|
95
|
+
|
|
96
|
+
if not isinstance(obj, dict):
|
|
97
|
+
return cls.model_validate(obj)
|
|
98
|
+
|
|
99
|
+
_obj = cls.model_validate({
|
|
100
|
+
"defaultDeliveryOption": obj.get("defaultDeliveryOption"),
|
|
101
|
+
"off": GetInappNotificationsResponseNotificationsInnerDeliveryOptionsOff.from_dict(obj["off"]) if obj.get("off") is not None else None,
|
|
102
|
+
"instant": GetInappNotificationsResponseNotificationsInnerDeliveryOptionsInstant.from_dict(obj["instant"]) if obj.get("instant") is not None else None
|
|
103
|
+
})
|
|
104
|
+
return _obj
|
|
105
|
+
|
|
106
|
+
|
pingram/models/get_inapp_notifications_response_notifications_inner_delivery_options_instant.py
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
NotificationAPI
|
|
5
|
+
|
|
6
|
+
Internal API for notification delivery and management
|
|
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, StrictBool, StrictFloat, StrictInt, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class GetInappNotificationsResponseNotificationsInnerDeliveryOptionsInstant(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
GetInappNotificationsResponseNotificationsInnerDeliveryOptionsInstant
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
enabled: StrictBool
|
|
30
|
+
batching: Optional[StrictBool] = None
|
|
31
|
+
batching_key: Optional[StrictStr] = Field(default=None, alias="batchingKey")
|
|
32
|
+
batching_window: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="batchingWindow")
|
|
33
|
+
__properties: ClassVar[List[str]] = ["enabled", "batching", "batchingKey", "batchingWindow"]
|
|
34
|
+
|
|
35
|
+
model_config = ConfigDict(
|
|
36
|
+
populate_by_name=True,
|
|
37
|
+
validate_assignment=True,
|
|
38
|
+
protected_namespaces=(),
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def to_str(self) -> str:
|
|
43
|
+
"""Returns the string representation of the model using alias"""
|
|
44
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
45
|
+
|
|
46
|
+
def to_json(self) -> str:
|
|
47
|
+
"""Returns the JSON representation of the model using alias"""
|
|
48
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
49
|
+
return json.dumps(self.to_dict())
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
53
|
+
"""Create an instance of GetInappNotificationsResponseNotificationsInnerDeliveryOptionsInstant from a JSON string"""
|
|
54
|
+
return cls.from_dict(json.loads(json_str))
|
|
55
|
+
|
|
56
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
57
|
+
"""Return the dictionary representation of the model using alias.
|
|
58
|
+
|
|
59
|
+
This has the following differences from calling pydantic's
|
|
60
|
+
`self.model_dump(by_alias=True)`:
|
|
61
|
+
|
|
62
|
+
* `None` is only added to the output dict for nullable fields that
|
|
63
|
+
were set at model initialization. Other fields with value `None`
|
|
64
|
+
are ignored.
|
|
65
|
+
"""
|
|
66
|
+
excluded_fields: Set[str] = set([
|
|
67
|
+
])
|
|
68
|
+
|
|
69
|
+
_dict = self.model_dump(
|
|
70
|
+
by_alias=True,
|
|
71
|
+
exclude=excluded_fields,
|
|
72
|
+
exclude_none=True,
|
|
73
|
+
)
|
|
74
|
+
return _dict
|
|
75
|
+
|
|
76
|
+
@classmethod
|
|
77
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
78
|
+
"""Create an instance of GetInappNotificationsResponseNotificationsInnerDeliveryOptionsInstant from a dict"""
|
|
79
|
+
if obj is None:
|
|
80
|
+
return None
|
|
81
|
+
|
|
82
|
+
if not isinstance(obj, dict):
|
|
83
|
+
return cls.model_validate(obj)
|
|
84
|
+
|
|
85
|
+
_obj = cls.model_validate({
|
|
86
|
+
"enabled": obj.get("enabled"),
|
|
87
|
+
"batching": obj.get("batching"),
|
|
88
|
+
"batchingKey": obj.get("batchingKey"),
|
|
89
|
+
"batchingWindow": obj.get("batchingWindow")
|
|
90
|
+
})
|
|
91
|
+
return _obj
|
|
92
|
+
|
|
93
|
+
|