pingram 0.1.0

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 (187) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +54 -0
  4. data/Rakefile +10 -0
  5. data/lib/pingram/api/account_api.rb +506 -0
  6. data/lib/pingram/api/addresses_api.rb +209 -0
  7. data/lib/pingram/api/components_api.rb +396 -0
  8. data/lib/pingram/api/default_api.rb +88 -0
  9. data/lib/pingram/api/domains_api.rb +204 -0
  10. data/lib/pingram/api/editor_api.rb +88 -0
  11. data/lib/pingram/api/environments_api.rb +215 -0
  12. data/lib/pingram/api/health_api.rb +77 -0
  13. data/lib/pingram/api/insights_api.rb +88 -0
  14. data/lib/pingram/api/keys_api.rb +204 -0
  15. data/lib/pingram/api/logs_api.rb +375 -0
  16. data/lib/pingram/api/members_api.rb +433 -0
  17. data/lib/pingram/api/sender_api.rb +221 -0
  18. data/lib/pingram/api/templates_api.rb +479 -0
  19. data/lib/pingram/api/types_api.rb +335 -0
  20. data/lib/pingram/api/user_api.rb +587 -0
  21. data/lib/pingram/api/users_api.rb +228 -0
  22. data/lib/pingram/api_client.rb +397 -0
  23. data/lib/pingram/api_error.rb +58 -0
  24. data/lib/pingram/api_model_base.rb +88 -0
  25. data/lib/pingram/client_wrapper.rb +212 -0
  26. data/lib/pingram/configuration.rb +330 -0
  27. data/lib/pingram/models/account_addresses_response.rb +166 -0
  28. data/lib/pingram/models/account_addresses_response_addresses_inner.rb +301 -0
  29. data/lib/pingram/models/account_get_response.rb +354 -0
  30. data/lib/pingram/models/account_get_response_pending_downgrade_usage_limit.rb +201 -0
  31. data/lib/pingram/models/address_response.rb +164 -0
  32. data/lib/pingram/models/auto_join_get_response.rb +192 -0
  33. data/lib/pingram/models/auto_join_post_response.rb +192 -0
  34. data/lib/pingram/models/auto_join_request_body.rb +166 -0
  35. data/lib/pingram/models/bee_token_v2.rb +190 -0
  36. data/lib/pingram/models/billing_post_request_body.rb +216 -0
  37. data/lib/pingram/models/billing_post_response_body.rb +367 -0
  38. data/lib/pingram/models/billing_post_response_body_pending_downgrade_usage_limit.rb +202 -0
  39. data/lib/pingram/models/channels_enum.rb +45 -0
  40. data/lib/pingram/models/create_account_request_body.rb +164 -0
  41. data/lib/pingram/models/create_account_response.rb +190 -0
  42. data/lib/pingram/models/create_address_request.rb +182 -0
  43. data/lib/pingram/models/create_key_request.rb +227 -0
  44. data/lib/pingram/models/create_key_response.rb +308 -0
  45. data/lib/pingram/models/delete_key_response.rb +165 -0
  46. data/lib/pingram/models/delete_user_response.rb +164 -0
  47. data/lib/pingram/models/email_auth_token_post_request.rb +147 -0
  48. data/lib/pingram/models/email_component_patch_request.rb +174 -0
  49. data/lib/pingram/models/email_component_post_request.rb +217 -0
  50. data/lib/pingram/models/email_component_response.rb +424 -0
  51. data/lib/pingram/models/email_component_response_referenced_by_inner.rb +238 -0
  52. data/lib/pingram/models/environment.rb +270 -0
  53. data/lib/pingram/models/environment_create_request.rb +164 -0
  54. data/lib/pingram/models/environment_patch_request.rb +176 -0
  55. data/lib/pingram/models/get_account_metadata_response.rb +164 -0
  56. data/lib/pingram/models/get_account_metadata_response_user_account_metadata.rb +216 -0
  57. data/lib/pingram/models/get_email_components_response_inner.rb +424 -0
  58. data/lib/pingram/models/get_environments_response_inner.rb +270 -0
  59. data/lib/pingram/models/get_inapp_notifications_response.rb +166 -0
  60. data/lib/pingram/models/get_inapp_notifications_response_notifications_inner.rb +389 -0
  61. data/lib/pingram/models/get_inapp_notifications_response_notifications_inner_delivery_options.rb +206 -0
  62. data/lib/pingram/models/get_inapp_notifications_response_notifications_inner_delivery_options_instant.rb +191 -0
  63. data/lib/pingram/models/get_inapp_notifications_response_notifications_inner_delivery_options_off.rb +164 -0
  64. data/lib/pingram/models/get_inapp_notifications_response_notifications_inner_replies_inner.rb +190 -0
  65. data/lib/pingram/models/get_inapp_notifications_response_notifications_inner_template.rb +103 -0
  66. data/lib/pingram/models/get_inapp_notifications_response_notifications_inner_template_any_of.rb +301 -0
  67. data/lib/pingram/models/get_keys_response.rb +168 -0
  68. data/lib/pingram/models/get_keys_response_keys_inner.rb +371 -0
  69. data/lib/pingram/models/get_logs_response.rb +175 -0
  70. data/lib/pingram/models/get_logs_response_messages_inner.rb +419 -0
  71. data/lib/pingram/models/get_logs_response_messages_inner_attachments_inner.rb +225 -0
  72. data/lib/pingram/models/get_members_response_inner.rb +236 -0
  73. data/lib/pingram/models/get_metrics_response_inner.rb +238 -0
  74. data/lib/pingram/models/get_metrics_response_inner_messages_inner.rb +159 -0
  75. data/lib/pingram/models/get_notifications_response_inner.rb +317 -0
  76. data/lib/pingram/models/get_notifications_response_inner_deduplication.rb +164 -0
  77. data/lib/pingram/models/get_notifications_response_inner_options.rb +201 -0
  78. data/lib/pingram/models/get_notifications_response_inner_options_email.rb +242 -0
  79. data/lib/pingram/models/get_notifications_response_inner_options_email_daily.rb +173 -0
  80. data/lib/pingram/models/get_notifications_response_inner_options_email_monthly.rb +216 -0
  81. data/lib/pingram/models/get_notifications_response_inner_options_email_weekly.rb +182 -0
  82. data/lib/pingram/models/get_notifications_response_inner_templates_inner.rb +214 -0
  83. data/lib/pingram/models/get_notifications_response_inner_throttling.rb +294 -0
  84. data/lib/pingram/models/get_senders_response_inner.rb +342 -0
  85. data/lib/pingram/models/get_templates_response.rb +103 -0
  86. data/lib/pingram/models/get_users_response.rb +201 -0
  87. data/lib/pingram/models/get_users_response_users_inner.rb +268 -0
  88. data/lib/pingram/models/get_users_response_users_inner_email_suppression_status.rb +214 -0
  89. data/lib/pingram/models/get_users_response_users_inner_push_tokens_inner.rb +252 -0
  90. data/lib/pingram/models/get_users_response_users_inner_push_tokens_inner_device.rb +209 -0
  91. data/lib/pingram/models/get_users_response_users_inner_slack_token.rb +317 -0
  92. data/lib/pingram/models/get_users_response_users_inner_slack_token_authed_user.rb +192 -0
  93. data/lib/pingram/models/get_users_response_users_inner_slack_token_enterprise.rb +156 -0
  94. data/lib/pingram/models/get_users_response_users_inner_slack_token_incoming_webhook.rb +174 -0
  95. data/lib/pingram/models/get_users_response_users_inner_slack_token_response_metadata.rb +200 -0
  96. data/lib/pingram/models/get_users_response_users_inner_web_push_tokens_inner.rb +164 -0
  97. data/lib/pingram/models/get_users_response_users_inner_web_push_tokens_inner_sub.rb +191 -0
  98. data/lib/pingram/models/get_users_response_users_inner_web_push_tokens_inner_sub_keys.rb +190 -0
  99. data/lib/pingram/models/in_app_notification_patch_request.rb +231 -0
  100. data/lib/pingram/models/in_app_notification_unread_clear_request.rb +156 -0
  101. data/lib/pingram/models/inapp_unread_count_response.rb +164 -0
  102. data/lib/pingram/models/inbound_request_body.rb +103 -0
  103. data/lib/pingram/models/inbound_response_body.rb +216 -0
  104. data/lib/pingram/models/inbound_response_body_results_inner.rb +216 -0
  105. data/lib/pingram/models/ingishts_post_request.rb +288 -0
  106. data/lib/pingram/models/ingishts_post_request_label_options.rb +147 -0
  107. data/lib/pingram/models/ingishts_post_request_metric_data_queries_inner.rb +208 -0
  108. data/lib/pingram/models/ingishts_post_request_metric_data_queries_inner_metric_stat.rb +211 -0
  109. data/lib/pingram/models/ingishts_post_request_metric_data_queries_inner_metric_stat_metric.rb +171 -0
  110. data/lib/pingram/models/ingishts_post_request_metric_data_queries_inner_metric_stat_metric_dimensions_inner.rb +159 -0
  111. data/lib/pingram/models/intercom_webhook.rb +293 -0
  112. data/lib/pingram/models/intercom_webhook_data.rb +164 -0
  113. data/lib/pingram/models/intercom_webhook_data_item.rb +103 -0
  114. data/lib/pingram/models/intercom_webhook_data_item_any_of.rb +453 -0
  115. data/lib/pingram/models/intercom_webhook_data_item_any_of_contacts.rb +216 -0
  116. data/lib/pingram/models/intercom_webhook_data_item_any_of_contacts_contacts_inner.rb +199 -0
  117. data/lib/pingram/models/intercom_webhook_data_item_any_of_source.rb +260 -0
  118. data/lib/pingram/models/intercom_webhook_data_item_any_of_source_author.rb +208 -0
  119. data/lib/pingram/models/invite_post_response.rb +156 -0
  120. data/lib/pingram/models/log_query_post_body.rb +251 -0
  121. data/lib/pingram/models/logs_bulk_request.rb +167 -0
  122. data/lib/pingram/models/logs_get_response.rb +167 -0
  123. data/lib/pingram/models/logs_get_response_logs_inner.rb +1808 -0
  124. data/lib/pingram/models/logs_query_response.rb +165 -0
  125. data/lib/pingram/models/logs_query_result_response.rb +194 -0
  126. data/lib/pingram/models/logs_retention_response.rb +165 -0
  127. data/lib/pingram/models/logs_tail_response.rb +167 -0
  128. data/lib/pingram/models/member_invite_request.rb +173 -0
  129. data/lib/pingram/models/member_update_request.rb +164 -0
  130. data/lib/pingram/models/message_response.rb +164 -0
  131. data/lib/pingram/models/notification.rb +317 -0
  132. data/lib/pingram/models/notification_create_request.rb +227 -0
  133. data/lib/pingram/models/notification_patch_request.rb +203 -0
  134. data/lib/pingram/models/post_email_test_request.rb +303 -0
  135. data/lib/pingram/models/post_email_test_response.rb +175 -0
  136. data/lib/pingram/models/post_senders_request_body.rb +164 -0
  137. data/lib/pingram/models/post_user_request.rb +215 -0
  138. data/lib/pingram/models/sender_post_body.rb +324 -0
  139. data/lib/pingram/models/sender_post_body_email.rb +217 -0
  140. data/lib/pingram/models/sender_post_body_inapp.rb +182 -0
  141. data/lib/pingram/models/sender_post_body_mobile_push.rb +190 -0
  142. data/lib/pingram/models/sender_post_body_options.rb +165 -0
  143. data/lib/pingram/models/sender_post_body_options_apn.rb +201 -0
  144. data/lib/pingram/models/sender_post_body_options_email.rb +209 -0
  145. data/lib/pingram/models/sender_post_body_options_email_attachments_inner.rb +103 -0
  146. data/lib/pingram/models/sender_post_body_options_email_attachments_inner_any_of.rb +190 -0
  147. data/lib/pingram/models/sender_post_body_options_email_attachments_inner_any_of1.rb +199 -0
  148. data/lib/pingram/models/sender_post_body_options_fcm.rb +147 -0
  149. data/lib/pingram/models/sender_post_body_options_fcm_android.rb +208 -0
  150. data/lib/pingram/models/sender_post_body_slack.rb +299 -0
  151. data/lib/pingram/models/sender_post_body_slack_metadata.rb +173 -0
  152. data/lib/pingram/models/sender_post_body_slack_metadata_entities_inner.rb +257 -0
  153. data/lib/pingram/models/sender_post_body_slack_metadata_entities_inner_external_ref.rb +174 -0
  154. data/lib/pingram/models/sender_post_body_sms.rb +156 -0
  155. data/lib/pingram/models/sender_post_body_sms_auto_reply.rb +164 -0
  156. data/lib/pingram/models/sender_post_body_to.rb +251 -0
  157. data/lib/pingram/models/sender_post_body_user.rb +268 -0
  158. data/lib/pingram/models/sender_post_body_web_push.rb +208 -0
  159. data/lib/pingram/models/sender_post_response.rb +192 -0
  160. data/lib/pingram/models/set_default_template_request.rb +204 -0
  161. data/lib/pingram/models/slack_interactivity_response.rb +165 -0
  162. data/lib/pingram/models/slack_oauth_request.rb +190 -0
  163. data/lib/pingram/models/success_response.rb +164 -0
  164. data/lib/pingram/models/supabase_configure_request.rb +242 -0
  165. data/lib/pingram/models/supabase_configure_response.rb +173 -0
  166. data/lib/pingram/models/supabase_o_auth_request.rb +216 -0
  167. data/lib/pingram/models/supabase_o_auth_response.rb +173 -0
  168. data/lib/pingram/models/supabase_projects_response.rb +166 -0
  169. data/lib/pingram/models/supabase_projects_response_projects_inner.rb +268 -0
  170. data/lib/pingram/models/supabase_status_response.rb +208 -0
  171. data/lib/pingram/models/template.rb +301 -0
  172. data/lib/pingram/models/template_patch_request.rb +104 -0
  173. data/lib/pingram/models/template_patch_request_any_of.rb +199 -0
  174. data/lib/pingram/models/template_patch_request_any_of1.rb +187 -0
  175. data/lib/pingram/models/template_patch_request_any_of1_batch.rb +217 -0
  176. data/lib/pingram/models/template_patch_request_any_of1_instant.rb +184 -0
  177. data/lib/pingram/models/template_post_request.rb +346 -0
  178. data/lib/pingram/models/template_post_request_batch.rb +217 -0
  179. data/lib/pingram/models/template_post_request_instant.rb +183 -0
  180. data/lib/pingram/models/update_address_request.rb +182 -0
  181. data/lib/pingram/models/user.rb +268 -0
  182. data/lib/pingram/models/user_suppression_delete_response.rb +164 -0
  183. data/lib/pingram/models/webhook_response.rb +182 -0
  184. data/lib/pingram/version.rb +15 -0
  185. data/lib/pingram.rb +215 -0
  186. data/pingram.gemspec +38 -0
  187. metadata +270 -0
