mailslurp_client 7.0.8 → 7.2.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (230) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mailslurp_client.rb +12 -3
  3. metadata +11 -372
  4. data/Gemfile +0 -9
  5. data/LICENSE +0 -22
  6. data/Makefile +0 -3
  7. data/README.md +0 -239
  8. data/Rakefile +0 -10
  9. data/docs/AliasControllerApi.md +0 -337
  10. data/docs/AttachmentControllerApi.md +0 -126
  11. data/docs/AttachmentMetaData.md +0 -23
  12. data/docs/BasicAuthOptions.md +0 -19
  13. data/docs/BulkActionsControllerApi.md +0 -165
  14. data/docs/BulkSendEmailOptions.md +0 -19
  15. data/docs/CommonActionsControllerApi.md +0 -218
  16. data/docs/ContactControllerApi.md +0 -274
  17. data/docs/ContactDto.md +0 -31
  18. data/docs/ContactProjection.md +0 -27
  19. data/docs/CreateAnonymousAliasOptions.md +0 -17
  20. data/docs/CreateContactOptions.md +0 -31
  21. data/docs/CreateDomainOptions.md +0 -17
  22. data/docs/CreateGroupOptions.md +0 -19
  23. data/docs/CreateOwnedAliasOptions.md +0 -23
  24. data/docs/CreateTemplateOptions.md +0 -19
  25. data/docs/CreateWebhookOptions.md +0 -21
  26. data/docs/DomainControllerApi.md +0 -223
  27. data/docs/DomainDto.md +0 -29
  28. data/docs/DomainPreview.md +0 -21
  29. data/docs/Email.md +0 -49
  30. data/docs/EmailAnalysis.md +0 -25
  31. data/docs/EmailControllerApi.md +0 -740
  32. data/docs/EmailPreview.md +0 -31
  33. data/docs/EmailProjection.md +0 -33
  34. data/docs/FormControllerApi.md +0 -79
  35. data/docs/ForwardEmailOptions.md +0 -23
  36. data/docs/GroupContactsDto.md +0 -19
  37. data/docs/GroupControllerApi.md +0 -437
  38. data/docs/GroupDto.md +0 -23
  39. data/docs/GroupProjection.md +0 -23
  40. data/docs/HTMLValidationResult.md +0 -21
  41. data/docs/Inbox.md +0 -33
  42. data/docs/InboxControllerApi.md +0 -705
  43. data/docs/InboxProjection.md +0 -29
  44. data/docs/JsonNode.md +0 -59
  45. data/docs/MatchOption.md +0 -21
  46. data/docs/MatchOptions.md +0 -17
  47. data/docs/ModelAlias.md +0 -31
  48. data/docs/PageAlias.md +0 -37
  49. data/docs/PageContactProjection.md +0 -37
  50. data/docs/PageEmailPreview.md +0 -37
  51. data/docs/PageEmailProjection.md +0 -37
  52. data/docs/PageGroupProjection.md +0 -37
  53. data/docs/PageInboxProjection.md +0 -37
  54. data/docs/PageTemplateProjection.md +0 -37
  55. data/docs/PageWebhookProjection.md +0 -37
  56. data/docs/Pageable.md +0 -27
  57. data/docs/RawEmailJson.md +0 -17
  58. data/docs/SendEmailOptions.md +0 -45
  59. data/docs/SetInboxFavouritedOptions.md +0 -17
  60. data/docs/SimpleSendEmailOptions.md +0 -23
  61. data/docs/Sort.md +0 -21
  62. data/docs/TemplateControllerApi.md +0 -274
  63. data/docs/TemplateDto.md +0 -25
  64. data/docs/TemplateProjection.md +0 -25
  65. data/docs/TemplateVariable.md +0 -19
  66. data/docs/UnreadCount.md +0 -17
  67. data/docs/UpdateGroupContacts.md +0 -17
  68. data/docs/UpdateInboxOptions.md +0 -25
  69. data/docs/UploadAttachmentOptions.md +0 -21
  70. data/docs/ValidationDto.md +0 -19
  71. data/docs/ValidationMessage.md +0 -19
  72. data/docs/WaitForConditions.md +0 -29
  73. data/docs/WaitForControllerApi.md +0 -317
  74. data/docs/WebhookControllerApi.md +0 -339
  75. data/docs/WebhookDto.md +0 -33
  76. data/docs/WebhookProjection.md +0 -27
  77. data/docs/WebhookTestRequest.md +0 -23
  78. data/docs/WebhookTestResponse.md +0 -19
  79. data/docs/WebhookTestResult.md +0 -21
  80. data/git_push.sh +0 -58
  81. data/lib/mailslurp_client/api/alias_controller_api.rb +0 -405
  82. data/lib/mailslurp_client/api/attachment_controller_api.rb +0 -160
  83. data/lib/mailslurp_client/api/bulk_actions_controller_api.rb +0 -203
  84. data/lib/mailslurp_client/api/common_actions_controller_api.rb +0 -257
  85. data/lib/mailslurp_client/api/contact_controller_api.rb +0 -323
  86. data/lib/mailslurp_client/api/domain_controller_api.rb +0 -264
  87. data/lib/mailslurp_client/api/email_controller_api.rb +0 -852
  88. data/lib/mailslurp_client/api/form_controller_api.rb +0 -104
  89. data/lib/mailslurp_client/api/group_controller_api.rb +0 -519
  90. data/lib/mailslurp_client/api/inbox_controller_api.rb +0 -822
  91. data/lib/mailslurp_client/api/template_controller_api.rb +0 -323
  92. data/lib/mailslurp_client/api/wait_for_controller_api.rb +0 -359
  93. data/lib/mailslurp_client/api/webhook_controller_api.rb +0 -405
  94. data/lib/mailslurp_client/api_client.rb +0 -386
  95. data/lib/mailslurp_client/api_error.rb +0 -57
  96. data/lib/mailslurp_client/configuration.rb +0 -248
  97. data/lib/mailslurp_client/models/attachment_meta_data.rb +0 -238
  98. data/lib/mailslurp_client/models/basic_auth_options.rb +0 -226
  99. data/lib/mailslurp_client/models/bulk_send_email_options.rb +0 -219
  100. data/lib/mailslurp_client/models/contact_dto.rb +0 -288
  101. data/lib/mailslurp_client/models/contact_projection.rb +0 -261
  102. data/lib/mailslurp_client/models/create_anonymous_alias_options.rb +0 -208
  103. data/lib/mailslurp_client/models/create_contact_options.rb +0 -277
  104. data/lib/mailslurp_client/models/create_domain_options.rb +0 -208
  105. data/lib/mailslurp_client/models/create_group_options.rb +0 -220
  106. data/lib/mailslurp_client/models/create_owned_alias_options.rb +0 -238
  107. data/lib/mailslurp_client/models/create_template_options.rb +0 -225
  108. data/lib/mailslurp_client/models/create_webhook_options.rb +0 -227
  109. data/lib/mailslurp_client/models/domain_dto.rb +0 -296
  110. data/lib/mailslurp_client/models/domain_preview.rb +0 -240
  111. data/lib/mailslurp_client/models/email.rb +0 -376
  112. data/lib/mailslurp_client/models/email_analysis.rb +0 -248
  113. data/lib/mailslurp_client/models/email_preview.rb +0 -286
  114. data/lib/mailslurp_client/models/email_projection.rb +0 -307
  115. data/lib/mailslurp_client/models/forward_email_options.rb +0 -244
  116. data/lib/mailslurp_client/models/group_contacts_dto.rb +0 -227
  117. data/lib/mailslurp_client/models/group_dto.rb +0 -248
  118. data/lib/mailslurp_client/models/group_projection.rb +0 -248
  119. data/lib/mailslurp_client/models/html_validation_result.rb +0 -243
  120. data/lib/mailslurp_client/models/inbox.rb +0 -290
  121. data/lib/mailslurp_client/models/inbox_projection.rb +0 -272
  122. data/lib/mailslurp_client/models/json_node.rb +0 -429
  123. data/lib/mailslurp_client/models/match_option.rb +0 -274
  124. data/lib/mailslurp_client/models/match_options.rb +0 -210
  125. data/lib/mailslurp_client/models/model_alias.rb +0 -284
  126. data/lib/mailslurp_client/models/page_alias.rb +0 -298
  127. data/lib/mailslurp_client/models/page_contact_projection.rb +0 -298
  128. data/lib/mailslurp_client/models/page_email_preview.rb +0 -298
  129. data/lib/mailslurp_client/models/page_email_projection.rb +0 -298
  130. data/lib/mailslurp_client/models/page_group_projection.rb +0 -298
  131. data/lib/mailslurp_client/models/page_inbox_projection.rb +0 -298
  132. data/lib/mailslurp_client/models/page_template_projection.rb +0 -298
  133. data/lib/mailslurp_client/models/page_webhook_projection.rb +0 -298
  134. data/lib/mailslurp_client/models/pageable.rb +0 -251
  135. data/lib/mailslurp_client/models/raw_email_json.rb +0 -211
  136. data/lib/mailslurp_client/models/send_email_options.rb +0 -392
  137. data/lib/mailslurp_client/models/set_inbox_favourited_options.rb +0 -208
  138. data/lib/mailslurp_client/models/simple_send_email_options.rb +0 -237
  139. data/lib/mailslurp_client/models/sort.rb +0 -224
  140. data/lib/mailslurp_client/models/template_dto.rb +0 -269
  141. data/lib/mailslurp_client/models/template_projection.rb +0 -269
  142. data/lib/mailslurp_client/models/template_variable.rb +0 -259
  143. data/lib/mailslurp_client/models/unread_count.rb +0 -211
  144. data/lib/mailslurp_client/models/update_group_contacts.rb +0 -213
  145. data/lib/mailslurp_client/models/update_inbox_options.rb +0 -250
  146. data/lib/mailslurp_client/models/upload_attachment_options.rb +0 -228
  147. data/lib/mailslurp_client/models/validation_dto.rb +0 -217
  148. data/lib/mailslurp_client/models/validation_message.rb +0 -220
  149. data/lib/mailslurp_client/models/wait_for_conditions.rb +0 -316
  150. data/lib/mailslurp_client/models/webhook_dto.rb +0 -326
  151. data/lib/mailslurp_client/models/webhook_projection.rb +0 -277
  152. data/lib/mailslurp_client/models/webhook_test_request.rb +0 -284
  153. data/lib/mailslurp_client/models/webhook_test_response.rb +0 -215
  154. data/lib/mailslurp_client/models/webhook_test_result.rb +0 -235
  155. data/lib/mailslurp_client/version.rb +0 -15
  156. data/mailslurp_client.gemspec +0 -39
  157. data/spec/api/alias_controller_api_spec.rb +0 -107
  158. data/spec/api/attachment_controller_api_spec.rb +0 -61
  159. data/spec/api/bulk_actions_controller_api_spec.rb +0 -68
  160. data/spec/api/common_actions_controller_api_spec.rb +0 -129
  161. data/spec/api/contact_controller_api_spec.rb +0 -91
  162. data/spec/api/domain_controller_api_spec.rb +0 -82
  163. data/spec/api/email_controller_api_spec.rb +0 -162
  164. data/spec/api/form_controller_api_spec.rb +0 -54
  165. data/spec/api/group_controller_api_spec.rb +0 -126
  166. data/spec/api/inbox_controller_api_spec.rb +0 -172
  167. data/spec/api/template_controller_api_spec.rb +0 -91
  168. data/spec/api/wait_for_controller_api_spec.rb +0 -107
  169. data/spec/api/webhook_controller_api_spec.rb +0 -107
  170. data/spec/api_client_spec.rb +0 -226
  171. data/spec/configuration_spec.rb +0 -42
  172. data/spec/models/attachment_meta_data_spec.rb +0 -59
  173. data/spec/models/basic_auth_options_spec.rb +0 -47
  174. data/spec/models/bulk_send_email_options_spec.rb +0 -47
  175. data/spec/models/contact_dto_spec.rb +0 -83
  176. data/spec/models/contact_projection_spec.rb +0 -71
  177. data/spec/models/create_anonymous_alias_options_spec.rb +0 -41
  178. data/spec/models/create_contact_options_spec.rb +0 -83
  179. data/spec/models/create_domain_options_spec.rb +0 -41
  180. data/spec/models/create_group_options_spec.rb +0 -47
  181. data/spec/models/create_owned_alias_options_spec.rb +0 -59
  182. data/spec/models/create_template_options_spec.rb +0 -47
  183. data/spec/models/create_webhook_options_spec.rb +0 -53
  184. data/spec/models/domain_dto_spec.rb +0 -77
  185. data/spec/models/domain_preview_spec.rb +0 -53
  186. data/spec/models/email_analysis_spec.rb +0 -65
  187. data/spec/models/email_preview_spec.rb +0 -83
  188. data/spec/models/email_projection_spec.rb +0 -89
  189. data/spec/models/email_spec.rb +0 -137
  190. data/spec/models/forward_email_options_spec.rb +0 -59
  191. data/spec/models/group_contacts_dto_spec.rb +0 -47
  192. data/spec/models/group_dto_spec.rb +0 -59
  193. data/spec/models/group_projection_spec.rb +0 -59
  194. data/spec/models/html_validation_result_spec.rb +0 -53
  195. data/spec/models/inbox_projection_spec.rb +0 -77
  196. data/spec/models/inbox_spec.rb +0 -89
  197. data/spec/models/json_node_spec.rb +0 -171
  198. data/spec/models/match_option_spec.rb +0 -61
  199. data/spec/models/match_options_spec.rb +0 -41
  200. data/spec/models/model_alias_spec.rb +0 -83
  201. data/spec/models/page_alias_spec.rb +0 -101
  202. data/spec/models/page_contact_projection_spec.rb +0 -101
  203. data/spec/models/page_email_preview_spec.rb +0 -101
  204. data/spec/models/page_email_projection_spec.rb +0 -101
  205. data/spec/models/page_group_projection_spec.rb +0 -101
  206. data/spec/models/page_inbox_projection_spec.rb +0 -101
  207. data/spec/models/page_template_projection_spec.rb +0 -101
  208. data/spec/models/page_webhook_projection_spec.rb +0 -101
  209. data/spec/models/pageable_spec.rb +0 -71
  210. data/spec/models/raw_email_json_spec.rb +0 -41
  211. data/spec/models/send_email_options_spec.rb +0 -129
  212. data/spec/models/set_inbox_favourited_options_spec.rb +0 -41
  213. data/spec/models/simple_send_email_options_spec.rb +0 -59
  214. data/spec/models/sort_spec.rb +0 -53
  215. data/spec/models/template_dto_spec.rb +0 -65
  216. data/spec/models/template_projection_spec.rb +0 -65
  217. data/spec/models/template_variable_spec.rb +0 -51
  218. data/spec/models/unread_count_spec.rb +0 -41
  219. data/spec/models/update_group_contacts_spec.rb +0 -41
  220. data/spec/models/update_inbox_options_spec.rb +0 -65
  221. data/spec/models/upload_attachment_options_spec.rb +0 -53
  222. data/spec/models/validation_dto_spec.rb +0 -47
  223. data/spec/models/validation_message_spec.rb +0 -47
  224. data/spec/models/wait_for_conditions_spec.rb +0 -85
  225. data/spec/models/webhook_dto_spec.rb +0 -93
  226. data/spec/models/webhook_projection_spec.rb +0 -71
  227. data/spec/models/webhook_test_request_spec.rb +0 -63
  228. data/spec/models/webhook_test_response_spec.rb +0 -47
  229. data/spec/models/webhook_test_result_spec.rb +0 -53
  230. data/spec/spec_helper.rb +0 -111
