Class: Sendmux::Management::Generated::MailboxesApi

Inherits:
Object
  • Object
show all
Defined in:
lib/sendmux_management_generated/api/mailboxes_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ MailboxesApi

Returns a new instance of MailboxesApi.



19
20
21
# File 'lib/sendmux_management_generated/api/mailboxes_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/sendmux_management_generated/api/mailboxes_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#management_create_mailbox(opts = {}) ⇒ MailboxCreateResultResponse

Create a mailbox Provisions a new mailbox plus an initial bearer token and matching IMAP/SMTP mailbox password. The domain portion of the email must already be verified via POST /domains. If supplied, ‘quota_bytes` must be one of the current storage tiers: 1073741824 (1 GB), 5368709120 (5 GB), or 53687091200 (50 GB). Creation provisions resources on our mail platform and, for `@myagent.mx` addresses, on Amazon SES — any failure rolls the partial state back automatically. Supply an `Idempotency-Key` header (any unique string, max 255 chars) to safely retry on network errors. Replays with the same key return the original response; replays with a different body return `409 idempotency_conflict`.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



28
29
30
31
# File 'lib/sendmux_management_generated/api/mailboxes_api.rb', line 28

def management_create_mailbox(opts = {})
  data, _status_code, _headers = management_create_mailbox_with_http_info(opts)
  data
end

#management_create_mailbox_key(public_id, opts = {}) ⇒ MailboxAppPasswordResultResponse

Create a mailbox API key Mints an additional bearer token plus IMAP/SMTP mailbox password for an existing mailbox. The plaintext key and password are shown exactly once — store them immediately. Supply an ‘Idempotency-Key` header (any unique string, max 255 chars) to safely retry on network errors. Replays with the same key return the original response; replays with a different body return `409 idempotency_conflict`.

Parameters:

  • public_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



100
101
102
103
# File 'lib/sendmux_management_generated/api/mailboxes_api.rb', line 100

def management_create_mailbox_key(public_id, opts = {})
  data, _status_code, _headers = management_create_mailbox_key_with_http_info(public_id, opts)
  data
end

#management_create_mailbox_key_with_http_info(public_id, opts = {}) ⇒ Array<(MailboxAppPasswordResultResponse, Integer, Hash)>

Create a mailbox API key Mints an additional bearer token plus IMAP/SMTP mailbox password for an existing mailbox. The plaintext key and password are shown exactly once — store them immediately. Supply an &#x60;Idempotency-Key&#x60; header (any unique string, max 255 chars) to safely retry on network errors. Replays with the same key return the original response; replays with a different body return &#x60;409 idempotency_conflict&#x60;.

Parameters:

  • public_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# File 'lib/sendmux_management_generated/api/mailboxes_api.rb', line 112

def management_create_mailbox_key_with_http_info(public_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MailboxesApi.management_create_mailbox_key ...'
  end
  # verify the required parameter 'public_id' is set
  if @api_client.config.client_side_validation && public_id.nil?
    fail ArgumentError, "Missing the required parameter 'public_id' when calling MailboxesApi.management_create_mailbox_key"
  end
  if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
    fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling MailboxesApi.management_create_mailbox_key, the character length must be smaller than or equal to 255.'
  end

  # resource path
  local_var_path = '/mailboxes/{public_id}/keys'.sub('{public_id}', CGI.escape(public_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'management_create_mailbox_key_request'])

  # return_type
  return_type = opts[:debug_return_type] || 'MailboxAppPasswordResultResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"MailboxesApi.management_create_mailbox_key",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MailboxesApi#management_create_mailbox_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#management_create_mailbox_with_http_info(opts = {}) ⇒ Array<(MailboxCreateResultResponse, Integer, Hash)>

Create a mailbox Provisions a new mailbox plus an initial bearer token and matching IMAP/SMTP mailbox password. The domain portion of the email must already be verified via POST /domains. If supplied, &#x60;quota_bytes&#x60; must be one of the current storage tiers: 1073741824 (1 GB), 5368709120 (5 GB), or 53687091200 (50 GB). Creation provisions resources on our mail platform and, for &#x60;@myagent.mx&#x60; addresses, on Amazon SES — any failure rolls the partial state back automatically. Supply an &#x60;Idempotency-Key&#x60; header (any unique string, max 255 chars) to safely retry on network errors. Replays with the same key return the original response; replays with a different body return &#x60;409 idempotency_conflict&#x60;.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(MailboxCreateResultResponse, Integer, Hash)>)

    MailboxCreateResultResponse data, response status code and response headers



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/sendmux_management_generated/api/mailboxes_api.rb', line 39

def management_create_mailbox_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MailboxesApi.management_create_mailbox ...'
  end
  if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
    fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling MailboxesApi.management_create_mailbox, the character length must be smaller than or equal to 255.'
  end

  # resource path
  local_var_path = '/mailboxes'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'management_create_mailbox_request'])

  # return_type
  return_type = opts[:debug_return_type] || 'MailboxCreateResultResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"MailboxesApi.management_create_mailbox",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MailboxesApi#management_create_mailbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#management_delete_mailbox(public_id, opts = {}) ⇒ MailboxDeletedResponse

