sendmux-mailbox 1.0.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 (139) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +12 -0
  3. data/README.md +3 -0
  4. data/lib/sendmux/mailbox/client.rb +34 -0
  5. data/lib/sendmux/mailbox/version.rb +7 -0
  6. data/lib/sendmux/mailbox.rb +12 -0
  7. data/lib/sendmux_mailbox_generated/api/mailbox_api_api.rb +3226 -0
  8. data/lib/sendmux_mailbox_generated/api_client.rb +441 -0
  9. data/lib/sendmux_mailbox_generated/api_error.rb +58 -0
  10. data/lib/sendmux_mailbox_generated/api_model_base.rb +88 -0
  11. data/lib/sendmux_mailbox_generated/configuration.rb +393 -0
  12. data/lib/sendmux_mailbox_generated/models/api_error_detail.rb +219 -0
  13. data/lib/sendmux_mailbox_generated/models/api_error_error.rb +275 -0
  14. data/lib/sendmux_mailbox_generated/models/api_error_meta.rb +164 -0
  15. data/lib/sendmux_mailbox_generated/models/api_error_response.rb +216 -0
  16. data/lib/sendmux_mailbox_generated/models/batch_delete_mailbox_messages_body.rb +204 -0
  17. data/lib/sendmux_mailbox_generated/models/batch_update_mailbox_messages_body.rb +224 -0
  18. data/lib/sendmux_mailbox_generated/models/create_mailbox_folder_body.rb +183 -0
  19. data/lib/sendmux_mailbox_generated/models/cursor_pagination.rb +173 -0
  20. data/lib/sendmux_mailbox_generated/models/mailbox.rb +284 -0
  21. data/lib/sendmux_mailbox_generated/models/mailbox_address.rb +176 -0
  22. data/lib/sendmux_mailbox_generated/models/mailbox_attachment.rb +248 -0
  23. data/lib/sendmux_mailbox_generated/models/mailbox_attachment_upload_result.rb +243 -0
  24. data/lib/sendmux_mailbox_generated/models/mailbox_attachment_upload_result_response.rb +223 -0
  25. data/lib/sendmux_mailbox_generated/models/mailbox_batch_delete_messages_result.rb +248 -0
  26. data/lib/sendmux_mailbox_generated/models/mailbox_batch_delete_messages_result_response.rb +223 -0
  27. data/lib/sendmux_mailbox_generated/models/mailbox_batch_get_body.rb +363 -0
  28. data/lib/sendmux_mailbox_generated/models/mailbox_batch_get_item.rb +188 -0
  29. data/lib/sendmux_mailbox_generated/models/mailbox_batch_get_result.rb +220 -0
  30. data/lib/sendmux_mailbox_generated/models/mailbox_batch_get_result_response.rb +223 -0
  31. data/lib/sendmux_mailbox_generated/models/mailbox_batch_get_result_states.rb +150 -0
  32. data/lib/sendmux_mailbox_generated/models/mailbox_batch_message_failure.rb +216 -0
  33. data/lib/sendmux_mailbox_generated/models/mailbox_batch_message_states.rb +162 -0
  34. data/lib/sendmux_mailbox_generated/models/mailbox_batch_update_messages_result.rb +248 -0
  35. data/lib/sendmux_mailbox_generated/models/mailbox_batch_update_messages_result_response.rb +223 -0
  36. data/lib/sendmux_mailbox_generated/models/mailbox_changes.rb +297 -0
  37. data/lib/sendmux_mailbox_generated/models/mailbox_changes_response.rb +223 -0
  38. data/lib/sendmux_mailbox_generated/models/mailbox_content_headers.rb +214 -0
  39. data/lib/sendmux_mailbox_generated/models/mailbox_content_headers_full_inner.rb +190 -0
  40. data/lib/sendmux_mailbox_generated/models/mailbox_content_headers_selected.rb +234 -0
  41. data/lib/sendmux_mailbox_generated/models/mailbox_folder.rb +307 -0
  42. data/lib/sendmux_mailbox_generated/models/mailbox_folder_cursor_list_response.rb +251 -0
  43. data/lib/sendmux_mailbox_generated/models/mailbox_folder_deleted_response.rb +223 -0
  44. data/lib/sendmux_mailbox_generated/models/mailbox_folder_deleted_response_all_of_data.rb +190 -0
  45. data/lib/sendmux_mailbox_generated/models/mailbox_folder_query_changes.rb +270 -0
  46. data/lib/sendmux_mailbox_generated/models/mailbox_folder_query_changes_added_inner.rb +190 -0
  47. data/lib/sendmux_mailbox_generated/models/mailbox_folder_query_changes_response.rb +223 -0
  48. data/lib/sendmux_mailbox_generated/models/mailbox_folder_response.rb +223 -0
  49. data/lib/sendmux_mailbox_generated/models/mailbox_get_changes200_response.rb +103 -0
  50. data/lib/sendmux_mailbox_generated/models/mailbox_identity.rb +352 -0
  51. data/lib/sendmux_mailbox_generated/models/mailbox_identity_cursor_list_response.rb +251 -0
  52. data/lib/sendmux_mailbox_generated/models/mailbox_identity_response.rb +223 -0
  53. data/lib/sendmux_mailbox_generated/models/mailbox_me.rb +301 -0
  54. data/lib/sendmux_mailbox_generated/models/mailbox_me_item_response.rb +223 -0
  55. data/lib/sendmux_mailbox_generated/models/mailbox_message.rb +515 -0
  56. data/lib/sendmux_mailbox_generated/models/mailbox_message_content.rb +348 -0
  57. data/lib/sendmux_mailbox_generated/models/mailbox_message_content_body.rb +327 -0
  58. data/lib/sendmux_mailbox_generated/models/mailbox_message_content_dates.rb +162 -0
  59. data/lib/sendmux_mailbox_generated/models/mailbox_message_content_participants.rb +276 -0
  60. data/lib/sendmux_mailbox_generated/models/mailbox_message_content_response.rb +223 -0
  61. data/lib/sendmux_mailbox_generated/models/mailbox_message_content_response_all_of_data.rb +355 -0
  62. data/lib/sendmux_mailbox_generated/models/mailbox_message_content_states.rb +176 -0
  63. data/lib/sendmux_mailbox_generated/models/mailbox_message_count.rb +176 -0
  64. data/lib/sendmux_mailbox_generated/models/mailbox_message_count_response.rb +223 -0
  65. data/lib/sendmux_mailbox_generated/models/mailbox_message_deleted_response.rb +223 -0
  66. data/lib/sendmux_mailbox_generated/models/mailbox_message_detail_response.rb +223 -0
  67. data/lib/sendmux_mailbox_generated/models/mailbox_message_flags.rb +242 -0
  68. data/lib/sendmux_mailbox_generated/models/mailbox_message_query_changes.rb +270 -0
  69. data/lib/sendmux_mailbox_generated/models/mailbox_message_query_changes_response.rb +223 -0
  70. data/lib/sendmux_mailbox_generated/models/mailbox_message_summary.rb +456 -0
  71. data/lib/sendmux_mailbox_generated/models/mailbox_message_summary_cursor_list_response.rb +251 -0
  72. data/lib/sendmux_mailbox_generated/models/mailbox_message_summary_from.rb +183 -0
  73. data/lib/sendmux_mailbox_generated/models/mailbox_quota.rb +359 -0
  74. data/lib/sendmux_mailbox_generated/models/mailbox_quota_cursor_list_response.rb +251 -0
  75. data/lib/sendmux_mailbox_generated/models/mailbox_raw_body.rb +279 -0
  76. data/lib/sendmux_mailbox_generated/models/mailbox_raw_body_body.rb +200 -0
  77. data/lib/sendmux_mailbox_generated/models/mailbox_raw_body_response.rb +223 -0
  78. data/lib/sendmux_mailbox_generated/models/mailbox_raw_body_response_all_of_data.rb +286 -0
  79. data/lib/sendmux_mailbox_generated/models/mailbox_realtime_event.rb +380 -0
  80. data/lib/sendmux_mailbox_generated/models/mailbox_realtime_message.rb +529 -0
  81. data/lib/sendmux_mailbox_generated/models/mailbox_realtime_message_all_of_body.rb +214 -0
  82. data/lib/sendmux_mailbox_generated/models/mailbox_search_snippet.rb +190 -0
  83. data/lib/sendmux_mailbox_generated/models/mailbox_search_snippets_result.rb +206 -0
  84. data/lib/sendmux_mailbox_generated/models/mailbox_search_snippets_result_response.rb +223 -0
  85. data/lib/sendmux_mailbox_generated/models/mailbox_send_result_response.rb +223 -0
  86. data/lib/sendmux_mailbox_generated/models/mailbox_send_scope.rb +213 -0
  87. data/lib/sendmux_mailbox_generated/models/mailbox_session.rb +294 -0
  88. data/lib/sendmux_mailbox_generated/models/mailbox_session_capabilities.rb +346 -0
  89. data/lib/sendmux_mailbox_generated/models/mailbox_session_capabilities_attachments.rb +294 -0
  90. data/lib/sendmux_mailbox_generated/models/mailbox_session_capabilities_folders.rb +320 -0
  91. data/lib/sendmux_mailbox_generated/models/mailbox_session_capabilities_identities.rb +268 -0
  92. data/lib/sendmux_mailbox_generated/models/mailbox_session_capabilities_messages.rb +516 -0
  93. data/lib/sendmux_mailbox_generated/models/mailbox_session_capabilities_quotas.rb +242 -0
  94. data/lib/sendmux_mailbox_generated/models/mailbox_session_capabilities_submissions.rb +242 -0
  95. data/lib/sendmux_mailbox_generated/models/mailbox_session_capabilities_sync.rb +222 -0
  96. data/lib/sendmux_mailbox_generated/models/mailbox_session_capabilities_threads.rb +268 -0
  97. data/lib/sendmux_mailbox_generated/models/mailbox_session_endpoints.rb +334 -0
  98. data/lib/sendmux_mailbox_generated/models/mailbox_session_gated.rb +451 -0
  99. data/lib/sendmux_mailbox_generated/models/mailbox_session_limits.rb +398 -0
  100. data/lib/sendmux_mailbox_generated/models/mailbox_session_mailbox.rb +203 -0
  101. data/lib/sendmux_mailbox_generated/models/mailbox_session_response.rb +223 -0
  102. data/lib/sendmux_mailbox_generated/models/mailbox_session_states.rb +294 -0
  103. data/lib/sendmux_mailbox_generated/models/mailbox_submission.rb +321 -0
  104. data/lib/sendmux_mailbox_generated/models/mailbox_submission_cursor_list_response.rb +251 -0
  105. data/lib/sendmux_mailbox_generated/models/mailbox_submission_delivery_status.rb +200 -0
  106. data/lib/sendmux_mailbox_generated/models/mailbox_submission_envelope.rb +178 -0
  107. data/lib/sendmux_mailbox_generated/models/mailbox_submission_envelope_address.rb +178 -0
  108. data/lib/sendmux_mailbox_generated/models/mailbox_submission_envelope_rcpt_to_inner.rb +185 -0
  109. data/lib/sendmux_mailbox_generated/models/mailbox_submission_response.rb +223 -0
  110. data/lib/sendmux_mailbox_generated/models/mailbox_thread.rb +398 -0
  111. data/lib/sendmux_mailbox_generated/models/mailbox_thread_content_meta.rb +244 -0
  112. data/lib/sendmux_mailbox_generated/models/mailbox_thread_content_meta_states.rb +188 -0
  113. data/lib/sendmux_mailbox_generated/models/mailbox_thread_content_response.rb +251 -0
  114. data/lib/sendmux_mailbox_generated/models/mailbox_thread_content_response_all_of_data.rb +355 -0
  115. data/lib/sendmux_mailbox_generated/models/mailbox_thread_detail_response.rb +223 -0
  116. data/lib/sendmux_mailbox_generated/models/mailbox_thread_summary.rb +363 -0
  117. data/lib/sendmux_mailbox_generated/models/mailbox_thread_summary_cursor_list_response.rb +251 -0
  118. data/lib/sendmux_mailbox_generated/models/mailbox_thread_summary_last_message.rb +463 -0
  119. data/lib/sendmux_mailbox_generated/models/mailbox_thread_summary_states.rb +162 -0
  120. data/lib/sendmux_mailbox_generated/models/mailbox_typed_changes.rb +164 -0
  121. data/lib/sendmux_mailbox_generated/models/mailbox_typed_changes_response.rb +223 -0
  122. data/lib/sendmux_mailbox_generated/models/mailbox_typed_changes_types.rb +192 -0
  123. data/lib/sendmux_mailbox_generated/models/mailbox_usage.rb +192 -0
  124. data/lib/sendmux_mailbox_generated/models/mailbox_usage_resource.rb +408 -0
  125. data/lib/sendmux_mailbox_generated/models/mailbox_usage_response.rb +223 -0
  126. data/lib/sendmux_mailbox_generated/models/mailbox_usage_states.rb +150 -0
  127. data/lib/sendmux_mailbox_generated/models/patch_mailbox_folder_body.rb +166 -0
  128. data/lib/sendmux_mailbox_generated/models/patch_mailbox_message_body.rb +168 -0
  129. data/lib/sendmux_mailbox_generated/models/response_meta.rb +164 -0
  130. data/lib/sendmux_mailbox_generated/models/send_mailbox_message_body.rb +283 -0
  131. data/lib/sendmux_mailbox_generated/models/send_mailbox_message_body_attachments_inner.rb +103 -0
  132. data/lib/sendmux_mailbox_generated/models/send_mailbox_message_body_attachments_inner_any_of.rb +217 -0
  133. data/lib/sendmux_mailbox_generated/models/send_mailbox_message_body_attachments_inner_any_of1.rb +217 -0
  134. data/lib/sendmux_mailbox_generated/models/send_mailbox_message_result.rb +214 -0
  135. data/lib/sendmux_mailbox_generated/models/success_envelope.rb +192 -0
  136. data/lib/sendmux_mailbox_generated/models/update_mailbox_identity_body.rb +216 -0
  137. data/lib/sendmux_mailbox_generated/version.rb +15 -0
  138. data/lib/sendmux_mailbox_generated.rb +166 -0
  139. metadata +255 -0
