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