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.
Files changed (189) hide show
  1. pingram/__init__.py +395 -0
  2. pingram/api/__init__.py +21 -0
  3. pingram/api/account_api.py +2198 -0
  4. pingram/api/addresses_api.py +860 -0
  5. pingram/api/components_api.py +1681 -0
  6. pingram/api/default_api.py +320 -0
  7. pingram/api/domains_api.py +849 -0
  8. pingram/api/editor_api.py +320 -0
  9. pingram/api/environments_api.py +878 -0
  10. pingram/api/health_api.py +287 -0
  11. pingram/api/insights_api.py +321 -0
  12. pingram/api/keys_api.py +849 -0
  13. pingram/api/logs_api.py +1632 -0
  14. pingram/api/members_api.py +1780 -0
  15. pingram/api/sender_api.py +892 -0
  16. pingram/api/templates_api.py +1889 -0
  17. pingram/api/types_api.py +1411 -0
  18. pingram/api/user_api.py +2534 -0
  19. pingram/api/users_api.py +936 -0
  20. pingram/api_client.py +807 -0
  21. pingram/api_response.py +21 -0
  22. pingram/client_wrapper.py +357 -0
  23. pingram/configuration.py +623 -0
  24. pingram/exceptions.py +219 -0
  25. pingram/models/__init__.py +173 -0
  26. pingram/models/account_addresses_response.py +95 -0
  27. pingram/models/account_addresses_response_addresses_inner.py +104 -0
  28. pingram/models/account_get_response.py +143 -0
  29. pingram/models/account_get_response_pending_downgrade_usage_limit.py +99 -0
  30. pingram/models/address_response.py +91 -0
  31. pingram/models/auto_join_get_response.py +89 -0
  32. pingram/models/auto_join_post_response.py +89 -0
  33. pingram/models/auto_join_request_body.py +87 -0
  34. pingram/models/bee_token_v2.py +89 -0
  35. pingram/models/billing_post_request_body.py +91 -0
  36. pingram/models/billing_post_response_body.py +149 -0
  37. pingram/models/billing_post_response_body_pending_downgrade_usage_limit.py +99 -0
  38. pingram/models/channels_enum.py +42 -0
  39. pingram/models/create_account_request_body.py +87 -0
  40. pingram/models/create_account_response.py +89 -0
  41. pingram/models/create_address_request.py +91 -0
  42. pingram/models/create_key_request.py +98 -0
  43. pingram/models/create_key_response.py +104 -0
  44. pingram/models/delete_key_response.py +87 -0
  45. pingram/models/delete_user_response.py +87 -0
  46. pingram/models/email_auth_token_post_request.py +87 -0
  47. pingram/models/email_component_patch_request.py +93 -0
  48. pingram/models/email_component_post_request.py +95 -0
  49. pingram/models/email_component_response.py +120 -0
  50. pingram/models/email_component_response_referenced_by_inner.py +92 -0
  51. pingram/models/environment.py +96 -0
  52. pingram/models/environment_create_request.py +87 -0
  53. pingram/models/environment_patch_request.py +94 -0
  54. pingram/models/get_account_metadata_response.py +91 -0
  55. pingram/models/get_account_metadata_response_user_account_metadata.py +91 -0
  56. pingram/models/get_email_components_response_inner.py +120 -0
  57. pingram/models/get_environments_response_inner.py +96 -0
  58. pingram/models/get_inapp_notifications_response.py +95 -0
  59. pingram/models/get_inapp_notifications_response_notifications_inner.py +137 -0
  60. pingram/models/get_inapp_notifications_response_notifications_inner_delivery_options.py +106 -0
  61. pingram/models/get_inapp_notifications_response_notifications_inner_delivery_options_instant.py +93 -0
  62. pingram/models/get_inapp_notifications_response_notifications_inner_delivery_options_off.py +87 -0
  63. pingram/models/get_inapp_notifications_response_notifications_inner_replies_inner.py +89 -0
  64. pingram/models/get_inapp_notifications_response_notifications_inner_template.py +136 -0
  65. pingram/models/get_inapp_notifications_response_notifications_inner_template_any_of.py +98 -0
  66. pingram/models/get_keys_response.py +95 -0
  67. pingram/models/get_keys_response_keys_inner.py +110 -0
  68. pingram/models/get_logs_response.py +97 -0
  69. pingram/models/get_logs_response_messages_inner.py +141 -0
  70. pingram/models/get_logs_response_messages_inner_attachments_inner.py +93 -0
  71. pingram/models/get_members_response_inner.py +95 -0
  72. pingram/models/get_metrics_response_inner.py +116 -0
  73. pingram/models/get_metrics_response_inner_messages_inner.py +89 -0
  74. pingram/models/get_notifications_response_inner.py +126 -0
  75. pingram/models/get_notifications_response_inner_deduplication.py +87 -0
  76. pingram/models/get_notifications_response_inner_options.py +122 -0
  77. pingram/models/get_notifications_response_inner_options_email.py +128 -0
  78. pingram/models/get_notifications_response_inner_options_email_daily.py +89 -0
  79. pingram/models/get_notifications_response_inner_options_email_monthly.py +101 -0
  80. pingram/models/get_notifications_response_inner_options_email_weekly.py +91 -0
  81. pingram/models/get_notifications_response_inner_templates_inner.py +90 -0
  82. pingram/models/get_notifications_response_inner_throttling.py +111 -0
  83. pingram/models/get_senders_response_inner.py +128 -0
  84. pingram/models/get_templates_response.py +136 -0
  85. pingram/models/get_users_response.py +99 -0
  86. pingram/models/get_users_response_users_inner.py +133 -0
  87. pingram/models/get_users_response_users_inner_email_suppression_status.py +96 -0
  88. pingram/models/get_users_response_users_inner_push_tokens_inner.py +104 -0
  89. pingram/models/get_users_response_users_inner_push_tokens_inner_device.py +97 -0
  90. pingram/models/get_users_response_users_inner_slack_token.py +140 -0
  91. pingram/models/get_users_response_users_inner_slack_token_authed_user.py +97 -0
  92. pingram/models/get_users_response_users_inner_slack_token_enterprise.py +89 -0
  93. pingram/models/get_users_response_users_inner_slack_token_incoming_webhook.py +93 -0
  94. pingram/models/get_users_response_users_inner_slack_token_response_metadata.py +97 -0
  95. pingram/models/get_users_response_users_inner_web_push_tokens_inner.py +91 -0
  96. pingram/models/get_users_response_users_inner_web_push_tokens_inner_sub.py +93 -0
  97. pingram/models/get_users_response_users_inner_web_push_tokens_inner_sub_keys.py +89 -0
  98. pingram/models/in_app_notification_patch_request.py +112 -0
  99. pingram/models/in_app_notification_unread_clear_request.py +89 -0
  100. pingram/models/inapp_unread_count_response.py +87 -0
  101. pingram/models/inbound_request_body.py +138 -0
  102. pingram/models/inbound_response_body.py +104 -0
  103. pingram/models/inbound_response_body_results_inner.py +103 -0
  104. pingram/models/ingishts_post_request.py +121 -0
  105. pingram/models/ingishts_post_request_label_options.py +87 -0
  106. pingram/models/ingishts_post_request_metric_data_queries_inner.py +103 -0
  107. pingram/models/ingishts_post_request_metric_data_queries_inner_metric_stat.py +107 -0
  108. pingram/models/ingishts_post_request_metric_data_queries_inner_metric_stat_metric.py +99 -0
  109. pingram/models/ingishts_post_request_metric_data_queries_inner_metric_stat_metric_dimensions_inner.py +89 -0
  110. pingram/models/intercom_webhook.py +106 -0
  111. pingram/models/intercom_webhook_data.py +91 -0
  112. pingram/models/intercom_webhook_data_item.py +136 -0
  113. pingram/models/intercom_webhook_data_item_any_of.py +140 -0
  114. pingram/models/intercom_webhook_data_item_any_of_contacts.py +104 -0
  115. pingram/models/intercom_webhook_data_item_any_of_contacts_contacts_inner.py +91 -0
  116. pingram/models/intercom_webhook_data_item_any_of_source.py +101 -0
  117. pingram/models/intercom_webhook_data_item_any_of_source_author.py +93 -0
  118. pingram/models/invite_post_response.py +89 -0
  119. pingram/models/log_query_post_body.py +109 -0
  120. pingram/models/logs_bulk_request.py +87 -0
  121. pingram/models/logs_get_response.py +95 -0
  122. pingram/models/logs_get_response_logs_inner.py +627 -0
  123. pingram/models/logs_query_response.py +87 -0
  124. pingram/models/logs_query_result_response.py +101 -0
  125. pingram/models/logs_retention_response.py +87 -0
  126. pingram/models/logs_tail_response.py +95 -0
  127. pingram/models/member_invite_request.py +89 -0
  128. pingram/models/member_update_request.py +87 -0
  129. pingram/models/message_response.py +87 -0
  130. pingram/models/notification.py +126 -0
  131. pingram/models/notification_create_request.py +97 -0
  132. pingram/models/notification_patch_request.py +112 -0
  133. pingram/models/post_email_test_request.py +99 -0
  134. pingram/models/post_email_test_response.py +89 -0
  135. pingram/models/post_senders_request_body.py +87 -0
  136. pingram/models/post_user_request.py +121 -0
  137. pingram/models/sender_post_body.py +166 -0
  138. pingram/models/sender_post_body_email.py +95 -0
  139. pingram/models/sender_post_body_inapp.py +91 -0
  140. pingram/models/sender_post_body_mobile_push.py +89 -0
  141. pingram/models/sender_post_body_options.py +103 -0
  142. pingram/models/sender_post_body_options_apn.py +99 -0
  143. pingram/models/sender_post_body_options_email.py +107 -0
  144. pingram/models/sender_post_body_options_email_attachments_inner.py +134 -0
  145. pingram/models/sender_post_body_options_email_attachments_inner_any_of.py +89 -0
  146. pingram/models/sender_post_body_options_email_attachments_inner_any_of1.py +91 -0
  147. pingram/models/sender_post_body_options_fcm.py +91 -0
  148. pingram/models/sender_post_body_options_fcm_android.py +103 -0
  149. pingram/models/sender_post_body_slack.py +123 -0
  150. pingram/models/sender_post_body_slack_metadata.py +99 -0
  151. pingram/models/sender_post_body_slack_metadata_entities_inner.py +99 -0
  152. pingram/models/sender_post_body_slack_metadata_entities_inner_external_ref.py +89 -0
  153. pingram/models/sender_post_body_sms.py +93 -0
  154. pingram/models/sender_post_body_sms_auto_reply.py +87 -0
  155. pingram/models/sender_post_body_to.py +133 -0
  156. pingram/models/sender_post_body_user.py +133 -0
  157. pingram/models/sender_post_body_web_push.py +93 -0
  158. pingram/models/sender_post_response.py +89 -0
  159. pingram/models/set_default_template_request.py +97 -0
  160. pingram/models/slack_interactivity_response.py +87 -0
  161. pingram/models/slack_oauth_request.py +89 -0
  162. pingram/models/success_response.py +87 -0
  163. pingram/models/supabase_configure_request.py +93 -0
  164. pingram/models/supabase_configure_response.py +89 -0
  165. pingram/models/supabase_o_auth_request.py +91 -0
  166. pingram/models/supabase_o_auth_response.py +89 -0
  167. pingram/models/supabase_projects_response.py +95 -0
  168. pingram/models/supabase_projects_response_projects_inner.py +95 -0
  169. pingram/models/supabase_status_response.py +93 -0
  170. pingram/models/template.py +98 -0
  171. pingram/models/template_patch_request.py +134 -0
  172. pingram/models/template_patch_request_any_of.py +97 -0
  173. pingram/models/template_patch_request_any_of1.py +103 -0
  174. pingram/models/template_patch_request_any_of1_batch.py +91 -0
  175. pingram/models/template_patch_request_any_of1_instant.py +91 -0
  176. pingram/models/template_post_request.py +131 -0
  177. pingram/models/template_post_request_batch.py +91 -0
  178. pingram/models/template_post_request_instant.py +91 -0
  179. pingram/models/update_address_request.py +91 -0
  180. pingram/models/user.py +133 -0
  181. pingram/models/user_suppression_delete_response.py +91 -0
  182. pingram/models/webhook_response.py +104 -0
  183. pingram/py.typed +0 -0
  184. pingram/rest.py +199 -0
  185. pingram_python-0.1.0.dist-info/METADATA +69 -0
  186. pingram_python-0.1.0.dist-info/RECORD +189 -0
  187. pingram_python-0.1.0.dist-info/WHEEL +5 -0
  188. pingram_python-0.1.0.dist-info/licenses/LICENSE +21 -0
  189. pingram_python-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,91 @@
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, StrictBool, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class GetNotificationsResponseInnerOptionsEMAILWeekly(BaseModel):
26
+ """
27
+ GetNotificationsResponseInnerOptionsEMAILWeekly
28
+ """ # noqa: E501
29
+ enabled: StrictBool
30
+ hour: Optional[StrictStr] = None
31
+ day: Optional[StrictStr] = None
32
+ __properties: ClassVar[List[str]] = ["enabled", "hour", "day"]
33
+
34
+ model_config = ConfigDict(
35
+ populate_by_name=True,
36
+ validate_assignment=True,
37
+ protected_namespaces=(),
38
+ )
39
+
40
+
41
+ def to_str(self) -> str:
42
+ """Returns the string representation of the model using alias"""
43
+ return pprint.pformat(self.model_dump(by_alias=True))
44
+
45
+ def to_json(self) -> str:
46
+ """Returns the JSON representation of the model using alias"""
47
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
+ return json.dumps(self.to_dict())
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of GetNotificationsResponseInnerOptionsEMAILWeekly from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
54
+
55
+ def to_dict(self) -> Dict[str, Any]:
56
+ """Return the dictionary representation of the model using alias.
57
+
58
+ This has the following differences from calling pydantic's
59
+ `self.model_dump(by_alias=True)`:
60
+
61
+ * `None` is only added to the output dict for nullable fields that
62
+ were set at model initialization. Other fields with value `None`
63
+ are ignored.
64
+ """
65
+ excluded_fields: Set[str] = set([
66
+ ])
67
+
68
+ _dict = self.model_dump(
69
+ by_alias=True,
70
+ exclude=excluded_fields,
71
+ exclude_none=True,
72
+ )
73
+ return _dict
74
+
75
+ @classmethod
76
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
77
+ """Create an instance of GetNotificationsResponseInnerOptionsEMAILWeekly from a dict"""
78
+ if obj is None:
79
+ return None
80
+
81
+ if not isinstance(obj, dict):
82
+ return cls.model_validate(obj)
83
+
84
+ _obj = cls.model_validate({
85
+ "enabled": obj.get("enabled"),
86
+ "hour": obj.get("hour"),
87
+ "day": obj.get("day")
88
+ })
89
+ return _obj
90
+
91
+
@@ -0,0 +1,90 @@
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
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 GetNotificationsResponseInnerTemplatesInner(BaseModel):
27
+ """
28
+ GetNotificationsResponseInnerTemplatesInner
29
+ """ # noqa: E501
30
+ channel: ChannelsEnum
31
+ template_ids: List[StrictStr] = Field(alias="templateIds")
32
+ __properties: ClassVar[List[str]] = ["channel", "templateIds"]
33
+
34
+ model_config = ConfigDict(
35
+ populate_by_name=True,
36
+ validate_assignment=True,
37
+ protected_namespaces=(),
38
+ )
39
+
40
+
41
+ def to_str(self) -> str:
42
+ """Returns the string representation of the model using alias"""
43
+ return pprint.pformat(self.model_dump(by_alias=True))
44
+
45
+ def to_json(self) -> str:
46
+ """Returns the JSON representation of the model using alias"""
47
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
+ return json.dumps(self.to_dict())
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of GetNotificationsResponseInnerTemplatesInner from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
54
+
55
+ def to_dict(self) -> Dict[str, Any]:
56
+ """Return the dictionary representation of the model using alias.
57
+
58
+ This has the following differences from calling pydantic's
59
+ `self.model_dump(by_alias=True)`:
60
+
61
+ * `None` is only added to the output dict for nullable fields that
62
+ were set at model initialization. Other fields with value `None`
63
+ are ignored.
64
+ """
65
+ excluded_fields: Set[str] = set([
66
+ ])
67
+
68
+ _dict = self.model_dump(
69
+ by_alias=True,
70
+ exclude=excluded_fields,
71
+ exclude_none=True,
72
+ )
73
+ return _dict
74
+
75
+ @classmethod
76
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
77
+ """Create an instance of GetNotificationsResponseInnerTemplatesInner from a dict"""
78
+ if obj is None:
79
+ return None
80
+
81
+ if not isinstance(obj, dict):
82
+ return cls.model_validate(obj)
83
+
84
+ _obj = cls.model_validate({
85
+ "channel": obj.get("channel"),
86
+ "templateIds": obj.get("templateIds")
87
+ })
88
+ return _obj
89
+
90
+
@@ -0,0 +1,111 @@
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, field_validator
21
+ from typing import Any, ClassVar, Dict, List, Union
22
+ from typing_extensions import Annotated
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class GetNotificationsResponseInnerThrottling(BaseModel):
27
+ """
28
+ GetNotificationsResponseInnerThrottling
29
+ """ # noqa: E501
30
+ max: Union[StrictFloat, StrictInt]
31
+ period: Union[StrictFloat, StrictInt]
32
+ unit: StrictStr
33
+ forever: StrictBool
34
+ scope: Annotated[List[StrictStr], Field(min_length=2, max_length=2)]
35
+ __properties: ClassVar[List[str]] = ["max", "period", "unit", "forever", "scope"]
36
+
37
+ @field_validator('unit')
38
+ def unit_validate_enum(cls, value):
39
+ """Validates the enum"""
40
+ if value not in set(['seconds', 'minutes', 'hours', 'days', 'months', 'years']):
41
+ raise ValueError("must be one of enum values ('seconds', 'minutes', 'hours', 'days', 'months', 'years')")
42
+ return value
43
+
44
+ @field_validator('scope')
45
+ def scope_validate_enum(cls, value):
46
+ """Validates the enum"""
47
+ for i in value:
48
+ if i not in set(['userId', 'notificationId']):
49
+ raise ValueError("each list item must be one of ('userId', 'notificationId')")
50
+ return value
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 GetNotificationsResponseInnerThrottling 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
+ return _dict
92
+
93
+ @classmethod
94
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
95
+ """Create an instance of GetNotificationsResponseInnerThrottling from a dict"""
96
+ if obj is None:
97
+ return None
98
+
99
+ if not isinstance(obj, dict):
100
+ return cls.model_validate(obj)
101
+
102
+ _obj = cls.model_validate({
103
+ "max": obj.get("max"),
104
+ "period": obj.get("period"),
105
+ "unit": obj.get("unit"),
106
+ "forever": obj.get("forever"),
107
+ "scope": obj.get("scope")
108
+ })
109
+ return _obj
110
+
111
+
@@ -0,0 +1,128 @@
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 datetime import datetime
21
+ from pydantic import BaseModel, ConfigDict, Field, 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 GetSendersResponseInner(BaseModel):
27
+ """
28
+ GetSendersResponseInner
29
+ """ # noqa: E501
30
+ sender: StrictStr
31
+ status: StrictStr
32
+ last_sync: datetime = Field(alias="lastSync")
33
+ type: StrictStr
34
+ verification_tokens: Optional[List[StrictStr]] = Field(default=None, alias="verificationTokens")
35
+ mail_from_domain_status: Optional[StrictStr] = Field(default=None, alias="mailFromDomainStatus")
36
+ created_at: StrictStr = Field(alias="createdAt")
37
+ private_dkim_key: Optional[StrictStr] = Field(default=None, alias="privateDKIMKey")
38
+ reminder_sent_at: Optional[StrictStr] = Field(default=None, alias="reminderSentAt")
39
+ __properties: ClassVar[List[str]] = ["sender", "status", "lastSync", "type", "verificationTokens", "mailFromDomainStatus", "createdAt", "privateDKIMKey", "reminderSentAt"]
40
+
41
+ @field_validator('status')
42
+ def status_validate_enum(cls, value):
43
+ """Validates the enum"""
44
+ if value not in set(['SUCCESS', 'PENDING', 'FAILED', 'TEMPORARY_FAILURE', 'NOT_STARTED']):
45
+ raise ValueError("must be one of enum values ('SUCCESS', 'PENDING', 'FAILED', 'TEMPORARY_FAILURE', 'NOT_STARTED')")
46
+ return value
47
+
48
+ @field_validator('type')
49
+ def type_validate_enum(cls, value):
50
+ """Validates the enum"""
51
+ if value not in set(['domain', 'email']):
52
+ raise ValueError("must be one of enum values ('domain', 'email')")
53
+ return value
54
+
55
+ @field_validator('mail_from_domain_status')
56
+ def mail_from_domain_status_validate_enum(cls, value):
57
+ """Validates the enum"""
58
+ if value is None:
59
+ return value
60
+
61
+ if value not in set(['PENDING', 'SUCCESS', 'FAILED', 'TEMPORARY_FAILURE']):
62
+ raise ValueError("must be one of enum values ('PENDING', 'SUCCESS', 'FAILED', 'TEMPORARY_FAILURE')")
63
+ return value
64
+
65
+ model_config = ConfigDict(
66
+ populate_by_name=True,
67
+ validate_assignment=True,
68
+ protected_namespaces=(),
69
+ )
70
+
71
+
72
+ def to_str(self) -> str:
73
+ """Returns the string representation of the model using alias"""
74
+ return pprint.pformat(self.model_dump(by_alias=True))
75
+
76
+ def to_json(self) -> str:
77
+ """Returns the JSON representation of the model using alias"""
78
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
79
+ return json.dumps(self.to_dict())
80
+
81
+ @classmethod
82
+ def from_json(cls, json_str: str) -> Optional[Self]:
83
+ """Create an instance of GetSendersResponseInner from a JSON string"""
84
+ return cls.from_dict(json.loads(json_str))
85
+
86
+ def to_dict(self) -> Dict[str, Any]:
87
+ """Return the dictionary representation of the model using alias.
88
+
89
+ This has the following differences from calling pydantic's
90
+ `self.model_dump(by_alias=True)`:
91
+
92
+ * `None` is only added to the output dict for nullable fields that
93
+ were set at model initialization. Other fields with value `None`
94
+ are ignored.
95
+ """
96
+ excluded_fields: Set[str] = set([
97
+ ])
98
+
99
+ _dict = self.model_dump(
100
+ by_alias=True,
101
+ exclude=excluded_fields,
102
+ exclude_none=True,
103
+ )
104
+ return _dict
105
+
106
+ @classmethod
107
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
108
+ """Create an instance of GetSendersResponseInner 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
+ "sender": obj.get("sender"),
117
+ "status": obj.get("status"),
118
+ "lastSync": obj.get("lastSync"),
119
+ "type": obj.get("type"),
120
+ "verificationTokens": obj.get("verificationTokens"),
121
+ "mailFromDomainStatus": obj.get("mailFromDomainStatus"),
122
+ "createdAt": obj.get("createdAt"),
123
+ "privateDKIMKey": obj.get("privateDKIMKey"),
124
+ "reminderSentAt": obj.get("reminderSentAt")
125
+ })
126
+ return _obj
127
+
128
+
@@ -0,0 +1,136 @@
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
+ from inspect import getfullargspec
17
+ import json
18
+ import pprint
19
+ import re # noqa: F401
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
21
+ from typing import List, Optional
22
+ from pingram.models.get_inapp_notifications_response_notifications_inner_template_any_of import GetInappNotificationsResponseNotificationsInnerTemplateAnyOf
23
+ from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
24
+ from typing_extensions import Literal, Self
25
+ from pydantic import Field
26
+
27
+ GETTEMPLATESRESPONSE_ANY_OF_SCHEMAS = ["GetInappNotificationsResponseNotificationsInnerTemplateAnyOf", "List[GetInappNotificationsResponseNotificationsInnerTemplateAnyOf]"]
28
+
29
+ class GetTemplatesResponse(BaseModel):
30
+ """
31
+ GetTemplatesResponse
32
+ """
33
+
34
+ # data type: GetInappNotificationsResponseNotificationsInnerTemplateAnyOf
35
+ anyof_schema_1_validator: Optional[GetInappNotificationsResponseNotificationsInnerTemplateAnyOf] = None
36
+ # data type: List[GetInappNotificationsResponseNotificationsInnerTemplateAnyOf]
37
+ anyof_schema_2_validator: Optional[List[GetInappNotificationsResponseNotificationsInnerTemplateAnyOf]] = None
38
+ if TYPE_CHECKING:
39
+ actual_instance: Optional[Union[GetInappNotificationsResponseNotificationsInnerTemplateAnyOf, List[GetInappNotificationsResponseNotificationsInnerTemplateAnyOf]]] = None
40
+ else:
41
+ actual_instance: Any = None
42
+ any_of_schemas: Set[str] = { "GetInappNotificationsResponseNotificationsInnerTemplateAnyOf", "List[GetInappNotificationsResponseNotificationsInnerTemplateAnyOf]" }
43
+
44
+ model_config = {
45
+ "validate_assignment": True,
46
+ "protected_namespaces": (),
47
+ }
48
+
49
+ def __init__(self, *args, **kwargs) -> None:
50
+ if args:
51
+ if len(args) > 1:
52
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
53
+ if kwargs:
54
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
55
+ super().__init__(actual_instance=args[0])
56
+ else:
57
+ super().__init__(**kwargs)
58
+
59
+ @field_validator('actual_instance')
60
+ def actual_instance_must_validate_anyof(cls, v):
61
+ instance = GetTemplatesResponse.model_construct()
62
+ error_messages = []
63
+ # validate data type: GetInappNotificationsResponseNotificationsInnerTemplateAnyOf
64
+ if not isinstance(v, GetInappNotificationsResponseNotificationsInnerTemplateAnyOf):
65
+ error_messages.append(f"Error! Input type `{type(v)}` is not `GetInappNotificationsResponseNotificationsInnerTemplateAnyOf`")
66
+ else:
67
+ return v
68
+
69
+ # validate data type: List[GetInappNotificationsResponseNotificationsInnerTemplateAnyOf]
70
+ try:
71
+ instance.anyof_schema_2_validator = v
72
+ return v
73
+ except (ValidationError, ValueError) as e:
74
+ error_messages.append(str(e))
75
+ if error_messages:
76
+ # no match
77
+ raise ValueError("No match found when setting the actual_instance in GetTemplatesResponse with anyOf schemas: GetInappNotificationsResponseNotificationsInnerTemplateAnyOf, List[GetInappNotificationsResponseNotificationsInnerTemplateAnyOf]. Details: " + ", ".join(error_messages))
78
+ else:
79
+ return v
80
+
81
+ @classmethod
82
+ def from_dict(cls, obj: Dict[str, Any]) -> Self:
83
+ return cls.from_json(json.dumps(obj))
84
+
85
+ @classmethod
86
+ def from_json(cls, json_str: str) -> Self:
87
+ """Returns the object represented by the json string"""
88
+ instance = cls.model_construct()
89
+ error_messages = []
90
+ # anyof_schema_1_validator: Optional[GetInappNotificationsResponseNotificationsInnerTemplateAnyOf] = None
91
+ try:
92
+ instance.actual_instance = GetInappNotificationsResponseNotificationsInnerTemplateAnyOf.from_json(json_str)
93
+ return instance
94
+ except (ValidationError, ValueError) as e:
95
+ error_messages.append(str(e))
96
+ # deserialize data into List[GetInappNotificationsResponseNotificationsInnerTemplateAnyOf]
97
+ try:
98
+ # validation
99
+ instance.anyof_schema_2_validator = json.loads(json_str)
100
+ # assign value to actual_instance
101
+ instance.actual_instance = instance.anyof_schema_2_validator
102
+ return instance
103
+ except (ValidationError, ValueError) as e:
104
+ error_messages.append(str(e))
105
+
106
+ if error_messages:
107
+ # no match
108
+ raise ValueError("No match found when deserializing the JSON string into GetTemplatesResponse with anyOf schemas: GetInappNotificationsResponseNotificationsInnerTemplateAnyOf, List[GetInappNotificationsResponseNotificationsInnerTemplateAnyOf]. Details: " + ", ".join(error_messages))
109
+ else:
110
+ return instance
111
+
112
+ def to_json(self) -> str:
113
+ """Returns the JSON representation of the actual instance"""
114
+ if self.actual_instance is None:
115
+ return "null"
116
+
117
+ if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
118
+ return self.actual_instance.to_json()
119
+ else:
120
+ return json.dumps(self.actual_instance)
121
+
122
+ def to_dict(self) -> Optional[Union[Dict[str, Any], GetInappNotificationsResponseNotificationsInnerTemplateAnyOf, List[GetInappNotificationsResponseNotificationsInnerTemplateAnyOf]]]:
123
+ """Returns the dict representation of the actual instance"""
124
+ if self.actual_instance is None:
125
+ return None
126
+
127
+ if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
128
+ return self.actual_instance.to_dict()
129
+ else:
130
+ return self.actual_instance
131
+
132
+ def to_str(self) -> str:
133
+ """Returns the string representation of the actual instance"""
134
+ return pprint.pformat(self.model_dump())
135
+
136
+
@@ -0,0 +1,99 @@
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_users_response_users_inner import GetUsersResponseUsersInner
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class GetUsersResponse(BaseModel):
27
+ """
28
+ GetUsersResponse
29
+ """ # noqa: E501
30
+ users: List[GetUsersResponseUsersInner]
31
+ last_evaluated_key: Optional[StrictStr] = Field(default=None, alias="lastEvaluatedKey")
32
+ has_more: StrictBool = Field(alias="hasMore")
33
+ __properties: ClassVar[List[str]] = ["users", "lastEvaluatedKey", "hasMore"]
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 GetUsersResponse 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
+ # override the default output from pydantic by calling `to_dict()` of each item in users (list)
75
+ _items = []
76
+ if self.users:
77
+ for _item_users in self.users:
78
+ if _item_users:
79
+ _items.append(_item_users.to_dict())
80
+ _dict['users'] = _items
81
+ return _dict
82
+
83
+ @classmethod
84
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
85
+ """Create an instance of GetUsersResponse from a dict"""
86
+ if obj is None:
87
+ return None
88
+
89
+ if not isinstance(obj, dict):
90
+ return cls.model_validate(obj)
91
+
92
+ _obj = cls.model_validate({
93
+ "users": [GetUsersResponseUsersInner.from_dict(_item) for _item in obj["users"]] if obj.get("users") is not None else None,
94
+ "lastEvaluatedKey": obj.get("lastEvaluatedKey"),
95
+ "hasMore": obj.get("hasMore")
96
+ })
97
+ return _obj
98
+
99
+