Delete a mailbox Removes a mailbox from our mail platform, Amazon SES (for ‘@myagent.mx` addresses), and Sendmux. All associated API keys are revoked.

Parameters:

  • public_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



175
176
177
178
# File 'lib/sendmux_management_generated/api/mailboxes_api.rb', line 175

def management_delete_mailbox(public_id, opts = {})
  data, _status_code, _headers = management_delete_mailbox_with_http_info(public_id, opts)
  data
end

#management_delete_mailbox_key(public_id, key_id, opts = {}) ⇒ MailboxKeyDeletedResponse

Revoke a mailbox API key Revokes a specific bearer token + matching mailbox password. Idempotent on already-revoked keys.

Parameters:

  • public_id (String)
  • key_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



239
240
241
242
# File 'lib/sendmux_management_generated/api/mailboxes_api.rb', line 239

def management_delete_mailbox_key(public_id, key_id, opts = {})
  data, _status_code, _headers = management_delete_mailbox_key_with_http_info(public_id, key_id, opts)
  data
end

#management_delete_mailbox_key_with_http_info(public_id, key_id, opts = {}) ⇒ Array<(MailboxKeyDeletedResponse, Integer, Hash)>

Revoke a mailbox API key Revokes a specific bearer token + matching mailbox password. Idempotent on already-revoked keys.

Parameters:

  • public_id (String)
  • key_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(MailboxKeyDeletedResponse, Integer, Hash)>)

    MailboxKeyDeletedResponse data, response status code and response headers



250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
# File 'lib/sendmux_management_generated/api/mailboxes_api.rb', line 250

def management_delete_mailbox_key_with_http_info(public_id, key_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MailboxesApi.management_delete_mailbox_key ...'
  end
  # verify the required parameter 'public_id' is set
  if @api_client.config.client_side_validation && public_id.nil?
    fail ArgumentError, "Missing the required parameter 'public_id' when calling MailboxesApi.management_delete_mailbox_key"
  end
  # verify the required parameter 'key_id' is set
  if @api_client.config.client_side_validation && key_id.nil?
    fail ArgumentError, "Missing the required parameter 'key_id' when calling MailboxesApi.management_delete_mailbox_key"
  end
  # resource path
  local_var_path = '/mailboxes/{public_id}/keys/{key_id}'.sub('{public_id}', CGI.escape(public_id.to_s)).sub('{key_id}', CGI.escape(key_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'MailboxKeyDeletedResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"MailboxesApi.management_delete_mailbox_key",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MailboxesApi#management_delete_mailbox_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#management_delete_mailbox_with_http_info(public_id, opts = {}) ⇒ Array<(MailboxDeletedResponse, Integer, Hash)>

Delete a mailbox Removes a mailbox from our mail platform, Amazon SES (for &#x60;@myagent.mx&#x60; addresses), and Sendmux. All associated API keys are revoked.

Parameters:

  • public_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(MailboxDeletedResponse, Integer, Hash)>)

    MailboxDeletedResponse data, response status code and response headers



185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# File 'lib/sendmux_management_generated/api/mailboxes_api.rb', line 185

def management_delete_mailbox_with_http_info(public_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MailboxesApi.management_delete_mailbox ...'
  end
  # verify the required parameter 'public_id' is set
  if @api_client.config.client_side_validation && public_id.nil?
    fail ArgumentError, "Missing the required parameter 'public_id' when calling MailboxesApi.management_delete_mailbox"
  end
  # resource path
  local_var_path = '/mailboxes/{public_id}'.sub('{public_id}', CGI.escape(public_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'MailboxDeletedResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"MailboxesApi.management_delete_mailbox",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MailboxesApi#management_delete_mailbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#management_get_mailbox(public_id, opts = {}) ⇒ MailboxItemResponse

Get a mailbox Returns a single mailbox, tenant-scoped to the caller’s team. 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 resource has not changed. The same ETag is the value to use in `If-Match` on PATCH for optimistic concurrency.

Parameters:

  • public_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :if_none_match (String)

Returns:



308
309
310
311
# File 'lib/sendmux_management_generated/api/mailboxes_api.rb', line 308

def management_get_mailbox(public_id, opts = {})
  data, _status_code, _headers = management_get_mailbox_with_http_info(public_id, opts)
  data
end

#management_get_mailbox_with_http_info(public_id, opts = {}) ⇒ Array<(MailboxItemResponse, Integer, Hash)>

Get a mailbox Returns a single mailbox, tenant-scoped to the caller&#39;s team. 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 resource has not changed. The same ETag is the value to use in &#x60;If-Match&#x60; on PATCH for optimistic concurrency.

Parameters:

  • public_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :if_none_match (String)

Returns:

  • (Array<(MailboxItemResponse, Integer, Hash)>)

    MailboxItemResponse data, response status code and response headers



319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
# File 'lib/sendmux_management_generated/api/mailboxes_api.rb', line 319

def management_get_mailbox_with_http_info(public_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MailboxesApi.management_get_mailbox ...'
  end
  # verify the required parameter 'public_id' is set
  if @api_client.config.client_side_validation && public_id.nil?
    fail ArgumentError, "Missing the required parameter 'public_id' when calling MailboxesApi.management_get_mailbox"
  end
  # resource path
  local_var_path = '/mailboxes/{public_id}'.sub('{public_id}', CGI.escape(public_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'MailboxItemResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"MailboxesApi.management_get_mailbox",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MailboxesApi#management_get_mailbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#management_list_mailboxes(opts = {}) ⇒ MailboxItemCursorListResponse

List mailboxes Returns a cursor-paginated list of mailboxes configured for the team, ordered by ‘created_at` descending. Pass `cursor=<next_cursor>` from the previous response to fetch the next page.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :cursor (String)
  • :limit (Integer)
  • :include_deleted (String)

Returns:



375
376
377
378
# File 'lib/sendmux_management_generated/api/mailboxes_api.rb', line 375

def management_list_mailboxes(opts = {})
  data, _status_code, _headers = management_list_mailboxes_with_http_info(opts)
  data
end

#management_list_mailboxes_with_http_info(opts = {}) ⇒ Array<(MailboxItemCursorListResponse, Integer, Hash)>

List mailboxes Returns a cursor-paginated list of mailboxes configured for the team, ordered by &#x60;created_at&#x60; descending. Pass &#x60;cursor&#x3D;&lt;next_cursor&gt;&#x60; from the previous response to fetch the next page.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :cursor (String)
  • :limit (Integer)
  • :include_deleted (String)

Returns:



387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
# File 'lib/sendmux_management_generated/api/mailboxes_api.rb', line 387

def management_list_mailboxes_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MailboxesApi.management_list_mailboxes ...'
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MailboxesApi.management_list_mailboxes, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MailboxesApi.management_list_mailboxes, must be greater than or equal to 1.'
  end

  allowable_values = ["true", "unknown_default_open_api"]
  if @api_client.config.client_side_validation && opts[:'include_deleted'] && !allowable_values.include?(opts[:'include_deleted'])
    fail ArgumentError, "invalid value for \"include_deleted\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/mailboxes'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'include_deleted'] = opts[:'include_deleted'] if !opts[:'include_deleted'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'MailboxItemCursorListResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"MailboxesApi.management_list_mailboxes",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MailboxesApi#management_list_mailboxes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#management_resume_mailbox(public_id, opts = {}) ⇒ MailboxItemResponse

Resume a mailbox Restores a suspended mailbox so it can authenticate, receive mail, and send from the mailbox address again. The operation is idempotent and accepts ‘Idempotency-Key` for safe retries.

Parameters:

  • public_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

Returns:



452
453
454
455
# File 'lib/sendmux_management_generated/api/mailboxes_api.rb', line 452

def management_resume_mailbox(public_id, opts = {})
  data, _status_code, _headers = management_resume_mailbox_with_http_info(public_id, opts)
  data
end

#management_resume_mailbox_with_http_info(public_id, opts = {}) ⇒ Array<(MailboxItemResponse, Integer, Hash)>

Resume a mailbox Restores a suspended mailbox so it can authenticate, receive mail, and send from the mailbox address again. The operation is idempotent and accepts &#x60;Idempotency-Key&#x60; for safe retries.

Parameters:

  • public_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

Returns:

  • (Array<(MailboxItemResponse, Integer, Hash)>)

    MailboxItemResponse data, response status code and response headers



463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
# File 'lib/sendmux_management_generated/api/mailboxes_api.rb', line 463

def management_resume_mailbox_with_http_info(public_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MailboxesApi.management_resume_mailbox ...'
  end
  # verify the required parameter 'public_id' is set
  if @api_client.config.client_side_validation && public_id.nil?
    fail ArgumentError, "Missing the required parameter 'public_id' when calling MailboxesApi.management_resume_mailbox"
  end
  if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
    fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling MailboxesApi.management_resume_mailbox, the character length must be smaller than or equal to 255.'
  end

  # resource path
  local_var_path = '/mailboxes/{public_id}/resume'.sub('{public_id}', CGI.escape(public_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'MailboxItemResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"MailboxesApi.management_resume_mailbox",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MailboxesApi#management_resume_mailbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#management_suspend_mailbox(public_id, opts = {}) ⇒ MailboxItemResponse

Suspend a mailbox Suspends a mailbox without deleting messages, credentials, or settings. Suspended mailboxes cannot receive mail, authenticate to mailbox protocols, or send from the mailbox address. The operation is idempotent and accepts ‘Idempotency-Key` for safe retries.

Parameters:

  • public_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

Returns:



522
523
524
525
# File 'lib/sendmux_management_generated/api/mailboxes_api.rb', line 522

def management_suspend_mailbox(public_id, opts = {})
  data, _status_code, _headers = management_suspend_mailbox_with_http_info(public_id, opts)
  data
end

#management_suspend_mailbox_with_http_info(public_id, opts = {}) ⇒ Array<(MailboxItemResponse, Integer, Hash)>

Suspend a mailbox Suspends a mailbox without deleting messages, credentials, or settings. Suspended mailboxes cannot receive mail, authenticate to mailbox protocols, or send from the mailbox address. The operation is idempotent and accepts &#x60;Idempotency-Key&#x60; for safe retries.

Parameters:

  • public_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

Returns:

  • (Array<(MailboxItemResponse, Integer, Hash)>)

    MailboxItemResponse data, response status code and response headers



533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
# File 'lib/sendmux_management_generated/api/mailboxes_api.rb', line 533

def management_suspend_mailbox_with_http_info(public_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MailboxesApi.management_suspend_mailbox ...'
  end
  # verify the required parameter 'public_id' is set
  if @api_client.config.client_side_validation && public_id.nil?
    fail ArgumentError, "Missing the required parameter 'public_id' when calling MailboxesApi.management_suspend_mailbox"
  end
  if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
    fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling MailboxesApi.management_suspend_mailbox, the character length must be smaller than or equal to 255.'
  end

  # resource path
  local_var_path = '/mailboxes/{public_id}/suspend'.sub('{public_id}', CGI.escape(public_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'MailboxItemResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"MailboxesApi.management_suspend_mailbox",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MailboxesApi#management_suspend_mailbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#management_update_mailbox(public_id, opts = {}) ⇒ MailboxItemResponse

Update a mailbox Updates any combination of display_name, quota_bytes, and send_scope on a mailbox. The display_name and send_scope changes land in a single transaction; quota_bytes is applied afterwards because it also updates external state on our mail platform. Quota can only be set to 1073741824 (1 GB), 5368709120 (5 GB), or 53687091200 (50 GB), and cannot be shrunk below the mailbox’s current usage. For optimistic concurrency, send ‘If-Match: <etag>` using the ETag from a prior GET. A mismatched `If-Match` returns `409 conflict` (the server’s ETag is echoed back so you can decide whether to re-fetch). Responses carry the new ETag so chained edits can pipeline without a re-GET.

Parameters:

  • public_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



593
594
595
596
# File 'lib/sendmux_management_generated/api/mailboxes_api.rb', line 593

def management_update_mailbox(public_id, opts = {})
  data, _status_code, _headers = management_update_mailbox_with_http_info(public_id, opts)
  data
end

#management_update_mailbox_with_http_info(public_id, opts = {}) ⇒ Array<(MailboxItemResponse, Integer, Hash)>

Update a mailbox Updates any combination of display_name, quota_bytes, and send_scope on a mailbox. The display_name and send_scope changes land in a single transaction; quota_bytes is applied afterwards because it also updates external state on our mail platform. Quota can only be set to 1073741824 (1 GB), 5368709120 (5 GB), or 53687091200 (50 GB), and cannot be shrunk below the mailbox&#39;s current usage. For optimistic concurrency, send &#x60;If-Match: &lt;etag&gt;&#x60; using the ETag from a prior GET. A mismatched &#x60;If-Match&#x60; returns &#x60;409 conflict&#x60; (the server&#39;s ETag is echoed back so you can decide whether to re-fetch). Responses carry the new ETag so chained edits can pipeline without a re-GET.

Parameters:

  • public_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(MailboxItemResponse, Integer, Hash)>)

    MailboxItemResponse data, response status code and response headers



605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
# File 'lib/sendmux_management_generated/api/mailboxes_api.rb', line 605

def management_update_mailbox_with_http_info(public_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MailboxesApi.management_update_mailbox ...'
  end
  # verify the required parameter 'public_id' is set
  if @api_client.config.client_side_validation && public_id.nil?
    fail ArgumentError, "Missing the required parameter 'public_id' when calling MailboxesApi.management_update_mailbox"
  end
  # resource path
  local_var_path = '/mailboxes/{public_id}'.sub('{public_id}', CGI.escape(public_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'update_mailbox_body'])

  # return_type
  return_type = opts[:debug_return_type] || 'MailboxItemResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"MailboxesApi.management_update_mailbox",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MailboxesApi#management_update_mailbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end