mailslurp_client 8.0.9 → 8.0.14

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 (90) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +7 -0
  3. data/README.md +123 -0
  4. data/SECURITY.md +4 -0
  5. data/SUPPORT.md +4 -0
  6. data/lib/mailslurp_client/api/alias_controller_api.rb +405 -0
  7. data/lib/mailslurp_client/api/attachment_controller_api.rb +160 -0
  8. data/lib/mailslurp_client/api/bulk_actions_controller_api.rb +203 -0
  9. data/lib/mailslurp_client/api/common_actions_controller_api.rb +257 -0
  10. data/lib/mailslurp_client/api/contact_controller_api.rb +323 -0
  11. data/lib/mailslurp_client/api/domain_controller_api.rb +264 -0
  12. data/lib/mailslurp_client/api/email_controller_api.rb +852 -0
  13. data/lib/mailslurp_client/api/form_controller_api.rb +104 -0
  14. data/lib/mailslurp_client/api/group_controller_api.rb +592 -0
  15. data/lib/mailslurp_client/api/inbox_controller_api.rb +897 -0
  16. data/lib/mailslurp_client/api/mail_server_controller_api.rb +146 -0
  17. data/lib/mailslurp_client/api/sent_emails_controller_api.rb +152 -0
  18. data/lib/mailslurp_client/api/template_controller_api.rb +323 -0
  19. data/lib/mailslurp_client/api/wait_for_controller_api.rb +359 -0
  20. data/lib/mailslurp_client/api/webhook_controller_api.rb +405 -0
  21. data/lib/mailslurp_client/api_client.rb +388 -0
  22. data/lib/mailslurp_client/api_error.rb +57 -0
  23. data/lib/mailslurp_client/configuration.rb +248 -0
  24. data/lib/mailslurp_client/models/attachment_meta_data.rb +238 -0
  25. data/lib/mailslurp_client/models/basic_auth_options.rb +226 -0
  26. data/lib/mailslurp_client/models/bulk_send_email_options.rb +219 -0
  27. data/lib/mailslurp_client/models/contact_dto.rb +311 -0
  28. data/lib/mailslurp_client/models/contact_projection.rb +270 -0
  29. data/lib/mailslurp_client/models/create_anonymous_alias_options.rb +208 -0
  30. data/lib/mailslurp_client/models/create_contact_options.rb +277 -0
  31. data/lib/mailslurp_client/models/create_domain_options.rb +208 -0
  32. data/lib/mailslurp_client/models/create_group_options.rb +220 -0
  33. data/lib/mailslurp_client/models/create_owned_alias_options.rb +238 -0
  34. data/lib/mailslurp_client/models/create_template_options.rb +225 -0
  35. data/lib/mailslurp_client/models/create_webhook_options.rb +227 -0
  36. data/lib/mailslurp_client/models/describe_domain_options.rb +211 -0
  37. data/lib/mailslurp_client/models/describe_mail_server_domain_result.rb +237 -0
  38. data/lib/mailslurp_client/models/domain_dto.rb +296 -0
  39. data/lib/mailslurp_client/models/domain_preview.rb +240 -0
  40. data/lib/mailslurp_client/models/email.rb +386 -0
  41. data/lib/mailslurp_client/models/email_analysis.rb +248 -0
  42. data/lib/mailslurp_client/models/email_preview.rb +296 -0
  43. data/lib/mailslurp_client/models/email_projection.rb +325 -0
  44. data/lib/mailslurp_client/models/email_verification_result.rb +263 -0
  45. data/lib/mailslurp_client/models/forward_email_options.rb +244 -0
  46. data/lib/mailslurp_client/models/group_contacts_dto.rb +227 -0
  47. data/lib/mailslurp_client/models/group_dto.rb +248 -0
  48. data/lib/mailslurp_client/models/group_projection.rb +248 -0
  49. data/lib/mailslurp_client/models/html_validation_result.rb +244 -0
  50. data/lib/mailslurp_client/models/inbox.rb +290 -0
  51. data/lib/mailslurp_client/models/inbox_projection.rb +263 -0
  52. data/lib/mailslurp_client/models/match_option.rb +274 -0
  53. data/lib/mailslurp_client/models/match_options.rb +210 -0
  54. data/lib/mailslurp_client/models/model_alias.rb +284 -0
  55. data/lib/mailslurp_client/models/name_server_record.rb +254 -0
  56. data/lib/mailslurp_client/models/page_alias.rb +298 -0
  57. data/lib/mailslurp_client/models/page_contact_projection.rb +298 -0
  58. data/lib/mailslurp_client/models/page_email_preview.rb +298 -0
  59. data/lib/mailslurp_client/models/page_email_projection.rb +298 -0
  60. data/lib/mailslurp_client/models/page_group_projection.rb +298 -0
  61. data/lib/mailslurp_client/models/page_inbox_projection.rb +298 -0
  62. data/lib/mailslurp_client/models/page_sent_email_projection.rb +298 -0
  63. data/lib/mailslurp_client/models/page_template_projection.rb +298 -0
  64. data/lib/mailslurp_client/models/page_webhook_projection.rb +298 -0
  65. data/lib/mailslurp_client/models/pageable.rb +251 -0
  66. data/lib/mailslurp_client/models/raw_email_json.rb +211 -0
  67. data/lib/mailslurp_client/models/send_email_options.rb +392 -0
  68. data/lib/mailslurp_client/models/sent_email_dto.rb +351 -0
  69. data/lib/mailslurp_client/models/sent_email_projection.rb +344 -0
  70. data/lib/mailslurp_client/models/set_inbox_favourited_options.rb +208 -0
  71. data/lib/mailslurp_client/models/simple_send_email_options.rb +237 -0
  72. data/lib/mailslurp_client/models/sort.rb +224 -0
  73. data/lib/mailslurp_client/models/template_dto.rb +269 -0
  74. data/lib/mailslurp_client/models/template_projection.rb +269 -0
  75. data/lib/mailslurp_client/models/template_variable.rb +259 -0
  76. data/lib/mailslurp_client/models/unread_count.rb +211 -0
  77. data/lib/mailslurp_client/models/update_group_contacts.rb +213 -0
  78. data/lib/mailslurp_client/models/update_inbox_options.rb +250 -0
  79. data/lib/mailslurp_client/models/upload_attachment_options.rb +228 -0
  80. data/lib/mailslurp_client/models/validation_dto.rb +217 -0
  81. data/lib/mailslurp_client/models/validation_message.rb +220 -0
  82. data/lib/mailslurp_client/models/verify_email_address_options.rb +239 -0
  83. data/lib/mailslurp_client/models/wait_for_conditions.rb +316 -0
  84. data/lib/mailslurp_client/models/webhook_dto.rb +326 -0
  85. data/lib/mailslurp_client/models/webhook_projection.rb +277 -0
  86. data/lib/mailslurp_client/models/webhook_test_request.rb +284 -0
  87. data/lib/mailslurp_client/models/webhook_test_response.rb +215 -0
  88. data/lib/mailslurp_client/models/webhook_test_result.rb +235 -0
  89. data/lib/mailslurp_client/version.rb +15 -0
  90. metadata +90 -2
