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,1889 @@
|
|
|
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
|
+
import warnings
|
|
15
|
+
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
|
16
|
+
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
17
|
+
from typing_extensions import Annotated
|
|
18
|
+
|
|
19
|
+
from pydantic import Field, StrictStr
|
|
20
|
+
from typing_extensions import Annotated
|
|
21
|
+
from pingram.models.get_templates_response import GetTemplatesResponse
|
|
22
|
+
from pingram.models.set_default_template_request import SetDefaultTemplateRequest
|
|
23
|
+
from pingram.models.template import Template
|
|
24
|
+
from pingram.models.template_patch_request import TemplatePatchRequest
|
|
25
|
+
from pingram.models.template_post_request import TemplatePostRequest
|
|
26
|
+
|
|
27
|
+
from pingram.api_client import ApiClient, RequestSerialized
|
|
28
|
+
from pingram.api_response import ApiResponse
|
|
29
|
+
from pingram.rest import RESTResponseType
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class TemplatesApi:
|
|
33
|
+
"""NOTE: This class is auto generated by OpenAPI Generator
|
|
34
|
+
Ref: https://openapi-generator.tech
|
|
35
|
+
|
|
36
|
+
Do not edit the class manually.
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
def __init__(self, api_client=None) -> None:
|
|
40
|
+
if api_client is None:
|
|
41
|
+
api_client = ApiClient.get_default()
|
|
42
|
+
self.api_client = api_client
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
@validate_call
|
|
46
|
+
async def templates_create_template(
|
|
47
|
+
self,
|
|
48
|
+
notification_id: Annotated[StrictStr, Field(description="Notification ID")],
|
|
49
|
+
channel: Annotated[StrictStr, Field(description="Channel type")],
|
|
50
|
+
template_post_request: TemplatePostRequest,
|
|
51
|
+
_request_timeout: Union[
|
|
52
|
+
None,
|
|
53
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
54
|
+
Tuple[
|
|
55
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
56
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
57
|
+
]
|
|
58
|
+
] = None,
|
|
59
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
60
|
+
_content_type: Optional[StrictStr] = None,
|
|
61
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
62
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
63
|
+
) -> Template:
|
|
64
|
+
"""Create a new template for a notification
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
:param notification_id: Notification ID (required)
|
|
68
|
+
:type notification_id: str
|
|
69
|
+
:param channel: Channel type (required)
|
|
70
|
+
:type channel: str
|
|
71
|
+
:param template_post_request: (required)
|
|
72
|
+
:type template_post_request: TemplatePostRequest
|
|
73
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
74
|
+
number provided, it will be total request
|
|
75
|
+
timeout. It can also be a pair (tuple) of
|
|
76
|
+
(connection, read) timeouts.
|
|
77
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
78
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
79
|
+
request; this effectively ignores the
|
|
80
|
+
authentication in the spec for a single request.
|
|
81
|
+
:type _request_auth: dict, optional
|
|
82
|
+
:param _content_type: force content-type for the request.
|
|
83
|
+
:type _content_type: str, Optional
|
|
84
|
+
:param _headers: set to override the headers for a single
|
|
85
|
+
request; this effectively ignores the headers
|
|
86
|
+
in the spec for a single request.
|
|
87
|
+
:type _headers: dict, optional
|
|
88
|
+
:param _host_index: set to override the host_index for a single
|
|
89
|
+
request; this effectively ignores the host_index
|
|
90
|
+
in the spec for a single request.
|
|
91
|
+
:type _host_index: int, optional
|
|
92
|
+
:return: Returns the result object.
|
|
93
|
+
""" # noqa: E501
|
|
94
|
+
|
|
95
|
+
_param = self._templates_create_template_serialize(
|
|
96
|
+
notification_id=notification_id,
|
|
97
|
+
channel=channel,
|
|
98
|
+
template_post_request=template_post_request,
|
|
99
|
+
_request_auth=_request_auth,
|
|
100
|
+
_content_type=_content_type,
|
|
101
|
+
_headers=_headers,
|
|
102
|
+
_host_index=_host_index
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
106
|
+
'200': "Template",
|
|
107
|
+
'400': None,
|
|
108
|
+
'401': None,
|
|
109
|
+
'500': None,
|
|
110
|
+
}
|
|
111
|
+
response_data = await self.api_client.call_api(
|
|
112
|
+
*_param,
|
|
113
|
+
_request_timeout=_request_timeout
|
|
114
|
+
)
|
|
115
|
+
await response_data.read()
|
|
116
|
+
return self.api_client.response_deserialize(
|
|
117
|
+
response_data=response_data,
|
|
118
|
+
response_types_map=_response_types_map,
|
|
119
|
+
).data
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
@validate_call
|
|
123
|
+
async def templates_create_template_with_http_info(
|
|
124
|
+
self,
|
|
125
|
+
notification_id: Annotated[StrictStr, Field(description="Notification ID")],
|
|
126
|
+
channel: Annotated[StrictStr, Field(description="Channel type")],
|
|
127
|
+
template_post_request: TemplatePostRequest,
|
|
128
|
+
_request_timeout: Union[
|
|
129
|
+
None,
|
|
130
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
131
|
+
Tuple[
|
|
132
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
133
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
134
|
+
]
|
|
135
|
+
] = None,
|
|
136
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
137
|
+
_content_type: Optional[StrictStr] = None,
|
|
138
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
139
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
140
|
+
) -> ApiResponse[Template]:
|
|
141
|
+
"""Create a new template for a notification
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
:param notification_id: Notification ID (required)
|
|
145
|
+
:type notification_id: str
|
|
146
|
+
:param channel: Channel type (required)
|
|
147
|
+
:type channel: str
|
|
148
|
+
:param template_post_request: (required)
|
|
149
|
+
:type template_post_request: TemplatePostRequest
|
|
150
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
151
|
+
number provided, it will be total request
|
|
152
|
+
timeout. It can also be a pair (tuple) of
|
|
153
|
+
(connection, read) timeouts.
|
|
154
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
155
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
156
|
+
request; this effectively ignores the
|
|
157
|
+
authentication in the spec for a single request.
|
|
158
|
+
:type _request_auth: dict, optional
|
|
159
|
+
:param _content_type: force content-type for the request.
|
|
160
|
+
:type _content_type: str, Optional
|
|
161
|
+
:param _headers: set to override the headers for a single
|
|
162
|
+
request; this effectively ignores the headers
|
|
163
|
+
in the spec for a single request.
|
|
164
|
+
:type _headers: dict, optional
|
|
165
|
+
:param _host_index: set to override the host_index for a single
|
|
166
|
+
request; this effectively ignores the host_index
|
|
167
|
+
in the spec for a single request.
|
|
168
|
+
:type _host_index: int, optional
|
|
169
|
+
:return: Returns the result object.
|
|
170
|
+
""" # noqa: E501
|
|
171
|
+
|
|
172
|
+
_param = self._templates_create_template_serialize(
|
|
173
|
+
notification_id=notification_id,
|
|
174
|
+
channel=channel,
|
|
175
|
+
template_post_request=template_post_request,
|
|
176
|
+
_request_auth=_request_auth,
|
|
177
|
+
_content_type=_content_type,
|
|
178
|
+
_headers=_headers,
|
|
179
|
+
_host_index=_host_index
|
|
180
|
+
)
|
|
181
|
+
|
|
182
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
183
|
+
'200': "Template",
|
|
184
|
+
'400': None,
|
|
185
|
+
'401': None,
|
|
186
|
+
'500': None,
|
|
187
|
+
}
|
|
188
|
+
response_data = await self.api_client.call_api(
|
|
189
|
+
*_param,
|
|
190
|
+
_request_timeout=_request_timeout
|
|
191
|
+
)
|
|
192
|
+
await response_data.read()
|
|
193
|
+
return self.api_client.response_deserialize(
|
|
194
|
+
response_data=response_data,
|
|
195
|
+
response_types_map=_response_types_map,
|
|
196
|
+
)
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
@validate_call
|
|
200
|
+
async def templates_create_template_without_preload_content(
|
|
201
|
+
self,
|
|
202
|
+
notification_id: Annotated[StrictStr, Field(description="Notification ID")],
|
|
203
|
+
channel: Annotated[StrictStr, Field(description="Channel type")],
|
|
204
|
+
template_post_request: TemplatePostRequest,
|
|
205
|
+
_request_timeout: Union[
|
|
206
|
+
None,
|
|
207
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
208
|
+
Tuple[
|
|
209
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
210
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
211
|
+
]
|
|
212
|
+
] = None,
|
|
213
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
214
|
+
_content_type: Optional[StrictStr] = None,
|
|
215
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
216
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
217
|
+
) -> RESTResponseType:
|
|
218
|
+
"""Create a new template for a notification
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
:param notification_id: Notification ID (required)
|
|
222
|
+
:type notification_id: str
|
|
223
|
+
:param channel: Channel type (required)
|
|
224
|
+
:type channel: str
|
|
225
|
+
:param template_post_request: (required)
|
|
226
|
+
:type template_post_request: TemplatePostRequest
|
|
227
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
228
|
+
number provided, it will be total request
|
|
229
|
+
timeout. It can also be a pair (tuple) of
|
|
230
|
+
(connection, read) timeouts.
|
|
231
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
232
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
233
|
+
request; this effectively ignores the
|
|
234
|
+
authentication in the spec for a single request.
|
|
235
|
+
:type _request_auth: dict, optional
|
|
236
|
+
:param _content_type: force content-type for the request.
|
|
237
|
+
:type _content_type: str, Optional
|
|
238
|
+
:param _headers: set to override the headers for a single
|
|
239
|
+
request; this effectively ignores the headers
|
|
240
|
+
in the spec for a single request.
|
|
241
|
+
:type _headers: dict, optional
|
|
242
|
+
:param _host_index: set to override the host_index for a single
|
|
243
|
+
request; this effectively ignores the host_index
|
|
244
|
+
in the spec for a single request.
|
|
245
|
+
:type _host_index: int, optional
|
|
246
|
+
:return: Returns the result object.
|
|
247
|
+
""" # noqa: E501
|
|
248
|
+
|
|
249
|
+
_param = self._templates_create_template_serialize(
|
|
250
|
+
notification_id=notification_id,
|
|
251
|
+
channel=channel,
|
|
252
|
+
template_post_request=template_post_request,
|
|
253
|
+
_request_auth=_request_auth,
|
|
254
|
+
_content_type=_content_type,
|
|
255
|
+
_headers=_headers,
|
|
256
|
+
_host_index=_host_index
|
|
257
|
+
)
|
|
258
|
+
|
|
259
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
260
|
+
'200': "Template",
|
|
261
|
+
'400': None,
|
|
262
|
+
'401': None,
|
|
263
|
+
'500': None,
|
|
264
|
+
}
|
|
265
|
+
response_data = await self.api_client.call_api(
|
|
266
|
+
*_param,
|
|
267
|
+
_request_timeout=_request_timeout
|
|
268
|
+
)
|
|
269
|
+
return response_data.response
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
def _templates_create_template_serialize(
|
|
273
|
+
self,
|
|
274
|
+
notification_id,
|
|
275
|
+
channel,
|
|
276
|
+
template_post_request,
|
|
277
|
+
_request_auth,
|
|
278
|
+
_content_type,
|
|
279
|
+
_headers,
|
|
280
|
+
_host_index,
|
|
281
|
+
) -> RequestSerialized:
|
|
282
|
+
|
|
283
|
+
_host = None
|
|
284
|
+
|
|
285
|
+
_collection_formats: Dict[str, str] = {
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
_path_params: Dict[str, str] = {}
|
|
289
|
+
_query_params: List[Tuple[str, str]] = []
|
|
290
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
291
|
+
_form_params: List[Tuple[str, str]] = []
|
|
292
|
+
_files: Dict[
|
|
293
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
294
|
+
] = {}
|
|
295
|
+
_body_params: Optional[bytes] = None
|
|
296
|
+
|
|
297
|
+
# process the path parameters
|
|
298
|
+
if notification_id is not None:
|
|
299
|
+
_path_params['notificationId'] = notification_id
|
|
300
|
+
if channel is not None:
|
|
301
|
+
_path_params['channel'] = channel
|
|
302
|
+
# process the query parameters
|
|
303
|
+
# process the header parameters
|
|
304
|
+
# process the form parameters
|
|
305
|
+
# process the body parameter
|
|
306
|
+
if template_post_request is not None:
|
|
307
|
+
_body_params = template_post_request
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
# set the HTTP header `Accept`
|
|
311
|
+
if 'Accept' not in _header_params:
|
|
312
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
313
|
+
[
|
|
314
|
+
'application/json'
|
|
315
|
+
]
|
|
316
|
+
)
|
|
317
|
+
|
|
318
|
+
# set the HTTP header `Content-Type`
|
|
319
|
+
if _content_type:
|
|
320
|
+
_header_params['Content-Type'] = _content_type
|
|
321
|
+
else:
|
|
322
|
+
_default_content_type = (
|
|
323
|
+
self.api_client.select_header_content_type(
|
|
324
|
+
[
|
|
325
|
+
'application/json'
|
|
326
|
+
]
|
|
327
|
+
)
|
|
328
|
+
)
|
|
329
|
+
if _default_content_type is not None:
|
|
330
|
+
_header_params['Content-Type'] = _default_content_type
|
|
331
|
+
|
|
332
|
+
# authentication setting
|
|
333
|
+
_auth_settings: List[str] = [
|
|
334
|
+
'endUserHashed',
|
|
335
|
+
'endUser',
|
|
336
|
+
'apiKey',
|
|
337
|
+
'clientCredentials'
|
|
338
|
+
]
|
|
339
|
+
|
|
340
|
+
return self.api_client.param_serialize(
|
|
341
|
+
method='POST',
|
|
342
|
+
resource_path='/notifications/{notificationId}/{channel}/templates',
|
|
343
|
+
path_params=_path_params,
|
|
344
|
+
query_params=_query_params,
|
|
345
|
+
header_params=_header_params,
|
|
346
|
+
body=_body_params,
|
|
347
|
+
post_params=_form_params,
|
|
348
|
+
files=_files,
|
|
349
|
+
auth_settings=_auth_settings,
|
|
350
|
+
collection_formats=_collection_formats,
|
|
351
|
+
_host=_host,
|
|
352
|
+
_request_auth=_request_auth
|
|
353
|
+
)
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
@validate_call
|
|
359
|
+
async def templates_delete_template(
|
|
360
|
+
self,
|
|
361
|
+
notification_id: Annotated[StrictStr, Field(description="Notification ID")],
|
|
362
|
+
channel: Annotated[StrictStr, Field(description="Channel type")],
|
|
363
|
+
template_id: Annotated[StrictStr, Field(description="Template ID")],
|
|
364
|
+
_request_timeout: Union[
|
|
365
|
+
None,
|
|
366
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
367
|
+
Tuple[
|
|
368
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
369
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
370
|
+
]
|
|
371
|
+
] = None,
|
|
372
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
373
|
+
_content_type: Optional[StrictStr] = None,
|
|
374
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
375
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
376
|
+
) -> None:
|
|
377
|
+
"""Delete a template
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
:param notification_id: Notification ID (required)
|
|
381
|
+
:type notification_id: str
|
|
382
|
+
:param channel: Channel type (required)
|
|
383
|
+
:type channel: str
|
|
384
|
+
:param template_id: Template ID (required)
|
|
385
|
+
:type template_id: str
|
|
386
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
387
|
+
number provided, it will be total request
|
|
388
|
+
timeout. It can also be a pair (tuple) of
|
|
389
|
+
(connection, read) timeouts.
|
|
390
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
391
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
392
|
+
request; this effectively ignores the
|
|
393
|
+
authentication in the spec for a single request.
|
|
394
|
+
:type _request_auth: dict, optional
|
|
395
|
+
:param _content_type: force content-type for the request.
|
|
396
|
+
:type _content_type: str, Optional
|
|
397
|
+
:param _headers: set to override the headers for a single
|
|
398
|
+
request; this effectively ignores the headers
|
|
399
|
+
in the spec for a single request.
|
|
400
|
+
:type _headers: dict, optional
|
|
401
|
+
:param _host_index: set to override the host_index for a single
|
|
402
|
+
request; this effectively ignores the host_index
|
|
403
|
+
in the spec for a single request.
|
|
404
|
+
:type _host_index: int, optional
|
|
405
|
+
:return: Returns the result object.
|
|
406
|
+
""" # noqa: E501
|
|
407
|
+
|
|
408
|
+
_param = self._templates_delete_template_serialize(
|
|
409
|
+
notification_id=notification_id,
|
|
410
|
+
channel=channel,
|
|
411
|
+
template_id=template_id,
|
|
412
|
+
_request_auth=_request_auth,
|
|
413
|
+
_content_type=_content_type,
|
|
414
|
+
_headers=_headers,
|
|
415
|
+
_host_index=_host_index
|
|
416
|
+
)
|
|
417
|
+
|
|
418
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
419
|
+
'204': None,
|
|
420
|
+
'400': None,
|
|
421
|
+
'401': None,
|
|
422
|
+
'500': None,
|
|
423
|
+
}
|
|
424
|
+
response_data = await self.api_client.call_api(
|
|
425
|
+
*_param,
|
|
426
|
+
_request_timeout=_request_timeout
|
|
427
|
+
)
|
|
428
|
+
await response_data.read()
|
|
429
|
+
return self.api_client.response_deserialize(
|
|
430
|
+
response_data=response_data,
|
|
431
|
+
response_types_map=_response_types_map,
|
|
432
|
+
).data
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
@validate_call
|
|
436
|
+
async def templates_delete_template_with_http_info(
|
|
437
|
+
self,
|
|
438
|
+
notification_id: Annotated[StrictStr, Field(description="Notification ID")],
|
|
439
|
+
channel: Annotated[StrictStr, Field(description="Channel type")],
|
|
440
|
+
template_id: Annotated[StrictStr, Field(description="Template ID")],
|
|
441
|
+
_request_timeout: Union[
|
|
442
|
+
None,
|
|
443
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
444
|
+
Tuple[
|
|
445
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
446
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
447
|
+
]
|
|
448
|
+
] = None,
|
|
449
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
450
|
+
_content_type: Optional[StrictStr] = None,
|
|
451
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
452
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
453
|
+
) -> ApiResponse[None]:
|
|
454
|
+
"""Delete a template
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
:param notification_id: Notification ID (required)
|
|
458
|
+
:type notification_id: str
|
|
459
|
+
:param channel: Channel type (required)
|
|
460
|
+
:type channel: str
|
|
461
|
+
:param template_id: Template ID (required)
|
|
462
|
+
:type template_id: str
|
|
463
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
464
|
+
number provided, it will be total request
|
|
465
|
+
timeout. It can also be a pair (tuple) of
|
|
466
|
+
(connection, read) timeouts.
|
|
467
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
468
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
469
|
+
request; this effectively ignores the
|
|
470
|
+
authentication in the spec for a single request.
|
|
471
|
+
:type _request_auth: dict, optional
|
|
472
|
+
:param _content_type: force content-type for the request.
|
|
473
|
+
:type _content_type: str, Optional
|
|
474
|
+
:param _headers: set to override the headers for a single
|
|
475
|
+
request; this effectively ignores the headers
|
|
476
|
+
in the spec for a single request.
|
|
477
|
+
:type _headers: dict, optional
|
|
478
|
+
:param _host_index: set to override the host_index for a single
|
|
479
|
+
request; this effectively ignores the host_index
|
|
480
|
+
in the spec for a single request.
|
|
481
|
+
:type _host_index: int, optional
|
|
482
|
+
:return: Returns the result object.
|
|
483
|
+
""" # noqa: E501
|
|
484
|
+
|
|
485
|
+
_param = self._templates_delete_template_serialize(
|
|
486
|
+
notification_id=notification_id,
|
|
487
|
+
channel=channel,
|
|
488
|
+
template_id=template_id,
|
|
489
|
+
_request_auth=_request_auth,
|
|
490
|
+
_content_type=_content_type,
|
|
491
|
+
_headers=_headers,
|
|
492
|
+
_host_index=_host_index
|
|
493
|
+
)
|
|
494
|
+
|
|
495
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
496
|
+
'204': None,
|
|
497
|
+
'400': None,
|
|
498
|
+
'401': None,
|
|
499
|
+
'500': None,
|
|
500
|
+
}
|
|
501
|
+
response_data = await self.api_client.call_api(
|
|
502
|
+
*_param,
|
|
503
|
+
_request_timeout=_request_timeout
|
|
504
|
+
)
|
|
505
|
+
await response_data.read()
|
|
506
|
+
return self.api_client.response_deserialize(
|
|
507
|
+
response_data=response_data,
|
|
508
|
+
response_types_map=_response_types_map,
|
|
509
|
+
)
|
|
510
|
+
|
|
511
|
+
|
|
512
|
+
@validate_call
|
|
513
|
+
async def templates_delete_template_without_preload_content(
|
|
514
|
+
self,
|
|
515
|
+
notification_id: Annotated[StrictStr, Field(description="Notification ID")],
|
|
516
|
+
channel: Annotated[StrictStr, Field(description="Channel type")],
|
|
517
|
+
template_id: Annotated[StrictStr, Field(description="Template ID")],
|
|
518
|
+
_request_timeout: Union[
|
|
519
|
+
None,
|
|
520
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
521
|
+
Tuple[
|
|
522
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
523
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
524
|
+
]
|
|
525
|
+
] = None,
|
|
526
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
527
|
+
_content_type: Optional[StrictStr] = None,
|
|
528
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
529
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
530
|
+
) -> RESTResponseType:
|
|
531
|
+
"""Delete a template
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
:param notification_id: Notification ID (required)
|
|
535
|
+
:type notification_id: str
|
|
536
|
+
:param channel: Channel type (required)
|
|
537
|
+
:type channel: str
|
|
538
|
+
:param template_id: Template ID (required)
|
|
539
|
+
:type template_id: str
|
|
540
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
541
|
+
number provided, it will be total request
|
|
542
|
+
timeout. It can also be a pair (tuple) of
|
|
543
|
+
(connection, read) timeouts.
|
|
544
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
545
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
546
|
+
request; this effectively ignores the
|
|
547
|
+
authentication in the spec for a single request.
|
|
548
|
+
:type _request_auth: dict, optional
|
|
549
|
+
:param _content_type: force content-type for the request.
|
|
550
|
+
:type _content_type: str, Optional
|
|
551
|
+
:param _headers: set to override the headers for a single
|
|
552
|
+
request; this effectively ignores the headers
|
|
553
|
+
in the spec for a single request.
|
|
554
|
+
:type _headers: dict, optional
|
|
555
|
+
:param _host_index: set to override the host_index for a single
|
|
556
|
+
request; this effectively ignores the host_index
|
|
557
|
+
in the spec for a single request.
|
|
558
|
+
:type _host_index: int, optional
|
|
559
|
+
:return: Returns the result object.
|
|
560
|
+
""" # noqa: E501
|
|
561
|
+
|
|
562
|
+
_param = self._templates_delete_template_serialize(
|
|
563
|
+
notification_id=notification_id,
|
|
564
|
+
channel=channel,
|
|
565
|
+
template_id=template_id,
|
|
566
|
+
_request_auth=_request_auth,
|
|
567
|
+
_content_type=_content_type,
|
|
568
|
+
_headers=_headers,
|
|
569
|
+
_host_index=_host_index
|
|
570
|
+
)
|
|
571
|
+
|
|
572
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
573
|
+
'204': None,
|
|
574
|
+
'400': None,
|
|
575
|
+
'401': None,
|
|
576
|
+
'500': None,
|
|
577
|
+
}
|
|
578
|
+
response_data = await self.api_client.call_api(
|
|
579
|
+
*_param,
|
|
580
|
+
_request_timeout=_request_timeout
|
|
581
|
+
)
|
|
582
|
+
return response_data.response
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
def _templates_delete_template_serialize(
|
|
586
|
+
self,
|
|
587
|
+
notification_id,
|
|
588
|
+
channel,
|
|
589
|
+
template_id,
|
|
590
|
+
_request_auth,
|
|
591
|
+
_content_type,
|
|
592
|
+
_headers,
|
|
593
|
+
_host_index,
|
|
594
|
+
) -> RequestSerialized:
|
|
595
|
+
|
|
596
|
+
_host = None
|
|
597
|
+
|
|
598
|
+
_collection_formats: Dict[str, str] = {
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
_path_params: Dict[str, str] = {}
|
|
602
|
+
_query_params: List[Tuple[str, str]] = []
|
|
603
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
604
|
+
_form_params: List[Tuple[str, str]] = []
|
|
605
|
+
_files: Dict[
|
|
606
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
607
|
+
] = {}
|
|
608
|
+
_body_params: Optional[bytes] = None
|
|
609
|
+
|
|
610
|
+
# process the path parameters
|
|
611
|
+
if notification_id is not None:
|
|
612
|
+
_path_params['notificationId'] = notification_id
|
|
613
|
+
if channel is not None:
|
|
614
|
+
_path_params['channel'] = channel
|
|
615
|
+
if template_id is not None:
|
|
616
|
+
_path_params['templateId'] = template_id
|
|
617
|
+
# process the query parameters
|
|
618
|
+
# process the header parameters
|
|
619
|
+
# process the form parameters
|
|
620
|
+
# process the body parameter
|
|
621
|
+
|
|
622
|
+
|
|
623
|
+
|
|
624
|
+
|
|
625
|
+
# authentication setting
|
|
626
|
+
_auth_settings: List[str] = [
|
|
627
|
+
'endUserHashed',
|
|
628
|
+
'endUser',
|
|
629
|
+
'apiKey',
|
|
630
|
+
'clientCredentials'
|
|
631
|
+
]
|
|
632
|
+
|
|
633
|
+
return self.api_client.param_serialize(
|
|
634
|
+
method='DELETE',
|
|
635
|
+
resource_path='/notifications/{notificationId}/{channel}/templates/{templateId}',
|
|
636
|
+
path_params=_path_params,
|
|
637
|
+
query_params=_query_params,
|
|
638
|
+
header_params=_header_params,
|
|
639
|
+
body=_body_params,
|
|
640
|
+
post_params=_form_params,
|
|
641
|
+
files=_files,
|
|
642
|
+
auth_settings=_auth_settings,
|
|
643
|
+
collection_formats=_collection_formats,
|
|
644
|
+
_host=_host,
|
|
645
|
+
_request_auth=_request_auth
|
|
646
|
+
)
|
|
647
|
+
|
|
648
|
+
|
|
649
|
+
|
|
650
|
+
|
|
651
|
+
@validate_call
|
|
652
|
+
async def templates_initiate_migration(
|
|
653
|
+
self,
|
|
654
|
+
notification_id: Annotated[StrictStr, Field(description="Notification ID")],
|
|
655
|
+
channel: Annotated[StrictStr, Field(description="Channel type")],
|
|
656
|
+
template_id: Annotated[StrictStr, Field(description="Template ID")],
|
|
657
|
+
_request_timeout: Union[
|
|
658
|
+
None,
|
|
659
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
660
|
+
Tuple[
|
|
661
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
662
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
663
|
+
]
|
|
664
|
+
] = None,
|
|
665
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
666
|
+
_content_type: Optional[StrictStr] = None,
|
|
667
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
668
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
669
|
+
) -> Template:
|
|
670
|
+
"""Initiate AI-powered template migration from complex to simple HTML
|
|
671
|
+
|
|
672
|
+
|
|
673
|
+
:param notification_id: Notification ID (required)
|
|
674
|
+
:type notification_id: str
|
|
675
|
+
:param channel: Channel type (required)
|
|
676
|
+
:type channel: str
|
|
677
|
+
:param template_id: Template ID (required)
|
|
678
|
+
:type template_id: str
|
|
679
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
680
|
+
number provided, it will be total request
|
|
681
|
+
timeout. It can also be a pair (tuple) of
|
|
682
|
+
(connection, read) timeouts.
|
|
683
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
684
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
685
|
+
request; this effectively ignores the
|
|
686
|
+
authentication in the spec for a single request.
|
|
687
|
+
:type _request_auth: dict, optional
|
|
688
|
+
:param _content_type: force content-type for the request.
|
|
689
|
+
:type _content_type: str, Optional
|
|
690
|
+
:param _headers: set to override the headers for a single
|
|
691
|
+
request; this effectively ignores the headers
|
|
692
|
+
in the spec for a single request.
|
|
693
|
+
:type _headers: dict, optional
|
|
694
|
+
:param _host_index: set to override the host_index for a single
|
|
695
|
+
request; this effectively ignores the host_index
|
|
696
|
+
in the spec for a single request.
|
|
697
|
+
:type _host_index: int, optional
|
|
698
|
+
:return: Returns the result object.
|
|
699
|
+
""" # noqa: E501
|
|
700
|
+
|
|
701
|
+
_param = self._templates_initiate_migration_serialize(
|
|
702
|
+
notification_id=notification_id,
|
|
703
|
+
channel=channel,
|
|
704
|
+
template_id=template_id,
|
|
705
|
+
_request_auth=_request_auth,
|
|
706
|
+
_content_type=_content_type,
|
|
707
|
+
_headers=_headers,
|
|
708
|
+
_host_index=_host_index
|
|
709
|
+
)
|
|
710
|
+
|
|
711
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
712
|
+
'200': "Template",
|
|
713
|
+
'400': None,
|
|
714
|
+
'401': None,
|
|
715
|
+
'500': None,
|
|
716
|
+
}
|
|
717
|
+
response_data = await self.api_client.call_api(
|
|
718
|
+
*_param,
|
|
719
|
+
_request_timeout=_request_timeout
|
|
720
|
+
)
|
|
721
|
+
await response_data.read()
|
|
722
|
+
return self.api_client.response_deserialize(
|
|
723
|
+
response_data=response_data,
|
|
724
|
+
response_types_map=_response_types_map,
|
|
725
|
+
).data
|
|
726
|
+
|
|
727
|
+
|
|
728
|
+
@validate_call
|
|
729
|
+
async def templates_initiate_migration_with_http_info(
|
|
730
|
+
self,
|
|
731
|
+
notification_id: Annotated[StrictStr, Field(description="Notification ID")],
|
|
732
|
+
channel: Annotated[StrictStr, Field(description="Channel type")],
|
|
733
|
+
template_id: Annotated[StrictStr, Field(description="Template ID")],
|
|
734
|
+
_request_timeout: Union[
|
|
735
|
+
None,
|
|
736
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
737
|
+
Tuple[
|
|
738
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
739
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
740
|
+
]
|
|
741
|
+
] = None,
|
|
742
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
743
|
+
_content_type: Optional[StrictStr] = None,
|
|
744
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
745
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
746
|
+
) -> ApiResponse[Template]:
|
|
747
|
+
"""Initiate AI-powered template migration from complex to simple HTML
|
|
748
|
+
|
|
749
|
+
|
|
750
|
+
:param notification_id: Notification ID (required)
|
|
751
|
+
:type notification_id: str
|
|
752
|
+
:param channel: Channel type (required)
|
|
753
|
+
:type channel: str
|
|
754
|
+
:param template_id: Template ID (required)
|
|
755
|
+
:type template_id: str
|
|
756
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
757
|
+
number provided, it will be total request
|
|
758
|
+
timeout. It can also be a pair (tuple) of
|
|
759
|
+
(connection, read) timeouts.
|
|
760
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
761
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
762
|
+
request; this effectively ignores the
|
|
763
|
+
authentication in the spec for a single request.
|
|
764
|
+
:type _request_auth: dict, optional
|
|
765
|
+
:param _content_type: force content-type for the request.
|
|
766
|
+
:type _content_type: str, Optional
|
|
767
|
+
:param _headers: set to override the headers for a single
|
|
768
|
+
request; this effectively ignores the headers
|
|
769
|
+
in the spec for a single request.
|
|
770
|
+
:type _headers: dict, optional
|
|
771
|
+
:param _host_index: set to override the host_index for a single
|
|
772
|
+
request; this effectively ignores the host_index
|
|
773
|
+
in the spec for a single request.
|
|
774
|
+
:type _host_index: int, optional
|
|
775
|
+
:return: Returns the result object.
|
|
776
|
+
""" # noqa: E501
|
|
777
|
+
|
|
778
|
+
_param = self._templates_initiate_migration_serialize(
|
|
779
|
+
notification_id=notification_id,
|
|
780
|
+
channel=channel,
|
|
781
|
+
template_id=template_id,
|
|
782
|
+
_request_auth=_request_auth,
|
|
783
|
+
_content_type=_content_type,
|
|
784
|
+
_headers=_headers,
|
|
785
|
+
_host_index=_host_index
|
|
786
|
+
)
|
|
787
|
+
|
|
788
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
789
|
+
'200': "Template",
|
|
790
|
+
'400': None,
|
|
791
|
+
'401': None,
|
|
792
|
+
'500': None,
|
|
793
|
+
}
|
|
794
|
+
response_data = await self.api_client.call_api(
|
|
795
|
+
*_param,
|
|
796
|
+
_request_timeout=_request_timeout
|
|
797
|
+
)
|
|
798
|
+
await response_data.read()
|
|
799
|
+
return self.api_client.response_deserialize(
|
|
800
|
+
response_data=response_data,
|
|
801
|
+
response_types_map=_response_types_map,
|
|
802
|
+
)
|
|
803
|
+
|
|
804
|
+
|
|
805
|
+
@validate_call
|
|
806
|
+
async def templates_initiate_migration_without_preload_content(
|
|
807
|
+
self,
|
|
808
|
+
notification_id: Annotated[StrictStr, Field(description="Notification ID")],
|
|
809
|
+
channel: Annotated[StrictStr, Field(description="Channel type")],
|
|
810
|
+
template_id: Annotated[StrictStr, Field(description="Template ID")],
|
|
811
|
+
_request_timeout: Union[
|
|
812
|
+
None,
|
|
813
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
814
|
+
Tuple[
|
|
815
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
816
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
817
|
+
]
|
|
818
|
+
] = None,
|
|
819
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
820
|
+
_content_type: Optional[StrictStr] = None,
|
|
821
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
822
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
823
|
+
) -> RESTResponseType:
|
|
824
|
+
"""Initiate AI-powered template migration from complex to simple HTML
|
|
825
|
+
|
|
826
|
+
|
|
827
|
+
:param notification_id: Notification ID (required)
|
|
828
|
+
:type notification_id: str
|
|
829
|
+
:param channel: Channel type (required)
|
|
830
|
+
:type channel: str
|
|
831
|
+
:param template_id: Template ID (required)
|
|
832
|
+
:type template_id: str
|
|
833
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
834
|
+
number provided, it will be total request
|
|
835
|
+
timeout. It can also be a pair (tuple) of
|
|
836
|
+
(connection, read) timeouts.
|
|
837
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
838
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
839
|
+
request; this effectively ignores the
|
|
840
|
+
authentication in the spec for a single request.
|
|
841
|
+
:type _request_auth: dict, optional
|
|
842
|
+
:param _content_type: force content-type for the request.
|
|
843
|
+
:type _content_type: str, Optional
|
|
844
|
+
:param _headers: set to override the headers for a single
|
|
845
|
+
request; this effectively ignores the headers
|
|
846
|
+
in the spec for a single request.
|
|
847
|
+
:type _headers: dict, optional
|
|
848
|
+
:param _host_index: set to override the host_index for a single
|
|
849
|
+
request; this effectively ignores the host_index
|
|
850
|
+
in the spec for a single request.
|
|
851
|
+
:type _host_index: int, optional
|
|
852
|
+
:return: Returns the result object.
|
|
853
|
+
""" # noqa: E501
|
|
854
|
+
|
|
855
|
+
_param = self._templates_initiate_migration_serialize(
|
|
856
|
+
notification_id=notification_id,
|
|
857
|
+
channel=channel,
|
|
858
|
+
template_id=template_id,
|
|
859
|
+
_request_auth=_request_auth,
|
|
860
|
+
_content_type=_content_type,
|
|
861
|
+
_headers=_headers,
|
|
862
|
+
_host_index=_host_index
|
|
863
|
+
)
|
|
864
|
+
|
|
865
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
866
|
+
'200': "Template",
|
|
867
|
+
'400': None,
|
|
868
|
+
'401': None,
|
|
869
|
+
'500': None,
|
|
870
|
+
}
|
|
871
|
+
response_data = await self.api_client.call_api(
|
|
872
|
+
*_param,
|
|
873
|
+
_request_timeout=_request_timeout
|
|
874
|
+
)
|
|
875
|
+
return response_data.response
|
|
876
|
+
|
|
877
|
+
|
|
878
|
+
def _templates_initiate_migration_serialize(
|
|
879
|
+
self,
|
|
880
|
+
notification_id,
|
|
881
|
+
channel,
|
|
882
|
+
template_id,
|
|
883
|
+
_request_auth,
|
|
884
|
+
_content_type,
|
|
885
|
+
_headers,
|
|
886
|
+
_host_index,
|
|
887
|
+
) -> RequestSerialized:
|
|
888
|
+
|
|
889
|
+
_host = None
|
|
890
|
+
|
|
891
|
+
_collection_formats: Dict[str, str] = {
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
_path_params: Dict[str, str] = {}
|
|
895
|
+
_query_params: List[Tuple[str, str]] = []
|
|
896
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
897
|
+
_form_params: List[Tuple[str, str]] = []
|
|
898
|
+
_files: Dict[
|
|
899
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
900
|
+
] = {}
|
|
901
|
+
_body_params: Optional[bytes] = None
|
|
902
|
+
|
|
903
|
+
# process the path parameters
|
|
904
|
+
if notification_id is not None:
|
|
905
|
+
_path_params['notificationId'] = notification_id
|
|
906
|
+
if channel is not None:
|
|
907
|
+
_path_params['channel'] = channel
|
|
908
|
+
if template_id is not None:
|
|
909
|
+
_path_params['templateId'] = template_id
|
|
910
|
+
# process the query parameters
|
|
911
|
+
# process the header parameters
|
|
912
|
+
# process the form parameters
|
|
913
|
+
# process the body parameter
|
|
914
|
+
|
|
915
|
+
|
|
916
|
+
# set the HTTP header `Accept`
|
|
917
|
+
if 'Accept' not in _header_params:
|
|
918
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
919
|
+
[
|
|
920
|
+
'application/json'
|
|
921
|
+
]
|
|
922
|
+
)
|
|
923
|
+
|
|
924
|
+
|
|
925
|
+
# authentication setting
|
|
926
|
+
_auth_settings: List[str] = [
|
|
927
|
+
'endUserHashed',
|
|
928
|
+
'endUser',
|
|
929
|
+
'apiKey',
|
|
930
|
+
'clientCredentials'
|
|
931
|
+
]
|
|
932
|
+
|
|
933
|
+
return self.api_client.param_serialize(
|
|
934
|
+
method='POST',
|
|
935
|
+
resource_path='/notifications/{notificationId}/{channel}/templates/{templateId}/migrate',
|
|
936
|
+
path_params=_path_params,
|
|
937
|
+
query_params=_query_params,
|
|
938
|
+
header_params=_header_params,
|
|
939
|
+
body=_body_params,
|
|
940
|
+
post_params=_form_params,
|
|
941
|
+
files=_files,
|
|
942
|
+
auth_settings=_auth_settings,
|
|
943
|
+
collection_formats=_collection_formats,
|
|
944
|
+
_host=_host,
|
|
945
|
+
_request_auth=_request_auth
|
|
946
|
+
)
|
|
947
|
+
|
|
948
|
+
|
|
949
|
+
|
|
950
|
+
|
|
951
|
+
@validate_call
|
|
952
|
+
async def templates_list_templates(
|
|
953
|
+
self,
|
|
954
|
+
notification_id: Annotated[StrictStr, Field(description="Notification ID")],
|
|
955
|
+
channel: Annotated[StrictStr, Field(description="Channel type")],
|
|
956
|
+
template_id: Annotated[StrictStr, Field(description="Template ID (optional for listing all)")],
|
|
957
|
+
_request_timeout: Union[
|
|
958
|
+
None,
|
|
959
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
960
|
+
Tuple[
|
|
961
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
962
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
963
|
+
]
|
|
964
|
+
] = None,
|
|
965
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
966
|
+
_content_type: Optional[StrictStr] = None,
|
|
967
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
968
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
969
|
+
) -> GetTemplatesResponse:
|
|
970
|
+
"""Get template(s) for a notification
|
|
971
|
+
|
|
972
|
+
|
|
973
|
+
:param notification_id: Notification ID (required)
|
|
974
|
+
:type notification_id: str
|
|
975
|
+
:param channel: Channel type (required)
|
|
976
|
+
:type channel: str
|
|
977
|
+
:param template_id: Template ID (optional for listing all) (required)
|
|
978
|
+
:type template_id: str
|
|
979
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
980
|
+
number provided, it will be total request
|
|
981
|
+
timeout. It can also be a pair (tuple) of
|
|
982
|
+
(connection, read) timeouts.
|
|
983
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
984
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
985
|
+
request; this effectively ignores the
|
|
986
|
+
authentication in the spec for a single request.
|
|
987
|
+
:type _request_auth: dict, optional
|
|
988
|
+
:param _content_type: force content-type for the request.
|
|
989
|
+
:type _content_type: str, Optional
|
|
990
|
+
:param _headers: set to override the headers for a single
|
|
991
|
+
request; this effectively ignores the headers
|
|
992
|
+
in the spec for a single request.
|
|
993
|
+
:type _headers: dict, optional
|
|
994
|
+
:param _host_index: set to override the host_index for a single
|
|
995
|
+
request; this effectively ignores the host_index
|
|
996
|
+
in the spec for a single request.
|
|
997
|
+
:type _host_index: int, optional
|
|
998
|
+
:return: Returns the result object.
|
|
999
|
+
""" # noqa: E501
|
|
1000
|
+
|
|
1001
|
+
_param = self._templates_list_templates_serialize(
|
|
1002
|
+
notification_id=notification_id,
|
|
1003
|
+
channel=channel,
|
|
1004
|
+
template_id=template_id,
|
|
1005
|
+
_request_auth=_request_auth,
|
|
1006
|
+
_content_type=_content_type,
|
|
1007
|
+
_headers=_headers,
|
|
1008
|
+
_host_index=_host_index
|
|
1009
|
+
)
|
|
1010
|
+
|
|
1011
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1012
|
+
'200': "GetTemplatesResponse",
|
|
1013
|
+
'400': None,
|
|
1014
|
+
'401': None,
|
|
1015
|
+
'500': None,
|
|
1016
|
+
}
|
|
1017
|
+
response_data = await self.api_client.call_api(
|
|
1018
|
+
*_param,
|
|
1019
|
+
_request_timeout=_request_timeout
|
|
1020
|
+
)
|
|
1021
|
+
await response_data.read()
|
|
1022
|
+
return self.api_client.response_deserialize(
|
|
1023
|
+
response_data=response_data,
|
|
1024
|
+
response_types_map=_response_types_map,
|
|
1025
|
+
).data
|
|
1026
|
+
|
|
1027
|
+
|
|
1028
|
+
@validate_call
|
|
1029
|
+
async def templates_list_templates_with_http_info(
|
|
1030
|
+
self,
|
|
1031
|
+
notification_id: Annotated[StrictStr, Field(description="Notification ID")],
|
|
1032
|
+
channel: Annotated[StrictStr, Field(description="Channel type")],
|
|
1033
|
+
template_id: Annotated[StrictStr, Field(description="Template ID (optional for listing all)")],
|
|
1034
|
+
_request_timeout: Union[
|
|
1035
|
+
None,
|
|
1036
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1037
|
+
Tuple[
|
|
1038
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1039
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1040
|
+
]
|
|
1041
|
+
] = None,
|
|
1042
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1043
|
+
_content_type: Optional[StrictStr] = None,
|
|
1044
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1045
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1046
|
+
) -> ApiResponse[GetTemplatesResponse]:
|
|
1047
|
+
"""Get template(s) for a notification
|
|
1048
|
+
|
|
1049
|
+
|
|
1050
|
+
:param notification_id: Notification ID (required)
|
|
1051
|
+
:type notification_id: str
|
|
1052
|
+
:param channel: Channel type (required)
|
|
1053
|
+
:type channel: str
|
|
1054
|
+
:param template_id: Template ID (optional for listing all) (required)
|
|
1055
|
+
:type template_id: str
|
|
1056
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1057
|
+
number provided, it will be total request
|
|
1058
|
+
timeout. It can also be a pair (tuple) of
|
|
1059
|
+
(connection, read) timeouts.
|
|
1060
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1061
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1062
|
+
request; this effectively ignores the
|
|
1063
|
+
authentication in the spec for a single request.
|
|
1064
|
+
:type _request_auth: dict, optional
|
|
1065
|
+
:param _content_type: force content-type for the request.
|
|
1066
|
+
:type _content_type: str, Optional
|
|
1067
|
+
:param _headers: set to override the headers for a single
|
|
1068
|
+
request; this effectively ignores the headers
|
|
1069
|
+
in the spec for a single request.
|
|
1070
|
+
:type _headers: dict, optional
|
|
1071
|
+
:param _host_index: set to override the host_index for a single
|
|
1072
|
+
request; this effectively ignores the host_index
|
|
1073
|
+
in the spec for a single request.
|
|
1074
|
+
:type _host_index: int, optional
|
|
1075
|
+
:return: Returns the result object.
|
|
1076
|
+
""" # noqa: E501
|
|
1077
|
+
|
|
1078
|
+
_param = self._templates_list_templates_serialize(
|
|
1079
|
+
notification_id=notification_id,
|
|
1080
|
+
channel=channel,
|
|
1081
|
+
template_id=template_id,
|
|
1082
|
+
_request_auth=_request_auth,
|
|
1083
|
+
_content_type=_content_type,
|
|
1084
|
+
_headers=_headers,
|
|
1085
|
+
_host_index=_host_index
|
|
1086
|
+
)
|
|
1087
|
+
|
|
1088
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1089
|
+
'200': "GetTemplatesResponse",
|
|
1090
|
+
'400': None,
|
|
1091
|
+
'401': None,
|
|
1092
|
+
'500': None,
|
|
1093
|
+
}
|
|
1094
|
+
response_data = await self.api_client.call_api(
|
|
1095
|
+
*_param,
|
|
1096
|
+
_request_timeout=_request_timeout
|
|
1097
|
+
)
|
|
1098
|
+
await response_data.read()
|
|
1099
|
+
return self.api_client.response_deserialize(
|
|
1100
|
+
response_data=response_data,
|
|
1101
|
+
response_types_map=_response_types_map,
|
|
1102
|
+
)
|
|
1103
|
+
|
|
1104
|
+
|
|
1105
|
+
@validate_call
|
|
1106
|
+
async def templates_list_templates_without_preload_content(
|
|
1107
|
+
self,
|
|
1108
|
+
notification_id: Annotated[StrictStr, Field(description="Notification ID")],
|
|
1109
|
+
channel: Annotated[StrictStr, Field(description="Channel type")],
|
|
1110
|
+
template_id: Annotated[StrictStr, Field(description="Template ID (optional for listing all)")],
|
|
1111
|
+
_request_timeout: Union[
|
|
1112
|
+
None,
|
|
1113
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1114
|
+
Tuple[
|
|
1115
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1116
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1117
|
+
]
|
|
1118
|
+
] = None,
|
|
1119
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1120
|
+
_content_type: Optional[StrictStr] = None,
|
|
1121
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1122
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1123
|
+
) -> RESTResponseType:
|
|
1124
|
+
"""Get template(s) for a notification
|
|
1125
|
+
|
|
1126
|
+
|
|
1127
|
+
:param notification_id: Notification ID (required)
|
|
1128
|
+
:type notification_id: str
|
|
1129
|
+
:param channel: Channel type (required)
|
|
1130
|
+
:type channel: str
|
|
1131
|
+
:param template_id: Template ID (optional for listing all) (required)
|
|
1132
|
+
:type template_id: str
|
|
1133
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1134
|
+
number provided, it will be total request
|
|
1135
|
+
timeout. It can also be a pair (tuple) of
|
|
1136
|
+
(connection, read) timeouts.
|
|
1137
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1138
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1139
|
+
request; this effectively ignores the
|
|
1140
|
+
authentication in the spec for a single request.
|
|
1141
|
+
:type _request_auth: dict, optional
|
|
1142
|
+
:param _content_type: force content-type for the request.
|
|
1143
|
+
:type _content_type: str, Optional
|
|
1144
|
+
:param _headers: set to override the headers for a single
|
|
1145
|
+
request; this effectively ignores the headers
|
|
1146
|
+
in the spec for a single request.
|
|
1147
|
+
:type _headers: dict, optional
|
|
1148
|
+
:param _host_index: set to override the host_index for a single
|
|
1149
|
+
request; this effectively ignores the host_index
|
|
1150
|
+
in the spec for a single request.
|
|
1151
|
+
:type _host_index: int, optional
|
|
1152
|
+
:return: Returns the result object.
|
|
1153
|
+
""" # noqa: E501
|
|
1154
|
+
|
|
1155
|
+
_param = self._templates_list_templates_serialize(
|
|
1156
|
+
notification_id=notification_id,
|
|
1157
|
+
channel=channel,
|
|
1158
|
+
template_id=template_id,
|
|
1159
|
+
_request_auth=_request_auth,
|
|
1160
|
+
_content_type=_content_type,
|
|
1161
|
+
_headers=_headers,
|
|
1162
|
+
_host_index=_host_index
|
|
1163
|
+
)
|
|
1164
|
+
|
|
1165
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1166
|
+
'200': "GetTemplatesResponse",
|
|
1167
|
+
'400': None,
|
|
1168
|
+
'401': None,
|
|
1169
|
+
'500': None,
|
|
1170
|
+
}
|
|
1171
|
+
response_data = await self.api_client.call_api(
|
|
1172
|
+
*_param,
|
|
1173
|
+
_request_timeout=_request_timeout
|
|
1174
|
+
)
|
|
1175
|
+
return response_data.response
|
|
1176
|
+
|
|
1177
|
+
|
|
1178
|
+
def _templates_list_templates_serialize(
|
|
1179
|
+
self,
|
|
1180
|
+
notification_id,
|
|
1181
|
+
channel,
|
|
1182
|
+
template_id,
|
|
1183
|
+
_request_auth,
|
|
1184
|
+
_content_type,
|
|
1185
|
+
_headers,
|
|
1186
|
+
_host_index,
|
|
1187
|
+
) -> RequestSerialized:
|
|
1188
|
+
|
|
1189
|
+
_host = None
|
|
1190
|
+
|
|
1191
|
+
_collection_formats: Dict[str, str] = {
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
_path_params: Dict[str, str] = {}
|
|
1195
|
+
_query_params: List[Tuple[str, str]] = []
|
|
1196
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
1197
|
+
_form_params: List[Tuple[str, str]] = []
|
|
1198
|
+
_files: Dict[
|
|
1199
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
1200
|
+
] = {}
|
|
1201
|
+
_body_params: Optional[bytes] = None
|
|
1202
|
+
|
|
1203
|
+
# process the path parameters
|
|
1204
|
+
if notification_id is not None:
|
|
1205
|
+
_path_params['notificationId'] = notification_id
|
|
1206
|
+
if channel is not None:
|
|
1207
|
+
_path_params['channel'] = channel
|
|
1208
|
+
if template_id is not None:
|
|
1209
|
+
_path_params['templateId'] = template_id
|
|
1210
|
+
# process the query parameters
|
|
1211
|
+
# process the header parameters
|
|
1212
|
+
# process the form parameters
|
|
1213
|
+
# process the body parameter
|
|
1214
|
+
|
|
1215
|
+
|
|
1216
|
+
# set the HTTP header `Accept`
|
|
1217
|
+
if 'Accept' not in _header_params:
|
|
1218
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
1219
|
+
[
|
|
1220
|
+
'application/json'
|
|
1221
|
+
]
|
|
1222
|
+
)
|
|
1223
|
+
|
|
1224
|
+
|
|
1225
|
+
# authentication setting
|
|
1226
|
+
_auth_settings: List[str] = [
|
|
1227
|
+
'endUserHashed',
|
|
1228
|
+
'endUser',
|
|
1229
|
+
'apiKey',
|
|
1230
|
+
'clientCredentials'
|
|
1231
|
+
]
|
|
1232
|
+
|
|
1233
|
+
return self.api_client.param_serialize(
|
|
1234
|
+
method='GET',
|
|
1235
|
+
resource_path='/notifications/{notificationId}/{channel}/templates/{templateId}',
|
|
1236
|
+
path_params=_path_params,
|
|
1237
|
+
query_params=_query_params,
|
|
1238
|
+
header_params=_header_params,
|
|
1239
|
+
body=_body_params,
|
|
1240
|
+
post_params=_form_params,
|
|
1241
|
+
files=_files,
|
|
1242
|
+
auth_settings=_auth_settings,
|
|
1243
|
+
collection_formats=_collection_formats,
|
|
1244
|
+
_host=_host,
|
|
1245
|
+
_request_auth=_request_auth
|
|
1246
|
+
)
|
|
1247
|
+
|
|
1248
|
+
|
|
1249
|
+
|
|
1250
|
+
|
|
1251
|
+
@validate_call
|
|
1252
|
+
async def templates_set_default_template(
|
|
1253
|
+
self,
|
|
1254
|
+
notification_id: Annotated[StrictStr, Field(description="Notification ID")],
|
|
1255
|
+
channel: Annotated[StrictStr, Field(description="Channel type")],
|
|
1256
|
+
set_default_template_request: SetDefaultTemplateRequest,
|
|
1257
|
+
_request_timeout: Union[
|
|
1258
|
+
None,
|
|
1259
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1260
|
+
Tuple[
|
|
1261
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1262
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1263
|
+
]
|
|
1264
|
+
] = None,
|
|
1265
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1266
|
+
_content_type: Optional[StrictStr] = None,
|
|
1267
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1268
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1269
|
+
) -> Template:
|
|
1270
|
+
"""Set a template as default for specific delivery modes
|
|
1271
|
+
|
|
1272
|
+
|
|
1273
|
+
:param notification_id: Notification ID (required)
|
|
1274
|
+
:type notification_id: str
|
|
1275
|
+
:param channel: Channel type (required)
|
|
1276
|
+
:type channel: str
|
|
1277
|
+
:param set_default_template_request: (required)
|
|
1278
|
+
:type set_default_template_request: SetDefaultTemplateRequest
|
|
1279
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1280
|
+
number provided, it will be total request
|
|
1281
|
+
timeout. It can also be a pair (tuple) of
|
|
1282
|
+
(connection, read) timeouts.
|
|
1283
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1284
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1285
|
+
request; this effectively ignores the
|
|
1286
|
+
authentication in the spec for a single request.
|
|
1287
|
+
:type _request_auth: dict, optional
|
|
1288
|
+
:param _content_type: force content-type for the request.
|
|
1289
|
+
:type _content_type: str, Optional
|
|
1290
|
+
:param _headers: set to override the headers for a single
|
|
1291
|
+
request; this effectively ignores the headers
|
|
1292
|
+
in the spec for a single request.
|
|
1293
|
+
:type _headers: dict, optional
|
|
1294
|
+
:param _host_index: set to override the host_index for a single
|
|
1295
|
+
request; this effectively ignores the host_index
|
|
1296
|
+
in the spec for a single request.
|
|
1297
|
+
:type _host_index: int, optional
|
|
1298
|
+
:return: Returns the result object.
|
|
1299
|
+
""" # noqa: E501
|
|
1300
|
+
|
|
1301
|
+
_param = self._templates_set_default_template_serialize(
|
|
1302
|
+
notification_id=notification_id,
|
|
1303
|
+
channel=channel,
|
|
1304
|
+
set_default_template_request=set_default_template_request,
|
|
1305
|
+
_request_auth=_request_auth,
|
|
1306
|
+
_content_type=_content_type,
|
|
1307
|
+
_headers=_headers,
|
|
1308
|
+
_host_index=_host_index
|
|
1309
|
+
)
|
|
1310
|
+
|
|
1311
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1312
|
+
'200': "Template",
|
|
1313
|
+
'400': None,
|
|
1314
|
+
'401': None,
|
|
1315
|
+
'500': None,
|
|
1316
|
+
}
|
|
1317
|
+
response_data = await self.api_client.call_api(
|
|
1318
|
+
*_param,
|
|
1319
|
+
_request_timeout=_request_timeout
|
|
1320
|
+
)
|
|
1321
|
+
await response_data.read()
|
|
1322
|
+
return self.api_client.response_deserialize(
|
|
1323
|
+
response_data=response_data,
|
|
1324
|
+
response_types_map=_response_types_map,
|
|
1325
|
+
).data
|
|
1326
|
+
|
|
1327
|
+
|
|
1328
|
+
@validate_call
|
|
1329
|
+
async def templates_set_default_template_with_http_info(
|
|
1330
|
+
self,
|
|
1331
|
+
notification_id: Annotated[StrictStr, Field(description="Notification ID")],
|
|
1332
|
+
channel: Annotated[StrictStr, Field(description="Channel type")],
|
|
1333
|
+
set_default_template_request: SetDefaultTemplateRequest,
|
|
1334
|
+
_request_timeout: Union[
|
|
1335
|
+
None,
|
|
1336
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1337
|
+
Tuple[
|
|
1338
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1339
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1340
|
+
]
|
|
1341
|
+
] = None,
|
|
1342
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1343
|
+
_content_type: Optional[StrictStr] = None,
|
|
1344
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1345
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1346
|
+
) -> ApiResponse[Template]:
|
|
1347
|
+
"""Set a template as default for specific delivery modes
|
|
1348
|
+
|
|
1349
|
+
|
|
1350
|
+
:param notification_id: Notification ID (required)
|
|
1351
|
+
:type notification_id: str
|
|
1352
|
+
:param channel: Channel type (required)
|
|
1353
|
+
:type channel: str
|
|
1354
|
+
:param set_default_template_request: (required)
|
|
1355
|
+
:type set_default_template_request: SetDefaultTemplateRequest
|
|
1356
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1357
|
+
number provided, it will be total request
|
|
1358
|
+
timeout. It can also be a pair (tuple) of
|
|
1359
|
+
(connection, read) timeouts.
|
|
1360
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1361
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1362
|
+
request; this effectively ignores the
|
|
1363
|
+
authentication in the spec for a single request.
|
|
1364
|
+
:type _request_auth: dict, optional
|
|
1365
|
+
:param _content_type: force content-type for the request.
|
|
1366
|
+
:type _content_type: str, Optional
|
|
1367
|
+
:param _headers: set to override the headers for a single
|
|
1368
|
+
request; this effectively ignores the headers
|
|
1369
|
+
in the spec for a single request.
|
|
1370
|
+
:type _headers: dict, optional
|
|
1371
|
+
:param _host_index: set to override the host_index for a single
|
|
1372
|
+
request; this effectively ignores the host_index
|
|
1373
|
+
in the spec for a single request.
|
|
1374
|
+
:type _host_index: int, optional
|
|
1375
|
+
:return: Returns the result object.
|
|
1376
|
+
""" # noqa: E501
|
|
1377
|
+
|
|
1378
|
+
_param = self._templates_set_default_template_serialize(
|
|
1379
|
+
notification_id=notification_id,
|
|
1380
|
+
channel=channel,
|
|
1381
|
+
set_default_template_request=set_default_template_request,
|
|
1382
|
+
_request_auth=_request_auth,
|
|
1383
|
+
_content_type=_content_type,
|
|
1384
|
+
_headers=_headers,
|
|
1385
|
+
_host_index=_host_index
|
|
1386
|
+
)
|
|
1387
|
+
|
|
1388
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1389
|
+
'200': "Template",
|
|
1390
|
+
'400': None,
|
|
1391
|
+
'401': None,
|
|
1392
|
+
'500': None,
|
|
1393
|
+
}
|
|
1394
|
+
response_data = await self.api_client.call_api(
|
|
1395
|
+
*_param,
|
|
1396
|
+
_request_timeout=_request_timeout
|
|
1397
|
+
)
|
|
1398
|
+
await response_data.read()
|
|
1399
|
+
return self.api_client.response_deserialize(
|
|
1400
|
+
response_data=response_data,
|
|
1401
|
+
response_types_map=_response_types_map,
|
|
1402
|
+
)
|
|
1403
|
+
|
|
1404
|
+
|
|
1405
|
+
@validate_call
|
|
1406
|
+
async def templates_set_default_template_without_preload_content(
|
|
1407
|
+
self,
|
|
1408
|
+
notification_id: Annotated[StrictStr, Field(description="Notification ID")],
|
|
1409
|
+
channel: Annotated[StrictStr, Field(description="Channel type")],
|
|
1410
|
+
set_default_template_request: SetDefaultTemplateRequest,
|
|
1411
|
+
_request_timeout: Union[
|
|
1412
|
+
None,
|
|
1413
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1414
|
+
Tuple[
|
|
1415
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1416
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1417
|
+
]
|
|
1418
|
+
] = None,
|
|
1419
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1420
|
+
_content_type: Optional[StrictStr] = None,
|
|
1421
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1422
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1423
|
+
) -> RESTResponseType:
|
|
1424
|
+
"""Set a template as default for specific delivery modes
|
|
1425
|
+
|
|
1426
|
+
|
|
1427
|
+
:param notification_id: Notification ID (required)
|
|
1428
|
+
:type notification_id: str
|
|
1429
|
+
:param channel: Channel type (required)
|
|
1430
|
+
:type channel: str
|
|
1431
|
+
:param set_default_template_request: (required)
|
|
1432
|
+
:type set_default_template_request: SetDefaultTemplateRequest
|
|
1433
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1434
|
+
number provided, it will be total request
|
|
1435
|
+
timeout. It can also be a pair (tuple) of
|
|
1436
|
+
(connection, read) timeouts.
|
|
1437
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1438
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1439
|
+
request; this effectively ignores the
|
|
1440
|
+
authentication in the spec for a single request.
|
|
1441
|
+
:type _request_auth: dict, optional
|
|
1442
|
+
:param _content_type: force content-type for the request.
|
|
1443
|
+
:type _content_type: str, Optional
|
|
1444
|
+
:param _headers: set to override the headers for a single
|
|
1445
|
+
request; this effectively ignores the headers
|
|
1446
|
+
in the spec for a single request.
|
|
1447
|
+
:type _headers: dict, optional
|
|
1448
|
+
:param _host_index: set to override the host_index for a single
|
|
1449
|
+
request; this effectively ignores the host_index
|
|
1450
|
+
in the spec for a single request.
|
|
1451
|
+
:type _host_index: int, optional
|
|
1452
|
+
:return: Returns the result object.
|
|
1453
|
+
""" # noqa: E501
|
|
1454
|
+
|
|
1455
|
+
_param = self._templates_set_default_template_serialize(
|
|
1456
|
+
notification_id=notification_id,
|
|
1457
|
+
channel=channel,
|
|
1458
|
+
set_default_template_request=set_default_template_request,
|
|
1459
|
+
_request_auth=_request_auth,
|
|
1460
|
+
_content_type=_content_type,
|
|
1461
|
+
_headers=_headers,
|
|
1462
|
+
_host_index=_host_index
|
|
1463
|
+
)
|
|
1464
|
+
|
|
1465
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1466
|
+
'200': "Template",
|
|
1467
|
+
'400': None,
|
|
1468
|
+
'401': None,
|
|
1469
|
+
'500': None,
|
|
1470
|
+
}
|
|
1471
|
+
response_data = await self.api_client.call_api(
|
|
1472
|
+
*_param,
|
|
1473
|
+
_request_timeout=_request_timeout
|
|
1474
|
+
)
|
|
1475
|
+
return response_data.response
|
|
1476
|
+
|
|
1477
|
+
|
|
1478
|
+
def _templates_set_default_template_serialize(
|
|
1479
|
+
self,
|
|
1480
|
+
notification_id,
|
|
1481
|
+
channel,
|
|
1482
|
+
set_default_template_request,
|
|
1483
|
+
_request_auth,
|
|
1484
|
+
_content_type,
|
|
1485
|
+
_headers,
|
|
1486
|
+
_host_index,
|
|
1487
|
+
) -> RequestSerialized:
|
|
1488
|
+
|
|
1489
|
+
_host = None
|
|
1490
|
+
|
|
1491
|
+
_collection_formats: Dict[str, str] = {
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1494
|
+
_path_params: Dict[str, str] = {}
|
|
1495
|
+
_query_params: List[Tuple[str, str]] = []
|
|
1496
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
1497
|
+
_form_params: List[Tuple[str, str]] = []
|
|
1498
|
+
_files: Dict[
|
|
1499
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
1500
|
+
] = {}
|
|
1501
|
+
_body_params: Optional[bytes] = None
|
|
1502
|
+
|
|
1503
|
+
# process the path parameters
|
|
1504
|
+
if notification_id is not None:
|
|
1505
|
+
_path_params['notificationId'] = notification_id
|
|
1506
|
+
if channel is not None:
|
|
1507
|
+
_path_params['channel'] = channel
|
|
1508
|
+
# process the query parameters
|
|
1509
|
+
# process the header parameters
|
|
1510
|
+
# process the form parameters
|
|
1511
|
+
# process the body parameter
|
|
1512
|
+
if set_default_template_request is not None:
|
|
1513
|
+
_body_params = set_default_template_request
|
|
1514
|
+
|
|
1515
|
+
|
|
1516
|
+
# set the HTTP header `Accept`
|
|
1517
|
+
if 'Accept' not in _header_params:
|
|
1518
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
1519
|
+
[
|
|
1520
|
+
'application/json'
|
|
1521
|
+
]
|
|
1522
|
+
)
|
|
1523
|
+
|
|
1524
|
+
# set the HTTP header `Content-Type`
|
|
1525
|
+
if _content_type:
|
|
1526
|
+
_header_params['Content-Type'] = _content_type
|
|
1527
|
+
else:
|
|
1528
|
+
_default_content_type = (
|
|
1529
|
+
self.api_client.select_header_content_type(
|
|
1530
|
+
[
|
|
1531
|
+
'application/json'
|
|
1532
|
+
]
|
|
1533
|
+
)
|
|
1534
|
+
)
|
|
1535
|
+
if _default_content_type is not None:
|
|
1536
|
+
_header_params['Content-Type'] = _default_content_type
|
|
1537
|
+
|
|
1538
|
+
# authentication setting
|
|
1539
|
+
_auth_settings: List[str] = [
|
|
1540
|
+
'endUserHashed',
|
|
1541
|
+
'endUser',
|
|
1542
|
+
'apiKey',
|
|
1543
|
+
'clientCredentials'
|
|
1544
|
+
]
|
|
1545
|
+
|
|
1546
|
+
return self.api_client.param_serialize(
|
|
1547
|
+
method='PATCH',
|
|
1548
|
+
resource_path='/notifications/{notificationId}/{channel}/templates/default',
|
|
1549
|
+
path_params=_path_params,
|
|
1550
|
+
query_params=_query_params,
|
|
1551
|
+
header_params=_header_params,
|
|
1552
|
+
body=_body_params,
|
|
1553
|
+
post_params=_form_params,
|
|
1554
|
+
files=_files,
|
|
1555
|
+
auth_settings=_auth_settings,
|
|
1556
|
+
collection_formats=_collection_formats,
|
|
1557
|
+
_host=_host,
|
|
1558
|
+
_request_auth=_request_auth
|
|
1559
|
+
)
|
|
1560
|
+
|
|
1561
|
+
|
|
1562
|
+
|
|
1563
|
+
|
|
1564
|
+
@validate_call
|
|
1565
|
+
async def templates_update_template(
|
|
1566
|
+
self,
|
|
1567
|
+
notification_id: Annotated[StrictStr, Field(description="Notification ID")],
|
|
1568
|
+
channel: Annotated[StrictStr, Field(description="Channel type")],
|
|
1569
|
+
template_id: Annotated[StrictStr, Field(description="Template ID")],
|
|
1570
|
+
template_patch_request: TemplatePatchRequest,
|
|
1571
|
+
_request_timeout: Union[
|
|
1572
|
+
None,
|
|
1573
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1574
|
+
Tuple[
|
|
1575
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1576
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1577
|
+
]
|
|
1578
|
+
] = None,
|
|
1579
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1580
|
+
_content_type: Optional[StrictStr] = None,
|
|
1581
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1582
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1583
|
+
) -> Template:
|
|
1584
|
+
"""Update a template's properties
|
|
1585
|
+
|
|
1586
|
+
|
|
1587
|
+
:param notification_id: Notification ID (required)
|
|
1588
|
+
:type notification_id: str
|
|
1589
|
+
:param channel: Channel type (required)
|
|
1590
|
+
:type channel: str
|
|
1591
|
+
:param template_id: Template ID (required)
|
|
1592
|
+
:type template_id: str
|
|
1593
|
+
:param template_patch_request: (required)
|
|
1594
|
+
:type template_patch_request: TemplatePatchRequest
|
|
1595
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1596
|
+
number provided, it will be total request
|
|
1597
|
+
timeout. It can also be a pair (tuple) of
|
|
1598
|
+
(connection, read) timeouts.
|
|
1599
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1600
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1601
|
+
request; this effectively ignores the
|
|
1602
|
+
authentication in the spec for a single request.
|
|
1603
|
+
:type _request_auth: dict, optional
|
|
1604
|
+
:param _content_type: force content-type for the request.
|
|
1605
|
+
:type _content_type: str, Optional
|
|
1606
|
+
:param _headers: set to override the headers for a single
|
|
1607
|
+
request; this effectively ignores the headers
|
|
1608
|
+
in the spec for a single request.
|
|
1609
|
+
:type _headers: dict, optional
|
|
1610
|
+
:param _host_index: set to override the host_index for a single
|
|
1611
|
+
request; this effectively ignores the host_index
|
|
1612
|
+
in the spec for a single request.
|
|
1613
|
+
:type _host_index: int, optional
|
|
1614
|
+
:return: Returns the result object.
|
|
1615
|
+
""" # noqa: E501
|
|
1616
|
+
|
|
1617
|
+
_param = self._templates_update_template_serialize(
|
|
1618
|
+
notification_id=notification_id,
|
|
1619
|
+
channel=channel,
|
|
1620
|
+
template_id=template_id,
|
|
1621
|
+
template_patch_request=template_patch_request,
|
|
1622
|
+
_request_auth=_request_auth,
|
|
1623
|
+
_content_type=_content_type,
|
|
1624
|
+
_headers=_headers,
|
|
1625
|
+
_host_index=_host_index
|
|
1626
|
+
)
|
|
1627
|
+
|
|
1628
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1629
|
+
'200': "Template",
|
|
1630
|
+
'400': None,
|
|
1631
|
+
'401': None,
|
|
1632
|
+
'500': None,
|
|
1633
|
+
}
|
|
1634
|
+
response_data = await self.api_client.call_api(
|
|
1635
|
+
*_param,
|
|
1636
|
+
_request_timeout=_request_timeout
|
|
1637
|
+
)
|
|
1638
|
+
await response_data.read()
|
|
1639
|
+
return self.api_client.response_deserialize(
|
|
1640
|
+
response_data=response_data,
|
|
1641
|
+
response_types_map=_response_types_map,
|
|
1642
|
+
).data
|
|
1643
|
+
|
|
1644
|
+
|
|
1645
|
+
@validate_call
|
|
1646
|
+
async def templates_update_template_with_http_info(
|
|
1647
|
+
self,
|
|
1648
|
+
notification_id: Annotated[StrictStr, Field(description="Notification ID")],
|
|
1649
|
+
channel: Annotated[StrictStr, Field(description="Channel type")],
|
|
1650
|
+
template_id: Annotated[StrictStr, Field(description="Template ID")],
|
|
1651
|
+
template_patch_request: TemplatePatchRequest,
|
|
1652
|
+
_request_timeout: Union[
|
|
1653
|
+
None,
|
|
1654
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1655
|
+
Tuple[
|
|
1656
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1657
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1658
|
+
]
|
|
1659
|
+
] = None,
|
|
1660
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1661
|
+
_content_type: Optional[StrictStr] = None,
|
|
1662
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1663
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1664
|
+
) -> ApiResponse[Template]:
|
|
1665
|
+
"""Update a template's properties
|
|
1666
|
+
|
|
1667
|
+
|
|
1668
|
+
:param notification_id: Notification ID (required)
|
|
1669
|
+
:type notification_id: str
|
|
1670
|
+
:param channel: Channel type (required)
|
|
1671
|
+
:type channel: str
|
|
1672
|
+
:param template_id: Template ID (required)
|
|
1673
|
+
:type template_id: str
|
|
1674
|
+
:param template_patch_request: (required)
|
|
1675
|
+
:type template_patch_request: TemplatePatchRequest
|
|
1676
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1677
|
+
number provided, it will be total request
|
|
1678
|
+
timeout. It can also be a pair (tuple) of
|
|
1679
|
+
(connection, read) timeouts.
|
|
1680
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1681
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1682
|
+
request; this effectively ignores the
|
|
1683
|
+
authentication in the spec for a single request.
|
|
1684
|
+
:type _request_auth: dict, optional
|
|
1685
|
+
:param _content_type: force content-type for the request.
|
|
1686
|
+
:type _content_type: str, Optional
|
|
1687
|
+
:param _headers: set to override the headers for a single
|
|
1688
|
+
request; this effectively ignores the headers
|
|
1689
|
+
in the spec for a single request.
|
|
1690
|
+
:type _headers: dict, optional
|
|
1691
|
+
:param _host_index: set to override the host_index for a single
|
|
1692
|
+
request; this effectively ignores the host_index
|
|
1693
|
+
in the spec for a single request.
|
|
1694
|
+
:type _host_index: int, optional
|
|
1695
|
+
:return: Returns the result object.
|
|
1696
|
+
""" # noqa: E501
|
|
1697
|
+
|
|
1698
|
+
_param = self._templates_update_template_serialize(
|
|
1699
|
+
notification_id=notification_id,
|
|
1700
|
+
channel=channel,
|
|
1701
|
+
template_id=template_id,
|
|
1702
|
+
template_patch_request=template_patch_request,
|
|
1703
|
+
_request_auth=_request_auth,
|
|
1704
|
+
_content_type=_content_type,
|
|
1705
|
+
_headers=_headers,
|
|
1706
|
+
_host_index=_host_index
|
|
1707
|
+
)
|
|
1708
|
+
|
|
1709
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1710
|
+
'200': "Template",
|
|
1711
|
+
'400': None,
|
|
1712
|
+
'401': None,
|
|
1713
|
+
'500': None,
|
|
1714
|
+
}
|
|
1715
|
+
response_data = await self.api_client.call_api(
|
|
1716
|
+
*_param,
|
|
1717
|
+
_request_timeout=_request_timeout
|
|
1718
|
+
)
|
|
1719
|
+
await response_data.read()
|
|
1720
|
+
return self.api_client.response_deserialize(
|
|
1721
|
+
response_data=response_data,
|
|
1722
|
+
response_types_map=_response_types_map,
|
|
1723
|
+
)
|
|
1724
|
+
|
|
1725
|
+
|
|
1726
|
+
@validate_call
|
|
1727
|
+
async def templates_update_template_without_preload_content(
|
|
1728
|
+
self,
|
|
1729
|
+
notification_id: Annotated[StrictStr, Field(description="Notification ID")],
|
|
1730
|
+
channel: Annotated[StrictStr, Field(description="Channel type")],
|
|
1731
|
+
template_id: Annotated[StrictStr, Field(description="Template ID")],
|
|
1732
|
+
template_patch_request: TemplatePatchRequest,
|
|
1733
|
+
_request_timeout: Union[
|
|
1734
|
+
None,
|
|
1735
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1736
|
+
Tuple[
|
|
1737
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1738
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1739
|
+
]
|
|
1740
|
+
] = None,
|
|
1741
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1742
|
+
_content_type: Optional[StrictStr] = None,
|
|
1743
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1744
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1745
|
+
) -> RESTResponseType:
|
|
1746
|
+
"""Update a template's properties
|
|
1747
|
+
|
|
1748
|
+
|
|
1749
|
+
:param notification_id: Notification ID (required)
|
|
1750
|
+
:type notification_id: str
|
|
1751
|
+
:param channel: Channel type (required)
|
|
1752
|
+
:type channel: str
|
|
1753
|
+
:param template_id: Template ID (required)
|
|
1754
|
+
:type template_id: str
|
|
1755
|
+
:param template_patch_request: (required)
|
|
1756
|
+
:type template_patch_request: TemplatePatchRequest
|
|
1757
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1758
|
+
number provided, it will be total request
|
|
1759
|
+
timeout. It can also be a pair (tuple) of
|
|
1760
|
+
(connection, read) timeouts.
|
|
1761
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1762
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1763
|
+
request; this effectively ignores the
|
|
1764
|
+
authentication in the spec for a single request.
|
|
1765
|
+
:type _request_auth: dict, optional
|
|
1766
|
+
:param _content_type: force content-type for the request.
|
|
1767
|
+
:type _content_type: str, Optional
|
|
1768
|
+
:param _headers: set to override the headers for a single
|
|
1769
|
+
request; this effectively ignores the headers
|
|
1770
|
+
in the spec for a single request.
|
|
1771
|
+
:type _headers: dict, optional
|
|
1772
|
+
:param _host_index: set to override the host_index for a single
|
|
1773
|
+
request; this effectively ignores the host_index
|
|
1774
|
+
in the spec for a single request.
|
|
1775
|
+
:type _host_index: int, optional
|
|
1776
|
+
:return: Returns the result object.
|
|
1777
|
+
""" # noqa: E501
|
|
1778
|
+
|
|
1779
|
+
_param = self._templates_update_template_serialize(
|
|
1780
|
+
notification_id=notification_id,
|
|
1781
|
+
channel=channel,
|
|
1782
|
+
template_id=template_id,
|
|
1783
|
+
template_patch_request=template_patch_request,
|
|
1784
|
+
_request_auth=_request_auth,
|
|
1785
|
+
_content_type=_content_type,
|
|
1786
|
+
_headers=_headers,
|
|
1787
|
+
_host_index=_host_index
|
|
1788
|
+
)
|
|
1789
|
+
|
|
1790
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1791
|
+
'200': "Template",
|
|
1792
|
+
'400': None,
|
|
1793
|
+
'401': None,
|
|
1794
|
+
'500': None,
|
|
1795
|
+
}
|
|
1796
|
+
response_data = await self.api_client.call_api(
|
|
1797
|
+
*_param,
|
|
1798
|
+
_request_timeout=_request_timeout
|
|
1799
|
+
)
|
|
1800
|
+
return response_data.response
|
|
1801
|
+
|
|
1802
|
+
|
|
1803
|
+
def _templates_update_template_serialize(
|
|
1804
|
+
self,
|
|
1805
|
+
notification_id,
|
|
1806
|
+
channel,
|
|
1807
|
+
template_id,
|
|
1808
|
+
template_patch_request,
|
|
1809
|
+
_request_auth,
|
|
1810
|
+
_content_type,
|
|
1811
|
+
_headers,
|
|
1812
|
+
_host_index,
|
|
1813
|
+
) -> RequestSerialized:
|
|
1814
|
+
|
|
1815
|
+
_host = None
|
|
1816
|
+
|
|
1817
|
+
_collection_formats: Dict[str, str] = {
|
|
1818
|
+
}
|
|
1819
|
+
|
|
1820
|
+
_path_params: Dict[str, str] = {}
|
|
1821
|
+
_query_params: List[Tuple[str, str]] = []
|
|
1822
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
1823
|
+
_form_params: List[Tuple[str, str]] = []
|
|
1824
|
+
_files: Dict[
|
|
1825
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
1826
|
+
] = {}
|
|
1827
|
+
_body_params: Optional[bytes] = None
|
|
1828
|
+
|
|
1829
|
+
# process the path parameters
|
|
1830
|
+
if notification_id is not None:
|
|
1831
|
+
_path_params['notificationId'] = notification_id
|
|
1832
|
+
if channel is not None:
|
|
1833
|
+
_path_params['channel'] = channel
|
|
1834
|
+
if template_id is not None:
|
|
1835
|
+
_path_params['templateId'] = template_id
|
|
1836
|
+
# process the query parameters
|
|
1837
|
+
# process the header parameters
|
|
1838
|
+
# process the form parameters
|
|
1839
|
+
# process the body parameter
|
|
1840
|
+
if template_patch_request is not None:
|
|
1841
|
+
_body_params = template_patch_request
|
|
1842
|
+
|
|
1843
|
+
|
|
1844
|
+
# set the HTTP header `Accept`
|
|
1845
|
+
if 'Accept' not in _header_params:
|
|
1846
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
1847
|
+
[
|
|
1848
|
+
'application/json'
|
|
1849
|
+
]
|
|
1850
|
+
)
|
|
1851
|
+
|
|
1852
|
+
# set the HTTP header `Content-Type`
|
|
1853
|
+
if _content_type:
|
|
1854
|
+
_header_params['Content-Type'] = _content_type
|
|
1855
|
+
else:
|
|
1856
|
+
_default_content_type = (
|
|
1857
|
+
self.api_client.select_header_content_type(
|
|
1858
|
+
[
|
|
1859
|
+
'application/json'
|
|
1860
|
+
]
|
|
1861
|
+
)
|
|
1862
|
+
)
|
|
1863
|
+
if _default_content_type is not None:
|
|
1864
|
+
_header_params['Content-Type'] = _default_content_type
|
|
1865
|
+
|
|
1866
|
+
# authentication setting
|
|
1867
|
+
_auth_settings: List[str] = [
|
|
1868
|
+
'endUserHashed',
|
|
1869
|
+
'endUser',
|
|
1870
|
+
'apiKey',
|
|
1871
|
+
'clientCredentials'
|
|
1872
|
+
]
|
|
1873
|
+
|
|
1874
|
+
return self.api_client.param_serialize(
|
|
1875
|
+
method='PATCH',
|
|
1876
|
+
resource_path='/notifications/{notificationId}/{channel}/templates/{templateId}',
|
|
1877
|
+
path_params=_path_params,
|
|
1878
|
+
query_params=_query_params,
|
|
1879
|
+
header_params=_header_params,
|
|
1880
|
+
body=_body_params,
|
|
1881
|
+
post_params=_form_params,
|
|
1882
|
+
files=_files,
|
|
1883
|
+
auth_settings=_auth_settings,
|
|
1884
|
+
collection_formats=_collection_formats,
|
|
1885
|
+
_host=_host,
|
|
1886
|
+
_request_auth=_request_auth
|
|
1887
|
+
)
|
|
1888
|
+
|
|
1889
|
+
|