@@ -0,0 +1,3226 @@
1
+ =begin
2
+ #Sendmux API
3
+
4
+ #Programmatic access to your Sendmux email infrastructure.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Sendmux::Mailbox::Generated
16
+ class MailboxAPIApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Batch delete mailbox messages
23
+ # Moves up to 100 messages to Trash by default with state-safe conflict handling. Set `permanent=true` to permanently delete them.
24
+ # @param [Hash] opts the optional parameters
25
+ # @option opts [BatchDeleteMailboxMessagesBody] :batch_delete_mailbox_messages_body
26
+ # @return [MailboxBatchDeleteMessagesResultResponse]
27
+ def mailbox_batch_delete_messages(opts = {})
28
+ data, _status_code, _headers = mailbox_batch_delete_messages_with_http_info(opts)
29
+ data
30
+ end
31
+
32
+ # Batch delete mailbox messages
33
+ # Moves up to 100 messages to Trash by default with state-safe conflict handling. Set `permanent=true` to permanently delete them.
34
+ # @param [Hash] opts the optional parameters
35
+ # @option opts [BatchDeleteMailboxMessagesBody] :batch_delete_mailbox_messages_body
36
+ # @return [Array<(MailboxBatchDeleteMessagesResultResponse, Integer, Hash)>] MailboxBatchDeleteMessagesResultResponse data, response status code and response headers
37
+ def mailbox_batch_delete_messages_with_http_info(opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_batch_delete_messages ...'
40
+ end
41
+ # resource path
42
+ local_var_path = '/mailbox/messages:batch-delete'
43
+
44
+ # query parameters
45
+ query_params = opts[:query_params] || {}
46
+
47
+ # header parameters
48
+ header_params = opts[:header_params] || {}
49
+ # HTTP header 'Accept' (if needed)
50
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
51
+ # HTTP header 'Content-Type'
52
+ content_type = @api_client.select_header_content_type(['application/json'])
53
+ if !content_type.nil?
54
+ header_params['Content-Type'] = content_type
55
+ end
56
+
57
+ # form parameters
58
+ form_params = opts[:form_params] || {}
59
+
60
+ # http body (model)
61
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'batch_delete_mailbox_messages_body'])
62
+
63
+ # return_type
64
+ return_type = opts[:debug_return_type] || 'MailboxBatchDeleteMessagesResultResponse'
65
+
66
+ # auth_names
67
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
68
+
69
+ new_options = opts.merge(
70
+ :operation => :"MailboxAPIApi.mailbox_batch_delete_messages",
71
+ :header_params => header_params,
72
+ :query_params => query_params,
73
+ :form_params => form_params,
74
+ :body => post_body,
75
+ :auth_names => auth_names,
76
+ :return_type => return_type
77
+ )
78
+
79
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
80
+ if @api_client.config.debugging
81
+ @api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_batch_delete_messages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
82
+ end
83
+ return data, status_code, headers
84
+ end
85
+
86
+ # Batch get mailbox messages
87
+ # Returns exact messages by ID. Use `body_mode` to choose summary-only output, raw body output, or clean JSON content. Attachment output remains metadata only; attachment contents are not parsed.
88
+ # @param [Hash] opts the optional parameters
89
+ # @option opts [MailboxBatchGetBody] :mailbox_batch_get_body
90
+ # @return [MailboxBatchGetResultResponse]
91
+ def mailbox_batch_get_messages(opts = {})
92
+ data, _status_code, _headers = mailbox_batch_get_messages_with_http_info(opts)
93
+ data
94
+ end
95
+
96
+ # Batch get mailbox messages
97
+ # Returns exact messages by ID. Use &#x60;body_mode&#x60; to choose summary-only output, raw body output, or clean JSON content. Attachment output remains metadata only; attachment contents are not parsed.
98
+ # @param [Hash] opts the optional parameters
99
+ # @option opts [MailboxBatchGetBody] :mailbox_batch_get_body
100
+ # @return [Array<(MailboxBatchGetResultResponse, Integer, Hash)>] MailboxBatchGetResultResponse data, response status code and response headers
101
+ def mailbox_batch_get_messages_with_http_info(opts = {})
102
+ if @api_client.config.debugging
103
+ @api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_batch_get_messages ...'
104
+ end
105
+ # resource path
106
+ local_var_path = '/mailbox/messages:batch-get'
107
+
108
+ # query parameters
109
+ query_params = opts[:query_params] || {}
110
+
111
+ # header parameters
112
+ header_params = opts[:header_params] || {}
113
+ # HTTP header 'Accept' (if needed)
114
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
115
+ # HTTP header 'Content-Type'
116
+ content_type = @api_client.select_header_content_type(['application/json'])
117
+ if !content_type.nil?
118
+ header_params['Content-Type'] = content_type
119
+ end
120
+
121
+ # form parameters
122
+ form_params = opts[:form_params] || {}
123
+
124
+ # http body (model)
125
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'mailbox_batch_get_body'])
126
+
127
+ # return_type
128
+ return_type = opts[:debug_return_type] || 'MailboxBatchGetResultResponse'
129
+
130
+ # auth_names
131
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
132
+
133
+ new_options = opts.merge(
134
+ :operation => :"MailboxAPIApi.mailbox_batch_get_messages",
135
+ :header_params => header_params,
136
+ :query_params => query_params,
137
+ :form_params => form_params,
138
+ :body => post_body,
139
+ :auth_names => auth_names,
140
+ :return_type => return_type
141
+ )
142
+
143
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
144
+ if @api_client.config.debugging
145
+ @api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_batch_get_messages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
146
+ end
147
+ return data, status_code, headers
148
+ end
149
+
150
+ # Batch update mailbox messages
151
+ # Updates allowed message flags and keywords for up to 100 messages with state-safe conflict handling.
152
+ # @param [Hash] opts the optional parameters
153
+ # @option opts [BatchUpdateMailboxMessagesBody] :batch_update_mailbox_messages_body
154
+ # @return [MailboxBatchUpdateMessagesResultResponse]
155
+ def mailbox_batch_update_messages(opts = {})
156
+ data, _status_code, _headers = mailbox_batch_update_messages_with_http_info(opts)
157
+ data
158
+ end
159
+
160
+ # Batch update mailbox messages
161
+ # Updates allowed message flags and keywords for up to 100 messages with state-safe conflict handling.
162
+ # @param [Hash] opts the optional parameters
163
+ # @option opts [BatchUpdateMailboxMessagesBody] :batch_update_mailbox_messages_body
164
+ # @return [Array<(MailboxBatchUpdateMessagesResultResponse, Integer, Hash)>] MailboxBatchUpdateMessagesResultResponse data, response status code and response headers
165
+ def mailbox_batch_update_messages_with_http_info(opts = {})
166
+ if @api_client.config.debugging
167
+ @api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_batch_update_messages ...'
168
+ end
169
+ # resource path
170
+ local_var_path = '/mailbox/messages:batch-update'
171
+
172
+ # query parameters
173
+ query_params = opts[:query_params] || {}
174
+
175
+ # header parameters
176
+ header_params = opts[:header_params] || {}
177
+ # HTTP header 'Accept' (if needed)
178
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
179
+ # HTTP header 'Content-Type'
180
+ content_type = @api_client.select_header_content_type(['application/json'])
181
+ if !content_type.nil?
182
+ header_params['Content-Type'] = content_type
183
+ end
184
+
185
+ # form parameters
186
+ form_params = opts[:form_params] || {}
187
+
188
+ # http body (model)
189
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'batch_update_mailbox_messages_body'])
190
+
191
+ # return_type
192
+ return_type = opts[:debug_return_type] || 'MailboxBatchUpdateMessagesResultResponse'
193
+
194
+ # auth_names
195
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
196
+
197
+ new_options = opts.merge(
198
+ :operation => :"MailboxAPIApi.mailbox_batch_update_messages",
199
+ :header_params => header_params,
200
+ :query_params => query_params,
201
+ :form_params => form_params,
202
+ :body => post_body,
203
+ :auth_names => auth_names,
204
+ :return_type => return_type
205
+ )
206
+
207
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
208
+ if @api_client.config.debugging
209
+ @api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_batch_update_messages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
210
+ end
211
+ return data, status_code, headers
212
+ end
213
+
214
+ # Count mailbox messages
215
+ # Returns a count for the supplied mailbox message filters without returning message rows.
216
+ # @param [Hash] opts the optional parameters
217
+ # @option opts [String] :folder_id
218
+ # @option opts [String] :thread_id
219
+ # @option opts [String] :q
220
+ # @option opts [String] :from
221
+ # @option opts [String] :to
222
+ # @option opts [String] :cc
223
+ # @option opts [String] :bcc
224
+ # @option opts [String] :subject
225
+ # @option opts [String] :body
226
+ # @option opts [String] :header_name
227
+ # @option opts [String] :header_value
228
+ # @option opts [Integer] :min_size_bytes
229
+ # @option opts [Integer] :max_size_bytes
230
+ # @option opts [String] :keyword
231
+ # @option opts [String] :not_keyword
232
+ # @option opts [String] :after
233
+ # @option opts [String] :before
234
+ # @option opts [Boolean] :has_attachment
235
+ # @option opts [Boolean] :is_unread
236
+ # @return [MailboxMessageCountResponse]
237
+ def mailbox_count_messages(opts = {})
238
+ data, _status_code, _headers = mailbox_count_messages_with_http_info(opts)
239
+ data
240
+ end
241
+
242
+ # Count mailbox messages
243
+ # Returns a count for the supplied mailbox message filters without returning message rows.
244
+ # @param [Hash] opts the optional parameters
245
+ # @option opts [String] :folder_id
246
+ # @option opts [String] :thread_id
247
+ # @option opts [String] :q
248
+ # @option opts [String] :from
249
+ # @option opts [String] :to
250
+ # @option opts [String] :cc
251
+ # @option opts [String] :bcc
252
+ # @option opts [String] :subject
253
+ # @option opts [String] :body
254
+ # @option opts [String] :header_name
255
+ # @option opts [String] :header_value
256
+ # @option opts [Integer] :min_size_bytes
257
+ # @option opts [Integer] :max_size_bytes
258
+ # @option opts [String] :keyword
259
+ # @option opts [String] :not_keyword
260
+ # @option opts [String] :after
261
+ # @option opts [String] :before
262
+ # @option opts [Boolean] :has_attachment
263
+ # @option opts [Boolean] :is_unread
264
+ # @return [Array<(MailboxMessageCountResponse, Integer, Hash)>] MailboxMessageCountResponse data, response status code and response headers
265
+ def mailbox_count_messages_with_http_info(opts = {})
266
+ if @api_client.config.debugging
267
+ @api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_count_messages ...'
268
+ end
269
+ if @api_client.config.client_side_validation && !opts[:'min_size_bytes'].nil? && opts[:'min_size_bytes'] < 0
270
+ fail ArgumentError, 'invalid value for "opts[:"min_size_bytes"]" when calling MailboxAPIApi.mailbox_count_messages, must be greater than or equal to 0.'
271
+ end
272
+
273
+ if @api_client.config.client_side_validation && !opts[:'max_size_bytes'].nil? && opts[:'max_size_bytes'] < 0
274
+ fail ArgumentError, 'invalid value for "opts[:"max_size_bytes"]" when calling MailboxAPIApi.mailbox_count_messages, must be greater than or equal to 0.'
275
+ end
276
+
277
+ # resource path
278
+ local_var_path = '/mailbox/messages/count'
279
+
280
+ # query parameters
281
+ query_params = opts[:query_params] || {}
282
+ query_params[:'folder_id'] = opts[:'folder_id'] if !opts[:'folder_id'].nil?
283
+ query_params[:'thread_id'] = opts[:'thread_id'] if !opts[:'thread_id'].nil?
284
+ query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
285
+ query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
286
+ query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil?
287
+ query_params[:'cc'] = opts[:'cc'] if !opts[:'cc'].nil?
288
+ query_params[:'bcc'] = opts[:'bcc'] if !opts[:'bcc'].nil?
289
+ query_params[:'subject'] = opts[:'subject'] if !opts[:'subject'].nil?
290
+ query_params[:'body'] = opts[:'body'] if !opts[:'body'].nil?
291
+ query_params[:'header_name'] = opts[:'header_name'] if !opts[:'header_name'].nil?
292
+ query_params[:'header_value'] = opts[:'header_value'] if !opts[:'header_value'].nil?
293
+ query_params[:'min_size_bytes'] = opts[:'min_size_bytes'] if !opts[:'min_size_bytes'].nil?
294
+ query_params[:'max_size_bytes'] = opts[:'max_size_bytes'] if !opts[:'max_size_bytes'].nil?
295
+ query_params[:'keyword'] = opts[:'keyword'] if !opts[:'keyword'].nil?
296
+ query_params[:'not_keyword'] = opts[:'not_keyword'] if !opts[:'not_keyword'].nil?
297
+ query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
298
+ query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
299
+ query_params[:'has_attachment'] = opts[:'has_attachment'] if !opts[:'has_attachment'].nil?
300
+ query_params[:'is_unread'] = opts[:'is_unread'] if !opts[:'is_unread'].nil?
301
+
302
+ # header parameters
303
+ header_params = opts[:header_params] || {}
304
+ # HTTP header 'Accept' (if needed)
305
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
306
+
307
+ # form parameters
308
+ form_params = opts[:form_params] || {}
309
+
310
+ # http body (model)
311
+ post_body = opts[:debug_body]
312
+
313
+ # return_type
314
+ return_type = opts[:debug_return_type] || 'MailboxMessageCountResponse'
315
+
316
+ # auth_names
317
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
318
+
319
+ new_options = opts.merge(
320
+ :operation => :"MailboxAPIApi.mailbox_count_messages",
321
+ :header_params => header_params,
322
+ :query_params => query_params,
323
+ :form_params => form_params,
324
+ :body => post_body,
325
+ :auth_names => auth_names,
326
+ :return_type => return_type
327
+ )
328
+
329
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
330
+ if @api_client.config.debugging
331
+ @api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_count_messages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
332
+ end
333
+ return data, status_code, headers
334
+ end
335
+
336
+ # Create a mailbox folder
337
+ # Creates a folder in the authenticated mailbox.
338
+ # @param [Hash] opts the optional parameters
339
+ # @option opts [CreateMailboxFolderBody] :create_mailbox_folder_body
340
+ # @return [MailboxFolderResponse]
341
+ def mailbox_create_folder(opts = {})
342
+ data, _status_code, _headers = mailbox_create_folder_with_http_info(opts)
343
+ data
344
+ end
345
+
346
+ # Create a mailbox folder
347
+ # Creates a folder in the authenticated mailbox.
348
+ # @param [Hash] opts the optional parameters
349
+ # @option opts [CreateMailboxFolderBody] :create_mailbox_folder_body
350
+ # @return [Array<(MailboxFolderResponse, Integer, Hash)>] MailboxFolderResponse data, response status code and response headers
351
+ def mailbox_create_folder_with_http_info(opts = {})
352
+ if @api_client.config.debugging
353
+ @api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_create_folder ...'
354
+ end
355
+ # resource path
356
+ local_var_path = '/mailbox/folders'
357
+
358
+ # query parameters
359
+ query_params = opts[:query_params] || {}
360
+
361
+ # header parameters
362
+ header_params = opts[:header_params] || {}
363
+ # HTTP header 'Accept' (if needed)
364
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
365
+ # HTTP header 'Content-Type'
366
+ content_type = @api_client.select_header_content_type(['application/json'])
367
+ if !content_type.nil?
368
+ header_params['Content-Type'] = content_type
369
+ end
370
+
371
+ # form parameters
372
+ form_params = opts[:form_params] || {}
373
+
374
+ # http body (model)
375
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_mailbox_folder_body'])
376
+
377
+ # return_type
378
+ return_type = opts[:debug_return_type] || 'MailboxFolderResponse'
379
+
380
+ # auth_names
381
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
382
+
383
+ new_options = opts.merge(
384
+ :operation => :"MailboxAPIApi.mailbox_create_folder",
385
+ :header_params => header_params,
386
+ :query_params => query_params,
387
+ :form_params => form_params,
388
+ :body => post_body,
389
+ :auth_names => auth_names,
390
+ :return_type => return_type
391
+ )
392
+
393
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
394
+ if @api_client.config.debugging
395
+ @api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_create_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
396
+ end
397
+ return data, status_code, headers
398
+ end
399
+
400
+ # Delete a mailbox folder
401
+ # Deletes an empty custom folder with state-safe conflict handling. Built-in folders and non-empty folders cannot be deleted. Send `If-Match` with a prior ETag to reject stale deletes.
402
+ # @param folder_id [String]
403
+ # @param [Hash] opts the optional parameters
404
+ # @option opts [String] :if_match
405
+ # @return [MailboxFolderDeletedResponse]
406
+ def mailbox_delete_folder(folder_id, opts = {})
407
+ data, _status_code, _headers = mailbox_delete_folder_with_http_info(folder_id, opts)
408
+ data
409
+ end
410
+
411
+ # Delete a mailbox folder
412
+ # Deletes an empty custom folder with state-safe conflict handling. Built-in folders and non-empty folders cannot be deleted. Send &#x60;If-Match&#x60; with a prior ETag to reject stale deletes.
413
+ # @param folder_id [String]
414
+ # @param [Hash] opts the optional parameters
415
+ # @option opts [String] :if_match
416
+ # @return [Array<(MailboxFolderDeletedResponse, Integer, Hash)>] MailboxFolderDeletedResponse data, response status code and response headers
417
+ def mailbox_delete_folder_with_http_info(folder_id, opts = {})
418
+ if @api_client.config.debugging
419
+ @api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_delete_folder ...'
420
+ end
421
+ # verify the required parameter 'folder_id' is set
422
+ if @api_client.config.client_side_validation && folder_id.nil?
423
+ fail ArgumentError, "Missing the required parameter 'folder_id' when calling MailboxAPIApi.mailbox_delete_folder"
424
+ end
425
+ # resource path
426
+ local_var_path = '/mailbox/folders/{folder_id}'.sub('{folder_id}', CGI.escape(folder_id.to_s))
427
+
428
+ # query parameters
429
+ query_params = opts[:query_params] || {}
430
+
431
+ # header parameters
432
+ header_params = opts[:header_params] || {}
433
+ # HTTP header 'Accept' (if needed)
434
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
435
+ header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?
436
+
437
+ # form parameters
438
+ form_params = opts[:form_params] || {}
439
+
440
+ # http body (model)
441
+ post_body = opts[:debug_body]
442
+
443
+ # return_type
444
+ return_type = opts[:debug_return_type] || 'MailboxFolderDeletedResponse'
445
+
446
+ # auth_names
447
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
448
+
449
+ new_options = opts.merge(
450
+ :operation => :"MailboxAPIApi.mailbox_delete_folder",
451
+ :header_params => header_params,
452
+ :query_params => query_params,
453
+ :form_params => form_params,
454
+ :body => post_body,
455
+ :auth_names => auth_names,
456
+ :return_type => return_type
457
+ )
458
+
459
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
460
+ if @api_client.config.debugging
461
+ @api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_delete_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
462
+ end
463
+ return data, status_code, headers
464
+ end
465
+
466
+ # Delete a mailbox message
467
+ # Moves a message to Trash by default with state-safe conflict handling. Set `permanent=true` to permanently delete it. Send `If-Match` with a prior ETag to reject stale deletes.
468
+ # @param message_id [String]
469
+ # @param [Hash] opts the optional parameters
470
+ # @option opts [Boolean] :permanent
471
+ # @option opts [String] :if_match
472
+ # @return [MailboxMessageDeletedResponse]
473
+ def mailbox_delete_message(message_id, opts = {})
474
+ data, _status_code, _headers = mailbox_delete_message_with_http_info(message_id, opts)
475
+ data
476
+ end
477
+
478
+ # Delete a mailbox message
479
+ # Moves a message to Trash by default with state-safe conflict handling. Set &#x60;permanent&#x3D;true&#x60; to permanently delete it. Send &#x60;If-Match&#x60; with a prior ETag to reject stale deletes.
480
+ # @param message_id [String]
481
+ # @param [Hash] opts the optional parameters
482
+ # @option opts [Boolean] :permanent
483
+ # @option opts [String] :if_match
484
+ # @return [Array<(MailboxMessageDeletedResponse, Integer, Hash)>] MailboxMessageDeletedResponse data, response status code and response headers
485
+ def mailbox_delete_message_with_http_info(message_id, opts = {})
486
+ if @api_client.config.debugging
487
+ @api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_delete_message ...'
488
+ end
489
+ # verify the required parameter 'message_id' is set
490
+ if @api_client.config.client_side_validation && message_id.nil?
491
+ fail ArgumentError, "Missing the required parameter 'message_id' when calling MailboxAPIApi.mailbox_delete_message"
492
+ end
493
+ # resource path
494
+ local_var_path = '/mailbox/messages/{message_id}'.sub('{message_id}', CGI.escape(message_id.to_s))
495
+
496
+ # query parameters
497
+ query_params = opts[:query_params] || {}
498
+ query_params[:'permanent'] = opts[:'permanent'] if !opts[:'permanent'].nil?
499
+
500
+ # header parameters
501
+ header_params = opts[:header_params] || {}
502
+ # HTTP header 'Accept' (if needed)
503
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
504
+ header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?
505
+
506
+ # form parameters
507
+ form_params = opts[:form_params] || {}
508
+
509
+ # http body (model)
510
+ post_body = opts[:debug_body]
511
+
512
+ # return_type
513
+ return_type = opts[:debug_return_type] || 'MailboxMessageDeletedResponse'
514
+
515
+ # auth_names
516
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
517
+
518
+ new_options = opts.merge(
519
+ :operation => :"MailboxAPIApi.mailbox_delete_message",
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(:DELETE, local_var_path, new_options)
529
+ if @api_client.config.debugging
530
+ @api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_delete_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
531
+ end
532
+ return data, status_code, headers
533
+ end
534
+
535
+ # Get mailbox changes
536
+ # Returns message changes in the legacy shape when `types` is omitted. Pass a comma-separated `types` list for a typed state map.
537
+ # @param [Hash] opts the optional parameters
538
+ # @option opts [String] :since_state
539
+ # @option opts [String] :types
540
+ # @option opts [String] :messages_since_state
541
+ # @option opts [String] :folders_since_state
542
+ # @option opts [String] :threads_since_state
543
+ # @option opts [String] :submissions_since_state
544
+ # @option opts [String] :identities_since_state
545
+ # @option opts [String] :quotas_since_state
546
+ # @option opts [Integer] :limit
547
+ # @return [MailboxGetChanges200Response]
548
+ def mailbox_get_changes(opts = {})
549
+ data, _status_code, _headers = mailbox_get_changes_with_http_info(opts)
550
+ data
551
+ end
552
+
553
+ # Get mailbox changes
554
+ # Returns message changes in the legacy shape when &#x60;types&#x60; is omitted. Pass a comma-separated &#x60;types&#x60; list for a typed state map.
555
+ # @param [Hash] opts the optional parameters
556
+ # @option opts [String] :since_state
557
+ # @option opts [String] :types
558
+ # @option opts [String] :messages_since_state
559
+ # @option opts [String] :folders_since_state
560
+ # @option opts [String] :threads_since_state
561
+ # @option opts [String] :submissions_since_state
562
+ # @option opts [String] :identities_since_state
563
+ # @option opts [String] :quotas_since_state
564
+ # @option opts [Integer] :limit
565
+ # @return [Array<(MailboxGetChanges200Response, Integer, Hash)>] MailboxGetChanges200Response data, response status code and response headers
566
+ def mailbox_get_changes_with_http_info(opts = {})
567
+ if @api_client.config.debugging
568
+ @api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_get_changes ...'
569
+ end
570
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500
571
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MailboxAPIApi.mailbox_get_changes, must be smaller than or equal to 500.'
572
+ end
573
+
574
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
575
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MailboxAPIApi.mailbox_get_changes, must be greater than or equal to 1.'
576
+ end
577
+
578
+ # resource path
579
+ local_var_path = '/mailbox/changes'
580
+
581
+ # query parameters
582
+ query_params = opts[:query_params] || {}
583
+ query_params[:'since_state'] = opts[:'since_state'] if !opts[:'since_state'].nil?
584
+ query_params[:'types'] = opts[:'types'] if !opts[:'types'].nil?
585
+ query_params[:'messages_since_state'] = opts[:'messages_since_state'] if !opts[:'messages_since_state'].nil?
586
+ query_params[:'folders_since_state'] = opts[:'folders_since_state'] if !opts[:'folders_since_state'].nil?
587
+ query_params[:'threads_since_state'] = opts[:'threads_since_state'] if !opts[:'threads_since_state'].nil?
588
+ query_params[:'submissions_since_state'] = opts[:'submissions_since_state'] if !opts[:'submissions_since_state'].nil?
589
+ query_params[:'identities_since_state'] = opts[:'identities_since_state'] if !opts[:'identities_since_state'].nil?
590
+ query_params[:'quotas_since_state'] = opts[:'quotas_since_state'] if !opts[:'quotas_since_state'].nil?
591
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
592
+
593
+ # header parameters
594
+ header_params = opts[:header_params] || {}
595
+ # HTTP header 'Accept' (if needed)
596
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
597
+
598
+ # form parameters
599
+ form_params = opts[:form_params] || {}
600
+
601
+ # http body (model)
602
+ post_body = opts[:debug_body]
603
+
604
+ # return_type
605
+ return_type = opts[:debug_return_type] || 'MailboxGetChanges200Response'
606
+
607
+ # auth_names
608
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
609
+
610
+ new_options = opts.merge(
611
+ :operation => :"MailboxAPIApi.mailbox_get_changes",
612
+ :header_params => header_params,
613
+ :query_params => query_params,
614
+ :form_params => form_params,
615
+ :body => post_body,
616
+ :auth_names => auth_names,
617
+ :return_type => return_type
618
+ )
619
+
620
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
621
+ if @api_client.config.debugging
622
+ @api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_get_changes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
623
+ end
624
+ return data, status_code, headers
625
+ end
626
+
627
+ # Get a mailbox folder
628
+ # Returns one folder from the authenticated mailbox. Responses include a weak `ETag` header.
629
+ # @param folder_id [String]
630
+ # @param [Hash] opts the optional parameters
631
+ # @option opts [String] :if_none_match
632
+ # @return [MailboxFolderResponse]
633
+ def mailbox_get_folder(folder_id, opts = {})
634
+ data, _status_code, _headers = mailbox_get_folder_with_http_info(folder_id, opts)
635
+ data
636
+ end
637
+
638
+ # Get a mailbox folder
639
+ # Returns one folder from the authenticated mailbox. Responses include a weak &#x60;ETag&#x60; header.
640
+ # @param folder_id [String]
641
+ # @param [Hash] opts the optional parameters
642
+ # @option opts [String] :if_none_match
643
+ # @return [Array<(MailboxFolderResponse, Integer, Hash)>] MailboxFolderResponse data, response status code and response headers
644
+ def mailbox_get_folder_with_http_info(folder_id, opts = {})
645
+ if @api_client.config.debugging
646
+ @api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_get_folder ...'
647
+ end
648
+ # verify the required parameter 'folder_id' is set
649
+ if @api_client.config.client_side_validation && folder_id.nil?
650
+ fail ArgumentError, "Missing the required parameter 'folder_id' when calling MailboxAPIApi.mailbox_get_folder"
651
+ end
652
+ # resource path
653
+ local_var_path = '/mailbox/folders/{folder_id}'.sub('{folder_id}', CGI.escape(folder_id.to_s))
654
+
655
+ # query parameters
656
+ query_params = opts[:query_params] || {}
657
+
658
+ # header parameters
659
+ header_params = opts[:header_params] || {}
660
+ # HTTP header 'Accept' (if needed)
661
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
662
+ header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?
663
+
664
+ # form parameters
665
+ form_params = opts[:form_params] || {}
666
+
667
+ # http body (model)
668
+ post_body = opts[:debug_body]
669
+
670
+ # return_type
671
+ return_type = opts[:debug_return_type] || 'MailboxFolderResponse'
672
+
673
+ # auth_names
674
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
675
+
676
+ new_options = opts.merge(
677
+ :operation => :"MailboxAPIApi.mailbox_get_folder",
678
+ :header_params => header_params,
679
+ :query_params => query_params,
680
+ :form_params => form_params,
681
+ :body => post_body,
682
+ :auth_names => auth_names,
683
+ :return_type => return_type
684
+ )
685
+
686
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
687
+ if @api_client.config.debugging
688
+ @api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_get_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
689
+ end
690
+ return data, status_code, headers
691
+ end
692
+
693
+ # Get folder changes
694
+ # Returns folder changes since a prior folder state, or the current folder state when omitted.
695
+ # @param [Hash] opts the optional parameters
696
+ # @option opts [String] :since_state
697
+ # @option opts [Integer] :limit
698
+ # @return [MailboxChangesResponse]
699
+ def mailbox_get_folder_changes(opts = {})
700
+ data, _status_code, _headers = mailbox_get_folder_changes_with_http_info(opts)
701
+ data
702
+ end
703
+
704
+ # Get folder changes
705
+ # Returns folder changes since a prior folder state, or the current folder state when omitted.
706
+ # @param [Hash] opts the optional parameters
707
+ # @option opts [String] :since_state
708
+ # @option opts [Integer] :limit
709
+ # @return [Array<(MailboxChangesResponse, Integer, Hash)>] MailboxChangesResponse data, response status code and response headers
710
+ def mailbox_get_folder_changes_with_http_info(opts = {})
711
+ if @api_client.config.debugging
712
+ @api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_get_folder_changes ...'
713
+ end
714
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500
715
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MailboxAPIApi.mailbox_get_folder_changes, must be smaller than or equal to 500.'
716
+ end
717
+
718
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
719
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MailboxAPIApi.mailbox_get_folder_changes, must be greater than or equal to 1.'
720
+ end
721
+
722
+ # resource path
723
+ local_var_path = '/mailbox/folders/changes'
724
+
725
+ # query parameters
726
+ query_params = opts[:query_params] || {}
727
+ query_params[:'since_state'] = opts[:'since_state'] if !opts[:'since_state'].nil?
728
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
729
+
730
+ # header parameters
731
+ header_params = opts[:header_params] || {}
732
+ # HTTP header 'Accept' (if needed)
733
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
734
+
735
+ # form parameters
736
+ form_params = opts[:form_params] || {}
737
+
738
+ # http body (model)
739
+ post_body = opts[:debug_body]
740
+
741
+ # return_type
742
+ return_type = opts[:debug_return_type] || 'MailboxChangesResponse'
743
+
744
+ # auth_names
745
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
746
+
747
+ new_options = opts.merge(
748
+ :operation => :"MailboxAPIApi.mailbox_get_folder_changes",
749
+ :header_params => header_params,
750
+ :query_params => query_params,
751
+ :form_params => form_params,
752
+ :body => post_body,
753
+ :auth_names => auth_names,
754
+ :return_type => return_type
755
+ )
756
+
757
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
758
+ if @api_client.config.debugging
759
+ @api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_get_folder_changes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
760
+ end
761
+ return data, status_code, headers
762
+ end
763
+
764
+ # Get mailbox sender identity
765
+ # Returns the default sender identity and signatures for the authenticated mailbox.
766
+ # @param [Hash] opts the optional parameters
767
+ # @return [MailboxIdentityResponse]
768
+ def mailbox_get_identity(opts = {})
769
+ data, _status_code, _headers = mailbox_get_identity_with_http_info(opts)
770
+ data
771
+ end
772
+
773
+ # Get mailbox sender identity
774
+ # Returns the default sender identity and signatures for the authenticated mailbox.
775
+ # @param [Hash] opts the optional parameters
776
+ # @return [Array<(MailboxIdentityResponse, Integer, Hash)>] MailboxIdentityResponse data, response status code and response headers
777
+ def mailbox_get_identity_with_http_info(opts = {})
778
+ if @api_client.config.debugging
779
+ @api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_get_identity ...'
780
+ end
781
+ # resource path
782
+ local_var_path = '/mailbox/identity'
783
+
784
+ # query parameters
785
+ query_params = opts[:query_params] || {}
786
+
787
+ # header parameters
788
+ header_params = opts[:header_params] || {}
789
+ # HTTP header 'Accept' (if needed)
790
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
791
+
792
+ # form parameters
793
+ form_params = opts[:form_params] || {}
794
+
795
+ # http body (model)
796
+ post_body = opts[:debug_body]
797
+
798
+ # return_type
799
+ return_type = opts[:debug_return_type] || 'MailboxIdentityResponse'
800
+
801
+ # auth_names
802
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
803
+
804
+ new_options = opts.merge(
805
+ :operation => :"MailboxAPIApi.mailbox_get_identity",
806
+ :header_params => header_params,
807
+ :query_params => query_params,
808
+ :form_params => form_params,
809
+ :body => post_body,
810
+ :auth_names => auth_names,
811
+ :return_type => return_type
812
+ )
813
+
814
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
815
+ if @api_client.config.debugging
816
+ @api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_get_identity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
817
+ end
818
+ return data, status_code, headers
819
+ end
820
+
821
+ # Self-introspect the calling mailbox
822
+ # Returns the mailbox the bearer token is scoped to, including live storage usage. Intended for SDK auto-discovery — call once on startup to resolve the mailbox ID. Requires a mailbox-scoped API key; root keys receive 403. Responses carry a weak `ETag` header — send it back as `If-None-Match` on the next request and the server will return `304 Not Modified` (no body) when the mailbox state has not changed.
823
+ # @param [Hash] opts the optional parameters
824
+ # @option opts [String] :if_none_match
825
+ # @return [MailboxMeItemResponse]
826
+ def mailbox_get_me(opts = {})
827
+ data, _status_code, _headers = mailbox_get_me_with_http_info(opts)
828
+ data
829
+ end
830
+
831
+ # Self-introspect the calling mailbox
832
+ # Returns the mailbox the bearer token is scoped to, including live storage usage. Intended for SDK auto-discovery — call once on startup to resolve the mailbox ID. Requires a mailbox-scoped API key; root keys receive 403. Responses carry a weak &#x60;ETag&#x60; header — send it back as &#x60;If-None-Match&#x60; on the next request and the server will return &#x60;304 Not Modified&#x60; (no body) when the mailbox state has not changed.
833
+ # @param [Hash] opts the optional parameters
834
+ # @option opts [String] :if_none_match
835
+ # @return [Array<(MailboxMeItemResponse, Integer, Hash)>] MailboxMeItemResponse data, response status code and response headers
836
+ def mailbox_get_me_with_http_info(opts = {})
837
+ if @api_client.config.debugging
838
+ @api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_get_me ...'
839
+ end
840
+ # resource path
841
+ local_var_path = '/mailbox/me'
842
+
843
+ # query parameters
844
+ query_params = opts[:query_params] || {}
845
+
846
+ # header parameters
847
+ header_params = opts[:header_params] || {}
848
+ # HTTP header 'Accept' (if needed)
849
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
850
+ header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?
851
+
852
+ # form parameters
853
+ form_params = opts[:form_params] || {}
854
+
855
+ # http body (model)
856
+ post_body = opts[:debug_body]
857
+
858
+ # return_type
859
+ return_type = opts[:debug_return_type] || 'MailboxMeItemResponse'
860
+
861
+ # auth_names
862
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
863
+
864
+ new_options = opts.merge(
865
+ :operation => :"MailboxAPIApi.mailbox_get_me",
866
+ :header_params => header_params,
867
+ :query_params => query_params,
868
+ :form_params => form_params,
869
+ :body => post_body,
870
+ :auth_names => auth_names,
871
+ :return_type => return_type
872
+ )
873
+
874
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
875
+ if @api_client.config.debugging
876
+ @api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_get_me\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
877
+ end
878
+ return data, status_code, headers
879
+ end
880
+
881
+ # Get a mailbox message
882
+ # Returns one message from the authenticated mailbox. Responses include a weak `ETag` header.
883
+ # @param message_id [String]
884
+ # @param [Hash] opts the optional parameters
885
+ # @option opts [String] :if_none_match
886
+ # @return [MailboxMessageDetailResponse]
887
+ def mailbox_get_message(message_id, opts = {})
888
+ data, _status_code, _headers = mailbox_get_message_with_http_info(message_id, opts)
889
+ data
890
+ end
891
+
892
+ # Get a mailbox message
893
+ # Returns one message from the authenticated mailbox. Responses include a weak &#x60;ETag&#x60; header.
894
+ # @param message_id [String]
895
+ # @param [Hash] opts the optional parameters
896
+ # @option opts [String] :if_none_match
897
+ # @return [Array<(MailboxMessageDetailResponse, Integer, Hash)>] MailboxMessageDetailResponse data, response status code and response headers
898
+ def mailbox_get_message_with_http_info(message_id, opts = {})
899
+ if @api_client.config.debugging
900
+ @api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_get_message ...'
901
+ end
902
+ # verify the required parameter 'message_id' is set
903
+ if @api_client.config.client_side_validation && message_id.nil?
904
+ fail ArgumentError, "Missing the required parameter 'message_id' when calling MailboxAPIApi.mailbox_get_message"
905
+ end
906
+ # resource path
907
+ local_var_path = '/mailbox/messages/{message_id}'.sub('{message_id}', CGI.escape(message_id.to_s))
908
+
909
+ # query parameters
910
+ query_params = opts[:query_params] || {}
911
+
912
+ # header parameters
913
+ header_params = opts[:header_params] || {}
914
+ # HTTP header 'Accept' (if needed)
915
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
916
+ header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?
917
+
918
+ # form parameters
919
+ form_params = opts[:form_params] || {}
920
+
921
+ # http body (model)
922
+ post_body = opts[:debug_body]
923
+
924
+ # return_type
925
+ return_type = opts[:debug_return_type] || 'MailboxMessageDetailResponse'
926
+
927
+ # auth_names
928
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
929
+
930
+ new_options = opts.merge(
931
+ :operation => :"MailboxAPIApi.mailbox_get_message",
932
+ :header_params => header_params,
933
+ :query_params => query_params,
934
+ :form_params => form_params,
935
+ :body => post_body,
936
+ :auth_names => auth_names,
937
+ :return_type => return_type
938
+ )
939
+
940
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
941
+ if @api_client.config.debugging
942
+ @api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_get_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
943
+ end
944
+ return data, status_code, headers
945
+ end
946
+
947
+ # Download a message attachment
948
+ # Streams one attachment from a message in the authenticated mailbox. Supports standard byte ranges.
949
+ # @param message_id [String]
950
+ # @param attachment_id [String]
951
+ # @param [Hash] opts the optional parameters
952
+ # @option opts [String] :range
953
+ # @return [nil]
954
+ def mailbox_get_message_attachment(message_id, attachment_id, opts = {})
955
+ mailbox_get_message_attachment_with_http_info(message_id, attachment_id, opts)
956
+ nil
957
+ end
958
+
959
+ # Download a message attachment
960
+ # Streams one attachment from a message in the authenticated mailbox. Supports standard byte ranges.
961
+ # @param message_id [String]
962
+ # @param attachment_id [String]
963
+ # @param [Hash] opts the optional parameters
964
+ # @option opts [String] :range
965
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
966
+ def mailbox_get_message_attachment_with_http_info(message_id, attachment_id, opts = {})
967
+ if @api_client.config.debugging
968
+ @api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_get_message_attachment ...'
969
+ end
970
+ # verify the required parameter 'message_id' is set
971
+ if @api_client.config.client_side_validation && message_id.nil?
972
+ fail ArgumentError, "Missing the required parameter 'message_id' when calling MailboxAPIApi.mailbox_get_message_attachment"
973
+ end
974
+ # verify the required parameter 'attachment_id' is set
975
+ if @api_client.config.client_side_validation && attachment_id.nil?
976
+ fail ArgumentError, "Missing the required parameter 'attachment_id' when calling MailboxAPIApi.mailbox_get_message_attachment"
977
+ end
978
+ # resource path
979
+ local_var_path = '/mailbox/messages/{message_id}/attachments/{attachment_id}'.sub('{message_id}', CGI.escape(message_id.to_s)).sub('{attachment_id}', CGI.escape(attachment_id.to_s))
980
+
981
+ # query parameters
982
+ query_params = opts[:query_params] || {}
983
+
984
+ # header parameters
985
+ header_params = opts[:header_params] || {}
986
+ # HTTP header 'Accept' (if needed)
987
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
988
+ header_params[:'Range'] = opts[:'range'] if !opts[:'range'].nil?
989
+
990
+ # form parameters
991
+ form_params = opts[:form_params] || {}
992
+
993
+ # http body (model)
994
+ post_body = opts[:debug_body]
995
+
996
+ # return_type
997
+ return_type = opts[:debug_return_type]
998
+
999
+ # auth_names
1000
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
1001
+
1002
+ new_options = opts.merge(
1003
+ :operation => :"MailboxAPIApi.mailbox_get_message_attachment",
1004
+ :header_params => header_params,
1005
+ :query_params => query_params,
1006
+ :form_params => form_params,
1007
+ :body => post_body,
1008
+ :auth_names => auth_names,
1009
+ :return_type => return_type
1010
+ )
1011
+
1012
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1013
+ if @api_client.config.debugging
1014
+ @api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_get_message_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1015
+ end
1016
+ return data, status_code, headers
1017
+ end
1018
+
1019
+ # Get quota changes
1020
+ # Returns quota changes since a prior quota state, or the current quota state when omitted.
1021
+ # @param [Hash] opts the optional parameters
1022
+ # @option opts [String] :since_state
1023
+ # @option opts [Integer] :limit
1024
+ # @return [MailboxChangesResponse]
1025
+ def mailbox_get_quota_changes(opts = {})
1026
+ data, _status_code, _headers = mailbox_get_quota_changes_with_http_info(opts)
1027
+ data
1028
+ end
1029
+
1030
+ # Get quota changes
1031
+ # Returns quota changes since a prior quota state, or the current quota state when omitted.
1032
+ # @param [Hash] opts the optional parameters
1033
+ # @option opts [String] :since_state
1034
+ # @option opts [Integer] :limit
1035
+ # @return [Array<(MailboxChangesResponse, Integer, Hash)>] MailboxChangesResponse data, response status code and response headers
1036
+ def mailbox_get_quota_changes_with_http_info(opts = {})
1037
+ if @api_client.config.debugging
1038
+ @api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_get_quota_changes ...'
1039
+ end
1040
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500
1041
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MailboxAPIApi.mailbox_get_quota_changes, must be smaller than or equal to 500.'
1042
+ end
1043
+
1044
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
1045
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MailboxAPIApi.mailbox_get_quota_changes, must be greater than or equal to 1.'
1046
+ end
1047
+
1048
+ # resource path
1049
+ local_var_path = '/mailbox/quotas/changes'
1050
+
1051
+ # query parameters
1052
+ query_params = opts[:query_params] || {}
1053
+ query_params[:'since_state'] = opts[:'since_state'] if !opts[:'since_state'].nil?
1054
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
1055
+
1056
+ # header parameters
1057
+ header_params = opts[:header_params] || {}
1058
+ # HTTP header 'Accept' (if needed)
1059
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1060
+
1061
+ # form parameters
1062
+ form_params = opts[:form_params] || {}
1063
+
1064
+ # http body (model)
1065
+ post_body = opts[:debug_body]
1066
+
1067
+ # return_type
1068
+ return_type = opts[:debug_return_type] || 'MailboxChangesResponse'
1069
+
1070
+ # auth_names
1071
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
1072
+
1073
+ new_options = opts.merge(
1074
+ :operation => :"MailboxAPIApi.mailbox_get_quota_changes",
1075
+ :header_params => header_params,
1076
+ :query_params => query_params,
1077
+ :form_params => form_params,
1078
+ :body => post_body,
1079
+ :auth_names => auth_names,
1080
+ :return_type => return_type
1081
+ )
1082
+
1083
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1084
+ if @api_client.config.debugging
1085
+ @api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_get_quota_changes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1086
+ end
1087
+ return data, status_code, headers
1088
+ end
1089
+
1090
+ # Get mailbox API session
1091
+ # Returns mailbox API capabilities, resource state tokens, limits, and disabled feature flags for the authenticated mailbox.
1092
+ # @param [Hash] opts the optional parameters
1093
+ # @option opts [String] :if_none_match
1094
+ # @return [MailboxSessionResponse]
1095
+ def mailbox_get_session(opts = {})
1096
+ data, _status_code, _headers = mailbox_get_session_with_http_info(opts)
1097
+ data
1098
+ end
1099
+
1100
+ # Get mailbox API session
1101
+ # Returns mailbox API capabilities, resource state tokens, limits, and disabled feature flags for the authenticated mailbox.
1102
+ # @param [Hash] opts the optional parameters
1103
+ # @option opts [String] :if_none_match
1104
+ # @return [Array<(MailboxSessionResponse, Integer, Hash)>] MailboxSessionResponse data, response status code and response headers
1105
+ def mailbox_get_session_with_http_info(opts = {})
1106
+ if @api_client.config.debugging
1107
+ @api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_get_session ...'
1108
+ end
1109
+ # resource path
1110
+ local_var_path = '/mailbox/session'
1111
+
1112
+ # query parameters
1113
+ query_params = opts[:query_params] || {}
1114
+
1115
+ # header parameters
1116
+ header_params = opts[:header_params] || {}
1117
+ # HTTP header 'Accept' (if needed)
1118
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1119
+ header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?
1120
+
1121
+ # form parameters
1122
+ form_params = opts[:form_params] || {}
1123
+
1124
+ # http body (model)
1125
+ post_body = opts[:debug_body]
1126
+
1127
+ # return_type
1128
+ return_type = opts[:debug_return_type] || 'MailboxSessionResponse'
1129
+
1130
+ # auth_names
1131
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
1132
+
1133
+ new_options = opts.merge(
1134
+ :operation => :"MailboxAPIApi.mailbox_get_session",
1135
+ :header_params => header_params,
1136
+ :query_params => query_params,
1137
+ :form_params => form_params,
1138
+ :body => post_body,
1139
+ :auth_names => auth_names,
1140
+ :return_type => return_type
1141
+ )
1142
+
1143
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1144
+ if @api_client.config.debugging
1145
+ @api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_get_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1146
+ end
1147
+ return data, status_code, headers
1148
+ end
1149
+
1150
+ # Get a mailbox submission
1151
+ # Returns one send submission for the authenticated mailbox. Responses include a weak `ETag` header.
1152
+ # @param submission_id [String]
1153
+ # @param [Hash] opts the optional parameters
1154
+ # @option opts [String] :if_none_match
1155
+ # @return [MailboxSubmissionResponse]
1156
+ def mailbox_get_submission(submission_id, opts = {})
1157
+ data, _status_code, _headers = mailbox_get_submission_with_http_info(submission_id, opts)
1158
+ data
1159
+ end
1160
+
1161
+ # Get a mailbox submission
1162
+ # Returns one send submission for the authenticated mailbox. Responses include a weak &#x60;ETag&#x60; header.
1163
+ # @param submission_id [String]
1164
+ # @param [Hash] opts the optional parameters
1165
+ # @option opts [String] :if_none_match
1166
+ # @return [Array<(MailboxSubmissionResponse, Integer, Hash)>] MailboxSubmissionResponse data, response status code and response headers
1167
+ def mailbox_get_submission_with_http_info(submission_id, opts = {})
1168
+ if @api_client.config.debugging
1169
+ @api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_get_submission ...'
1170
+ end
1171
+ # verify the required parameter 'submission_id' is set
1172
+ if @api_client.config.client_side_validation && submission_id.nil?
1173
+ fail ArgumentError, "Missing the required parameter 'submission_id' when calling MailboxAPIApi.mailbox_get_submission"
1174
+ end
1175
+ # resource path
1176
+ local_var_path = '/mailbox/submissions/{submission_id}'.sub('{submission_id}', CGI.escape(submission_id.to_s))
1177
+
1178
+ # query parameters
1179
+ query_params = opts[:query_params] || {}
1180
+
1181
+ # header parameters
1182
+ header_params = opts[:header_params] || {}
1183
+ # HTTP header 'Accept' (if needed)
1184
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1185
+ header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?
1186
+
1187
+ # form parameters
1188
+ form_params = opts[:form_params] || {}
1189
+
1190
+ # http body (model)
1191
+ post_body = opts[:debug_body]
1192
+
1193
+ # return_type
1194
+ return_type = opts[:debug_return_type] || 'MailboxSubmissionResponse'
1195
+
1196
+ # auth_names
1197
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
1198
+
1199
+ new_options = opts.merge(
1200
+ :operation => :"MailboxAPIApi.mailbox_get_submission",
1201
+ :header_params => header_params,
1202
+ :query_params => query_params,
1203
+ :form_params => form_params,
1204
+ :body => post_body,
1205
+ :auth_names => auth_names,
1206
+ :return_type => return_type
1207
+ )
1208
+
1209
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1210
+ if @api_client.config.debugging
1211
+ @api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_get_submission\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1212
+ end
1213
+ return data, status_code, headers
1214
+ end
1215
+
1216
+ # Get submission changes
1217
+ # Returns send submission changes since a prior submission state, or the current state when omitted.
1218
+ # @param [Hash] opts the optional parameters
1219
+ # @option opts [String] :since_state
1220
+ # @option opts [Integer] :limit
1221
+ # @return [MailboxChangesResponse]
1222
+ def mailbox_get_submission_changes(opts = {})
1223
+ data, _status_code, _headers = mailbox_get_submission_changes_with_http_info(opts)
1224
+ data
1225
+ end
1226
+
1227
+ # Get submission changes
1228
+ # Returns send submission changes since a prior submission state, or the current state when omitted.
1229
+ # @param [Hash] opts the optional parameters
1230
+ # @option opts [String] :since_state
1231
+ # @option opts [Integer] :limit
1232
+ # @return [Array<(MailboxChangesResponse, Integer, Hash)>] MailboxChangesResponse data, response status code and response headers
1233
+ def mailbox_get_submission_changes_with_http_info(opts = {})
1234
+ if @api_client.config.debugging
1235
+ @api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_get_submission_changes ...'
1236
+ end
1237
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500
1238
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MailboxAPIApi.mailbox_get_submission_changes, must be smaller than or equal to 500.'
1239
+ end
1240
+
1241
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
1242
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MailboxAPIApi.mailbox_get_submission_changes, must be greater than or equal to 1.'
1243
+ end
1244
+
1245
+ # resource path
1246
+ local_var_path = '/mailbox/submissions/changes'
1247
+
1248
+ # query parameters
1249
+ query_params = opts[:query_params] || {}
1250
+ query_params[:'since_state'] = opts[:'since_state'] if !opts[:'since_state'].nil?
1251
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
1252
+
1253
+ # header parameters
1254
+ header_params = opts[:header_params] || {}
1255
+ # HTTP header 'Accept' (if needed)
1256
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1257
+
1258
+ # form parameters
1259
+ form_params = opts[:form_params] || {}
1260
+
1261
+ # http body (model)
1262
+ post_body = opts[:debug_body]
1263
+
1264
+ # return_type
1265
+ return_type = opts[:debug_return_type] || 'MailboxChangesResponse'
1266
+
1267
+ # auth_names
1268
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
1269
+
1270
+ new_options = opts.merge(
1271
+ :operation => :"MailboxAPIApi.mailbox_get_submission_changes",
1272
+ :header_params => header_params,
1273
+ :query_params => query_params,
1274
+ :form_params => form_params,
1275
+ :body => post_body,
1276
+ :auth_names => auth_names,
1277
+ :return_type => return_type
1278
+ )
1279
+
1280
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1281
+ if @api_client.config.debugging
1282
+ @api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_get_submission_changes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1283
+ end
1284
+ return data, status_code, headers
1285
+ end
1286
+
1287
+ # Get a mailbox thread
1288
+ # Returns thread metadata, message IDs, participants, last message, unread count, and state for one conversation. Responses include a weak `ETag` header.
1289
+ # @param thread_id [String]
1290
+ # @param [Hash] opts the optional parameters
1291
+ # @option opts [String] :if_none_match
1292
+ # @return [MailboxThreadDetailResponse]
1293
+ def mailbox_get_thread(thread_id, opts = {})
1294
+ data, _status_code, _headers = mailbox_get_thread_with_http_info(thread_id, opts)
1295
+ data
1296
+ end
1297
+
1298
+ # Get a mailbox thread
1299
+ # Returns thread metadata, message IDs, participants, last message, unread count, and state for one conversation. Responses include a weak &#x60;ETag&#x60; header.
1300
+ # @param thread_id [String]
1301
+ # @param [Hash] opts the optional parameters
1302
+ # @option opts [String] :if_none_match
1303
+ # @return [Array<(MailboxThreadDetailResponse, Integer, Hash)>] MailboxThreadDetailResponse data, response status code and response headers
1304
+ def mailbox_get_thread_with_http_info(thread_id, opts = {})
1305
+ if @api_client.config.debugging
1306
+ @api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_get_thread ...'
1307
+ end
1308
+ # verify the required parameter 'thread_id' is set
1309
+ if @api_client.config.client_side_validation && thread_id.nil?
1310
+ fail ArgumentError, "Missing the required parameter 'thread_id' when calling MailboxAPIApi.mailbox_get_thread"
1311
+ end
1312
+ # resource path
1313
+ local_var_path = '/mailbox/threads/{thread_id}'.sub('{thread_id}', CGI.escape(thread_id.to_s))
1314
+
1315
+ # query parameters
1316
+ query_params = opts[:query_params] || {}
1317
+
1318
+ # header parameters
1319
+ header_params = opts[:header_params] || {}
1320
+ # HTTP header 'Accept' (if needed)
1321
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1322
+ header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?
1323
+
1324
+ # form parameters
1325
+ form_params = opts[:form_params] || {}
1326
+
1327
+ # http body (model)
1328
+ post_body = opts[:debug_body]
1329
+
1330
+ # return_type
1331
+ return_type = opts[:debug_return_type] || 'MailboxThreadDetailResponse'
1332
+
1333
+ # auth_names
1334
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
1335
+
1336
+ new_options = opts.merge(
1337
+ :operation => :"MailboxAPIApi.mailbox_get_thread",
1338
+ :header_params => header_params,
1339
+ :query_params => query_params,
1340
+ :form_params => form_params,
1341
+ :body => post_body,
1342
+ :auth_names => auth_names,
1343
+ :return_type => return_type
1344
+ )
1345
+
1346
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1347
+ if @api_client.config.debugging
1348
+ @api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_get_thread\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1349
+ end
1350
+ return data, status_code, headers
1351
+ end
1352
+
1353
+ # Get clean thread content
1354
+ # Returns a cursor-paginated clean JSON view of messages in a thread. Attachment output is metadata only; attachment contents are not parsed by this endpoint.
1355
+ # @param thread_id [String]
1356
+ # @param [Hash] opts the optional parameters
1357
+ # @option opts [String] :part
1358
+ # @option opts [Integer] :max_body_chars
1359
+ # @option opts [Boolean] :strip_signature
1360
+ # @option opts [Boolean] :strip_quotes
1361
+ # @option opts [Boolean] :include_links
1362
+ # @option opts [Boolean] :include_html
1363
+ # @option opts [String] :include_headers
1364
+ # @option opts [String] :include_attachments
1365
+ # @option opts [String] :cursor
1366
+ # @option opts [Integer] :limit
1367
+ # @option opts [String] :sort
1368
+ # @option opts [String] :if_none_match
1369
+ # @return [MailboxThreadContentResponse]
1370
+ def mailbox_get_thread_content(thread_id, opts = {})
1371
+ data, _status_code, _headers = mailbox_get_thread_content_with_http_info(thread_id, opts)
1372
+ data
1373
+ end
1374
+
1375
+ # Get clean thread content
1376
+ # Returns a cursor-paginated clean JSON view of messages in a thread. Attachment output is metadata only; attachment contents are not parsed by this endpoint.
1377
+ # @param thread_id [String]
1378
+ # @param [Hash] opts the optional parameters
1379
+ # @option opts [String] :part
1380
+ # @option opts [Integer] :max_body_chars
1381
+ # @option opts [Boolean] :strip_signature
1382
+ # @option opts [Boolean] :strip_quotes
1383
+ # @option opts [Boolean] :include_links
1384
+ # @option opts [Boolean] :include_html
1385
+ # @option opts [String] :include_headers
1386
+ # @option opts [String] :include_attachments
1387
+ # @option opts [String] :cursor
1388
+ # @option opts [Integer] :limit
1389
+ # @option opts [String] :sort
1390
+ # @option opts [String] :if_none_match
1391
+ # @return [Array<(MailboxThreadContentResponse, Integer, Hash)>] MailboxThreadContentResponse data, response status code and response headers
1392
+ def mailbox_get_thread_content_with_http_info(thread_id, opts = {})
1393
+ if @api_client.config.debugging
1394
+ @api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_get_thread_content ...'
1395
+ end
1396
+ # verify the required parameter 'thread_id' is set
1397
+ if @api_client.config.client_side_validation && thread_id.nil?
1398
+ fail ArgumentError, "Missing the required parameter 'thread_id' when calling MailboxAPIApi.mailbox_get_thread_content"
1399
+ end
1400
+ allowable_values = ["auto", "text", "html", "unknown_default_open_api"]
1401
+ if @api_client.config.client_side_validation && opts[:'part'] && !allowable_values.include?(opts[:'part'])
1402
+ fail ArgumentError, "invalid value for \"part\", must be one of #{allowable_values}"
1403
+ end
1404
+ if @api_client.config.client_side_validation && !opts[:'max_body_chars'].nil? && opts[:'max_body_chars'] > 1000000
1405
+ fail ArgumentError, 'invalid value for "opts[:"max_body_chars"]" when calling MailboxAPIApi.mailbox_get_thread_content, must be smaller than or equal to 1000000.'
1406
+ end
1407
+
1408
+ if @api_client.config.client_side_validation && !opts[:'max_body_chars'].nil? && opts[:'max_body_chars'] < 1
1409
+ fail ArgumentError, 'invalid value for "opts[:"max_body_chars"]" when calling MailboxAPIApi.mailbox_get_thread_content, must be greater than or equal to 1.'
1410
+ end
1411
+
1412
+ allowable_values = ["none", "selected", "full", "unknown_default_open_api"]
1413
+ if @api_client.config.client_side_validation && opts[:'include_headers'] && !allowable_values.include?(opts[:'include_headers'])
1414
+ fail ArgumentError, "invalid value for \"include_headers\", must be one of #{allowable_values}"
1415
+ end
1416
+ allowable_values = ["none", "metadata", "unknown_default_open_api"]
1417
+ if @api_client.config.client_side_validation && opts[:'include_attachments'] && !allowable_values.include?(opts[:'include_attachments'])
1418
+ fail ArgumentError, "invalid value for \"include_attachments\", must be one of #{allowable_values}"
1419
+ end
1420
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
1421
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MailboxAPIApi.mailbox_get_thread_content, must be smaller than or equal to 100.'
1422
+ end
1423
+
1424
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
1425
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MailboxAPIApi.mailbox_get_thread_content, must be greater than or equal to 1.'
1426
+ end
1427
+
1428
+ allowable_values = ["asc", "desc", "unknown_default_open_api"]
1429
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
1430
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
1431
+ end
1432
+ # resource path
1433
+ local_var_path = '/mailbox/threads/{thread_id}/content'.sub('{thread_id}', CGI.escape(thread_id.to_s))
1434
+
1435
+ # query parameters
1436
+ query_params = opts[:query_params] || {}
1437
+ query_params[:'part'] = opts[:'part'] if !opts[:'part'].nil?
1438
+ query_params[:'max_body_chars'] = opts[:'max_body_chars'] if !opts[:'max_body_chars'].nil?
1439
+ query_params[:'strip_signature'] = opts[:'strip_signature'] if !opts[:'strip_signature'].nil?
1440
+ query_params[:'strip_quotes'] = opts[:'strip_quotes'] if !opts[:'strip_quotes'].nil?
1441
+ query_params[:'include_links'] = opts[:'include_links'] if !opts[:'include_links'].nil?
1442
+ query_params[:'include_html'] = opts[:'include_html'] if !opts[:'include_html'].nil?
1443
+ query_params[:'include_headers'] = opts[:'include_headers'] if !opts[:'include_headers'].nil?
1444
+ query_params[:'include_attachments'] = opts[:'include_attachments'] if !opts[:'include_attachments'].nil?
1445
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
1446
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
1447
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
1448
+
1449
+ # header parameters
1450
+ header_params = opts[:header_params] || {}
1451
+ # HTTP header 'Accept' (if needed)
1452
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1453
+ header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?
1454
+
1455
+ # form parameters
1456
+ form_params = opts[:form_params] || {}
1457
+
1458
+ # http body (model)
1459
+ post_body = opts[:debug_body]
1460
+
1461
+ # return_type
1462
+ return_type = opts[:debug_return_type] || 'MailboxThreadContentResponse'
1463
+
1464
+ # auth_names
1465
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
1466
+
1467
+ new_options = opts.merge(
1468
+ :operation => :"MailboxAPIApi.mailbox_get_thread_content",
1469
+ :header_params => header_params,
1470
+ :query_params => query_params,
1471
+ :form_params => form_params,
1472
+ :body => post_body,
1473
+ :auth_names => auth_names,
1474
+ :return_type => return_type
1475
+ )
1476
+
1477
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1478
+ if @api_client.config.debugging
1479
+ @api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_get_thread_content\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1480
+ end
1481
+ return data, status_code, headers
1482
+ end
1483
+
1484
+ # Get raw message body
1485
+ # Returns raw message body content for the authenticated mailbox. This endpoint does not strip signatures, strip quoted replies, extract links, or clean the body into a structured content shape.
1486
+ # @param message_id [String]
1487
+ # @param [Hash] opts the optional parameters
1488
+ # @option opts [String] :part
1489
+ # @option opts [Integer] :max_body_chars
1490
+ # @option opts [String] :if_none_match
1491
+ # @return [MailboxRawBodyResponse]
1492
+ def mailbox_list_body(message_id, opts = {})
1493
+ data, _status_code, _headers = mailbox_list_body_with_http_info(message_id, opts)
1494
+ data
1495
+ end
1496
+
1497
+ # Get raw message body
1498
+ # Returns raw message body content for the authenticated mailbox. This endpoint does not strip signatures, strip quoted replies, extract links, or clean the body into a structured content shape.
1499
+ # @param message_id [String]
1500
+ # @param [Hash] opts the optional parameters
1501
+ # @option opts [String] :part
1502
+ # @option opts [Integer] :max_body_chars
1503
+ # @option opts [String] :if_none_match
1504
+ # @return [Array<(MailboxRawBodyResponse, Integer, Hash)>] MailboxRawBodyResponse data, response status code and response headers
1505
+ def mailbox_list_body_with_http_info(message_id, opts = {})
1506
+ if @api_client.config.debugging
1507
+ @api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_list_body ...'
1508
+ end
1509
+ # verify the required parameter 'message_id' is set
1510
+ if @api_client.config.client_side_validation && message_id.nil?
1511
+ fail ArgumentError, "Missing the required parameter 'message_id' when calling MailboxAPIApi.mailbox_list_body"
1512
+ end
1513
+ allowable_values = ["text", "html", "both", "unknown_default_open_api"]
1514
+ if @api_client.config.client_side_validation && opts[:'part'] && !allowable_values.include?(opts[:'part'])
1515
+ fail ArgumentError, "invalid value for \"part\", must be one of #{allowable_values}"
1516
+ end
1517
+ if @api_client.config.client_side_validation && !opts[:'max_body_chars'].nil? && opts[:'max_body_chars'] > 1000000
1518
+ fail ArgumentError, 'invalid value for "opts[:"max_body_chars"]" when calling MailboxAPIApi.mailbox_list_body, must be smaller than or equal to 1000000.'
1519
+ end
1520
+
1521
+ if @api_client.config.client_side_validation && !opts[:'max_body_chars'].nil? && opts[:'max_body_chars'] < 1
1522
+ fail ArgumentError, 'invalid value for "opts[:"max_body_chars"]" when calling MailboxAPIApi.mailbox_list_body, must be greater than or equal to 1.'
1523
+ end
1524
+
1525
+ # resource path
1526
+ local_var_path = '/mailbox/messages/{message_id}/body'.sub('{message_id}', CGI.escape(message_id.to_s))
1527
+
1528
+ # query parameters
1529
+ query_params = opts[:query_params] || {}
1530
+ query_params[:'part'] = opts[:'part'] if !opts[:'part'].nil?
1531
+ query_params[:'max_body_chars'] = opts[:'max_body_chars'] if !opts[:'max_body_chars'].nil?
1532
+
1533
+ # header parameters
1534
+ header_params = opts[:header_params] || {}
1535
+ # HTTP header 'Accept' (if needed)
1536
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1537
+ header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?
1538
+
1539
+ # form parameters
1540
+ form_params = opts[:form_params] || {}
1541
+
1542
+ # http body (model)
1543
+ post_body = opts[:debug_body]
1544
+
1545
+ # return_type
1546
+ return_type = opts[:debug_return_type] || 'MailboxRawBodyResponse'
1547
+
1548
+ # auth_names
1549
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
1550
+
1551
+ new_options = opts.merge(
1552
+ :operation => :"MailboxAPIApi.mailbox_list_body",
1553
+ :header_params => header_params,
1554
+ :query_params => query_params,
1555
+ :form_params => form_params,
1556
+ :body => post_body,
1557
+ :auth_names => auth_names,
1558
+ :return_type => return_type
1559
+ )
1560
+
1561
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1562
+ if @api_client.config.debugging
1563
+ @api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_list_body\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1564
+ end
1565
+ return data, status_code, headers
1566
+ end
1567
+
1568
+ # Get clean message content
1569
+ # Returns deterministic clean JSON content for one message. Attachment output is metadata only; attachment contents are not parsed by this endpoint.
1570
+ # @param message_id [String]
1571
+ # @param [Hash] opts the optional parameters
1572
+ # @option opts [String] :part
1573
+ # @option opts [Integer] :max_body_chars
1574
+ # @option opts [Boolean] :strip_signature
1575
+ # @option opts [Boolean] :strip_quotes
1576
+ # @option opts [Boolean] :include_links
1577
+ # @option opts [Boolean] :include_html
1578
+ # @option opts [String] :include_headers
1579
+ # @option opts [String] :include_attachments
1580
+ # @option opts [String] :if_none_match
1581
+ # @return [MailboxMessageContentResponse]
1582
+ def mailbox_list_content(message_id, opts = {})
1583
+ data, _status_code, _headers = mailbox_list_content_with_http_info(message_id, opts)
1584
+ data
1585
+ end
1586
+
1587
+ # Get clean message content
1588
+ # Returns deterministic clean JSON content for one message. Attachment output is metadata only; attachment contents are not parsed by this endpoint.
1589
+ # @param message_id [String]
1590
+ # @param [Hash] opts the optional parameters
1591
+ # @option opts [String] :part
1592
+ # @option opts [Integer] :max_body_chars
1593
+ # @option opts [Boolean] :strip_signature
1594
+ # @option opts [Boolean] :strip_quotes
1595
+ # @option opts [Boolean] :include_links
1596
+ # @option opts [Boolean] :include_html
1597
+ # @option opts [String] :include_headers
1598
+ # @option opts [String] :include_attachments
1599
+ # @option opts [String] :if_none_match
1600
+ # @return [Array<(MailboxMessageContentResponse, Integer, Hash)>] MailboxMessageContentResponse data, response status code and response headers
1601
+ def mailbox_list_content_with_http_info(message_id, opts = {})
1602
+ if @api_client.config.debugging
1603
+ @api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_list_content ...'
1604
+ end
1605
+ # verify the required parameter 'message_id' is set
1606
+ if @api_client.config.client_side_validation && message_id.nil?
1607
+ fail ArgumentError, "Missing the required parameter 'message_id' when calling MailboxAPIApi.mailbox_list_content"
1608
+ end
1609
+ allowable_values = ["auto", "text", "html", "unknown_default_open_api"]
1610
+ if @api_client.config.client_side_validation && opts[:'part'] && !allowable_values.include?(opts[:'part'])
1611
+ fail ArgumentError, "invalid value for \"part\", must be one of #{allowable_values}"
1612
+ end
1613
+ if @api_client.config.client_side_validation && !opts[:'max_body_chars'].nil? && opts[:'max_body_chars'] > 1000000
1614
+ fail ArgumentError, 'invalid value for "opts[:"max_body_chars"]" when calling MailboxAPIApi.mailbox_list_content, must be smaller than or equal to 1000000.'
1615
+ end
1616
+
1617
+ if @api_client.config.client_side_validation && !opts[:'max_body_chars'].nil? && opts[:'max_body_chars'] < 1
1618
+ fail ArgumentError, 'invalid value for "opts[:"max_body_chars"]" when calling MailboxAPIApi.mailbox_list_content, must be greater than or equal to 1.'
1619
+ end
1620
+
1621
+ allowable_values = ["none", "selected", "full", "unknown_default_open_api"]
1622
+ if @api_client.config.client_side_validation && opts[:'include_headers'] && !allowable_values.include?(opts[:'include_headers'])
1623
+ fail ArgumentError, "invalid value for \"include_headers\", must be one of #{allowable_values}"
1624
+ end
1625
+ allowable_values = ["none", "metadata", "unknown_default_open_api"]
1626
+ if @api_client.config.client_side_validation && opts[:'include_attachments'] && !allowable_values.include?(opts[:'include_attachments'])
1627
+ fail ArgumentError, "invalid value for \"include_attachments\", must be one of #{allowable_values}"
1628
+ end
1629
+ # resource path
1630
+ local_var_path = '/mailbox/messages/{message_id}/content'.sub('{message_id}', CGI.escape(message_id.to_s))
1631
+
1632
+ # query parameters
1633
+ query_params = opts[:query_params] || {}
1634
+ query_params[:'part'] = opts[:'part'] if !opts[:'part'].nil?
1635
+ query_params[:'max_body_chars'] = opts[:'max_body_chars'] if !opts[:'max_body_chars'].nil?
1636
+ query_params[:'strip_signature'] = opts[:'strip_signature'] if !opts[:'strip_signature'].nil?
1637
+ query_params[:'strip_quotes'] = opts[:'strip_quotes'] if !opts[:'strip_quotes'].nil?
1638
+ query_params[:'include_links'] = opts[:'include_links'] if !opts[:'include_links'].nil?
1639
+ query_params[:'include_html'] = opts[:'include_html'] if !opts[:'include_html'].nil?
1640
+ query_params[:'include_headers'] = opts[:'include_headers'] if !opts[:'include_headers'].nil?
1641
+ query_params[:'include_attachments'] = opts[:'include_attachments'] if !opts[:'include_attachments'].nil?
1642
+
1643
+ # header parameters
1644
+ header_params = opts[:header_params] || {}
1645
+ # HTTP header 'Accept' (if needed)
1646
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1647
+ header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?
1648
+
1649
+ # form parameters
1650
+ form_params = opts[:form_params] || {}
1651
+
1652
+ # http body (model)
1653
+ post_body = opts[:debug_body]
1654
+
1655
+ # return_type
1656
+ return_type = opts[:debug_return_type] || 'MailboxMessageContentResponse'
1657
+
1658
+ # auth_names
1659
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
1660
+
1661
+ new_options = opts.merge(
1662
+ :operation => :"MailboxAPIApi.mailbox_list_content",
1663
+ :header_params => header_params,
1664
+ :query_params => query_params,
1665
+ :form_params => form_params,
1666
+ :body => post_body,
1667
+ :auth_names => auth_names,
1668
+ :return_type => return_type
1669
+ )
1670
+
1671
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1672
+ if @api_client.config.debugging
1673
+ @api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_list_content\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1674
+ end
1675
+ return data, status_code, headers
1676
+ end
1677
+
1678
+ # List mailbox folders
1679
+ # Returns a cursor-paginated list of folders for the authenticated mailbox.
1680
+ # @param [Hash] opts the optional parameters
1681
+ # @option opts [String] :cursor
1682
+ # @option opts [Integer] :limit
1683
+ # @return [MailboxFolderCursorListResponse]
1684
+ def mailbox_list_folders(opts = {})
1685
+ data, _status_code, _headers = mailbox_list_folders_with_http_info(opts)
1686
+ data
1687
+ end
1688
+
1689
+ # List mailbox folders
1690
+ # Returns a cursor-paginated list of folders for the authenticated mailbox.
1691
+ # @param [Hash] opts the optional parameters
1692
+ # @option opts [String] :cursor
1693
+ # @option opts [Integer] :limit
1694
+ # @return [Array<(MailboxFolderCursorListResponse, Integer, Hash)>] MailboxFolderCursorListResponse data, response status code and response headers
1695
+ def mailbox_list_folders_with_http_info(opts = {})
1696
+ if @api_client.config.debugging
1697
+ @api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_list_folders ...'
1698
+ end
1699
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
1700
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MailboxAPIApi.mailbox_list_folders, must be smaller than or equal to 100.'
1701
+ end
1702
+
1703
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
1704
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MailboxAPIApi.mailbox_list_folders, must be greater than or equal to 1.'
1705
+ end
1706
+
1707
+ # resource path
1708
+ local_var_path = '/mailbox/folders'
1709
+
1710
+ # query parameters
1711
+ query_params = opts[:query_params] || {}
1712
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
1713
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
1714
+
1715
+ # header parameters
1716
+ header_params = opts[:header_params] || {}
1717
+ # HTTP header 'Accept' (if needed)
1718
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1719
+
1720
+ # form parameters
1721
+ form_params = opts[:form_params] || {}
1722
+
1723
+ # http body (model)
1724
+ post_body = opts[:debug_body]
1725
+
1726
+ # return_type
1727
+ return_type = opts[:debug_return_type] || 'MailboxFolderCursorListResponse'
1728
+
1729
+ # auth_names
1730
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
1731
+
1732
+ new_options = opts.merge(
1733
+ :operation => :"MailboxAPIApi.mailbox_list_folders",
1734
+ :header_params => header_params,
1735
+ :query_params => query_params,
1736
+ :form_params => form_params,
1737
+ :body => post_body,
1738
+ :auth_names => auth_names,
1739
+ :return_type => return_type
1740
+ )
1741
+
1742
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1743
+ if @api_client.config.debugging
1744
+ @api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_list_folders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1745
+ end
1746
+ return data, status_code, headers
1747
+ end
1748
+
1749
+ # List mailbox sender identities
1750
+ # Returns sender identities available to the authenticated mailbox.
1751
+ # @param [Hash] opts the optional parameters
1752
+ # @option opts [String] :cursor
1753
+ # @option opts [Integer] :limit
1754
+ # @return [MailboxIdentityCursorListResponse]
1755
+ def mailbox_list_identities(opts = {})
1756
+ data, _status_code, _headers = mailbox_list_identities_with_http_info(opts)
1757
+ data
1758
+ end
1759
+
1760
+ # List mailbox sender identities
1761
+ # Returns sender identities available to the authenticated mailbox.
1762
+ # @param [Hash] opts the optional parameters
1763
+ # @option opts [String] :cursor
1764
+ # @option opts [Integer] :limit
1765
+ # @return [Array<(MailboxIdentityCursorListResponse, Integer, Hash)>] MailboxIdentityCursorListResponse data, response status code and response headers
1766
+ def mailbox_list_identities_with_http_info(opts = {})
1767
+ if @api_client.config.debugging
1768
+ @api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_list_identities ...'
1769
+ end
1770
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
1771
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MailboxAPIApi.mailbox_list_identities, must be smaller than or equal to 100.'
1772
+ end
1773
+
1774
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
1775
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MailboxAPIApi.mailbox_list_identities, must be greater than or equal to 1.'
1776
+ end
1777
+
1778
+ # resource path
1779
+ local_var_path = '/mailbox/identities'
1780
+
1781
+ # query parameters
1782
+ query_params = opts[:query_params] || {}
1783
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
1784
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
1785
+
1786
+ # header parameters
1787
+ header_params = opts[:header_params] || {}
1788
+ # HTTP header 'Accept' (if needed)
1789
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1790
+
1791
+ # form parameters
1792
+ form_params = opts[:form_params] || {}
1793
+
1794
+ # http body (model)
1795
+ post_body = opts[:debug_body]
1796
+
1797
+ # return_type
1798
+ return_type = opts[:debug_return_type] || 'MailboxIdentityCursorListResponse'
1799
+
1800
+ # auth_names
1801
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
1802
+
1803
+ new_options = opts.merge(
1804
+ :operation => :"MailboxAPIApi.mailbox_list_identities",
1805
+ :header_params => header_params,
1806
+ :query_params => query_params,
1807
+ :form_params => form_params,
1808
+ :body => post_body,
1809
+ :auth_names => auth_names,
1810
+ :return_type => return_type
1811
+ )
1812
+
1813
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1814
+ if @api_client.config.debugging
1815
+ @api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_list_identities\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1816
+ end
1817
+ return data, status_code, headers
1818
+ end
1819
+
1820
+ # List mailbox messages
1821
+ # Returns a cursor-paginated list of messages for the authenticated mailbox. Requires a mailbox API key.
1822
+ # @param [Hash] opts the optional parameters
1823
+ # @option opts [String] :cursor
1824
+ # @option opts [Integer] :limit
1825
+ # @option opts [String] :folder_id
1826
+ # @option opts [String] :thread_id
1827
+ # @option opts [String] :q
1828
+ # @option opts [String] :from
1829
+ # @option opts [String] :to
1830
+ # @option opts [String] :cc
1831
+ # @option opts [String] :bcc
1832
+ # @option opts [String] :subject
1833
+ # @option opts [String] :body
1834
+ # @option opts [String] :header_name
1835
+ # @option opts [String] :header_value
1836
+ # @option opts [Integer] :min_size_bytes
1837
+ # @option opts [Integer] :max_size_bytes
1838
+ # @option opts [String] :keyword
1839
+ # @option opts [String] :not_keyword
1840
+ # @option opts [String] :after
1841
+ # @option opts [String] :before
1842
+ # @option opts [Boolean] :has_attachment
1843
+ # @option opts [Boolean] :is_unread
1844
+ # @option opts [String] :sort_by
1845
+ # @option opts [String] :sort_direction
1846
+ # @return [MailboxMessageSummaryCursorListResponse]
1847
+ def mailbox_list_messages(opts = {})
1848
+ data, _status_code, _headers = mailbox_list_messages_with_http_info(opts)
1849
+ data
1850
+ end
1851
+
1852
+ # List mailbox messages
1853
+ # Returns a cursor-paginated list of messages for the authenticated mailbox. Requires a mailbox API key.
1854
+ # @param [Hash] opts the optional parameters
1855
+ # @option opts [String] :cursor
1856
+ # @option opts [Integer] :limit
1857
+ # @option opts [String] :folder_id
1858
+ # @option opts [String] :thread_id
1859
+ # @option opts [String] :q
1860
+ # @option opts [String] :from
1861
+ # @option opts [String] :to
1862
+ # @option opts [String] :cc
1863
+ # @option opts [String] :bcc
1864
+ # @option opts [String] :subject
1865
+ # @option opts [String] :body
1866
+ # @option opts [String] :header_name
1867
+ # @option opts [String] :header_value
1868
+ # @option opts [Integer] :min_size_bytes
1869
+ # @option opts [Integer] :max_size_bytes
1870
+ # @option opts [String] :keyword
1871
+ # @option opts [String] :not_keyword
1872
+ # @option opts [String] :after
1873
+ # @option opts [String] :before
1874
+ # @option opts [Boolean] :has_attachment
1875
+ # @option opts [Boolean] :is_unread
1876
+ # @option opts [String] :sort_by
1877
+ # @option opts [String] :sort_direction
1878
+ # @return [Array<(MailboxMessageSummaryCursorListResponse, Integer, Hash)>] MailboxMessageSummaryCursorListResponse data, response status code and response headers
1879
+ def mailbox_list_messages_with_http_info(opts = {})
1880
+ if @api_client.config.debugging
1881
+ @api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_list_messages ...'
1882
+ end
1883
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
1884
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MailboxAPIApi.mailbox_list_messages, must be smaller than or equal to 100.'
1885
+ end
1886
+
1887
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
1888
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MailboxAPIApi.mailbox_list_messages, must be greater than or equal to 1.'
1889
+ end
1890
+
1891
+ if @api_client.config.client_side_validation && !opts[:'min_size_bytes'].nil? && opts[:'min_size_bytes'] < 0
1892
+ fail ArgumentError, 'invalid value for "opts[:"min_size_bytes"]" when calling MailboxAPIApi.mailbox_list_messages, must be greater than or equal to 0.'
1893
+ end
1894
+
1895
+ if @api_client.config.client_side_validation && !opts[:'max_size_bytes'].nil? && opts[:'max_size_bytes'] < 0
1896
+ fail ArgumentError, 'invalid value for "opts[:"max_size_bytes"]" when calling MailboxAPIApi.mailbox_list_messages, must be greater than or equal to 0.'
1897
+ end
1898
+
1899
+ allowable_values = ["received_at", "sent_at", "subject", "from", "to", "size_bytes", "unknown_default_open_api"]
1900
+ if @api_client.config.client_side_validation && opts[:'sort_by'] && !allowable_values.include?(opts[:'sort_by'])
1901
+ fail ArgumentError, "invalid value for \"sort_by\", must be one of #{allowable_values}"
1902
+ end
1903
+ allowable_values = ["asc", "desc", "unknown_default_open_api"]
1904
+ if @api_client.config.client_side_validation && opts[:'sort_direction'] && !allowable_values.include?(opts[:'sort_direction'])
1905
+ fail ArgumentError, "invalid value for \"sort_direction\", must be one of #{allowable_values}"
1906
+ end
1907
+ # resource path
1908
+ local_var_path = '/mailbox/messages'
1909
+
1910
+ # query parameters
1911
+ query_params = opts[:query_params] || {}
1912
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
1913
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
1914
+ query_params[:'folder_id'] = opts[:'folder_id'] if !opts[:'folder_id'].nil?
1915
+ query_params[:'thread_id'] = opts[:'thread_id'] if !opts[:'thread_id'].nil?
1916
+ query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
1917
+ query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
1918
+ query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil?
1919
+ query_params[:'cc'] = opts[:'cc'] if !opts[:'cc'].nil?
1920
+ query_params[:'bcc'] = opts[:'bcc'] if !opts[:'bcc'].nil?
1921
+ query_params[:'subject'] = opts[:'subject'] if !opts[:'subject'].nil?
1922
+ query_params[:'body'] = opts[:'body'] if !opts[:'body'].nil?
1923
+ query_params[:'header_name'] = opts[:'header_name'] if !opts[:'header_name'].nil?
1924
+ query_params[:'header_value'] = opts[:'header_value'] if !opts[:'header_value'].nil?
1925
+ query_params[:'min_size_bytes'] = opts[:'min_size_bytes'] if !opts[:'min_size_bytes'].nil?
1926
+ query_params[:'max_size_bytes'] = opts[:'max_size_bytes'] if !opts[:'max_size_bytes'].nil?
1927
+ query_params[:'keyword'] = opts[:'keyword'] if !opts[:'keyword'].nil?
1928
+ query_params[:'not_keyword'] = opts[:'not_keyword'] if !opts[:'not_keyword'].nil?
1929
+ query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
1930
+ query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
1931
+ query_params[:'has_attachment'] = opts[:'has_attachment'] if !opts[:'has_attachment'].nil?
1932
+ query_params[:'is_unread'] = opts[:'is_unread'] if !opts[:'is_unread'].nil?
1933
+ query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?
1934
+ query_params[:'sort_direction'] = opts[:'sort_direction'] if !opts[:'sort_direction'].nil?
1935
+
1936
+ # header parameters
1937
+ header_params = opts[:header_params] || {}
1938
+ # HTTP header 'Accept' (if needed)
1939
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1940
+
1941
+ # form parameters
1942
+ form_params = opts[:form_params] || {}
1943
+
1944
+ # http body (model)
1945
+ post_body = opts[:debug_body]
1946
+
1947
+ # return_type
1948
+ return_type = opts[:debug_return_type] || 'MailboxMessageSummaryCursorListResponse'
1949
+
1950
+ # auth_names
1951
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
1952
+
1953
+ new_options = opts.merge(
1954
+ :operation => :"MailboxAPIApi.mailbox_list_messages",
1955
+ :header_params => header_params,
1956
+ :query_params => query_params,
1957
+ :form_params => form_params,
1958
+ :body => post_body,
1959
+ :auth_names => auth_names,
1960
+ :return_type => return_type
1961
+ )
1962
+
1963
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1964
+ if @api_client.config.debugging
1965
+ @api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_list_messages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1966
+ end
1967
+ return data, status_code, headers
1968
+ end
1969
+
1970
+ # List mailbox quotas
1971
+ # Returns a cursor-paginated list of quota usage and limits for the authenticated mailbox.
1972
+ # @param [Hash] opts the optional parameters
1973
+ # @option opts [String] :cursor
1974
+ # @option opts [Integer] :limit
1975
+ # @option opts [String] :name
1976
+ # @option opts [String] :scope
1977
+ # @option opts [String] :resource_type
1978
+ # @option opts [String] :type
1979
+ # @option opts [String] :sort_by
1980
+ # @option opts [String] :sort_direction
1981
+ # @return [MailboxQuotaCursorListResponse]
1982
+ def mailbox_list_quotas(opts = {})
1983
+ data, _status_code, _headers = mailbox_list_quotas_with_http_info(opts)
1984
+ data
1985
+ end
1986
+
1987
+ # List mailbox quotas
1988
+ # Returns a cursor-paginated list of quota usage and limits for the authenticated mailbox.
1989
+ # @param [Hash] opts the optional parameters
1990
+ # @option opts [String] :cursor
1991
+ # @option opts [Integer] :limit
1992
+ # @option opts [String] :name
1993
+ # @option opts [String] :scope
1994
+ # @option opts [String] :resource_type
1995
+ # @option opts [String] :type
1996
+ # @option opts [String] :sort_by
1997
+ # @option opts [String] :sort_direction
1998
+ # @return [Array<(MailboxQuotaCursorListResponse, Integer, Hash)>] MailboxQuotaCursorListResponse data, response status code and response headers
1999
+ def mailbox_list_quotas_with_http_info(opts = {})
2000
+ if @api_client.config.debugging
2001
+ @api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_list_quotas ...'
2002
+ end
2003
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
2004
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MailboxAPIApi.mailbox_list_quotas, must be smaller than or equal to 100.'
2005
+ end
2006
+
2007
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
2008
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MailboxAPIApi.mailbox_list_quotas, must be greater than or equal to 1.'
2009
+ end
2010
+
2011
+ allowable_values = ["account", "domain", "global", "unknown_default_open_api"]
2012
+ if @api_client.config.client_side_validation && opts[:'scope'] && !allowable_values.include?(opts[:'scope'])
2013
+ fail ArgumentError, "invalid value for \"scope\", must be one of #{allowable_values}"
2014
+ end
2015
+ allowable_values = ["count", "octets", "unknown_default_open_api"]
2016
+ if @api_client.config.client_side_validation && opts[:'resource_type'] && !allowable_values.include?(opts[:'resource_type'])
2017
+ fail ArgumentError, "invalid value for \"resource_type\", must be one of #{allowable_values}"
2018
+ end
2019
+ allowable_values = ["name", "used", "unknown_default_open_api"]
2020
+ if @api_client.config.client_side_validation && opts[:'sort_by'] && !allowable_values.include?(opts[:'sort_by'])
2021
+ fail ArgumentError, "invalid value for \"sort_by\", must be one of #{allowable_values}"
2022
+ end
2023
+ allowable_values = ["asc", "desc", "unknown_default_open_api"]
2024
+ if @api_client.config.client_side_validation && opts[:'sort_direction'] && !allowable_values.include?(opts[:'sort_direction'])
2025
+ fail ArgumentError, "invalid value for \"sort_direction\", must be one of #{allowable_values}"
2026
+ end
2027
+ # resource path
2028
+ local_var_path = '/mailbox/quotas'
2029
+
2030
+ # query parameters
2031
+ query_params = opts[:query_params] || {}
2032
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
2033
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
2034
+ query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
2035
+ query_params[:'scope'] = opts[:'scope'] if !opts[:'scope'].nil?
2036
+ query_params[:'resource_type'] = opts[:'resource_type'] if !opts[:'resource_type'].nil?
2037
+ query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
2038
+ query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?
2039
+ query_params[:'sort_direction'] = opts[:'sort_direction'] if !opts[:'sort_direction'].nil?
2040
+
2041
+ # header parameters
2042
+ header_params = opts[:header_params] || {}
2043
+ # HTTP header 'Accept' (if needed)
2044
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2045
+
2046
+ # form parameters
2047
+ form_params = opts[:form_params] || {}
2048
+
2049
+ # http body (model)
2050
+ post_body = opts[:debug_body]
2051
+
2052
+ # return_type
2053
+ return_type = opts[:debug_return_type] || 'MailboxQuotaCursorListResponse'
2054
+
2055
+ # auth_names
2056
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
2057
+
2058
+ new_options = opts.merge(
2059
+ :operation => :"MailboxAPIApi.mailbox_list_quotas",
2060
+ :header_params => header_params,
2061
+ :query_params => query_params,
2062
+ :form_params => form_params,
2063
+ :body => post_body,
2064
+ :auth_names => auth_names,
2065
+ :return_type => return_type
2066
+ )
2067
+
2068
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2069
+ if @api_client.config.debugging
2070
+ @api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_list_quotas\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2071
+ end
2072
+ return data, status_code, headers
2073
+ end
2074
+
2075
+ # List mailbox submissions
2076
+ # Returns a cursor-paginated list of send submissions for the authenticated mailbox, including delivery lifecycle fields when available.
2077
+ # @param [Hash] opts the optional parameters
2078
+ # @option opts [String] :cursor
2079
+ # @option opts [Integer] :limit
2080
+ # @option opts [String] :identity_ids
2081
+ # @option opts [String] :email_ids
2082
+ # @option opts [String] :thread_ids
2083
+ # @option opts [String] :undo_status
2084
+ # @option opts [String] :after
2085
+ # @option opts [String] :before
2086
+ # @option opts [String] :sort_by
2087
+ # @option opts [String] :sort_direction
2088
+ # @return [MailboxSubmissionCursorListResponse]
2089
+ def mailbox_list_submissions(opts = {})
2090
+ data, _status_code, _headers = mailbox_list_submissions_with_http_info(opts)
2091
+ data
2092
+ end
2093
+
2094
+ # List mailbox submissions
2095
+ # Returns a cursor-paginated list of send submissions for the authenticated mailbox, including delivery lifecycle fields when available.
2096
+ # @param [Hash] opts the optional parameters
2097
+ # @option opts [String] :cursor
2098
+ # @option opts [Integer] :limit
2099
+ # @option opts [String] :identity_ids
2100
+ # @option opts [String] :email_ids
2101
+ # @option opts [String] :thread_ids
2102
+ # @option opts [String] :undo_status
2103
+ # @option opts [String] :after
2104
+ # @option opts [String] :before
2105
+ # @option opts [String] :sort_by
2106
+ # @option opts [String] :sort_direction
2107
+ # @return [Array<(MailboxSubmissionCursorListResponse, Integer, Hash)>] MailboxSubmissionCursorListResponse data, response status code and response headers
2108
+ def mailbox_list_submissions_with_http_info(opts = {})
2109
+ if @api_client.config.debugging
2110
+ @api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_list_submissions ...'
2111
+ end
2112
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
2113
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MailboxAPIApi.mailbox_list_submissions, must be smaller than or equal to 100.'
2114
+ end
2115
+
2116
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
2117
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MailboxAPIApi.mailbox_list_submissions, must be greater than or equal to 1.'
2118
+ end
2119
+
2120
+ allowable_values = ["pending", "final", "canceled", "unknown_default_open_api"]
2121
+ if @api_client.config.client_side_validation && opts[:'undo_status'] && !allowable_values.include?(opts[:'undo_status'])
2122
+ fail ArgumentError, "invalid value for \"undo_status\", must be one of #{allowable_values}"
2123
+ end
2124
+ allowable_values = ["send_at", "email_id", "thread_id", "unknown_default_open_api"]
2125
+ if @api_client.config.client_side_validation && opts[:'sort_by'] && !allowable_values.include?(opts[:'sort_by'])
2126
+ fail ArgumentError, "invalid value for \"sort_by\", must be one of #{allowable_values}"
2127
+ end
2128
+ allowable_values = ["asc", "desc", "unknown_default_open_api"]
2129
+ if @api_client.config.client_side_validation && opts[:'sort_direction'] && !allowable_values.include?(opts[:'sort_direction'])
2130
+ fail ArgumentError, "invalid value for \"sort_direction\", must be one of #{allowable_values}"
2131
+ end
2132
+ # resource path
2133
+ local_var_path = '/mailbox/submissions'
2134
+
2135
+ # query parameters
2136
+ query_params = opts[:query_params] || {}
2137
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
2138
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
2139
+ query_params[:'identity_ids'] = opts[:'identity_ids'] if !opts[:'identity_ids'].nil?
2140
+ query_params[:'email_ids'] = opts[:'email_ids'] if !opts[:'email_ids'].nil?
2141
+ query_params[:'thread_ids'] = opts[:'thread_ids'] if !opts[:'thread_ids'].nil?
2142
+ query_params[:'undo_status'] = opts[:'undo_status'] if !opts[:'undo_status'].nil?
2143
+ query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
2144
+ query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
2145
+ query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?
2146
+ query_params[:'sort_direction'] = opts[:'sort_direction'] if !opts[:'sort_direction'].nil?
2147
+
2148
+ # header parameters
2149
+ header_params = opts[:header_params] || {}
2150
+ # HTTP header 'Accept' (if needed)
2151
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2152
+
2153
+ # form parameters
2154
+ form_params = opts[:form_params] || {}
2155
+
2156
+ # http body (model)
2157
+ post_body = opts[:debug_body]
2158
+
2159
+ # return_type
2160
+ return_type = opts[:debug_return_type] || 'MailboxSubmissionCursorListResponse'
2161
+
2162
+ # auth_names
2163
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
2164
+
2165
+ new_options = opts.merge(
2166
+ :operation => :"MailboxAPIApi.mailbox_list_submissions",
2167
+ :header_params => header_params,
2168
+ :query_params => query_params,
2169
+ :form_params => form_params,
2170
+ :body => post_body,
2171
+ :auth_names => auth_names,
2172
+ :return_type => return_type
2173
+ )
2174
+
2175
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2176
+ if @api_client.config.debugging
2177
+ @api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_list_submissions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2178
+ end
2179
+ return data, status_code, headers
2180
+ end
2181
+
2182
+ # List thread messages
2183
+ # Returns cursor-paginated message summaries for one thread. Use the thread content endpoint when you need cleaned bodies.
2184
+ # @param thread_id [String]
2185
+ # @param [Hash] opts the optional parameters
2186
+ # @option opts [String] :cursor
2187
+ # @option opts [Integer] :limit
2188
+ # @option opts [String] :sort
2189
+ # @return [MailboxMessageSummaryCursorListResponse]
2190
+ def mailbox_list_thread_messages(thread_id, opts = {})
2191
+ data, _status_code, _headers = mailbox_list_thread_messages_with_http_info(thread_id, opts)
2192
+ data
2193
+ end
2194
+
2195
+ # List thread messages
2196
+ # Returns cursor-paginated message summaries for one thread. Use the thread content endpoint when you need cleaned bodies.
2197
+ # @param thread_id [String]
2198
+ # @param [Hash] opts the optional parameters
2199
+ # @option opts [String] :cursor
2200
+ # @option opts [Integer] :limit
2201
+ # @option opts [String] :sort
2202
+ # @return [Array<(MailboxMessageSummaryCursorListResponse, Integer, Hash)>] MailboxMessageSummaryCursorListResponse data, response status code and response headers
2203
+ def mailbox_list_thread_messages_with_http_info(thread_id, opts = {})
2204
+ if @api_client.config.debugging
2205
+ @api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_list_thread_messages ...'
2206
+ end
2207
+ # verify the required parameter 'thread_id' is set
2208
+ if @api_client.config.client_side_validation && thread_id.nil?
2209
+ fail ArgumentError, "Missing the required parameter 'thread_id' when calling MailboxAPIApi.mailbox_list_thread_messages"
2210
+ end
2211
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
2212
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MailboxAPIApi.mailbox_list_thread_messages, must be smaller than or equal to 100.'
2213
+ end
2214
+
2215
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
2216
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MailboxAPIApi.mailbox_list_thread_messages, must be greater than or equal to 1.'
2217
+ end
2218
+
2219
+ allowable_values = ["asc", "desc", "unknown_default_open_api"]
2220
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
2221
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
2222
+ end
2223
+ # resource path
2224
+ local_var_path = '/mailbox/threads/{thread_id}/messages'.sub('{thread_id}', CGI.escape(thread_id.to_s))
2225
+
2226
+ # query parameters
2227
+ query_params = opts[:query_params] || {}
2228
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
2229
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
2230
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
2231
+
2232
+ # header parameters
2233
+ header_params = opts[:header_params] || {}
2234
+ # HTTP header 'Accept' (if needed)
2235
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2236
+
2237
+ # form parameters
2238
+ form_params = opts[:form_params] || {}
2239
+
2240
+ # http body (model)
2241
+ post_body = opts[:debug_body]
2242
+
2243
+ # return_type
2244
+ return_type = opts[:debug_return_type] || 'MailboxMessageSummaryCursorListResponse'
2245
+
2246
+ # auth_names
2247
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
2248
+
2249
+ new_options = opts.merge(
2250
+ :operation => :"MailboxAPIApi.mailbox_list_thread_messages",
2251
+ :header_params => header_params,
2252
+ :query_params => query_params,
2253
+ :form_params => form_params,
2254
+ :body => post_body,
2255
+ :auth_names => auth_names,
2256
+ :return_type => return_type
2257
+ )
2258
+
2259
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2260
+ if @api_client.config.debugging
2261
+ @api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_list_thread_messages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2262
+ end
2263
+ return data, status_code, headers
2264
+ end
2265
+
2266
+ # List mailbox threads
2267
+ # Returns a cursor-paginated list of conversation threads for the authenticated mailbox. Filter by text, participant, folder, unread state, attachment presence, or date range.
2268
+ # @param [Hash] opts the optional parameters
2269
+ # @option opts [String] :cursor
2270
+ # @option opts [Integer] :limit
2271
+ # @option opts [String] :q
2272
+ # @option opts [String] :participant
2273
+ # @option opts [String] :folder_id
2274
+ # @option opts [String] :after
2275
+ # @option opts [String] :before
2276
+ # @option opts [Boolean] :has_attachment
2277
+ # @option opts [Boolean] :is_unread
2278
+ # @option opts [String] :sort_direction
2279
+ # @return [MailboxThreadSummaryCursorListResponse]
2280
+ def mailbox_list_threads(opts = {})
2281
+ data, _status_code, _headers = mailbox_list_threads_with_http_info(opts)
2282
+ data
2283
+ end
2284
+
2285
+ # List mailbox threads
2286
+ # Returns a cursor-paginated list of conversation threads for the authenticated mailbox. Filter by text, participant, folder, unread state, attachment presence, or date range.
2287
+ # @param [Hash] opts the optional parameters
2288
+ # @option opts [String] :cursor
2289
+ # @option opts [Integer] :limit
2290
+ # @option opts [String] :q
2291
+ # @option opts [String] :participant
2292
+ # @option opts [String] :folder_id
2293
+ # @option opts [String] :after
2294
+ # @option opts [String] :before
2295
+ # @option opts [Boolean] :has_attachment
2296
+ # @option opts [Boolean] :is_unread
2297
+ # @option opts [String] :sort_direction
2298
+ # @return [Array<(MailboxThreadSummaryCursorListResponse, Integer, Hash)>] MailboxThreadSummaryCursorListResponse data, response status code and response headers
2299
+ def mailbox_list_threads_with_http_info(opts = {})
2300
+ if @api_client.config.debugging
2301
+ @api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_list_threads ...'
2302
+ end
2303
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
2304
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MailboxAPIApi.mailbox_list_threads, must be smaller than or equal to 100.'
2305
+ end
2306
+
2307
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
2308
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MailboxAPIApi.mailbox_list_threads, must be greater than or equal to 1.'
2309
+ end
2310
+
2311
+ allowable_values = ["asc", "desc", "unknown_default_open_api"]
2312
+ if @api_client.config.client_side_validation && opts[:'sort_direction'] && !allowable_values.include?(opts[:'sort_direction'])
2313
+ fail ArgumentError, "invalid value for \"sort_direction\", must be one of #{allowable_values}"
2314
+ end
2315
+ # resource path
2316
+ local_var_path = '/mailbox/threads'
2317
+
2318
+ # query parameters
2319
+ query_params = opts[:query_params] || {}
2320
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
2321
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
2322
+ query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
2323
+ query_params[:'participant'] = opts[:'participant'] if !opts[:'participant'].nil?
2324
+ query_params[:'folder_id'] = opts[:'folder_id'] if !opts[:'folder_id'].nil?
2325
+ query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
2326
+ query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
2327
+ query_params[:'has_attachment'] = opts[:'has_attachment'] if !opts[:'has_attachment'].nil?
2328
+ query_params[:'is_unread'] = opts[:'is_unread'] if !opts[:'is_unread'].nil?
2329
+ query_params[:'sort_direction'] = opts[:'sort_direction'] if !opts[:'sort_direction'].nil?
2330
+
2331
+ # header parameters
2332
+ header_params = opts[:header_params] || {}
2333
+ # HTTP header 'Accept' (if needed)
2334
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2335
+
2336
+ # form parameters
2337
+ form_params = opts[:form_params] || {}
2338
+
2339
+ # http body (model)
2340
+ post_body = opts[:debug_body]
2341
+
2342
+ # return_type
2343
+ return_type = opts[:debug_return_type] || 'MailboxThreadSummaryCursorListResponse'
2344
+
2345
+ # auth_names
2346
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
2347
+
2348
+ new_options = opts.merge(
2349
+ :operation => :"MailboxAPIApi.mailbox_list_threads",
2350
+ :header_params => header_params,
2351
+ :query_params => query_params,
2352
+ :form_params => form_params,
2353
+ :body => post_body,
2354
+ :auth_names => auth_names,
2355
+ :return_type => return_type
2356
+ )
2357
+
2358
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2359
+ if @api_client.config.debugging
2360
+ @api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_list_threads\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2361
+ end
2362
+ return data, status_code, headers
2363
+ end
2364
+
2365
+ # Get mailbox usage
2366
+ # Returns a compact usage view derived from mailbox quota records. Responses include a weak `ETag` header.
2367
+ # @param [Hash] opts the optional parameters
2368
+ # @option opts [String] :if_none_match
2369
+ # @return [MailboxUsageResponse]
2370
+ def mailbox_list_usage(opts = {})
2371
+ data, _status_code, _headers = mailbox_list_usage_with_http_info(opts)
2372
+ data
2373
+ end
2374
+
2375
+ # Get mailbox usage
2376
+ # Returns a compact usage view derived from mailbox quota records. Responses include a weak &#x60;ETag&#x60; header.
2377
+ # @param [Hash] opts the optional parameters
2378
+ # @option opts [String] :if_none_match
2379
+ # @return [Array<(MailboxUsageResponse, Integer, Hash)>] MailboxUsageResponse data, response status code and response headers
2380
+ def mailbox_list_usage_with_http_info(opts = {})
2381
+ if @api_client.config.debugging
2382
+ @api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_list_usage ...'
2383
+ end
2384
+ # resource path
2385
+ local_var_path = '/mailbox/usage'
2386
+
2387
+ # query parameters
2388
+ query_params = opts[:query_params] || {}
2389
+
2390
+ # header parameters
2391
+ header_params = opts[:header_params] || {}
2392
+ # HTTP header 'Accept' (if needed)
2393
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2394
+ header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?
2395
+
2396
+ # form parameters
2397
+ form_params = opts[:form_params] || {}
2398
+
2399
+ # http body (model)
2400
+ post_body = opts[:debug_body]
2401
+
2402
+ # return_type
2403
+ return_type = opts[:debug_return_type] || 'MailboxUsageResponse'
2404
+
2405
+ # auth_names
2406
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
2407
+
2408
+ new_options = opts.merge(
2409
+ :operation => :"MailboxAPIApi.mailbox_list_usage",
2410
+ :header_params => header_params,
2411
+ :query_params => query_params,
2412
+ :form_params => form_params,
2413
+ :body => post_body,
2414
+ :auth_names => auth_names,
2415
+ :return_type => return_type
2416
+ )
2417
+
2418
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2419
+ if @api_client.config.debugging
2420
+ @api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_list_usage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2421
+ end
2422
+ return data, status_code, headers
2423
+ end
2424
+
2425
+ # Get folder query changes
2426
+ # Returns folder-list index changes since a prior folder query state, or the current folder query state when omitted.
2427
+ # @param [Hash] opts the optional parameters
2428
+ # @option opts [String] :since_query_state
2429
+ # @option opts [Integer] :limit
2430
+ # @return [MailboxFolderQueryChangesResponse]
2431
+ def mailbox_query_folder_changes(opts = {})
2432
+ data, _status_code, _headers = mailbox_query_folder_changes_with_http_info(opts)
2433
+ data
2434
+ end
2435
+
2436
+ # Get folder query changes
2437
+ # Returns folder-list index changes since a prior folder query state, or the current folder query state when omitted.
2438
+ # @param [Hash] opts the optional parameters
2439
+ # @option opts [String] :since_query_state
2440
+ # @option opts [Integer] :limit
2441
+ # @return [Array<(MailboxFolderQueryChangesResponse, Integer, Hash)>] MailboxFolderQueryChangesResponse data, response status code and response headers
2442
+ def mailbox_query_folder_changes_with_http_info(opts = {})
2443
+ if @api_client.config.debugging
2444
+ @api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_query_folder_changes ...'
2445
+ end
2446
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500
2447
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MailboxAPIApi.mailbox_query_folder_changes, must be smaller than or equal to 500.'
2448
+ end
2449
+
2450
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
2451
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MailboxAPIApi.mailbox_query_folder_changes, must be greater than or equal to 1.'
2452
+ end
2453
+
2454
+ # resource path
2455
+ local_var_path = '/mailbox/folders/query-changes'
2456
+
2457
+ # query parameters
2458
+ query_params = opts[:query_params] || {}
2459
+ query_params[:'since_query_state'] = opts[:'since_query_state'] if !opts[:'since_query_state'].nil?
2460
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
2461
+
2462
+ # header parameters
2463
+ header_params = opts[:header_params] || {}
2464
+ # HTTP header 'Accept' (if needed)
2465
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2466
+
2467
+ # form parameters
2468
+ form_params = opts[:form_params] || {}
2469
+
2470
+ # http body (model)
2471
+ post_body = opts[:debug_body]
2472
+
2473
+ # return_type
2474
+ return_type = opts[:debug_return_type] || 'MailboxFolderQueryChangesResponse'
2475
+
2476
+ # auth_names
2477
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
2478
+
2479
+ new_options = opts.merge(
2480
+ :operation => :"MailboxAPIApi.mailbox_query_folder_changes",
2481
+ :header_params => header_params,
2482
+ :query_params => query_params,
2483
+ :form_params => form_params,
2484
+ :body => post_body,
2485
+ :auth_names => auth_names,
2486
+ :return_type => return_type
2487
+ )
2488
+
2489
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2490
+ if @api_client.config.debugging
2491
+ @api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_query_folder_changes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2492
+ end
2493
+ return data, status_code, headers
2494
+ end
2495
+
2496
+ # Get message query changes
2497
+ # Returns filtered message-list index changes since a prior message query state, or the current message query state when omitted.
2498
+ # @param [Hash] opts the optional parameters
2499
+ # @option opts [String] :since_query_state
2500
+ # @option opts [Integer] :limit
2501
+ # @option opts [String] :up_to_id
2502
+ # @option opts [Boolean] :calculate_total
2503
+ # @option opts [String] :folder_id
2504
+ # @option opts [String] :q
2505
+ # @option opts [String] :from
2506
+ # @option opts [String] :to
2507
+ # @option opts [String] :cc
2508
+ # @option opts [String] :bcc
2509
+ # @option opts [String] :subject
2510
+ # @option opts [String] :body
2511
+ # @option opts [String] :header_name
2512
+ # @option opts [String] :header_value
2513
+ # @option opts [Integer] :min_size_bytes
2514
+ # @option opts [Integer] :max_size_bytes
2515
+ # @option opts [String] :keyword
2516
+ # @option opts [String] :not_keyword
2517
+ # @option opts [String] :after
2518
+ # @option opts [String] :before
2519
+ # @option opts [Boolean] :has_attachment
2520
+ # @option opts [Boolean] :is_unread
2521
+ # @option opts [String] :sort_by
2522
+ # @option opts [String] :sort_direction
2523
+ # @return [MailboxMessageQueryChangesResponse]
2524
+ def mailbox_query_message_changes(opts = {})
2525
+ data, _status_code, _headers = mailbox_query_message_changes_with_http_info(opts)
2526
+ data
2527
+ end
2528
+
2529
+ # Get message query changes
2530
+ # Returns filtered message-list index changes since a prior message query state, or the current message query state when omitted.
2531
+ # @param [Hash] opts the optional parameters
2532
+ # @option opts [String] :since_query_state
2533
+ # @option opts [Integer] :limit
2534
+ # @option opts [String] :up_to_id
2535
+ # @option opts [Boolean] :calculate_total
2536
+ # @option opts [String] :folder_id
2537
+ # @option opts [String] :q
2538
+ # @option opts [String] :from
2539
+ # @option opts [String] :to
2540
+ # @option opts [String] :cc
2541
+ # @option opts [String] :bcc
2542
+ # @option opts [String] :subject
2543
+ # @option opts [String] :body
2544
+ # @option opts [String] :header_name
2545
+ # @option opts [String] :header_value
2546
+ # @option opts [Integer] :min_size_bytes
2547
+ # @option opts [Integer] :max_size_bytes
2548
+ # @option opts [String] :keyword
2549
+ # @option opts [String] :not_keyword
2550
+ # @option opts [String] :after
2551
+ # @option opts [String] :before
2552
+ # @option opts [Boolean] :has_attachment
2553
+ # @option opts [Boolean] :is_unread
2554
+ # @option opts [String] :sort_by
2555
+ # @option opts [String] :sort_direction
2556
+ # @return [Array<(MailboxMessageQueryChangesResponse, Integer, Hash)>] MailboxMessageQueryChangesResponse data, response status code and response headers
2557
+ def mailbox_query_message_changes_with_http_info(opts = {})
2558
+ if @api_client.config.debugging
2559
+ @api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_query_message_changes ...'
2560
+ end
2561
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500
2562
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MailboxAPIApi.mailbox_query_message_changes, must be smaller than or equal to 500.'
2563
+ end
2564
+
2565
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
2566
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MailboxAPIApi.mailbox_query_message_changes, must be greater than or equal to 1.'
2567
+ end
2568
+
2569
+ if @api_client.config.client_side_validation && !opts[:'min_size_bytes'].nil? && opts[:'min_size_bytes'] < 0
2570
+ fail ArgumentError, 'invalid value for "opts[:"min_size_bytes"]" when calling MailboxAPIApi.mailbox_query_message_changes, must be greater than or equal to 0.'
2571
+ end
2572
+
2573
+ if @api_client.config.client_side_validation && !opts[:'max_size_bytes'].nil? && opts[:'max_size_bytes'] < 0
2574
+ fail ArgumentError, 'invalid value for "opts[:"max_size_bytes"]" when calling MailboxAPIApi.mailbox_query_message_changes, must be greater than or equal to 0.'
2575
+ end
2576
+
2577
+ allowable_values = ["received_at", "sent_at", "subject", "from", "to", "size_bytes", "unknown_default_open_api"]
2578
+ if @api_client.config.client_side_validation && opts[:'sort_by'] && !allowable_values.include?(opts[:'sort_by'])
2579
+ fail ArgumentError, "invalid value for \"sort_by\", must be one of #{allowable_values}"
2580
+ end
2581
+ allowable_values = ["asc", "desc", "unknown_default_open_api"]
2582
+ if @api_client.config.client_side_validation && opts[:'sort_direction'] && !allowable_values.include?(opts[:'sort_direction'])
2583
+ fail ArgumentError, "invalid value for \"sort_direction\", must be one of #{allowable_values}"
2584
+ end
2585
+ # resource path
2586
+ local_var_path = '/mailbox/messages/query-changes'
2587
+
2588
+ # query parameters
2589
+ query_params = opts[:query_params] || {}
2590
+ query_params[:'since_query_state'] = opts[:'since_query_state'] if !opts[:'since_query_state'].nil?
2591
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
2592
+ query_params[:'up_to_id'] = opts[:'up_to_id'] if !opts[:'up_to_id'].nil?
2593
+ query_params[:'calculate_total'] = opts[:'calculate_total'] if !opts[:'calculate_total'].nil?
2594
+ query_params[:'folder_id'] = opts[:'folder_id'] if !opts[:'folder_id'].nil?
2595
+ query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
2596
+ query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
2597
+ query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil?
2598
+ query_params[:'cc'] = opts[:'cc'] if !opts[:'cc'].nil?
2599
+ query_params[:'bcc'] = opts[:'bcc'] if !opts[:'bcc'].nil?
2600
+ query_params[:'subject'] = opts[:'subject'] if !opts[:'subject'].nil?
2601
+ query_params[:'body'] = opts[:'body'] if !opts[:'body'].nil?
2602
+ query_params[:'header_name'] = opts[:'header_name'] if !opts[:'header_name'].nil?
2603
+ query_params[:'header_value'] = opts[:'header_value'] if !opts[:'header_value'].nil?
2604
+ query_params[:'min_size_bytes'] = opts[:'min_size_bytes'] if !opts[:'min_size_bytes'].nil?
2605
+ query_params[:'max_size_bytes'] = opts[:'max_size_bytes'] if !opts[:'max_size_bytes'].nil?
2606
+ query_params[:'keyword'] = opts[:'keyword'] if !opts[:'keyword'].nil?
2607
+ query_params[:'not_keyword'] = opts[:'not_keyword'] if !opts[:'not_keyword'].nil?
2608
+ query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
2609
+ query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
2610
+ query_params[:'has_attachment'] = opts[:'has_attachment'] if !opts[:'has_attachment'].nil?
2611
+ query_params[:'is_unread'] = opts[:'is_unread'] if !opts[:'is_unread'].nil?
2612
+ query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?
2613
+ query_params[:'sort_direction'] = opts[:'sort_direction'] if !opts[:'sort_direction'].nil?
2614
+
2615
+ # header parameters
2616
+ header_params = opts[:header_params] || {}
2617
+ # HTTP header 'Accept' (if needed)
2618
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2619
+
2620
+ # form parameters
2621
+ form_params = opts[:form_params] || {}
2622
+
2623
+ # http body (model)
2624
+ post_body = opts[:debug_body]
2625
+
2626
+ # return_type
2627
+ return_type = opts[:debug_return_type] || 'MailboxMessageQueryChangesResponse'
2628
+
2629
+ # auth_names
2630
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
2631
+
2632
+ new_options = opts.merge(
2633
+ :operation => :"MailboxAPIApi.mailbox_query_message_changes",
2634
+ :header_params => header_params,
2635
+ :query_params => query_params,
2636
+ :form_params => form_params,
2637
+ :body => post_body,
2638
+ :auth_names => auth_names,
2639
+ :return_type => return_type
2640
+ )
2641
+
2642
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2643
+ if @api_client.config.debugging
2644
+ @api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_query_message_changes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2645
+ end
2646
+ return data, status_code, headers
2647
+ end
2648
+
2649
+ # Get message search snippets
2650
+ # Returns subject and preview snippets for a text search. Provide `message_ids` to snippet exact messages, or omit it to snippet the first filtered results.
2651
+ # @param q [String]
2652
+ # @param [Hash] opts the optional parameters
2653
+ # @option opts [String] :folder_id
2654
+ # @option opts [String] :from
2655
+ # @option opts [String] :to
2656
+ # @option opts [String] :cc
2657
+ # @option opts [String] :bcc
2658
+ # @option opts [String] :subject
2659
+ # @option opts [String] :body
2660
+ # @option opts [String] :header_name
2661
+ # @option opts [String] :header_value
2662
+ # @option opts [Integer] :min_size_bytes
2663
+ # @option opts [Integer] :max_size_bytes
2664
+ # @option opts [String] :keyword
2665
+ # @option opts [String] :not_keyword
2666
+ # @option opts [String] :after
2667
+ # @option opts [String] :before
2668
+ # @option opts [Boolean] :has_attachment
2669
+ # @option opts [Boolean] :is_unread
2670
+ # @option opts [String] :message_ids
2671
+ # @option opts [Integer] :limit
2672
+ # @return [MailboxSearchSnippetsResultResponse]
2673
+ def mailbox_search_message_snippets(q, opts = {})
2674
+ data, _status_code, _headers = mailbox_search_message_snippets_with_http_info(q, opts)
2675
+ data
2676
+ end
2677
+
2678
+ # Get message search snippets
2679
+ # Returns subject and preview snippets for a text search. Provide &#x60;message_ids&#x60; to snippet exact messages, or omit it to snippet the first filtered results.
2680
+ # @param q [String]
2681
+ # @param [Hash] opts the optional parameters
2682
+ # @option opts [String] :folder_id
2683
+ # @option opts [String] :from
2684
+ # @option opts [String] :to
2685
+ # @option opts [String] :cc
2686
+ # @option opts [String] :bcc
2687
+ # @option opts [String] :subject
2688
+ # @option opts [String] :body
2689
+ # @option opts [String] :header_name
2690
+ # @option opts [String] :header_value
2691
+ # @option opts [Integer] :min_size_bytes
2692
+ # @option opts [Integer] :max_size_bytes
2693
+ # @option opts [String] :keyword
2694
+ # @option opts [String] :not_keyword
2695
+ # @option opts [String] :after
2696
+ # @option opts [String] :before
2697
+ # @option opts [Boolean] :has_attachment
2698
+ # @option opts [Boolean] :is_unread
2699
+ # @option opts [String] :message_ids
2700
+ # @option opts [Integer] :limit
2701
+ # @return [Array<(MailboxSearchSnippetsResultResponse, Integer, Hash)>] MailboxSearchSnippetsResultResponse data, response status code and response headers
2702
+ def mailbox_search_message_snippets_with_http_info(q, opts = {})
2703
+ if @api_client.config.debugging
2704
+ @api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_search_message_snippets ...'
2705
+ end
2706
+ # verify the required parameter 'q' is set
2707
+ if @api_client.config.client_side_validation && q.nil?
2708
+ fail ArgumentError, "Missing the required parameter 'q' when calling MailboxAPIApi.mailbox_search_message_snippets"
2709
+ end
2710
+ if @api_client.config.client_side_validation && !opts[:'min_size_bytes'].nil? && opts[:'min_size_bytes'] < 0
2711
+ fail ArgumentError, 'invalid value for "opts[:"min_size_bytes"]" when calling MailboxAPIApi.mailbox_search_message_snippets, must be greater than or equal to 0.'
2712
+ end
2713
+
2714
+ if @api_client.config.client_side_validation && !opts[:'max_size_bytes'].nil? && opts[:'max_size_bytes'] < 0
2715
+ fail ArgumentError, 'invalid value for "opts[:"max_size_bytes"]" when calling MailboxAPIApi.mailbox_search_message_snippets, must be greater than or equal to 0.'
2716
+ end
2717
+
2718
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
2719
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MailboxAPIApi.mailbox_search_message_snippets, must be smaller than or equal to 100.'
2720
+ end
2721
+
2722
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
2723
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MailboxAPIApi.mailbox_search_message_snippets, must be greater than or equal to 1.'
2724
+ end
2725
+
2726
+ # resource path
2727
+ local_var_path = '/mailbox/messages/search-snippets'
2728
+
2729
+ # query parameters
2730
+ query_params = opts[:query_params] || {}
2731
+ query_params[:'q'] = q
2732
+ query_params[:'folder_id'] = opts[:'folder_id'] if !opts[:'folder_id'].nil?
2733
+ query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
2734
+ query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil?
2735
+ query_params[:'cc'] = opts[:'cc'] if !opts[:'cc'].nil?
2736
+ query_params[:'bcc'] = opts[:'bcc'] if !opts[:'bcc'].nil?
2737
+ query_params[:'subject'] = opts[:'subject'] if !opts[:'subject'].nil?
2738
+ query_params[:'body'] = opts[:'body'] if !opts[:'body'].nil?
2739
+ query_params[:'header_name'] = opts[:'header_name'] if !opts[:'header_name'].nil?
2740
+ query_params[:'header_value'] = opts[:'header_value'] if !opts[:'header_value'].nil?
2741
+ query_params[:'min_size_bytes'] = opts[:'min_size_bytes'] if !opts[:'min_size_bytes'].nil?
2742
+ query_params[:'max_size_bytes'] = opts[:'max_size_bytes'] if !opts[:'max_size_bytes'].nil?
2743
+ query_params[:'keyword'] = opts[:'keyword'] if !opts[:'keyword'].nil?
2744
+ query_params[:'not_keyword'] = opts[:'not_keyword'] if !opts[:'not_keyword'].nil?
2745
+ query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
2746
+ query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
2747
+ query_params[:'has_attachment'] = opts[:'has_attachment'] if !opts[:'has_attachment'].nil?
2748
+ query_params[:'is_unread'] = opts[:'is_unread'] if !opts[:'is_unread'].nil?
2749
+ query_params[:'message_ids'] = opts[:'message_ids'] if !opts[:'message_ids'].nil?
2750
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
2751
+
2752
+ # header parameters
2753
+ header_params = opts[:header_params] || {}
2754
+ # HTTP header 'Accept' (if needed)
2755
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2756
+
2757
+ # form parameters
2758
+ form_params = opts[:form_params] || {}
2759
+
2760
+ # http body (model)
2761
+ post_body = opts[:debug_body]
2762
+
2763
+ # return_type
2764
+ return_type = opts[:debug_return_type] || 'MailboxSearchSnippetsResultResponse'
2765
+
2766
+ # auth_names
2767
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
2768
+
2769
+ new_options = opts.merge(
2770
+ :operation => :"MailboxAPIApi.mailbox_search_message_snippets",
2771
+ :header_params => header_params,
2772
+ :query_params => query_params,
2773
+ :form_params => form_params,
2774
+ :body => post_body,
2775
+ :auth_names => auth_names,
2776
+ :return_type => return_type
2777
+ )
2778
+
2779
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2780
+ if @api_client.config.debugging
2781
+ @api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_search_message_snippets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2782
+ end
2783
+ return data, status_code, headers
2784
+ end
2785
+
2786
+ # Send a mailbox message
2787
+ # Creates and queues a message from the authenticated mailbox. Supply an `Idempotency-Key` header to safely retry. Attachments may use small inline base64 content or blob IDs returned by `POST /mailbox/attachments:upload`.
2788
+ # @param [Hash] opts the optional parameters
2789
+ # @option opts [String] :idempotency_key
2790
+ # @option opts [SendMailboxMessageBody] :send_mailbox_message_body
2791
+ # @return [MailboxSendResultResponse]
2792
+ def mailbox_send_message(opts = {})
2793
+ data, _status_code, _headers = mailbox_send_message_with_http_info(opts)
2794
+ data
2795
+ end
2796
+
2797
+ # Send a mailbox message
2798
+ # Creates and queues a message from the authenticated mailbox. Supply an &#x60;Idempotency-Key&#x60; header to safely retry. Attachments may use small inline base64 content or blob IDs returned by &#x60;POST /mailbox/attachments:upload&#x60;.
2799
+ # @param [Hash] opts the optional parameters
2800
+ # @option opts [String] :idempotency_key
2801
+ # @option opts [SendMailboxMessageBody] :send_mailbox_message_body
2802
+ # @return [Array<(MailboxSendResultResponse, Integer, Hash)>] MailboxSendResultResponse data, response status code and response headers
2803
+ def mailbox_send_message_with_http_info(opts = {})
2804
+ if @api_client.config.debugging
2805
+ @api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_send_message ...'
2806
+ end
2807
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
2808
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling MailboxAPIApi.mailbox_send_message, the character length must be smaller than or equal to 255.'
2809
+ end
2810
+
2811
+ # resource path
2812
+ local_var_path = '/mailbox/messages/send'
2813
+
2814
+ # query parameters
2815
+ query_params = opts[:query_params] || {}
2816
+
2817
+ # header parameters
2818
+ header_params = opts[:header_params] || {}
2819
+ # HTTP header 'Accept' (if needed)
2820
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2821
+ # HTTP header 'Content-Type'
2822
+ content_type = @api_client.select_header_content_type(['application/json'])
2823
+ if !content_type.nil?
2824
+ header_params['Content-Type'] = content_type
2825
+ end
2826
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
2827
+
2828
+ # form parameters
2829
+ form_params = opts[:form_params] || {}
2830
+
2831
+ # http body (model)
2832
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'send_mailbox_message_body'])
2833
+
2834
+ # return_type
2835
+ return_type = opts[:debug_return_type] || 'MailboxSendResultResponse'
2836
+
2837
+ # auth_names
2838
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
2839
+
2840
+ new_options = opts.merge(
2841
+ :operation => :"MailboxAPIApi.mailbox_send_message",
2842
+ :header_params => header_params,
2843
+ :query_params => query_params,
2844
+ :form_params => form_params,
2845
+ :body => post_body,
2846
+ :auth_names => auth_names,
2847
+ :return_type => return_type
2848
+ )
2849
+
2850
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
2851
+ if @api_client.config.debugging
2852
+ @api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_send_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2853
+ end
2854
+ return data, status_code, headers
2855
+ end
2856
+
2857
+ # Stream mailbox events
2858
+ # Streams bounded rich mailbox events for connected clients. Each received-message event includes subject, participants, preview, attachment metadata, and a capped body snapshot; use the message endpoints for full content or attachment bytes.
2859
+ # @param [Hash] opts the optional parameters
2860
+ # @option opts [String] :event_types
2861
+ # @option opts [String] :last_event_id
2862
+ # @option opts [Integer] :ping
2863
+ # @option opts [Integer] :close_after
2864
+ # @option opts [String] :last_event_id2
2865
+ # @return [MailboxRealtimeEvent]
2866
+ def mailbox_stream_events(opts = {})
2867
+ data, _status_code, _headers = mailbox_stream_events_with_http_info(opts)
2868
+ data
2869
+ end
2870
+
2871
+ # Stream mailbox events
2872
+ # Streams bounded rich mailbox events for connected clients. Each received-message event includes subject, participants, preview, attachment metadata, and a capped body snapshot; use the message endpoints for full content or attachment bytes.
2873
+ # @param [Hash] opts the optional parameters
2874
+ # @option opts [String] :event_types
2875
+ # @option opts [String] :last_event_id
2876
+ # @option opts [Integer] :ping
2877
+ # @option opts [Integer] :close_after
2878
+ # @option opts [String] :last_event_id2
2879
+ # @return [Array<(MailboxRealtimeEvent, Integer, Hash)>] MailboxRealtimeEvent data, response status code and response headers
2880
+ def mailbox_stream_events_with_http_info(opts = {})
2881
+ if @api_client.config.debugging
2882
+ @api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_stream_events ...'
2883
+ end
2884
+ if @api_client.config.client_side_validation && !opts[:'ping'].nil? && opts[:'ping'] > 300
2885
+ fail ArgumentError, 'invalid value for "opts[:"ping"]" when calling MailboxAPIApi.mailbox_stream_events, must be smaller than or equal to 300.'
2886
+ end
2887
+
2888
+ if @api_client.config.client_side_validation && !opts[:'ping'].nil? && opts[:'ping'] < 10
2889
+ fail ArgumentError, 'invalid value for "opts[:"ping"]" when calling MailboxAPIApi.mailbox_stream_events, must be greater than or equal to 10.'
2890
+ end
2891
+
2892
+ if @api_client.config.client_side_validation && !opts[:'close_after'].nil? && opts[:'close_after'] > 3600
2893
+ fail ArgumentError, 'invalid value for "opts[:"close_after"]" when calling MailboxAPIApi.mailbox_stream_events, must be smaller than or equal to 3600.'
2894
+ end
2895
+
2896
+ if @api_client.config.client_side_validation && !opts[:'close_after'].nil? && opts[:'close_after'] < 30
2897
+ fail ArgumentError, 'invalid value for "opts[:"close_after"]" when calling MailboxAPIApi.mailbox_stream_events, must be greater than or equal to 30.'
2898
+ end
2899
+
2900
+ # resource path
2901
+ local_var_path = '/mailbox/events'
2902
+
2903
+ # query parameters
2904
+ query_params = opts[:query_params] || {}
2905
+ query_params[:'event_types'] = opts[:'event_types'] if !opts[:'event_types'].nil?
2906
+ query_params[:'last_event_id'] = opts[:'last_event_id'] if !opts[:'last_event_id'].nil?
2907
+ query_params[:'ping'] = opts[:'ping'] if !opts[:'ping'].nil?
2908
+ query_params[:'close_after'] = opts[:'close_after'] if !opts[:'close_after'].nil?
2909
+
2910
+ # header parameters
2911
+ header_params = opts[:header_params] || {}
2912
+ # HTTP header 'Accept' (if needed)
2913
+ header_params['Accept'] = @api_client.select_header_accept(['text/event-stream', 'application/json']) unless header_params['Accept']
2914
+ header_params[:'Last-Event-ID'] = opts[:'last_event_id2'] if !opts[:'last_event_id2'].nil?
2915
+
2916
+ # form parameters
2917
+ form_params = opts[:form_params] || {}
2918
+
2919
+ # http body (model)
2920
+ post_body = opts[:debug_body]
2921
+
2922
+ # return_type
2923
+ return_type = opts[:debug_return_type] || 'MailboxRealtimeEvent'
2924
+
2925
+ # auth_names
2926
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
2927
+
2928
+ new_options = opts.merge(
2929
+ :operation => :"MailboxAPIApi.mailbox_stream_events",
2930
+ :header_params => header_params,
2931
+ :query_params => query_params,
2932
+ :form_params => form_params,
2933
+ :body => post_body,
2934
+ :auth_names => auth_names,
2935
+ :return_type => return_type
2936
+ )
2937
+
2938
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2939
+ if @api_client.config.debugging
2940
+ @api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_stream_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2941
+ end
2942
+ return data, status_code, headers
2943
+ end
2944
+
2945
+ # Update a mailbox folder
2946
+ # Updates a folder with state-safe conflict handling. Send `If-Match` with a prior ETag to reject stale edits.
2947
+ # @param folder_id [String]
2948
+ # @param [Hash] opts the optional parameters
2949
+ # @option opts [String] :if_match
2950
+ # @option opts [PatchMailboxFolderBody] :patch_mailbox_folder_body
2951
+ # @return [MailboxFolderResponse]
2952
+ def mailbox_update_folder(folder_id, opts = {})
2953
+ data, _status_code, _headers = mailbox_update_folder_with_http_info(folder_id, opts)
2954
+ data
2955
+ end
2956
+
2957
+ # Update a mailbox folder
2958
+ # Updates a folder with state-safe conflict handling. Send &#x60;If-Match&#x60; with a prior ETag to reject stale edits.
2959
+ # @param folder_id [String]
2960
+ # @param [Hash] opts the optional parameters
2961
+ # @option opts [String] :if_match
2962
+ # @option opts [PatchMailboxFolderBody] :patch_mailbox_folder_body
2963
+ # @return [Array<(MailboxFolderResponse, Integer, Hash)>] MailboxFolderResponse data, response status code and response headers
2964
+ def mailbox_update_folder_with_http_info(folder_id, opts = {})
2965
+ if @api_client.config.debugging
2966
+ @api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_update_folder ...'
2967
+ end
2968
+ # verify the required parameter 'folder_id' is set
2969
+ if @api_client.config.client_side_validation && folder_id.nil?
2970
+ fail ArgumentError, "Missing the required parameter 'folder_id' when calling MailboxAPIApi.mailbox_update_folder"
2971
+ end
2972
+ # resource path
2973
+ local_var_path = '/mailbox/folders/{folder_id}'.sub('{folder_id}', CGI.escape(folder_id.to_s))
2974
+
2975
+ # query parameters
2976
+ query_params = opts[:query_params] || {}
2977
+
2978
+ # header parameters
2979
+ header_params = opts[:header_params] || {}
2980
+ # HTTP header 'Accept' (if needed)
2981
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2982
+ # HTTP header 'Content-Type'
2983
+ content_type = @api_client.select_header_content_type(['application/json'])
2984
+ if !content_type.nil?
2985
+ header_params['Content-Type'] = content_type
2986
+ end
2987
+ header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?
2988
+
2989
+ # form parameters
2990
+ form_params = opts[:form_params] || {}
2991
+
2992
+ # http body (model)
2993
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'patch_mailbox_folder_body'])
2994
+
2995
+ # return_type
2996
+ return_type = opts[:debug_return_type] || 'MailboxFolderResponse'
2997
+
2998
+ # auth_names
2999
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
3000
+
3001
+ new_options = opts.merge(
3002
+ :operation => :"MailboxAPIApi.mailbox_update_folder",
3003
+ :header_params => header_params,
3004
+ :query_params => query_params,
3005
+ :form_params => form_params,
3006
+ :body => post_body,
3007
+ :auth_names => auth_names,
3008
+ :return_type => return_type
3009
+ )
3010
+
3011
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
3012
+ if @api_client.config.debugging
3013
+ @api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_update_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3014
+ end
3015
+ return data, status_code, headers
3016
+ end
3017
+
3018
+ # Update mailbox sender identity
3019
+ # Updates the default sender name, plain text signature, and HTML signature for the authenticated mailbox.
3020
+ # @param [Hash] opts the optional parameters
3021
+ # @option opts [UpdateMailboxIdentityBody] :update_mailbox_identity_body
3022
+ # @return [MailboxIdentityResponse]
3023
+ def mailbox_update_identity(opts = {})
3024
+ data, _status_code, _headers = mailbox_update_identity_with_http_info(opts)
3025
+ data
3026
+ end
3027
+
3028
+ # Update mailbox sender identity
3029
+ # Updates the default sender name, plain text signature, and HTML signature for the authenticated mailbox.
3030
+ # @param [Hash] opts the optional parameters
3031
+ # @option opts [UpdateMailboxIdentityBody] :update_mailbox_identity_body
3032
+ # @return [Array<(MailboxIdentityResponse, Integer, Hash)>] MailboxIdentityResponse data, response status code and response headers
3033
+ def mailbox_update_identity_with_http_info(opts = {})
3034
+ if @api_client.config.debugging
3035
+ @api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_update_identity ...'
3036
+ end
3037
+ # resource path
3038
+ local_var_path = '/mailbox/identity'
3039
+
3040
+ # query parameters
3041
+ query_params = opts[:query_params] || {}
3042
+
3043
+ # header parameters
3044
+ header_params = opts[:header_params] || {}
3045
+ # HTTP header 'Accept' (if needed)
3046
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
3047
+ # HTTP header 'Content-Type'
3048
+ content_type = @api_client.select_header_content_type(['application/json'])
3049
+ if !content_type.nil?
3050
+ header_params['Content-Type'] = content_type
3051
+ end
3052
+
3053
+ # form parameters
3054
+ form_params = opts[:form_params] || {}
3055
+
3056
+ # http body (model)
3057
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'update_mailbox_identity_body'])
3058
+
3059
+ # return_type
3060
+ return_type = opts[:debug_return_type] || 'MailboxIdentityResponse'
3061
+
3062
+ # auth_names
3063
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
3064
+
3065
+ new_options = opts.merge(
3066
+ :operation => :"MailboxAPIApi.mailbox_update_identity",
3067
+ :header_params => header_params,
3068
+ :query_params => query_params,
3069
+ :form_params => form_params,
3070
+ :body => post_body,
3071
+ :auth_names => auth_names,
3072
+ :return_type => return_type
3073
+ )
3074
+
3075
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
3076
+ if @api_client.config.debugging
3077
+ @api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_update_identity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3078
+ end
3079
+ return data, status_code, headers
3080
+ end
3081
+
3082
+ # Update mailbox message flags
3083
+ # Updates mutable message flags and keywords with state-safe conflict handling. Send `If-Match` with a prior ETag to reject stale edits.
3084
+ # @param message_id [String]
3085
+ # @param [Hash] opts the optional parameters
3086
+ # @option opts [String] :if_match
3087
+ # @option opts [PatchMailboxMessageBody] :patch_mailbox_message_body
3088
+ # @return [MailboxMessageDetailResponse]
3089
+ def mailbox_update_message(message_id, opts = {})
3090
+ data, _status_code, _headers = mailbox_update_message_with_http_info(message_id, opts)
3091
+ data
3092
+ end
3093
+
3094
+ # Update mailbox message flags
3095
+ # Updates mutable message flags and keywords with state-safe conflict handling. Send &#x60;If-Match&#x60; with a prior ETag to reject stale edits.
3096
+ # @param message_id [String]
3097
+ # @param [Hash] opts the optional parameters
3098
+ # @option opts [String] :if_match
3099
+ # @option opts [PatchMailboxMessageBody] :patch_mailbox_message_body
3100
+ # @return [Array<(MailboxMessageDetailResponse, Integer, Hash)>] MailboxMessageDetailResponse data, response status code and response headers
3101
+ def mailbox_update_message_with_http_info(message_id, opts = {})
3102
+ if @api_client.config.debugging
3103
+ @api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_update_message ...'
3104
+ end
3105
+ # verify the required parameter 'message_id' is set
3106
+ if @api_client.config.client_side_validation && message_id.nil?
3107
+ fail ArgumentError, "Missing the required parameter 'message_id' when calling MailboxAPIApi.mailbox_update_message"
3108
+ end
3109
+ # resource path
3110
+ local_var_path = '/mailbox/messages/{message_id}'.sub('{message_id}', CGI.escape(message_id.to_s))
3111
+
3112
+ # query parameters
3113
+ query_params = opts[:query_params] || {}
3114
+
3115
+ # header parameters
3116
+ header_params = opts[:header_params] || {}
3117
+ # HTTP header 'Accept' (if needed)
3118
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
3119
+ # HTTP header 'Content-Type'
3120
+ content_type = @api_client.select_header_content_type(['application/json'])
3121
+ if !content_type.nil?
3122
+ header_params['Content-Type'] = content_type
3123
+ end
3124
+ header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?
3125
+
3126
+ # form parameters
3127
+ form_params = opts[:form_params] || {}
3128
+
3129
+ # http body (model)
3130
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'patch_mailbox_message_body'])
3131
+
3132
+ # return_type
3133
+ return_type = opts[:debug_return_type] || 'MailboxMessageDetailResponse'
3134
+
3135
+ # auth_names
3136
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
3137
+
3138
+ new_options = opts.merge(
3139
+ :operation => :"MailboxAPIApi.mailbox_update_message",
3140
+ :header_params => header_params,
3141
+ :query_params => query_params,
3142
+ :form_params => form_params,
3143
+ :body => post_body,
3144
+ :auth_names => auth_names,
3145
+ :return_type => return_type
3146
+ )
3147
+
3148
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
3149
+ if @api_client.config.debugging
3150
+ @api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_update_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3151
+ end
3152
+ return data, status_code, headers
3153
+ end
3154
+
3155
+ # Upload a mailbox attachment
3156
+ # Uploads one attachment as binary data and returns a blob ID that can be supplied to `POST /mailbox/messages/send`.
3157
+ # @param filename [String]
3158
+ # @param [Hash] opts the optional parameters
3159
+ # @option opts [File] :body
3160
+ # @return [MailboxAttachmentUploadResultResponse]
3161
+ def mailbox_upload_attachment(filename, opts = {})
3162
+ data, _status_code, _headers = mailbox_upload_attachment_with_http_info(filename, opts)
3163
+ data
3164
+ end
3165
+
3166
+ # Upload a mailbox attachment
3167
+ # Uploads one attachment as binary data and returns a blob ID that can be supplied to &#x60;POST /mailbox/messages/send&#x60;.
3168
+ # @param filename [String]
3169
+ # @param [Hash] opts the optional parameters
3170
+ # @option opts [File] :body
3171
+ # @return [Array<(MailboxAttachmentUploadResultResponse, Integer, Hash)>] MailboxAttachmentUploadResultResponse data, response status code and response headers
3172
+ def mailbox_upload_attachment_with_http_info(filename, opts = {})
3173
+ if @api_client.config.debugging
3174
+ @api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_upload_attachment ...'
3175
+ end
3176
+ # verify the required parameter 'filename' is set
3177
+ if @api_client.config.client_side_validation && filename.nil?
3178
+ fail ArgumentError, "Missing the required parameter 'filename' when calling MailboxAPIApi.mailbox_upload_attachment"
3179
+ end
3180
+ # resource path
3181
+ local_var_path = '/mailbox/attachments:upload'
3182
+
3183
+ # query parameters
3184
+ query_params = opts[:query_params] || {}
3185
+ query_params[:'filename'] = filename
3186
+
3187
+ # header parameters
3188
+ header_params = opts[:header_params] || {}
3189
+ # HTTP header 'Accept' (if needed)
3190
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
3191
+ # HTTP header 'Content-Type'
3192
+ content_type = @api_client.select_header_content_type(['application/octet-stream'])
3193
+ if !content_type.nil?
3194
+ header_params['Content-Type'] = content_type
3195
+ end
3196
+
3197
+ # form parameters
3198
+ form_params = opts[:form_params] || {}
3199
+
3200
+ # http body (model)
3201
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
3202
+
3203
+ # return_type
3204
+ return_type = opts[:debug_return_type] || 'MailboxAttachmentUploadResultResponse'
3205
+
3206
+ # auth_names
3207
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
3208
+
3209
+ new_options = opts.merge(
3210
+ :operation => :"MailboxAPIApi.mailbox_upload_attachment",
3211
+ :header_params => header_params,
3212
+ :query_params => query_params,
3213
+ :form_params => form_params,
3214
+ :body => post_body,
3215
+ :auth_names => auth_names,
3216
+ :return_type => return_type
3217
+ )
3218
+
3219
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
3220
+ if @api_client.config.debugging
3221
+ @api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_upload_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3222
+ end
3223
+ return data, status_code, headers
3224
+ end
3225
+ end
3226
+ end