@@ -0,0 +1,897 @@
1
+ =begin
2
+ #MailSlurp API
3
+
4
+ #MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository
5
+
6
+ The version of the OpenAPI document: 6.5.2
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module MailSlurpClient
16
+ class InboxControllerApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Create an Inbox (email address)
23
+ # Create a new inbox and with a randomized email address to send and receive from. Pass emailAddress parameter if you wish to use a specific email address. Creating an inbox is required before sending or receiving emails. If writing tests it is recommended that you create a new inbox during each test method so that it is unique and empty.
24
+ # @param [Hash] opts the optional parameters
25
+ # @option opts [String] :description Optional description for an inbox.
26
+ # @option opts [String] :email_address Optional email address including domain you wish inbox to use (eg: test123@mydomain.com). Only supports domains that you have registered and verified with MailSlurp using dashboard or `createDomain` method.
27
+ # @option opts [DateTime] :expires_at Optional expires at timestamp. If your plan supports this feature you can specify when an inbox should expire. If left empty inbox will exist permanently or expire when your plan dictates
28
+ # @option opts [Boolean] :favourite Is inbox favourited.
29
+ # @option opts [String] :name Optional name for an inbox.
30
+ # @option opts [Array<String>] :tags Optional tags for an inbox. Can be used for searching and filtering inboxes.
31
+ # @return [Inbox]
32
+ def create_inbox(opts = {})
33
+ data, _status_code, _headers = create_inbox_with_http_info(opts)
34
+ data
35
+ end
36
+
37
+ # Create an Inbox (email address)
38
+ # Create a new inbox and with a randomized email address to send and receive from. Pass emailAddress parameter if you wish to use a specific email address. Creating an inbox is required before sending or receiving emails. If writing tests it is recommended that you create a new inbox during each test method so that it is unique and empty.
39
+ # @param [Hash] opts the optional parameters
40
+ # @option opts [String] :description Optional description for an inbox.
41
+ # @option opts [String] :email_address Optional email address including domain you wish inbox to use (eg: test123@mydomain.com). Only supports domains that you have registered and verified with MailSlurp using dashboard or &#x60;createDomain&#x60; method.
42
+ # @option opts [DateTime] :expires_at Optional expires at timestamp. If your plan supports this feature you can specify when an inbox should expire. If left empty inbox will exist permanently or expire when your plan dictates
43
+ # @option opts [Boolean] :favourite Is inbox favourited.
44
+ # @option opts [String] :name Optional name for an inbox.
45
+ # @option opts [Array<String>] :tags Optional tags for an inbox. Can be used for searching and filtering inboxes.
46
+ # @return [Array<(Inbox, Integer, Hash)>] Inbox data, response status code and response headers
47
+ def create_inbox_with_http_info(opts = {})
48
+ if @api_client.config.debugging
49
+ @api_client.config.logger.debug 'Calling API: InboxControllerApi.create_inbox ...'
50
+ end
51
+ # resource path
52
+ local_var_path = '/inboxes'
53
+
54
+ # query parameters
55
+ query_params = opts[:query_params] || {}
56
+ query_params[:'description'] = opts[:'description'] if !opts[:'description'].nil?
57
+ query_params[:'emailAddress'] = opts[:'email_address'] if !opts[:'email_address'].nil?
58
+ query_params[:'expiresAt'] = opts[:'expires_at'] if !opts[:'expires_at'].nil?
59
+ query_params[:'favourite'] = opts[:'favourite'] if !opts[:'favourite'].nil?
60
+ query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
61
+ query_params[:'tags'] = @api_client.build_collection_param(opts[:'tags'], :multi) if !opts[:'tags'].nil?
62
+
63
+ # header parameters
64
+ header_params = opts[:header_params] || {}
65
+ # HTTP header 'Accept' (if needed)
66
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
67
+
68
+ # form parameters
69
+ form_params = opts[:form_params] || {}
70
+
71
+ # http body (model)
72
+ post_body = opts[:body]
73
+
74
+ # return_type
75
+ return_type = opts[:return_type] || 'Inbox'
76
+
77
+ # auth_names
78
+ auth_names = opts[:auth_names] || ['API_KEY']
79
+
80
+ new_options = opts.merge(
81
+ :header_params => header_params,
82
+ :query_params => query_params,
83
+ :form_params => form_params,
84
+ :body => post_body,
85
+ :auth_names => auth_names,
86
+ :return_type => return_type
87
+ )
88
+
89
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
90
+ if @api_client.config.debugging
91
+ @api_client.config.logger.debug "API called: InboxControllerApi#create_inbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
92
+ end
93
+ return data, status_code, headers
94
+ end
95
+
96
+ # Delete all inboxes
97
+ # Permanently delete all inboxes and associated email addresses. This will also delete all emails within the inboxes. Be careful as inboxes cannot be recovered once deleted. Note: deleting inboxes will not impact your usage limits. Monthly inbox creation limits are based on how many inboxes were created in the last 30 days, not how many inboxes you currently have.
98
+ # @param [Hash] opts the optional parameters
99
+ # @return [nil]
100
+ def delete_all_inboxes(opts = {})
101
+ delete_all_inboxes_with_http_info(opts)
102
+ nil
103
+ end
104
+
105
+ # Delete all inboxes
106
+ # Permanently delete all inboxes and associated email addresses. This will also delete all emails within the inboxes. Be careful as inboxes cannot be recovered once deleted. Note: deleting inboxes will not impact your usage limits. Monthly inbox creation limits are based on how many inboxes were created in the last 30 days, not how many inboxes you currently have.
107
+ # @param [Hash] opts the optional parameters
108
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
109
+ def delete_all_inboxes_with_http_info(opts = {})
110
+ if @api_client.config.debugging
111
+ @api_client.config.logger.debug 'Calling API: InboxControllerApi.delete_all_inboxes ...'
112
+ end
113
+ # resource path
114
+ local_var_path = '/inboxes'
115
+
116
+ # query parameters
117
+ query_params = opts[:query_params] || {}
118
+
119
+ # header parameters
120
+ header_params = opts[:header_params] || {}
121
+
122
+ # form parameters
123
+ form_params = opts[:form_params] || {}
124
+
125
+ # http body (model)
126
+ post_body = opts[:body]
127
+
128
+ # return_type
129
+ return_type = opts[:return_type]
130
+
131
+ # auth_names
132
+ auth_names = opts[:auth_names] || ['API_KEY']
133
+
134
+ new_options = opts.merge(
135
+ :header_params => header_params,
136
+ :query_params => query_params,
137
+ :form_params => form_params,
138
+ :body => post_body,
139
+ :auth_names => auth_names,
140
+ :return_type => return_type
141
+ )
142
+
143
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
144
+ if @api_client.config.debugging
145
+ @api_client.config.logger.debug "API called: InboxControllerApi#delete_all_inboxes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
146
+ end
147
+ return data, status_code, headers
148
+ end
149
+
150
+ # Delete inbox
151
+ # Permanently delete an inbox and associated email address aswell as all emails within the given inbox. This action cannot be undone. Note: deleting an inbox will not affect your account usage. Monthly inbox usage is based on how many inboxes you create within 30 days, not how many exist at time of request.
152
+ # @param inbox_id [String] inboxId
153
+ # @param [Hash] opts the optional parameters
154
+ # @return [nil]
155
+ def delete_inbox(inbox_id, opts = {})
156
+ delete_inbox_with_http_info(inbox_id, opts)
157
+ nil
158
+ end
159
+
160
+ # Delete inbox
161
+ # Permanently delete an inbox and associated email address aswell as all emails within the given inbox. This action cannot be undone. Note: deleting an inbox will not affect your account usage. Monthly inbox usage is based on how many inboxes you create within 30 days, not how many exist at time of request.
162
+ # @param inbox_id [String] inboxId
163
+ # @param [Hash] opts the optional parameters
164
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
165
+ def delete_inbox_with_http_info(inbox_id, opts = {})
166
+ if @api_client.config.debugging
167
+ @api_client.config.logger.debug 'Calling API: InboxControllerApi.delete_inbox ...'
168
+ end
169
+ # verify the required parameter 'inbox_id' is set
170
+ if @api_client.config.client_side_validation && inbox_id.nil?
171
+ fail ArgumentError, "Missing the required parameter 'inbox_id' when calling InboxControllerApi.delete_inbox"
172
+ end
173
+ # resource path
174
+ local_var_path = '/inboxes/{inboxId}'.sub('{' + 'inboxId' + '}', CGI.escape(inbox_id.to_s))
175
+
176
+ # query parameters
177
+ query_params = opts[:query_params] || {}
178
+
179
+ # header parameters
180
+ header_params = opts[:header_params] || {}
181
+
182
+ # form parameters
183
+ form_params = opts[:form_params] || {}
184
+
185
+ # http body (model)
186
+ post_body = opts[:body]
187
+
188
+ # return_type
189
+ return_type = opts[:return_type]
190
+
191
+ # auth_names
192
+ auth_names = opts[:auth_names] || ['API_KEY']
193
+
194
+ new_options = opts.merge(
195
+ :header_params => header_params,
196
+ :query_params => query_params,
197
+ :form_params => form_params,
198
+ :body => post_body,
199
+ :auth_names => auth_names,
200
+ :return_type => return_type
201
+ )
202
+
203
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
204
+ if @api_client.config.debugging
205
+ @api_client.config.logger.debug "API called: InboxControllerApi#delete_inbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
206
+ end
207
+ return data, status_code, headers
208
+ end
209
+
210
+ # List Inboxes Paginated
211
+ # List inboxes in paginated form. Allows for page index, page size, and sort direction. Can also filter by favourited or email address like pattern.
212
+ # @param [Hash] opts the optional parameters
213
+ # @option opts [Boolean] :favourite Optionally filter results for favourites only (default to false)
214
+ # @option opts [Integer] :page Optional page index in inbox list pagination (default to 0)
215
+ # @option opts [String] :search Optionally filter by search words partial matching ID, tags, name, and email address
216
+ # @option opts [Integer] :size Optional page size in inbox list pagination (default to 20)
217
+ # @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC')
218
+ # @option opts [String] :tag Optionally filter by tags
219
+ # @return [PageInboxProjection]
220
+ def get_all_inboxes(opts = {})
221
+ data, _status_code, _headers = get_all_inboxes_with_http_info(opts)
222
+ data
223
+ end
224
+
225
+ # List Inboxes Paginated
226
+ # List inboxes in paginated form. Allows for page index, page size, and sort direction. Can also filter by favourited or email address like pattern.
227
+ # @param [Hash] opts the optional parameters
228
+ # @option opts [Boolean] :favourite Optionally filter results for favourites only
229
+ # @option opts [Integer] :page Optional page index in inbox list pagination
230
+ # @option opts [String] :search Optionally filter by search words partial matching ID, tags, name, and email address
231
+ # @option opts [Integer] :size Optional page size in inbox list pagination
232
+ # @option opts [String] :sort Optional createdAt sort direction ASC or DESC
233
+ # @option opts [String] :tag Optionally filter by tags
234
+ # @return [Array<(PageInboxProjection, Integer, Hash)>] PageInboxProjection data, response status code and response headers
235
+ def get_all_inboxes_with_http_info(opts = {})
236
+ if @api_client.config.debugging
237
+ @api_client.config.logger.debug 'Calling API: InboxControllerApi.get_all_inboxes ...'
238
+ end
239
+ allowable_values = ["ASC", "DESC"]
240
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
241
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
242
+ end
243
+ # resource path
244
+ local_var_path = '/inboxes/paginated'
245
+
246
+ # query parameters
247
+ query_params = opts[:query_params] || {}
248
+ query_params[:'favourite'] = opts[:'favourite'] if !opts[:'favourite'].nil?
249
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
250
+ query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
251
+ query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
252
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
253
+ query_params[:'tag'] = opts[:'tag'] if !opts[:'tag'].nil?
254
+
255
+ # header parameters
256
+ header_params = opts[:header_params] || {}
257
+ # HTTP header 'Accept' (if needed)
258
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
259
+
260
+ # form parameters
261
+ form_params = opts[:form_params] || {}
262
+
263
+ # http body (model)
264
+ post_body = opts[:body]
265
+
266
+ # return_type
267
+ return_type = opts[:return_type] || 'PageInboxProjection'
268
+
269
+ # auth_names
270
+ auth_names = opts[:auth_names] || ['API_KEY']
271
+
272
+ new_options = opts.merge(
273
+ :header_params => header_params,
274
+ :query_params => query_params,
275
+ :form_params => form_params,
276
+ :body => post_body,
277
+ :auth_names => auth_names,
278
+ :return_type => return_type
279
+ )
280
+
281
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
282
+ if @api_client.config.debugging
283
+ @api_client.config.logger.debug "API called: InboxControllerApi#get_all_inboxes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
284
+ end
285
+ return data, status_code, headers
286
+ end
287
+
288
+ # Get emails in an Inbox
289
+ # List emails that an inbox has received. Only emails that are sent to the inbox's email address will appear in the inbox. It may take several seconds for any email you send to an inbox's email address to appear in the inbox. To make this endpoint wait for a minimum number of emails use the `minCount` parameter. The server will retry the inbox database until the `minCount` is satisfied or the `retryTimeout` is reached
290
+ # @param inbox_id [String] Id of inbox that emails belongs to
291
+ # @param [Hash] opts the optional parameters
292
+ # @option opts [Integer] :limit Limit the result set, ordered by received date time sort direction
293
+ # @option opts [Integer] :min_count Minimum acceptable email count. Will cause request to hang (and retry) until minCount is satisfied or retryTimeout is reached.
294
+ # @option opts [Integer] :retry_timeout Maximum milliseconds to spend retrying inbox database until minCount emails are returned
295
+ # @option opts [DateTime] :since Exclude emails received before this ISO 8601 date time
296
+ # @option opts [String] :sort Sort the results by received date and direction ASC or DESC
297
+ # @return [Array<EmailPreview>]
298
+ def get_emails(inbox_id, opts = {})
299
+ data, _status_code, _headers = get_emails_with_http_info(inbox_id, opts)
300
+ data
301
+ end
302
+
303
+ # Get emails in an Inbox
304
+ # List emails that an inbox has received. Only emails that are sent to the inbox&#39;s email address will appear in the inbox. It may take several seconds for any email you send to an inbox&#39;s email address to appear in the inbox. To make this endpoint wait for a minimum number of emails use the &#x60;minCount&#x60; parameter. The server will retry the inbox database until the &#x60;minCount&#x60; is satisfied or the &#x60;retryTimeout&#x60; is reached
305
+ # @param inbox_id [String] Id of inbox that emails belongs to
306
+ # @param [Hash] opts the optional parameters
307
+ # @option opts [Integer] :limit Limit the result set, ordered by received date time sort direction
308
+ # @option opts [Integer] :min_count Minimum acceptable email count. Will cause request to hang (and retry) until minCount is satisfied or retryTimeout is reached.
309
+ # @option opts [Integer] :retry_timeout Maximum milliseconds to spend retrying inbox database until minCount emails are returned
310
+ # @option opts [DateTime] :since Exclude emails received before this ISO 8601 date time
311
+ # @option opts [String] :sort Sort the results by received date and direction ASC or DESC
312
+ # @return [Array<(Array<EmailPreview>, Integer, Hash)>] Array<EmailPreview> data, response status code and response headers
313
+ def get_emails_with_http_info(inbox_id, opts = {})
314
+ if @api_client.config.debugging
315
+ @api_client.config.logger.debug 'Calling API: InboxControllerApi.get_emails ...'
316
+ end
317
+ # verify the required parameter 'inbox_id' is set
318
+ if @api_client.config.client_side_validation && inbox_id.nil?
319
+ fail ArgumentError, "Missing the required parameter 'inbox_id' when calling InboxControllerApi.get_emails"
320
+ end
321
+ allowable_values = ["ASC", "DESC"]
322
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
323
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
324
+ end
325
+ # resource path
326
+ local_var_path = '/inboxes/{inboxId}/emails'.sub('{' + 'inboxId' + '}', CGI.escape(inbox_id.to_s))
327
+
328
+ # query parameters
329
+ query_params = opts[:query_params] || {}
330
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
331
+ query_params[:'minCount'] = opts[:'min_count'] if !opts[:'min_count'].nil?
332
+ query_params[:'retryTimeout'] = opts[:'retry_timeout'] if !opts[:'retry_timeout'].nil?
333
+ query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
334
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
335
+
336
+ # header parameters
337
+ header_params = opts[:header_params] || {}
338
+ # HTTP header 'Accept' (if needed)
339
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
340
+
341
+ # form parameters
342
+ form_params = opts[:form_params] || {}
343
+
344
+ # http body (model)
345
+ post_body = opts[:body]
346
+
347
+ # return_type
348
+ return_type = opts[:return_type] || 'Array<EmailPreview>'
349
+
350
+ # auth_names
351
+ auth_names = opts[:auth_names] || ['API_KEY']
352
+
353
+ new_options = opts.merge(
354
+ :header_params => header_params,
355
+ :query_params => query_params,
356
+ :form_params => form_params,
357
+ :body => post_body,
358
+ :auth_names => auth_names,
359
+ :return_type => return_type
360
+ )
361
+
362
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
363
+ if @api_client.config.debugging
364
+ @api_client.config.logger.debug "API called: InboxControllerApi#get_emails\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
365
+ end
366
+ return data, status_code, headers
367
+ end
368
+
369
+ # Get Inbox
370
+ # Returns an inbox's properties, including its email address and ID.
371
+ # @param inbox_id [String] inboxId
372
+ # @param [Hash] opts the optional parameters
373
+ # @return [Inbox]
374
+ def get_inbox(inbox_id, opts = {})
375
+ data, _status_code, _headers = get_inbox_with_http_info(inbox_id, opts)
376
+ data
377
+ end
378
+
379
+ # Get Inbox
380
+ # Returns an inbox&#39;s properties, including its email address and ID.
381
+ # @param inbox_id [String] inboxId
382
+ # @param [Hash] opts the optional parameters
383
+ # @return [Array<(Inbox, Integer, Hash)>] Inbox data, response status code and response headers
384
+ def get_inbox_with_http_info(inbox_id, opts = {})
385
+ if @api_client.config.debugging
386
+ @api_client.config.logger.debug 'Calling API: InboxControllerApi.get_inbox ...'
387
+ end
388
+ # verify the required parameter 'inbox_id' is set
389
+ if @api_client.config.client_side_validation && inbox_id.nil?
390
+ fail ArgumentError, "Missing the required parameter 'inbox_id' when calling InboxControllerApi.get_inbox"
391
+ end
392
+ # resource path
393
+ local_var_path = '/inboxes/{inboxId}'.sub('{' + 'inboxId' + '}', CGI.escape(inbox_id.to_s))
394
+
395
+ # query parameters
396
+ query_params = opts[:query_params] || {}
397
+
398
+ # header parameters
399
+ header_params = opts[:header_params] || {}
400
+ # HTTP header 'Accept' (if needed)
401
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
402
+
403
+ # form parameters
404
+ form_params = opts[:form_params] || {}
405
+
406
+ # http body (model)
407
+ post_body = opts[:body]
408
+
409
+ # return_type
410
+ return_type = opts[:return_type] || 'Inbox'
411
+
412
+ # auth_names
413
+ auth_names = opts[:auth_names] || ['API_KEY']
414
+
415
+ new_options = opts.merge(
416
+ :header_params => header_params,
417
+ :query_params => query_params,
418
+ :form_params => form_params,
419
+ :body => post_body,
420
+ :auth_names => auth_names,
421
+ :return_type => return_type
422
+ )
423
+
424
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
425
+ if @api_client.config.debugging
426
+ @api_client.config.logger.debug "API called: InboxControllerApi#get_inbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
427
+ end
428
+ return data, status_code, headers
429
+ end
430
+
431
+ # Get inbox emails paginated
432
+ # Get a paginated list of emails in an inbox. Does not hold connections open.
433
+ # @param inbox_id [String] Id of inbox that emails belongs to
434
+ # @param [Hash] opts the optional parameters
435
+ # @option opts [Integer] :page Optional page index in inbox emails list pagination (default to 0)
436
+ # @option opts [Integer] :size Optional page size in inbox emails list pagination (default to 20)
437
+ # @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC')
438
+ # @return [PageEmailPreview]
439
+ def get_inbox_emails_paginated(inbox_id, opts = {})
440
+ data, _status_code, _headers = get_inbox_emails_paginated_with_http_info(inbox_id, opts)
441
+ data
442
+ end
443
+
444
+ # Get inbox emails paginated
445
+ # Get a paginated list of emails in an inbox. Does not hold connections open.
446
+ # @param inbox_id [String] Id of inbox that emails belongs to
447
+ # @param [Hash] opts the optional parameters
448
+ # @option opts [Integer] :page Optional page index in inbox emails list pagination
449
+ # @option opts [Integer] :size Optional page size in inbox emails list pagination
450
+ # @option opts [String] :sort Optional createdAt sort direction ASC or DESC
451
+ # @return [Array<(PageEmailPreview, Integer, Hash)>] PageEmailPreview data, response status code and response headers
452
+ def get_inbox_emails_paginated_with_http_info(inbox_id, opts = {})
453
+ if @api_client.config.debugging
454
+ @api_client.config.logger.debug 'Calling API: InboxControllerApi.get_inbox_emails_paginated ...'
455
+ end
456
+ # verify the required parameter 'inbox_id' is set
457
+ if @api_client.config.client_side_validation && inbox_id.nil?
458
+ fail ArgumentError, "Missing the required parameter 'inbox_id' when calling InboxControllerApi.get_inbox_emails_paginated"
459
+ end
460
+ allowable_values = ["ASC", "DESC"]
461
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
462
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
463
+ end
464
+ # resource path
465
+ local_var_path = '/inboxes/{inboxId}/emails/paginated'.sub('{' + 'inboxId' + '}', CGI.escape(inbox_id.to_s))
466
+
467
+ # query parameters
468
+ query_params = opts[:query_params] || {}
469
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
470
+ query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
471
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
472
+
473
+ # header parameters
474
+ header_params = opts[:header_params] || {}
475
+ # HTTP header 'Accept' (if needed)
476
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
477
+
478
+ # form parameters
479
+ form_params = opts[:form_params] || {}
480
+
481
+ # http body (model)
482
+ post_body = opts[:body]
483
+
484
+ # return_type
485
+ return_type = opts[:return_type] || 'PageEmailPreview'
486
+
487
+ # auth_names
488
+ auth_names = opts[:auth_names] || ['API_KEY']
489
+
490
+ new_options = opts.merge(
491
+ :header_params => header_params,
492
+ :query_params => query_params,
493
+ :form_params => form_params,
494
+ :body => post_body,
495
+ :auth_names => auth_names,
496
+ :return_type => return_type
497
+ )
498
+
499
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
500
+ if @api_client.config.debugging
501
+ @api_client.config.logger.debug "API called: InboxControllerApi#get_inbox_emails_paginated\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
502
+ end
503
+ return data, status_code, headers
504
+ end
505
+
506
+ # Get Inbox Sent Emails
507
+ # Returns an inbox's sent email receipts. Call individual sent email endpoints for more details. Note for privacy reasons the full body of sent emails is never stored. An MD5 hash hex is available for comparison instead.
508
+ # @param inbox_id [String] inboxId
509
+ # @param [Hash] opts the optional parameters
510
+ # @option opts [Integer] :page Optional page index in inbox sent email list pagination (default to 0)
511
+ # @option opts [Integer] :size Optional page size in inbox sent email list pagination (default to 20)
512
+ # @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC')
513
+ # @return [PageSentEmailProjection]
514
+ def get_inbox_sent_emails(inbox_id, opts = {})
515
+ data, _status_code, _headers = get_inbox_sent_emails_with_http_info(inbox_id, opts)
516
+ data
517
+ end
518
+
519
+ # Get Inbox Sent Emails
520
+ # Returns an inbox&#39;s sent email receipts. Call individual sent email endpoints for more details. Note for privacy reasons the full body of sent emails is never stored. An MD5 hash hex is available for comparison instead.
521
+ # @param inbox_id [String] inboxId
522
+ # @param [Hash] opts the optional parameters
523
+ # @option opts [Integer] :page Optional page index in inbox sent email list pagination
524
+ # @option opts [Integer] :size Optional page size in inbox sent email list pagination
525
+ # @option opts [String] :sort Optional createdAt sort direction ASC or DESC
526
+ # @return [Array<(PageSentEmailProjection, Integer, Hash)>] PageSentEmailProjection data, response status code and response headers
527
+ def get_inbox_sent_emails_with_http_info(inbox_id, opts = {})
528
+ if @api_client.config.debugging
529
+ @api_client.config.logger.debug 'Calling API: InboxControllerApi.get_inbox_sent_emails ...'
530
+ end
531
+ # verify the required parameter 'inbox_id' is set
532
+ if @api_client.config.client_side_validation && inbox_id.nil?
533
+ fail ArgumentError, "Missing the required parameter 'inbox_id' when calling InboxControllerApi.get_inbox_sent_emails"
534
+ end
535
+ allowable_values = ["ASC", "DESC"]
536
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
537
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
538
+ end
539
+ # resource path
540
+ local_var_path = '/inboxes/{inboxId}/sent'.sub('{' + 'inboxId' + '}', CGI.escape(inbox_id.to_s))
541
+
542
+ # query parameters
543
+ query_params = opts[:query_params] || {}
544
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
545
+ query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
546
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
547
+
548
+ # header parameters
549
+ header_params = opts[:header_params] || {}
550
+ # HTTP header 'Accept' (if needed)
551
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
552
+
553
+ # form parameters
554
+ form_params = opts[:form_params] || {}
555
+
556
+ # http body (model)
557
+ post_body = opts[:body]
558
+
559
+ # return_type
560
+ return_type = opts[:return_type] || 'PageSentEmailProjection'
561
+
562
+ # auth_names
563
+ auth_names = opts[:auth_names] || ['API_KEY']
564
+
565
+ new_options = opts.merge(
566
+ :header_params => header_params,
567
+ :query_params => query_params,
568
+ :form_params => form_params,
569
+ :body => post_body,
570
+ :auth_names => auth_names,
571
+ :return_type => return_type
572
+ )
573
+
574
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
575
+ if @api_client.config.debugging
576
+ @api_client.config.logger.debug "API called: InboxControllerApi#get_inbox_sent_emails\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
577
+ end
578
+ return data, status_code, headers
579
+ end
580
+
581
+ # Get inbox tags
582
+ # Get all inbox tags
583
+ # @param [Hash] opts the optional parameters
584
+ # @return [Array<String>]
585
+ def get_inbox_tags(opts = {})
586
+ data, _status_code, _headers = get_inbox_tags_with_http_info(opts)
587
+ data
588
+ end
589
+
590
+ # Get inbox tags
591
+ # Get all inbox tags
592
+ # @param [Hash] opts the optional parameters
593
+ # @return [Array<(Array<String>, Integer, Hash)>] Array<String> data, response status code and response headers
594
+ def get_inbox_tags_with_http_info(opts = {})
595
+ if @api_client.config.debugging
596
+ @api_client.config.logger.debug 'Calling API: InboxControllerApi.get_inbox_tags ...'
597
+ end
598
+ # resource path
599
+ local_var_path = '/inboxes/tags'
600
+
601
+ # query parameters
602
+ query_params = opts[:query_params] || {}
603
+
604
+ # header parameters
605
+ header_params = opts[:header_params] || {}
606
+ # HTTP header 'Accept' (if needed)
607
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
608
+
609
+ # form parameters
610
+ form_params = opts[:form_params] || {}
611
+
612
+ # http body (model)
613
+ post_body = opts[:body]
614
+
615
+ # return_type
616
+ return_type = opts[:return_type] || 'Array<String>'
617
+
618
+ # auth_names
619
+ auth_names = opts[:auth_names] || ['API_KEY']
620
+
621
+ new_options = opts.merge(
622
+ :header_params => header_params,
623
+ :query_params => query_params,
624
+ :form_params => form_params,
625
+ :body => post_body,
626
+ :auth_names => auth_names,
627
+ :return_type => return_type
628
+ )
629
+
630
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
631
+ if @api_client.config.debugging
632
+ @api_client.config.logger.debug "API called: InboxControllerApi#get_inbox_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
633
+ end
634
+ return data, status_code, headers
635
+ end
636
+
637
+ # List Inboxes / Email Addresses
638
+ # List the inboxes you have created
639
+ # @param [Hash] opts the optional parameters
640
+ # @return [Array<Inbox>]
641
+ def get_inboxes(opts = {})
642
+ data, _status_code, _headers = get_inboxes_with_http_info(opts)
643
+ data
644
+ end
645
+
646
+ # List Inboxes / Email Addresses
647
+ # List the inboxes you have created
648
+ # @param [Hash] opts the optional parameters
649
+ # @return [Array<(Array<Inbox>, Integer, Hash)>] Array<Inbox> data, response status code and response headers
650
+ def get_inboxes_with_http_info(opts = {})
651
+ if @api_client.config.debugging
652
+ @api_client.config.logger.debug 'Calling API: InboxControllerApi.get_inboxes ...'
653
+ end
654
+ # resource path
655
+ local_var_path = '/inboxes'
656
+
657
+ # query parameters
658
+ query_params = opts[:query_params] || {}
659
+
660
+ # header parameters
661
+ header_params = opts[:header_params] || {}
662
+ # HTTP header 'Accept' (if needed)
663
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
664
+
665
+ # form parameters
666
+ form_params = opts[:form_params] || {}
667
+
668
+ # http body (model)
669
+ post_body = opts[:body]
670
+
671
+ # return_type
672
+ return_type = opts[:return_type] || 'Array<Inbox>'
673
+
674
+ # auth_names
675
+ auth_names = opts[:auth_names] || ['API_KEY']
676
+
677
+ new_options = opts.merge(
678
+ :header_params => header_params,
679
+ :query_params => query_params,
680
+ :form_params => form_params,
681
+ :body => post_body,
682
+ :auth_names => auth_names,
683
+ :return_type => return_type
684
+ )
685
+
686
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
687
+ if @api_client.config.debugging
688
+ @api_client.config.logger.debug "API called: InboxControllerApi#get_inboxes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
689
+ end
690
+ return data, status_code, headers
691
+ end
692
+
693
+ # Send Email
694
+ # Send an email from an inbox's email address. The request body should contain the `SendEmailOptions` that include recipients, attachments, body etc. See `SendEmailOptions` for all available properties. Note the `inboxId` refers to the inbox's id not the inbox's email address. See https://www.mailslurp.com/guides/ for more information on how to send emails.
695
+ # @param inbox_id [String] ID of the inbox you want to send the email from
696
+ # @param [Hash] opts the optional parameters
697
+ # @option opts [SendEmailOptions] :send_email_options Options for the email
698
+ # @return [nil]
699
+ def send_email(inbox_id, opts = {})
700
+ send_email_with_http_info(inbox_id, opts)
701
+ nil
702
+ end
703
+
704
+ # Send Email
705
+ # Send an email from an inbox&#39;s email address. The request body should contain the &#x60;SendEmailOptions&#x60; that include recipients, attachments, body etc. See &#x60;SendEmailOptions&#x60; for all available properties. Note the &#x60;inboxId&#x60; refers to the inbox&#39;s id not the inbox&#39;s email address. See https://www.mailslurp.com/guides/ for more information on how to send emails.
706
+ # @param inbox_id [String] ID of the inbox you want to send the email from
707
+ # @param [Hash] opts the optional parameters
708
+ # @option opts [SendEmailOptions] :send_email_options Options for the email
709
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
710
+ def send_email_with_http_info(inbox_id, opts = {})
711
+ if @api_client.config.debugging
712
+ @api_client.config.logger.debug 'Calling API: InboxControllerApi.send_email ...'
713
+ end
714
+ # verify the required parameter 'inbox_id' is set
715
+ if @api_client.config.client_side_validation && inbox_id.nil?
716
+ fail ArgumentError, "Missing the required parameter 'inbox_id' when calling InboxControllerApi.send_email"
717
+ end
718
+ # resource path
719
+ local_var_path = '/inboxes/{inboxId}'.sub('{' + 'inboxId' + '}', CGI.escape(inbox_id.to_s))
720
+
721
+ # query parameters
722
+ query_params = opts[:query_params] || {}
723
+
724
+ # header parameters
725
+ header_params = opts[:header_params] || {}
726
+ # HTTP header 'Content-Type'
727
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
728
+
729
+ # form parameters
730
+ form_params = opts[:form_params] || {}
731
+
732
+ # http body (model)
733
+ post_body = opts[:body] || @api_client.object_to_http_body(opts[:'send_email_options'])
734
+
735
+ # return_type
736
+ return_type = opts[:return_type]
737
+
738
+ # auth_names
739
+ auth_names = opts[:auth_names] || ['API_KEY']
740
+
741
+ new_options = opts.merge(
742
+ :header_params => header_params,
743
+ :query_params => query_params,
744
+ :form_params => form_params,
745
+ :body => post_body,
746
+ :auth_names => auth_names,
747
+ :return_type => return_type
748
+ )
749
+
750
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
751
+ if @api_client.config.debugging
752
+ @api_client.config.logger.debug "API called: InboxControllerApi#send_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
753
+ end
754
+ return data, status_code, headers
755
+ end
756
+
757
+ # Set inbox favourited state
758
+ # Set and return new favourite state for an inbox
759
+ # @param inbox_id [String] inboxId
760
+ # @param set_inbox_favourited_options [SetInboxFavouritedOptions] setInboxFavouritedOptions
761
+ # @param [Hash] opts the optional parameters
762
+ # @return [Inbox]
763
+ def set_inbox_favourited(inbox_id, set_inbox_favourited_options, opts = {})
764
+ data, _status_code, _headers = set_inbox_favourited_with_http_info(inbox_id, set_inbox_favourited_options, opts)
765
+ data
766
+ end
767
+
768
+ # Set inbox favourited state
769
+ # Set and return new favourite state for an inbox
770
+ # @param inbox_id [String] inboxId
771
+ # @param set_inbox_favourited_options [SetInboxFavouritedOptions] setInboxFavouritedOptions
772
+ # @param [Hash] opts the optional parameters
773
+ # @return [Array<(Inbox, Integer, Hash)>] Inbox data, response status code and response headers
774
+ def set_inbox_favourited_with_http_info(inbox_id, set_inbox_favourited_options, opts = {})
775
+ if @api_client.config.debugging
776
+ @api_client.config.logger.debug 'Calling API: InboxControllerApi.set_inbox_favourited ...'
777
+ end
778
+ # verify the required parameter 'inbox_id' is set
779
+ if @api_client.config.client_side_validation && inbox_id.nil?
780
+ fail ArgumentError, "Missing the required parameter 'inbox_id' when calling InboxControllerApi.set_inbox_favourited"
781
+ end
782
+ # verify the required parameter 'set_inbox_favourited_options' is set
783
+ if @api_client.config.client_side_validation && set_inbox_favourited_options.nil?
784
+ fail ArgumentError, "Missing the required parameter 'set_inbox_favourited_options' when calling InboxControllerApi.set_inbox_favourited"
785
+ end
786
+ # resource path
787
+ local_var_path = '/inboxes/{inboxId}/favourite'.sub('{' + 'inboxId' + '}', CGI.escape(inbox_id.to_s))
788
+
789
+ # query parameters
790
+ query_params = opts[:query_params] || {}
791
+
792
+ # header parameters
793
+ header_params = opts[:header_params] || {}
794
+ # HTTP header 'Accept' (if needed)
795
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
796
+ # HTTP header 'Content-Type'
797
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
798
+
799
+ # form parameters
800
+ form_params = opts[:form_params] || {}
801
+
802
+ # http body (model)
803
+ post_body = opts[:body] || @api_client.object_to_http_body(set_inbox_favourited_options)
804
+
805
+ # return_type
806
+ return_type = opts[:return_type] || 'Inbox'
807
+
808
+ # auth_names
809
+ auth_names = opts[:auth_names] || ['API_KEY']
810
+
811
+ new_options = opts.merge(
812
+ :header_params => header_params,
813
+ :query_params => query_params,
814
+ :form_params => form_params,
815
+ :body => post_body,
816
+ :auth_names => auth_names,
817
+ :return_type => return_type
818
+ )
819
+
820
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
821
+ if @api_client.config.debugging
822
+ @api_client.config.logger.debug "API called: InboxControllerApi#set_inbox_favourited\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
823
+ end
824
+ return data, status_code, headers
825
+ end
826
+
827
+ # Update Inbox
828
+ # Update editable fields on an inbox
829
+ # @param inbox_id [String] inboxId
830
+ # @param update_inbox_options [UpdateInboxOptions] updateInboxOptions
831
+ # @param [Hash] opts the optional parameters
832
+ # @return [Inbox]
833
+ def update_inbox(inbox_id, update_inbox_options, opts = {})
834
+ data, _status_code, _headers = update_inbox_with_http_info(inbox_id, update_inbox_options, opts)
835
+ data
836
+ end
837
+
838
+ # Update Inbox
839
+ # Update editable fields on an inbox
840
+ # @param inbox_id [String] inboxId
841
+ # @param update_inbox_options [UpdateInboxOptions] updateInboxOptions
842
+ # @param [Hash] opts the optional parameters
843
+ # @return [Array<(Inbox, Integer, Hash)>] Inbox data, response status code and response headers
844
+ def update_inbox_with_http_info(inbox_id, update_inbox_options, opts = {})
845
+ if @api_client.config.debugging
846
+ @api_client.config.logger.debug 'Calling API: InboxControllerApi.update_inbox ...'
847
+ end
848
+ # verify the required parameter 'inbox_id' is set
849
+ if @api_client.config.client_side_validation && inbox_id.nil?
850
+ fail ArgumentError, "Missing the required parameter 'inbox_id' when calling InboxControllerApi.update_inbox"
851
+ end
852
+ # verify the required parameter 'update_inbox_options' is set
853
+ if @api_client.config.client_side_validation && update_inbox_options.nil?
854
+ fail ArgumentError, "Missing the required parameter 'update_inbox_options' when calling InboxControllerApi.update_inbox"
855
+ end
856
+ # resource path
857
+ local_var_path = '/inboxes/{inboxId}'.sub('{' + 'inboxId' + '}', CGI.escape(inbox_id.to_s))
858
+
859
+ # query parameters
860
+ query_params = opts[:query_params] || {}
861
+
862
+ # header parameters
863
+ header_params = opts[:header_params] || {}
864
+ # HTTP header 'Accept' (if needed)
865
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
866
+ # HTTP header 'Content-Type'
867
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
868
+
869
+ # form parameters
870
+ form_params = opts[:form_params] || {}
871
+
872
+ # http body (model)
873
+ post_body = opts[:body] || @api_client.object_to_http_body(update_inbox_options)
874
+
875
+ # return_type
876
+ return_type = opts[:return_type] || 'Inbox'
877
+
878
+ # auth_names
879
+ auth_names = opts[:auth_names] || ['API_KEY']
880
+
881
+ new_options = opts.merge(
882
+ :header_params => header_params,
883
+ :query_params => query_params,
884
+ :form_params => form_params,
885
+ :body => post_body,
886
+ :auth_names => auth_names,
887
+ :return_type => return_type
888
+ )
889
+
890
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
891
+ if @api_client.config.debugging
892
+ @api_client.config.logger.debug "API called: InboxControllerApi#update_inbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
893
+ end
894
+ return data, status_code, headers
895
+ end
896
+ end
897
+ end