@@ -0,0 +1,479 @@
1
+ =begin
2
+ #NotificationAPI
3
+
4
+ #Internal API for notification delivery and management
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Pingram
16
+ class TemplatesApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Create a new template for a notification
23
+ # @param notification_id [String] Notification ID
24
+ # @param channel [String] Channel type
25
+ # @param template_post_request [TemplatePostRequest]
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [Template]
28
+ def templates_create_template(notification_id, channel, template_post_request, opts = {})
29
+ data, _status_code, _headers = templates_create_template_with_http_info(notification_id, channel, template_post_request, opts)
30
+ data
31
+ end
32
+
33
+ # Create a new template for a notification
34
+ # @param notification_id [String] Notification ID
35
+ # @param channel [String] Channel type
36
+ # @param template_post_request [TemplatePostRequest]
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [Array<(Template, Integer, Hash)>] Template data, response status code and response headers
39
+ def templates_create_template_with_http_info(notification_id, channel, template_post_request, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: TemplatesApi.templates_create_template ...'
42
+ end
43
+ # verify the required parameter 'notification_id' is set
44
+ if @api_client.config.client_side_validation && notification_id.nil?
45
+ fail ArgumentError, "Missing the required parameter 'notification_id' when calling TemplatesApi.templates_create_template"
46
+ end
47
+ # verify the required parameter 'channel' is set
48
+ if @api_client.config.client_side_validation && channel.nil?
49
+ fail ArgumentError, "Missing the required parameter 'channel' when calling TemplatesApi.templates_create_template"
50
+ end
51
+ # verify the required parameter 'template_post_request' is set
52
+ if @api_client.config.client_side_validation && template_post_request.nil?
53
+ fail ArgumentError, "Missing the required parameter 'template_post_request' when calling TemplatesApi.templates_create_template"
54
+ end
55
+ # resource path
56
+ local_var_path = '/notifications/{notificationId}/{channel}/templates'.sub('{' + 'notificationId' + '}', CGI.escape(notification_id.to_s)).sub('{' + 'channel' + '}', CGI.escape(channel.to_s))
57
+
58
+ # query parameters
59
+ query_params = opts[:query_params] || {}
60
+
61
+ # header parameters
62
+ header_params = opts[:header_params] || {}
63
+ # HTTP header 'Accept' (if needed)
64
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
65
+ # HTTP header 'Content-Type'
66
+ content_type = @api_client.select_header_content_type(['application/json'])
67
+ if !content_type.nil?
68
+ header_params['Content-Type'] = content_type
69
+ end
70
+
71
+ # form parameters
72
+ form_params = opts[:form_params] || {}
73
+
74
+ # http body (model)
75
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(template_post_request)
76
+
77
+ # return_type
78
+ return_type = opts[:debug_return_type] || 'Template'
79
+
80
+ # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
81
+ auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
82
+
83
+ new_options = opts.merge(
84
+ :operation => :"TemplatesApi.templates_create_template",
85
+ :header_params => header_params,
86
+ :query_params => query_params,
87
+ :form_params => form_params,
88
+ :body => post_body,
89
+ :auth_names => auth_names,
90
+ :return_type => return_type
91
+ )
92
+
93
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
94
+ if @api_client.config.debugging
95
+ @api_client.config.logger.debug "API called: TemplatesApi#templates_create_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
96
+ end
97
+ return data, status_code, headers
98
+ end
99
+
100
+ # Delete a template
101
+ # @param notification_id [String] Notification ID
102
+ # @param channel [String] Channel type
103
+ # @param template_id [String] Template ID
104
+ # @param [Hash] opts the optional parameters
105
+ # @return [nil]
106
+ def templates_delete_template(notification_id, channel, template_id, opts = {})
107
+ templates_delete_template_with_http_info(notification_id, channel, template_id, opts)
108
+ nil
109
+ end
110
+
111
+ # Delete a template
112
+ # @param notification_id [String] Notification ID
113
+ # @param channel [String] Channel type
114
+ # @param template_id [String] Template ID
115
+ # @param [Hash] opts the optional parameters
116
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
117
+ def templates_delete_template_with_http_info(notification_id, channel, template_id, opts = {})
118
+ if @api_client.config.debugging
119
+ @api_client.config.logger.debug 'Calling API: TemplatesApi.templates_delete_template ...'
120
+ end
121
+ # verify the required parameter 'notification_id' is set
122
+ if @api_client.config.client_side_validation && notification_id.nil?
123
+ fail ArgumentError, "Missing the required parameter 'notification_id' when calling TemplatesApi.templates_delete_template"
124
+ end
125
+ # verify the required parameter 'channel' is set
126
+ if @api_client.config.client_side_validation && channel.nil?
127
+ fail ArgumentError, "Missing the required parameter 'channel' when calling TemplatesApi.templates_delete_template"
128
+ end
129
+ # verify the required parameter 'template_id' is set
130
+ if @api_client.config.client_side_validation && template_id.nil?
131
+ fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.templates_delete_template"
132
+ end
133
+ # resource path
134
+ local_var_path = '/notifications/{notificationId}/{channel}/templates/{templateId}'.sub('{' + 'notificationId' + '}', CGI.escape(notification_id.to_s)).sub('{' + 'channel' + '}', CGI.escape(channel.to_s)).sub('{' + 'templateId' + '}', CGI.escape(template_id.to_s))
135
+
136
+ # query parameters
137
+ query_params = opts[:query_params] || {}
138
+
139
+ # header parameters
140
+ header_params = opts[:header_params] || {}
141
+
142
+ # form parameters
143
+ form_params = opts[:form_params] || {}
144
+
145
+ # http body (model)
146
+ post_body = opts[:debug_body]
147
+
148
+ # return_type
149
+ return_type = opts[:debug_return_type]
150
+
151
+ # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
152
+ auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
153
+
154
+ new_options = opts.merge(
155
+ :operation => :"TemplatesApi.templates_delete_template",
156
+ :header_params => header_params,
157
+ :query_params => query_params,
158
+ :form_params => form_params,
159
+ :body => post_body,
160
+ :auth_names => auth_names,
161
+ :return_type => return_type
162
+ )
163
+
164
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
165
+ if @api_client.config.debugging
166
+ @api_client.config.logger.debug "API called: TemplatesApi#templates_delete_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
167
+ end
168
+ return data, status_code, headers
169
+ end
170
+
171
+ # Initiate AI-powered template migration from complex to simple HTML
172
+ # @param notification_id [String] Notification ID
173
+ # @param channel [String] Channel type
174
+ # @param template_id [String] Template ID
175
+ # @param [Hash] opts the optional parameters
176
+ # @return [Template]
177
+ def templates_initiate_migration(notification_id, channel, template_id, opts = {})
178
+ data, _status_code, _headers = templates_initiate_migration_with_http_info(notification_id, channel, template_id, opts)
179
+ data
180
+ end
181
+
182
+ # Initiate AI-powered template migration from complex to simple HTML
183
+ # @param notification_id [String] Notification ID
184
+ # @param channel [String] Channel type
185
+ # @param template_id [String] Template ID
186
+ # @param [Hash] opts the optional parameters
187
+ # @return [Array<(Template, Integer, Hash)>] Template data, response status code and response headers
188
+ def templates_initiate_migration_with_http_info(notification_id, channel, template_id, opts = {})
189
+ if @api_client.config.debugging
190
+ @api_client.config.logger.debug 'Calling API: TemplatesApi.templates_initiate_migration ...'
191
+ end
192
+ # verify the required parameter 'notification_id' is set
193
+ if @api_client.config.client_side_validation && notification_id.nil?
194
+ fail ArgumentError, "Missing the required parameter 'notification_id' when calling TemplatesApi.templates_initiate_migration"
195
+ end
196
+ # verify the required parameter 'channel' is set
197
+ if @api_client.config.client_side_validation && channel.nil?
198
+ fail ArgumentError, "Missing the required parameter 'channel' when calling TemplatesApi.templates_initiate_migration"
199
+ end
200
+ # verify the required parameter 'template_id' is set
201
+ if @api_client.config.client_side_validation && template_id.nil?
202
+ fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.templates_initiate_migration"
203
+ end
204
+ # resource path
205
+ local_var_path = '/notifications/{notificationId}/{channel}/templates/{templateId}/migrate'.sub('{' + 'notificationId' + '}', CGI.escape(notification_id.to_s)).sub('{' + 'channel' + '}', CGI.escape(channel.to_s)).sub('{' + 'templateId' + '}', CGI.escape(template_id.to_s))
206
+
207
+ # query parameters
208
+ query_params = opts[:query_params] || {}
209
+
210
+ # header parameters
211
+ header_params = opts[:header_params] || {}
212
+ # HTTP header 'Accept' (if needed)
213
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
214
+
215
+ # form parameters
216
+ form_params = opts[:form_params] || {}
217
+
218
+ # http body (model)
219
+ post_body = opts[:debug_body]
220
+
221
+ # return_type
222
+ return_type = opts[:debug_return_type] || 'Template'
223
+
224
+ # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
225
+ auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
226
+
227
+ new_options = opts.merge(
228
+ :operation => :"TemplatesApi.templates_initiate_migration",
229
+ :header_params => header_params,
230
+ :query_params => query_params,
231
+ :form_params => form_params,
232
+ :body => post_body,
233
+ :auth_names => auth_names,
234
+ :return_type => return_type
235
+ )
236
+
237
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
238
+ if @api_client.config.debugging
239
+ @api_client.config.logger.debug "API called: TemplatesApi#templates_initiate_migration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
240
+ end
241
+ return data, status_code, headers
242
+ end
243
+
244
+ # Get template(s) for a notification
245
+ # @param notification_id [String] Notification ID
246
+ # @param channel [String] Channel type
247
+ # @param template_id [String] Template ID (optional for listing all)
248
+ # @param [Hash] opts the optional parameters
249
+ # @return [GetTemplatesResponse]
250
+ def templates_list_templates(notification_id, channel, template_id, opts = {})
251
+ data, _status_code, _headers = templates_list_templates_with_http_info(notification_id, channel, template_id, opts)
252
+ data
253
+ end
254
+
255
+ # Get template(s) for a notification
256
+ # @param notification_id [String] Notification ID
257
+ # @param channel [String] Channel type
258
+ # @param template_id [String] Template ID (optional for listing all)
259
+ # @param [Hash] opts the optional parameters
260
+ # @return [Array<(GetTemplatesResponse, Integer, Hash)>] GetTemplatesResponse data, response status code and response headers
261
+ def templates_list_templates_with_http_info(notification_id, channel, template_id, opts = {})
262
+ if @api_client.config.debugging
263
+ @api_client.config.logger.debug 'Calling API: TemplatesApi.templates_list_templates ...'
264
+ end
265
+ # verify the required parameter 'notification_id' is set
266
+ if @api_client.config.client_side_validation && notification_id.nil?
267
+ fail ArgumentError, "Missing the required parameter 'notification_id' when calling TemplatesApi.templates_list_templates"
268
+ end
269
+ # verify the required parameter 'channel' is set
270
+ if @api_client.config.client_side_validation && channel.nil?
271
+ fail ArgumentError, "Missing the required parameter 'channel' when calling TemplatesApi.templates_list_templates"
272
+ end
273
+ # verify the required parameter 'template_id' is set
274
+ if @api_client.config.client_side_validation && template_id.nil?
275
+ fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.templates_list_templates"
276
+ end
277
+ # resource path
278
+ local_var_path = '/notifications/{notificationId}/{channel}/templates/{templateId}'.sub('{' + 'notificationId' + '}', CGI.escape(notification_id.to_s)).sub('{' + 'channel' + '}', CGI.escape(channel.to_s)).sub('{' + 'templateId' + '}', CGI.escape(template_id.to_s))
279
+
280
+ # query parameters
281
+ query_params = opts[:query_params] || {}
282
+
283
+ # header parameters
284
+ header_params = opts[:header_params] || {}
285
+ # HTTP header 'Accept' (if needed)
286
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
287
+
288
+ # form parameters
289
+ form_params = opts[:form_params] || {}
290
+
291
+ # http body (model)
292
+ post_body = opts[:debug_body]
293
+
294
+ # return_type
295
+ return_type = opts[:debug_return_type] || 'GetTemplatesResponse'
296
+
297
+ # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
298
+ auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
299
+
300
+ new_options = opts.merge(
301
+ :operation => :"TemplatesApi.templates_list_templates",
302
+ :header_params => header_params,
303
+ :query_params => query_params,
304
+ :form_params => form_params,
305
+ :body => post_body,
306
+ :auth_names => auth_names,
307
+ :return_type => return_type
308
+ )
309
+
310
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
311
+ if @api_client.config.debugging
312
+ @api_client.config.logger.debug "API called: TemplatesApi#templates_list_templates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
313
+ end
314
+ return data, status_code, headers
315
+ end
316
+
317
+ # Set a template as default for specific delivery modes
318
+ # @param notification_id [String] Notification ID
319
+ # @param channel [String] Channel type
320
+ # @param set_default_template_request [SetDefaultTemplateRequest]
321
+ # @param [Hash] opts the optional parameters
322
+ # @return [Template]
323
+ def templates_set_default_template(notification_id, channel, set_default_template_request, opts = {})
324
+ data, _status_code, _headers = templates_set_default_template_with_http_info(notification_id, channel, set_default_template_request, opts)
325
+ data
326
+ end
327
+
328
+ # Set a template as default for specific delivery modes
329
+ # @param notification_id [String] Notification ID
330
+ # @param channel [String] Channel type
331
+ # @param set_default_template_request [SetDefaultTemplateRequest]
332
+ # @param [Hash] opts the optional parameters
333
+ # @return [Array<(Template, Integer, Hash)>] Template data, response status code and response headers
334
+ def templates_set_default_template_with_http_info(notification_id, channel, set_default_template_request, opts = {})
335
+ if @api_client.config.debugging
336
+ @api_client.config.logger.debug 'Calling API: TemplatesApi.templates_set_default_template ...'
337
+ end
338
+ # verify the required parameter 'notification_id' is set
339
+ if @api_client.config.client_side_validation && notification_id.nil?
340
+ fail ArgumentError, "Missing the required parameter 'notification_id' when calling TemplatesApi.templates_set_default_template"
341
+ end
342
+ # verify the required parameter 'channel' is set
343
+ if @api_client.config.client_side_validation && channel.nil?
344
+ fail ArgumentError, "Missing the required parameter 'channel' when calling TemplatesApi.templates_set_default_template"
345
+ end
346
+ # verify the required parameter 'set_default_template_request' is set
347
+ if @api_client.config.client_side_validation && set_default_template_request.nil?
348
+ fail ArgumentError, "Missing the required parameter 'set_default_template_request' when calling TemplatesApi.templates_set_default_template"
349
+ end
350
+ # resource path
351
+ local_var_path = '/notifications/{notificationId}/{channel}/templates/default'.sub('{' + 'notificationId' + '}', CGI.escape(notification_id.to_s)).sub('{' + 'channel' + '}', CGI.escape(channel.to_s))
352
+
353
+ # query parameters
354
+ query_params = opts[:query_params] || {}
355
+
356
+ # header parameters
357
+ header_params = opts[:header_params] || {}
358
+ # HTTP header 'Accept' (if needed)
359
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
360
+ # HTTP header 'Content-Type'
361
+ content_type = @api_client.select_header_content_type(['application/json'])
362
+ if !content_type.nil?
363
+ header_params['Content-Type'] = content_type
364
+ end
365
+
366
+ # form parameters
367
+ form_params = opts[:form_params] || {}
368
+
369
+ # http body (model)
370
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(set_default_template_request)
371
+
372
+ # return_type
373
+ return_type = opts[:debug_return_type] || 'Template'
374
+
375
+ # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
376
+ auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
377
+
378
+ new_options = opts.merge(
379
+ :operation => :"TemplatesApi.templates_set_default_template",
380
+ :header_params => header_params,
381
+ :query_params => query_params,
382
+ :form_params => form_params,
383
+ :body => post_body,
384
+ :auth_names => auth_names,
385
+ :return_type => return_type
386
+ )
387
+
388
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
389
+ if @api_client.config.debugging
390
+ @api_client.config.logger.debug "API called: TemplatesApi#templates_set_default_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
391
+ end
392
+ return data, status_code, headers
393
+ end
394
+
395
+ # Update a template's properties
396
+ # @param notification_id [String] Notification ID
397
+ # @param channel [String] Channel type
398
+ # @param template_id [String] Template ID
399
+ # @param template_patch_request [TemplatePatchRequest]
400
+ # @param [Hash] opts the optional parameters
401
+ # @return [Template]
402
+ def templates_update_template(notification_id, channel, template_id, template_patch_request, opts = {})
403
+ data, _status_code, _headers = templates_update_template_with_http_info(notification_id, channel, template_id, template_patch_request, opts)
404
+ data
405
+ end
406
+
407
+ # Update a template&#39;s properties
408
+ # @param notification_id [String] Notification ID
409
+ # @param channel [String] Channel type
410
+ # @param template_id [String] Template ID
411
+ # @param template_patch_request [TemplatePatchRequest]
412
+ # @param [Hash] opts the optional parameters
413
+ # @return [Array<(Template, Integer, Hash)>] Template data, response status code and response headers
414
+ def templates_update_template_with_http_info(notification_id, channel, template_id, template_patch_request, opts = {})
415
+ if @api_client.config.debugging
416
+ @api_client.config.logger.debug 'Calling API: TemplatesApi.templates_update_template ...'
417
+ end
418
+ # verify the required parameter 'notification_id' is set
419
+ if @api_client.config.client_side_validation && notification_id.nil?
420
+ fail ArgumentError, "Missing the required parameter 'notification_id' when calling TemplatesApi.templates_update_template"
421
+ end
422
+ # verify the required parameter 'channel' is set
423
+ if @api_client.config.client_side_validation && channel.nil?
424
+ fail ArgumentError, "Missing the required parameter 'channel' when calling TemplatesApi.templates_update_template"
425
+ end
426
+ # verify the required parameter 'template_id' is set
427
+ if @api_client.config.client_side_validation && template_id.nil?
428
+ fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.templates_update_template"
429
+ end
430
+ # verify the required parameter 'template_patch_request' is set
431
+ if @api_client.config.client_side_validation && template_patch_request.nil?
432
+ fail ArgumentError, "Missing the required parameter 'template_patch_request' when calling TemplatesApi.templates_update_template"
433
+ end
434
+ # resource path
435
+ local_var_path = '/notifications/{notificationId}/{channel}/templates/{templateId}'.sub('{' + 'notificationId' + '}', CGI.escape(notification_id.to_s)).sub('{' + 'channel' + '}', CGI.escape(channel.to_s)).sub('{' + 'templateId' + '}', CGI.escape(template_id.to_s))
436
+
437
+ # query parameters
438
+ query_params = opts[:query_params] || {}
439
+
440
+ # header parameters
441
+ header_params = opts[:header_params] || {}
442
+ # HTTP header 'Accept' (if needed)
443
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
444
+ # HTTP header 'Content-Type'
445
+ content_type = @api_client.select_header_content_type(['application/json'])
446
+ if !content_type.nil?
447
+ header_params['Content-Type'] = content_type
448
+ end
449
+
450
+ # form parameters
451
+ form_params = opts[:form_params] || {}
452
+
453
+ # http body (model)
454
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(template_patch_request)
455
+
456
+ # return_type
457
+ return_type = opts[:debug_return_type] || 'Template'
458
+
459
+ # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
460
+ auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
461
+
462
+ new_options = opts.merge(
463
+ :operation => :"TemplatesApi.templates_update_template",
464
+ :header_params => header_params,
465
+ :query_params => query_params,
466
+ :form_params => form_params,
467
+ :body => post_body,
468
+ :auth_names => auth_names,
469
+ :return_type => return_type
470
+ )
471
+
472
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
473
+ if @api_client.config.debugging
474
+ @api_client.config.logger.debug "API called: TemplatesApi#templates_update_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
475
+ end
476
+ return data, status_code, headers
477
+ end
478
+ end
479
+ end