@@ -1,852 +0,0 @@
1
- =begin
2
- #MailSlurp API
3
-
4
- #MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository
5
-
6
- The version of the OpenAPI document: d1659dc1567a5b62f65d0612107a50aace03e085
7
-
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.3
10
-
11
- =end
12
-
13
- require 'cgi'
14
-
15
- module MailSlurpClient
16
- class EmailControllerApi
17
- attr_accessor :api_client
18
-
19
- def initialize(api_client = ApiClient.default)
20
- @api_client = api_client
21
- end
22
- # Delete all emails
23
- # Deletes all emails in your account. Be careful as emails cannot be recovered
24
- # @param [Hash] opts the optional parameters
25
- # @return [nil]
26
- def delete_all_emails(opts = {})
27
- delete_all_emails_with_http_info(opts)
28
- nil
29
- end
30
-
31
- # Delete all emails
32
- # Deletes all emails in your account. Be careful as emails cannot be recovered
33
- # @param [Hash] opts the optional parameters
34
- # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
35
- def delete_all_emails_with_http_info(opts = {})
36
- if @api_client.config.debugging
37
- @api_client.config.logger.debug 'Calling API: EmailControllerApi.delete_all_emails ...'
38
- end
39
- # resource path
40
- local_var_path = '/emails'
41
-
42
- # query parameters
43
- query_params = opts[:query_params] || {}
44
-
45
- # header parameters
46
- header_params = opts[:header_params] || {}
47
-
48
- # form parameters
49
- form_params = opts[:form_params] || {}
50
-
51
- # http body (model)
52
- post_body = opts[:body]
53
-
54
- # return_type
55
- return_type = opts[:return_type]
56
-
57
- # auth_names
58
- auth_names = opts[:auth_names] || ['API_KEY']
59
-
60
- new_options = opts.merge(
61
- :header_params => header_params,
62
- :query_params => query_params,
63
- :form_params => form_params,
64
- :body => post_body,
65
- :auth_names => auth_names,
66
- :return_type => return_type
67
- )
68
-
69
- data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
70
- if @api_client.config.debugging
71
- @api_client.config.logger.debug "API called: EmailControllerApi#delete_all_emails\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
72
- end
73
- return data, status_code, headers
74
- end
75
-
76
- # Delete an email
77
- # Deletes an email and removes it from the inbox. Deleted emails cannot be recovered.
78
- # @param email_id [String] emailId
79
- # @param [Hash] opts the optional parameters
80
- # @return [nil]
81
- def delete_email(email_id, opts = {})
82
- delete_email_with_http_info(email_id, opts)
83
- nil
84
- end
85
-
86
- # Delete an email
87
- # Deletes an email and removes it from the inbox. Deleted emails cannot be recovered.
88
- # @param email_id [String] emailId
89
- # @param [Hash] opts the optional parameters
90
- # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
91
- def delete_email_with_http_info(email_id, opts = {})
92
- if @api_client.config.debugging
93
- @api_client.config.logger.debug 'Calling API: EmailControllerApi.delete_email ...'
94
- end
95
- # verify the required parameter 'email_id' is set
96
- if @api_client.config.client_side_validation && email_id.nil?
97
- fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.delete_email"
98
- end
99
- # resource path
100
- local_var_path = '/emails/{emailId}'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))
101
-
102
- # query parameters
103
- query_params = opts[:query_params] || {}
104
-
105
- # header parameters
106
- header_params = opts[:header_params] || {}
107
-
108
- # form parameters
109
- form_params = opts[:form_params] || {}
110
-
111
- # http body (model)
112
- post_body = opts[:body]
113
-
114
- # return_type
115
- return_type = opts[:return_type]
116
-
117
- # auth_names
118
- auth_names = opts[:auth_names] || ['API_KEY']
119
-
120
- new_options = opts.merge(
121
- :header_params => header_params,
122
- :query_params => query_params,
123
- :form_params => form_params,
124
- :body => post_body,
125
- :auth_names => auth_names,
126
- :return_type => return_type
127
- )
128
-
129
- data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
130
- if @api_client.config.debugging
131
- @api_client.config.logger.debug "API called: EmailControllerApi#delete_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
132
- end
133
- return data, status_code, headers
134
- end
135
-
136
- # Get email attachment bytes
137
- # Returns the specified attachment for a given email as a byte stream (file download). You can find attachment ids in email responses endpoint responses. The response type is application/octet-stream.
138
- # @param attachment_id [String] attachmentId
139
- # @param email_id [String] emailId
140
- # @param [Hash] opts the optional parameters
141
- # @option opts [String] :api_key Can pass apiKey in url for this request if you wish to download the file in a browser
142
- # @return [String]
143
- def download_attachment(attachment_id, email_id, opts = {})
144
- data, _status_code, _headers = download_attachment_with_http_info(attachment_id, email_id, opts)
145
- data
146
- end
147
-
148
- # Get email attachment bytes
149
- # Returns the specified attachment for a given email as a byte stream (file download). You can find attachment ids in email responses endpoint responses. The response type is application/octet-stream.
150
- # @param attachment_id [String] attachmentId
151
- # @param email_id [String] emailId
152
- # @param [Hash] opts the optional parameters
153
- # @option opts [String] :api_key Can pass apiKey in url for this request if you wish to download the file in a browser
154
- # @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
155
- def download_attachment_with_http_info(attachment_id, email_id, opts = {})
156
- if @api_client.config.debugging
157
- @api_client.config.logger.debug 'Calling API: EmailControllerApi.download_attachment ...'
158
- end
159
- # verify the required parameter 'attachment_id' is set
160
- if @api_client.config.client_side_validation && attachment_id.nil?
161
- fail ArgumentError, "Missing the required parameter 'attachment_id' when calling EmailControllerApi.download_attachment"
162
- end
163
- # verify the required parameter 'email_id' is set
164
- if @api_client.config.client_side_validation && email_id.nil?
165
- fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.download_attachment"
166
- end
167
- # resource path
168
- local_var_path = '/emails/{emailId}/attachments/{attachmentId}'.sub('{' + 'attachmentId' + '}', CGI.escape(attachment_id.to_s)).sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))
169
-
170
- # query parameters
171
- query_params = opts[:query_params] || {}
172
- query_params[:'apiKey'] = opts[:'api_key'] if !opts[:'api_key'].nil?
173
-
174
- # header parameters
175
- header_params = opts[:header_params] || {}
176
- # HTTP header 'Accept' (if needed)
177
- header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
178
-
179
- # form parameters
180
- form_params = opts[:form_params] || {}
181
-
182
- # http body (model)
183
- post_body = opts[:body]
184
-
185
- # return_type
186
- return_type = opts[:return_type] || 'String'
187
-
188
- # auth_names
189
- auth_names = opts[:auth_names] || ['API_KEY']
190
-
191
- new_options = opts.merge(
192
- :header_params => header_params,
193
- :query_params => query_params,
194
- :form_params => form_params,
195
- :body => post_body,
196
- :auth_names => auth_names,
197
- :return_type => return_type
198
- )
199
-
200
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
201
- if @api_client.config.debugging
202
- @api_client.config.logger.debug "API called: EmailControllerApi#download_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
203
- end
204
- return data, status_code, headers
205
- end
206
-
207
- # Forward email
208
- # Forward an existing email to new recipients.
209
- # @param email_id [String] emailId
210
- # @param forward_email_options [ForwardEmailOptions] forwardEmailOptions
211
- # @param [Hash] opts the optional parameters
212
- # @return [nil]
213
- def forward_email(email_id, forward_email_options, opts = {})
214
- forward_email_with_http_info(email_id, forward_email_options, opts)
215
- nil
216
- end
217
-
218
- # Forward email
219
- # Forward an existing email to new recipients.
220
- # @param email_id [String] emailId
221
- # @param forward_email_options [ForwardEmailOptions] forwardEmailOptions
222
- # @param [Hash] opts the optional parameters
223
- # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
224
- def forward_email_with_http_info(email_id, forward_email_options, opts = {})
225
- if @api_client.config.debugging
226
- @api_client.config.logger.debug 'Calling API: EmailControllerApi.forward_email ...'
227
- end
228
- # verify the required parameter 'email_id' is set
229
- if @api_client.config.client_side_validation && email_id.nil?
230
- fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.forward_email"
231
- end
232
- # verify the required parameter 'forward_email_options' is set
233
- if @api_client.config.client_side_validation && forward_email_options.nil?
234
- fail ArgumentError, "Missing the required parameter 'forward_email_options' when calling EmailControllerApi.forward_email"
235
- end
236
- # resource path
237
- local_var_path = '/emails/{emailId}/forward'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))
238
-
239
- # query parameters
240
- query_params = opts[:query_params] || {}
241
-
242
- # header parameters
243
- header_params = opts[:header_params] || {}
244
- # HTTP header 'Content-Type'
245
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
246
-
247
- # form parameters
248
- form_params = opts[:form_params] || {}
249
-
250
- # http body (model)
251
- post_body = opts[:body] || @api_client.object_to_http_body(forward_email_options)
252
-
253
- # return_type
254
- return_type = opts[:return_type]
255
-
256
- # auth_names
257
- auth_names = opts[:auth_names] || ['API_KEY']
258
-
259
- new_options = opts.merge(
260
- :header_params => header_params,
261
- :query_params => query_params,
262
- :form_params => form_params,
263
- :body => post_body,
264
- :auth_names => auth_names,
265
- :return_type => return_type
266
- )
267
-
268
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
269
- if @api_client.config.debugging
270
- @api_client.config.logger.debug "API called: EmailControllerApi#forward_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
271
- end
272
- return data, status_code, headers
273
- end
274
-
275
- # Get email attachment metadata
276
- # Returns the metadata such as name and content-type for a given attachment and email.
277
- # @param attachment_id [String] attachmentId
278
- # @param email_id [String] emailId
279
- # @param [Hash] opts the optional parameters
280
- # @return [AttachmentMetaData]
281
- def get_attachment_meta_data(attachment_id, email_id, opts = {})
282
- data, _status_code, _headers = get_attachment_meta_data_with_http_info(attachment_id, email_id, opts)
283
- data
284
- end
285
-
286
- # Get email attachment metadata
287
- # Returns the metadata such as name and content-type for a given attachment and email.
288
- # @param attachment_id [String] attachmentId
289
- # @param email_id [String] emailId
290
- # @param [Hash] opts the optional parameters
291
- # @return [Array<(AttachmentMetaData, Integer, Hash)>] AttachmentMetaData data, response status code and response headers
292
- def get_attachment_meta_data_with_http_info(attachment_id, email_id, opts = {})
293
- if @api_client.config.debugging
294
- @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_attachment_meta_data ...'
295
- end
296
- # verify the required parameter 'attachment_id' is set
297
- if @api_client.config.client_side_validation && attachment_id.nil?
298
- fail ArgumentError, "Missing the required parameter 'attachment_id' when calling EmailControllerApi.get_attachment_meta_data"
299
- end
300
- # verify the required parameter 'email_id' is set
301
- if @api_client.config.client_side_validation && email_id.nil?
302
- fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.get_attachment_meta_data"
303
- end
304
- # resource path
305
- local_var_path = '/emails/{emailId}/attachments/{attachmentId}/metadata'.sub('{' + 'attachmentId' + '}', CGI.escape(attachment_id.to_s)).sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))
306
-
307
- # query parameters
308
- query_params = opts[:query_params] || {}
309
-
310
- # header parameters
311
- header_params = opts[:header_params] || {}
312
- # HTTP header 'Accept' (if needed)
313
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
314
-
315
- # form parameters
316
- form_params = opts[:form_params] || {}
317
-
318
- # http body (model)
319
- post_body = opts[:body]
320
-
321
- # return_type
322
- return_type = opts[:return_type] || 'AttachmentMetaData'
323
-
324
- # auth_names
325
- auth_names = opts[:auth_names] || ['API_KEY']
326
-
327
- new_options = opts.merge(
328
- :header_params => header_params,
329
- :query_params => query_params,
330
- :form_params => form_params,
331
- :body => post_body,
332
- :auth_names => auth_names,
333
- :return_type => return_type
334
- )
335
-
336
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
337
- if @api_client.config.debugging
338
- @api_client.config.logger.debug "API called: EmailControllerApi#get_attachment_meta_data\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
339
- end
340
- return data, status_code, headers
341
- end
342
-
343
- # Get all email attachment metadata
344
- # Returns an array of attachment metadata such as name and content-type for a given email if present.
345
- # @param email_id [String] emailId
346
- # @param [Hash] opts the optional parameters
347
- # @return [Array<AttachmentMetaData>]
348
- def get_attachments(email_id, opts = {})
349
- data, _status_code, _headers = get_attachments_with_http_info(email_id, opts)
350
- data
351
- end
352
-
353
- # Get all email attachment metadata
354
- # Returns an array of attachment metadata such as name and content-type for a given email if present.
355
- # @param email_id [String] emailId
356
- # @param [Hash] opts the optional parameters
357
- # @return [Array<(Array<AttachmentMetaData>, Integer, Hash)>] Array<AttachmentMetaData> data, response status code and response headers
358
- def get_attachments_with_http_info(email_id, opts = {})
359
- if @api_client.config.debugging
360
- @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_attachments ...'
361
- end
362
- # verify the required parameter 'email_id' is set
363
- if @api_client.config.client_side_validation && email_id.nil?
364
- fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.get_attachments"
365
- end
366
- # resource path
367
- local_var_path = '/emails/{emailId}/attachments'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))
368
-
369
- # query parameters
370
- query_params = opts[:query_params] || {}
371
-
372
- # header parameters
373
- header_params = opts[:header_params] || {}
374
- # HTTP header 'Accept' (if needed)
375
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
376
-
377
- # form parameters
378
- form_params = opts[:form_params] || {}
379
-
380
- # http body (model)
381
- post_body = opts[:body]
382
-
383
- # return_type
384
- return_type = opts[:return_type] || 'Array<AttachmentMetaData>'
385
-
386
- # auth_names
387
- auth_names = opts[:auth_names] || ['API_KEY']
388
-
389
- new_options = opts.merge(
390
- :header_params => header_params,
391
- :query_params => query_params,
392
- :form_params => form_params,
393
- :body => post_body,
394
- :auth_names => auth_names,
395
- :return_type => return_type
396
- )
397
-
398
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
399
- if @api_client.config.debugging
400
- @api_client.config.logger.debug "API called: EmailControllerApi#get_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
401
- end
402
- return data, status_code, headers
403
- end
404
-
405
- # Get email content
406
- # Returns a email summary object with headers and content. To retrieve the raw unparsed email use the getRawEmail endpoints
407
- # @param email_id [String] emailId
408
- # @param [Hash] opts the optional parameters
409
- # @option opts [Boolean] :decode Decode email body quoted-printable encoding to plain text. SMTP servers often encode text using quoted-printable format (for instance &#x60;&#x3D;D7&#x60;). This can be a pain for testing (default to false)
410
- # @return [Email]
411
- def get_email(email_id, opts = {})
412
- data, _status_code, _headers = get_email_with_http_info(email_id, opts)
413
- data
414
- end
415
-
416
- # Get email content
417
- # Returns a email summary object with headers and content. To retrieve the raw unparsed email use the getRawEmail endpoints
418
- # @param email_id [String] emailId
419
- # @param [Hash] opts the optional parameters
420
- # @option opts [Boolean] :decode Decode email body quoted-printable encoding to plain text. SMTP servers often encode text using quoted-printable format (for instance &#x60;&#x3D;D7&#x60;). This can be a pain for testing
421
- # @return [Array<(Email, Integer, Hash)>] Email data, response status code and response headers
422
- def get_email_with_http_info(email_id, opts = {})
423
- if @api_client.config.debugging
424
- @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_email ...'
425
- end
426
- # verify the required parameter 'email_id' is set
427
- if @api_client.config.client_side_validation && email_id.nil?
428
- fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.get_email"
429
- end
430
- # resource path
431
- local_var_path = '/emails/{emailId}'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))
432
-
433
- # query parameters
434
- query_params = opts[:query_params] || {}
435
- query_params[:'decode'] = opts[:'decode'] if !opts[:'decode'].nil?
436
-
437
- # header parameters
438
- header_params = opts[:header_params] || {}
439
- # HTTP header 'Accept' (if needed)
440
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
441
-
442
- # form parameters
443
- form_params = opts[:form_params] || {}
444
-
445
- # http body (model)
446
- post_body = opts[:body]
447
-
448
- # return_type
449
- return_type = opts[:return_type] || 'Email'
450
-
451
- # auth_names
452
- auth_names = opts[:auth_names] || ['API_KEY']
453
-
454
- new_options = opts.merge(
455
- :header_params => header_params,
456
- :query_params => query_params,
457
- :form_params => form_params,
458
- :body => post_body,
459
- :auth_names => auth_names,
460
- :return_type => return_type
461
- )
462
-
463
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
464
- if @api_client.config.debugging
465
- @api_client.config.logger.debug "API called: EmailControllerApi#get_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
466
- end
467
- return data, status_code, headers
468
- end
469
-
470
- # Get email content as HTML
471
- # Retrieve email content as HTML response for viewing in browsers. Decodes quoted-printable entities and converts charset to UTF-8. Pass your API KEY as a request parameter when viewing in a browser: `?apiKey=xxx`
472
- # @param email_id [String] emailId
473
- # @param [Hash] opts the optional parameters
474
- # @option opts [Boolean] :decode decode (default to false)
475
- # @return [String]
476
- def get_email_html(email_id, opts = {})
477
- data, _status_code, _headers = get_email_html_with_http_info(email_id, opts)
478
- data
479
- end
480
-
481
- # Get email content as HTML
482
- # Retrieve email content as HTML response for viewing in browsers. Decodes quoted-printable entities and converts charset to UTF-8. Pass your API KEY as a request parameter when viewing in a browser: &#x60;?apiKey&#x3D;xxx&#x60;
483
- # @param email_id [String] emailId
484
- # @param [Hash] opts the optional parameters
485
- # @option opts [Boolean] :decode decode
486
- # @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
487
- def get_email_html_with_http_info(email_id, opts = {})
488
- if @api_client.config.debugging
489
- @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_email_html ...'
490
- end
491
- # verify the required parameter 'email_id' is set
492
- if @api_client.config.client_side_validation && email_id.nil?
493
- fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.get_email_html"
494
- end
495
- # resource path
496
- local_var_path = '/emails/{emailId}/html'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))
497
-
498
- # query parameters
499
- query_params = opts[:query_params] || {}
500
- query_params[:'decode'] = opts[:'decode'] if !opts[:'decode'].nil?
501
-
502
- # header parameters
503
- header_params = opts[:header_params] || {}
504
- # HTTP header 'Accept' (if needed)
505
- header_params['Accept'] = @api_client.select_header_accept(['text/html'])
506
-
507
- # form parameters
508
- form_params = opts[:form_params] || {}
509
-
510
- # http body (model)
511
- post_body = opts[:body]
512
-
513
- # return_type
514
- return_type = opts[:return_type] || 'String'
515
-
516
- # auth_names
517
- auth_names = opts[:auth_names] || ['API_KEY']
518
-
519
- new_options = opts.merge(
520
- :header_params => header_params,
521
- :query_params => query_params,
522
- :form_params => form_params,
523
- :body => post_body,
524
- :auth_names => auth_names,
525
- :return_type => return_type
526
- )
527
-
528
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
529
- if @api_client.config.debugging
530
- @api_client.config.logger.debug "API called: EmailControllerApi#get_email_html\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
531
- end
532
- return data, status_code, headers
533
- end
534
-
535
- # Get all emails
536
- # By default returns all emails across all inboxes sorted by ascending created at date. Responses are paginated. You can restrict results to a list of inbox IDs. You can also filter out read messages
537
- # @param [Hash] opts the optional parameters
538
- # @option opts [Array<String>] :inbox_id Optional inbox ids to filter by. Can be repeated. By default will use all inboxes belonging to your account.
539
- # @option opts [Integer] :page Optional page index in email list pagination (default to 0)
540
- # @option opts [Integer] :size Optional page size in email list pagination (default to 20)
541
- # @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC')
542
- # @option opts [Boolean] :unread_only Optional filter for unread emails only. All emails are considered unread until they are viewed in the dashboard or requested directly (default to false)
543
- # @return [PageEmailProjection]
544
- def get_emails_paginated(opts = {})
545
- data, _status_code, _headers = get_emails_paginated_with_http_info(opts)
546
- data
547
- end
548
-
549
- # Get all emails
550
- # By default returns all emails across all inboxes sorted by ascending created at date. Responses are paginated. You can restrict results to a list of inbox IDs. You can also filter out read messages
551
- # @param [Hash] opts the optional parameters
552
- # @option opts [Array<String>] :inbox_id Optional inbox ids to filter by. Can be repeated. By default will use all inboxes belonging to your account.
553
- # @option opts [Integer] :page Optional page index in email list pagination
554
- # @option opts [Integer] :size Optional page size in email list pagination
555
- # @option opts [String] :sort Optional createdAt sort direction ASC or DESC
556
- # @option opts [Boolean] :unread_only Optional filter for unread emails only. All emails are considered unread until they are viewed in the dashboard or requested directly
557
- # @return [Array<(PageEmailProjection, Integer, Hash)>] PageEmailProjection data, response status code and response headers
558
- def get_emails_paginated_with_http_info(opts = {})
559
- if @api_client.config.debugging
560
- @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_emails_paginated ...'
561
- end
562
- allowable_values = ["ASC", "DESC"]
563
- if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
564
- fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
565
- end
566
- # resource path
567
- local_var_path = '/emails'
568
-
569
- # query parameters
570
- query_params = opts[:query_params] || {}
571
- query_params[:'inboxId'] = @api_client.build_collection_param(opts[:'inbox_id'], :multi) if !opts[:'inbox_id'].nil?
572
- query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
573
- query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
574
- query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
575
- query_params[:'unreadOnly'] = opts[:'unread_only'] if !opts[:'unread_only'].nil?
576
-
577
- # header parameters
578
- header_params = opts[:header_params] || {}
579
- # HTTP header 'Accept' (if needed)
580
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
581
-
582
- # form parameters
583
- form_params = opts[:form_params] || {}
584
-
585
- # http body (model)
586
- post_body = opts[:body]
587
-
588
- # return_type
589
- return_type = opts[:return_type] || 'PageEmailProjection'
590
-
591
- # auth_names
592
- auth_names = opts[:auth_names] || ['API_KEY']
593
-
594
- new_options = opts.merge(
595
- :header_params => header_params,
596
- :query_params => query_params,
597
- :form_params => form_params,
598
- :body => post_body,
599
- :auth_names => auth_names,
600
- :return_type => return_type
601
- )
602
-
603
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
604
- if @api_client.config.debugging
605
- @api_client.config.logger.debug "API called: EmailControllerApi#get_emails_paginated\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
606
- end
607
- return data, status_code, headers
608
- end
609
-
610
- # Get raw email string
611
- # Returns a raw, unparsed, and unprocessed email. If your client has issues processing the response it is likely due to the response content-type which is text/plain. If you need a JSON response content-type use the getRawEmailJson endpoint
612
- # @param email_id [String] emailId
613
- # @param [Hash] opts the optional parameters
614
- # @return [String]
615
- def get_raw_email_contents(email_id, opts = {})
616
- data, _status_code, _headers = get_raw_email_contents_with_http_info(email_id, opts)
617
- data
618
- end
619
-
620
- # Get raw email string
621
- # Returns a raw, unparsed, and unprocessed email. If your client has issues processing the response it is likely due to the response content-type which is text/plain. If you need a JSON response content-type use the getRawEmailJson endpoint
622
- # @param email_id [String] emailId
623
- # @param [Hash] opts the optional parameters
624
- # @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
625
- def get_raw_email_contents_with_http_info(email_id, opts = {})
626
- if @api_client.config.debugging
627
- @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_raw_email_contents ...'
628
- end
629
- # verify the required parameter 'email_id' is set
630
- if @api_client.config.client_side_validation && email_id.nil?
631
- fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.get_raw_email_contents"
632
- end
633
- # resource path
634
- local_var_path = '/emails/{emailId}/raw'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))
635
-
636
- # query parameters
637
- query_params = opts[:query_params] || {}
638
-
639
- # header parameters
640
- header_params = opts[:header_params] || {}
641
- # HTTP header 'Accept' (if needed)
642
- header_params['Accept'] = @api_client.select_header_accept(['text/plain'])
643
-
644
- # form parameters
645
- form_params = opts[:form_params] || {}
646
-
647
- # http body (model)
648
- post_body = opts[:body]
649
-
650
- # return_type
651
- return_type = opts[:return_type] || 'String'
652
-
653
- # auth_names
654
- auth_names = opts[:auth_names] || ['API_KEY']
655
-
656
- new_options = opts.merge(
657
- :header_params => header_params,
658
- :query_params => query_params,
659
- :form_params => form_params,
660
- :body => post_body,
661
- :auth_names => auth_names,
662
- :return_type => return_type
663
- )
664
-
665
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
666
- if @api_client.config.debugging
667
- @api_client.config.logger.debug "API called: EmailControllerApi#get_raw_email_contents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
668
- end
669
- return data, status_code, headers
670
- end
671
-
672
- # Get raw email in JSON
673
- # Returns a raw, unparsed, and unprocessed email wrapped in a JSON response object for easier handling when compared with the getRawEmail text/plain response
674
- # @param email_id [String] emailId
675
- # @param [Hash] opts the optional parameters
676
- # @return [RawEmailJson]
677
- def get_raw_email_json(email_id, opts = {})
678
- data, _status_code, _headers = get_raw_email_json_with_http_info(email_id, opts)
679
- data
680
- end
681
-
682
- # Get raw email in JSON
683
- # Returns a raw, unparsed, and unprocessed email wrapped in a JSON response object for easier handling when compared with the getRawEmail text/plain response
684
- # @param email_id [String] emailId
685
- # @param [Hash] opts the optional parameters
686
- # @return [Array<(RawEmailJson, Integer, Hash)>] RawEmailJson data, response status code and response headers
687
- def get_raw_email_json_with_http_info(email_id, opts = {})
688
- if @api_client.config.debugging
689
- @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_raw_email_json ...'
690
- end
691
- # verify the required parameter 'email_id' is set
692
- if @api_client.config.client_side_validation && email_id.nil?
693
- fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.get_raw_email_json"
694
- end
695
- # resource path
696
- local_var_path = '/emails/{emailId}/raw/json'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))
697
-
698
- # query parameters
699
- query_params = opts[:query_params] || {}
700
-
701
- # header parameters
702
- header_params = opts[:header_params] || {}
703
- # HTTP header 'Accept' (if needed)
704
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
705
-
706
- # form parameters
707
- form_params = opts[:form_params] || {}
708
-
709
- # http body (model)
710
- post_body = opts[:body]
711
-
712
- # return_type
713
- return_type = opts[:return_type] || 'RawEmailJson'
714
-
715
- # auth_names
716
- auth_names = opts[:auth_names] || ['API_KEY']
717
-
718
- new_options = opts.merge(
719
- :header_params => header_params,
720
- :query_params => query_params,
721
- :form_params => form_params,
722
- :body => post_body,
723
- :auth_names => auth_names,
724
- :return_type => return_type
725
- )
726
-
727
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
728
- if @api_client.config.debugging
729
- @api_client.config.logger.debug "API called: EmailControllerApi#get_raw_email_json\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
730
- end
731
- return data, status_code, headers
732
- end
733
-
734
- # Get unread email count
735
- # Get number of emails unread
736
- # @param [Hash] opts the optional parameters
737
- # @return [UnreadCount]
738
- def get_unread_email_count(opts = {})
739
- data, _status_code, _headers = get_unread_email_count_with_http_info(opts)
740
- data
741
- end
742
-
743
- # Get unread email count
744
- # Get number of emails unread
745
- # @param [Hash] opts the optional parameters
746
- # @return [Array<(UnreadCount, Integer, Hash)>] UnreadCount data, response status code and response headers
747
- def get_unread_email_count_with_http_info(opts = {})
748
- if @api_client.config.debugging
749
- @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_unread_email_count ...'
750
- end
751
- # resource path
752
- local_var_path = '/emails/unreadCount'
753
-
754
- # query parameters
755
- query_params = opts[:query_params] || {}
756
-
757
- # header parameters
758
- header_params = opts[:header_params] || {}
759
- # HTTP header 'Accept' (if needed)
760
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
761
-
762
- # form parameters
763
- form_params = opts[:form_params] || {}
764
-
765
- # http body (model)
766
- post_body = opts[:body]
767
-
768
- # return_type
769
- return_type = opts[:return_type] || 'UnreadCount'
770
-
771
- # auth_names
772
- auth_names = opts[:auth_names] || ['API_KEY']
773
-
774
- new_options = opts.merge(
775
- :header_params => header_params,
776
- :query_params => query_params,
777
- :form_params => form_params,
778
- :body => post_body,
779
- :auth_names => auth_names,
780
- :return_type => return_type
781
- )
782
-
783
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
784
- if @api_client.config.debugging
785
- @api_client.config.logger.debug "API called: EmailControllerApi#get_unread_email_count\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
786
- end
787
- return data, status_code, headers
788
- end
789
-
790
- # Validate email
791
- # Validate the HTML content of email if HTML is found. Considered valid if no HTML.
792
- # @param email_id [String] emailId
793
- # @param [Hash] opts the optional parameters
794
- # @return [ValidationDto]
795
- def validate_email(email_id, opts = {})
796
- data, _status_code, _headers = validate_email_with_http_info(email_id, opts)
797
- data
798
- end
799
-
800
- # Validate email
801
- # Validate the HTML content of email if HTML is found. Considered valid if no HTML.
802
- # @param email_id [String] emailId
803
- # @param [Hash] opts the optional parameters
804
- # @return [Array<(ValidationDto, Integer, Hash)>] ValidationDto data, response status code and response headers
805
- def validate_email_with_http_info(email_id, opts = {})
806
- if @api_client.config.debugging
807
- @api_client.config.logger.debug 'Calling API: EmailControllerApi.validate_email ...'
808
- end
809
- # verify the required parameter 'email_id' is set
810
- if @api_client.config.client_side_validation && email_id.nil?
811
- fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.validate_email"
812
- end
813
- # resource path
814
- local_var_path = '/emails/{emailId}/validate'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))
815
-
816
- # query parameters
817
- query_params = opts[:query_params] || {}
818
-
819
- # header parameters
820
- header_params = opts[:header_params] || {}
821
- # HTTP header 'Accept' (if needed)
822
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
823
-
824
- # form parameters
825
- form_params = opts[:form_params] || {}
826
-
827
- # http body (model)
828
- post_body = opts[:body]
829
-
830
- # return_type
831
- return_type = opts[:return_type] || 'ValidationDto'
832
-
833
- # auth_names
834
- auth_names = opts[:auth_names] || ['API_KEY']
835
-
836
- new_options = opts.merge(
837
- :header_params => header_params,
838
- :query_params => query_params,
839
- :form_params => form_params,
840
- :body => post_body,
841
- :auth_names => auth_names,
842
- :return_type => return_type
843
- )
844
-
845
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
846
- if @api_client.config.debugging
847
- @api_client.config.logger.debug "API called: EmailControllerApi#validate_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
848
- end
849
- return data, status_code, headers
850
- end
851
- end
852
- end