Class: Lockally::MailboxesApi

Inherits:
Object
  • Object
show all
Defined in:
lib/lockally/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/lockally/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/lockally/api/mailboxes_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#add_shared_member(email, add_shared_member_request, opts = {}) ⇒ SharedMember

Add a shared mailbox member

Parameters:

  • email (String)
  • add_shared_member_request (AddSharedMemberRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



27
28
29
30
# File 'lib/lockally/api/mailboxes_api.rb', line 27

def add_shared_member(email, add_shared_member_request, opts = {})
  data, _status_code, _headers = add_shared_member_with_http_info(email, add_shared_member_request, opts)
  data
end

#add_shared_member_with_http_info(email, add_shared_member_request, opts = {}) ⇒ Array<(SharedMember, Integer, Hash)>

Add a shared mailbox member

Parameters:

  • email (String)
  • add_shared_member_request (AddSharedMemberRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    SharedMember data, response status code and response headers



37
38
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
92
# File 'lib/lockally/api/mailboxes_api.rb', line 37

def add_shared_member_with_http_info(email, add_shared_member_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MailboxesApi.add_shared_member ...'
  end
  # verify the required parameter 'email' is set
  if @api_client.config.client_side_validation && email.nil?
    fail ArgumentError, "Missing the required parameter 'email' when calling MailboxesApi.add_shared_member"
  end
  # verify the required parameter 'add_shared_member_request' is set
  if @api_client.config.client_side_validation && add_shared_member_request.nil?
    fail ArgumentError, "Missing the required parameter 'add_shared_member_request' when calling MailboxesApi.add_shared_member"
  end
  # resource path
  local_var_path = '/v1/mailboxes/{email}/members'.sub('{email}', CGI.escape(email.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', 'application/problem+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

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

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

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

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

  new_options = opts.merge(
    :operation => :"MailboxesApi.add_shared_member",
    :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#add_shared_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_shared_members(email, opts = {}) ⇒ ListSharedMembers200Response

List shared mailbox members

Parameters:

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

    the optional parameters

Returns:



98
99
100
101
# File 'lib/lockally/api/mailboxes_api.rb', line 98

def list_shared_members(email, opts = {})
  data, _status_code, _headers = list_shared_members_with_http_info(email, opts)
  data
end

#list_shared_members_with_http_info(email, opts = {}) ⇒ Array<(ListSharedMembers200Response, Integer, Hash)>

List shared mailbox members

Parameters:

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

    the optional parameters

Returns:



107
108
109
110
111
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
# File 'lib/lockally/api/mailboxes_api.rb', line 107

def list_shared_members_with_http_info(email, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MailboxesApi.list_shared_members ...'
  end
  # verify the required parameter 'email' is set
  if @api_client.config.client_side_validation && email.nil?
    fail ArgumentError, "Missing the required parameter 'email' when calling MailboxesApi.list_shared_members"
  end
  # resource path
  local_var_path = '/v1/mailboxes/{email}/members'.sub('{email}', CGI.escape(email.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', 'application/problem+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] || 'ListSharedMembers200Response'

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

  new_options = opts.merge(
    :operation => :"MailboxesApi.list_shared_members",
    :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#list_shared_members\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#remove_shared_member(email, member_email, opts = {}) ⇒ nil

Remove a shared mailbox member

Parameters:

  • email (String)
  • member_email (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


160
161
162
163
# File 'lib/lockally/api/mailboxes_api.rb', line 160

def remove_shared_member(email, member_email, opts = {})
  remove_shared_member_with_http_info(email, member_email, opts)
  nil
end

#remove_shared_member_with_http_info(email, member_email, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Remove a shared mailbox member

Parameters:

  • email (String)
  • member_email (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    nil, response status code and response headers



170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
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
# File 'lib/lockally/api/mailboxes_api.rb', line 170

def remove_shared_member_with_http_info(email, member_email, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MailboxesApi.remove_shared_member ...'
  end
  # verify the required parameter 'email' is set
  if @api_client.config.client_side_validation && email.nil?
    fail ArgumentError, "Missing the required parameter 'email' when calling MailboxesApi.remove_shared_member"
  end
  # verify the required parameter 'member_email' is set
  if @api_client.config.client_side_validation && member_email.nil?
    fail ArgumentError, "Missing the required parameter 'member_email' when calling MailboxesApi.remove_shared_member"
  end
  # resource path
  local_var_path = '/v1/mailboxes/{email}/members/{memberEmail}'.sub('{email}', CGI.escape(email.to_s)).sub('{memberEmail}', CGI.escape(member_email.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/problem+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]

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

  new_options = opts.merge(
    :operation => :"MailboxesApi.remove_shared_member",
    :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#remove_shared_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#v1_mailboxes_email_delete(email, opts = {}) ⇒ nil

Soft-delete a mailbox Sets soft_deleted_at = now() and hard_delete_after = now() + 90d per design D25. A background sweep (planned) will hard-delete after the window. The mailbox is also disabled immediately.

Parameters:

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

    the optional parameters

Returns:

  • (nil)


227
228
229
230
# File 'lib/lockally/api/mailboxes_api.rb', line 227

def v1_mailboxes_email_delete(email, opts = {})
  v1_mailboxes_email_delete_with_http_info(email, opts)
  nil
end

#v1_mailboxes_email_delete_with_http_info(email, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Soft-delete a mailbox Sets `soft_deleted_at = now()` and `hard_delete_after = now() + 90d` per design D25. A background sweep (planned) will hard-delete after the window. The mailbox is also disabled immediately.

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



237
238
239
240
241
242
243
244
245
246
247
248
249
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
# File 'lib/lockally/api/mailboxes_api.rb', line 237

def v1_mailboxes_email_delete_with_http_info(email, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MailboxesApi.v1_mailboxes_email_delete ...'
  end
  # verify the required parameter 'email' is set
  if @api_client.config.client_side_validation && email.nil?
    fail ArgumentError, "Missing the required parameter 'email' when calling MailboxesApi.v1_mailboxes_email_delete"
  end
  # resource path
  local_var_path = '/v1/mailboxes/{email}'.sub('{email}', CGI.escape(email.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/problem+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]

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

  new_options = opts.merge(
    :operation => :"MailboxesApi.v1_mailboxes_email_delete",
    :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#v1_mailboxes_email_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#v1_mailboxes_email_export_download_get(email, token, opts = {}) ⇒ File

Download a previously-issued mailbox export Public endpoint (no Authorization header). Validates the one-shot token from the URL, marks it used, and streams an mbox file. Second GET with the same token returns 404 — tokens are single-use.

Parameters:

  • email (String)
  • token (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (File)


291
292
293
294
# File 'lib/lockally/api/mailboxes_api.rb', line 291

def v1_mailboxes_email_export_download_get(email, token, opts = {})
  data, _status_code, _headers = v1_mailboxes_email_export_download_get_with_http_info(email, token, opts)
  data
end

#v1_mailboxes_email_export_download_get_with_http_info(email, token, opts = {}) ⇒ Array<(File, Integer, Hash)>

Download a previously-issued mailbox export Public endpoint (no Authorization header). Validates the one-shot token from the URL, marks it used, and streams an mbox file. Second GET with the same token returns 404 — tokens are single-use.

Parameters:

  • email (String)
  • token (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    File data, response status code and response headers



302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
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
# File 'lib/lockally/api/mailboxes_api.rb', line 302

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

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/mbox', 'application/problem+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] || 'File'

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

  new_options = opts.merge(
    :operation => :"MailboxesApi.v1_mailboxes_email_export_download_get",
    :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#v1_mailboxes_email_export_download_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#v1_mailboxes_email_export_post(email, opts = {}) ⇒ V1MailboxesEmailExportPost201Response

Request a mailbox export Issues a one-shot "presigned" download URL for the mailbox's content in mbox format. The URL works without an Authorization header — the token in the query string is the authz. TTL is 5 minutes; the token is consumed on first GET. v1 caveat: the synthesized mbox only contains outbound mail (from lockally.messages). v2 swaps in Stalwart's export primitive for full inbox + folder structure + flags. The endpoint contract stays unchanged.

Parameters:

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

    the optional parameters

Returns:



360
361
362
363
# File 'lib/lockally/api/mailboxes_api.rb', line 360

def v1_mailboxes_email_export_post(email, opts = {})
  data, _status_code, _headers = v1_mailboxes_email_export_post_with_http_info(email, opts)
  data
end

#v1_mailboxes_email_export_post_with_http_info(email, opts = {}) ⇒ Array<(V1MailboxesEmailExportPost201Response, Integer, Hash)>

Request a mailbox export Issues a one-shot &quot;presigned&quot; download URL for the mailbox's content in mbox format. The URL works without an Authorization header — the token in the query string is the authz. TTL is 5 minutes; the token is consumed on first GET. v1 caveat: the synthesized mbox only contains outbound mail (from `lockally.messages`). v2 swaps in Stalwart's export primitive for full inbox + folder structure + flags. The endpoint contract stays unchanged.

Parameters:

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

    the optional parameters

Returns:



370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
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
# File 'lib/lockally/api/mailboxes_api.rb', line 370

def v1_mailboxes_email_export_post_with_http_info(email, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MailboxesApi.v1_mailboxes_email_export_post ...'
  end
  # verify the required parameter 'email' is set
  if @api_client.config.client_side_validation && email.nil?
    fail ArgumentError, "Missing the required parameter 'email' when calling MailboxesApi.v1_mailboxes_email_export_post"
  end
  # resource path
  local_var_path = '/v1/mailboxes/{email}/export'.sub('{email}', CGI.escape(email.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', 'application/problem+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] || 'V1MailboxesEmailExportPost201Response'

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

  new_options = opts.merge(
    :operation => :"MailboxesApi.v1_mailboxes_email_export_post",
    :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#v1_mailboxes_email_export_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#v1_mailboxes_email_get(email, opts = {}) ⇒ Mailbox

Get a mailbox

Parameters:

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

    the optional parameters

Returns:



422
423
424
425
# File 'lib/lockally/api/mailboxes_api.rb', line 422

def v1_mailboxes_email_get(email, opts = {})
  data, _status_code, _headers = v1_mailboxes_email_get_with_http_info(email, opts)
  data
end

#v1_mailboxes_email_get_with_http_info(email, opts = {}) ⇒ Array<(Mailbox, Integer, Hash)>

Get a mailbox

Parameters:

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

    the optional parameters

Returns:

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

    Mailbox data, response status code and response headers



431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
# File 'lib/lockally/api/mailboxes_api.rb', line 431

def v1_mailboxes_email_get_with_http_info(email, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MailboxesApi.v1_mailboxes_email_get ...'
  end
  # verify the required parameter 'email' is set
  if @api_client.config.client_side_validation && email.nil?
    fail ArgumentError, "Missing the required parameter 'email' when calling MailboxesApi.v1_mailboxes_email_get"
  end
  # resource path
  local_var_path = '/v1/mailboxes/{email}'.sub('{email}', CGI.escape(email.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', 'application/problem+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] || 'Mailbox'

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

  new_options = opts.merge(
    :operation => :"MailboxesApi.v1_mailboxes_email_get",
    :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#v1_mailboxes_email_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#v1_mailboxes_email_patch(email, v1_mailboxes_email_patch_request, opts = {}) ⇒ Mailbox

Update a mailbox Supply at least one of password, quota_bytes, disabled. Returns the updated mailbox.

Parameters:

Returns:



485
486
487
488
# File 'lib/lockally/api/mailboxes_api.rb', line 485

def v1_mailboxes_email_patch(email, v1_mailboxes_email_patch_request, opts = {})
  data, _status_code, _headers = v1_mailboxes_email_patch_with_http_info(email, v1_mailboxes_email_patch_request, opts)
  data
end

#v1_mailboxes_email_patch_with_http_info(email, v1_mailboxes_email_patch_request, opts = {}) ⇒ Array<(Mailbox, Integer, Hash)>

Update a mailbox Supply at least one of `password`, `quota_bytes`, `disabled`. Returns the updated mailbox.

Parameters:

Returns:

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

    Mailbox data, response status code and response headers



496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
# File 'lib/lockally/api/mailboxes_api.rb', line 496

def v1_mailboxes_email_patch_with_http_info(email, v1_mailboxes_email_patch_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MailboxesApi.v1_mailboxes_email_patch ...'
  end
  # verify the required parameter 'email' is set
  if @api_client.config.client_side_validation && email.nil?
    fail ArgumentError, "Missing the required parameter 'email' when calling MailboxesApi.v1_mailboxes_email_patch"
  end
  # verify the required parameter 'v1_mailboxes_email_patch_request' is set
  if @api_client.config.client_side_validation && v1_mailboxes_email_patch_request.nil?
    fail ArgumentError, "Missing the required parameter 'v1_mailboxes_email_patch_request' when calling MailboxesApi.v1_mailboxes_email_patch"
  end
  # resource path
  local_var_path = '/v1/mailboxes/{email}'.sub('{email}', CGI.escape(email.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', 'application/problem+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

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

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

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

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

  new_options = opts.merge(
    :operation => :"MailboxesApi.v1_mailboxes_email_patch",
    :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#v1_mailboxes_email_patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#v1_mailboxes_email_vacation_delete(email, opts = {}) ⇒ nil

Remove the vacation responder Idempotent — 204 whether or not a row existed.

Parameters:

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

    the optional parameters

Returns:

  • (nil)


558
559
560
561
# File 'lib/lockally/api/mailboxes_api.rb', line 558

def v1_mailboxes_email_vacation_delete(email, opts = {})
  v1_mailboxes_email_vacation_delete_with_http_info(email, opts)
  nil
end

#v1_mailboxes_email_vacation_delete_with_http_info(email, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Remove the vacation responder Idempotent — 204 whether or not a row existed.

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
# File 'lib/lockally/api/mailboxes_api.rb', line 568

def v1_mailboxes_email_vacation_delete_with_http_info(email, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MailboxesApi.v1_mailboxes_email_vacation_delete ...'
  end
  # verify the required parameter 'email' is set
  if @api_client.config.client_side_validation && email.nil?
    fail ArgumentError, "Missing the required parameter 'email' when calling MailboxesApi.v1_mailboxes_email_vacation_delete"
  end
  # resource path
  local_var_path = '/v1/mailboxes/{email}/vacation'.sub('{email}', CGI.escape(email.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/problem+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]

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

  new_options = opts.merge(
    :operation => :"MailboxesApi.v1_mailboxes_email_vacation_delete",
    :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#v1_mailboxes_email_vacation_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#v1_mailboxes_email_vacation_get(email, opts = {}) ⇒ VacationResponder

Get the vacation responder Returns the stored vacation rule or 404 if none is set.

Parameters:

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

    the optional parameters

Returns:



621
622
623
624
# File 'lib/lockally/api/mailboxes_api.rb', line 621

def v1_mailboxes_email_vacation_get(email, opts = {})
  data, _status_code, _headers = v1_mailboxes_email_vacation_get_with_http_info(email, opts)
  data
end

#v1_mailboxes_email_vacation_get_with_http_info(email, opts = {}) ⇒ Array<(VacationResponder, Integer, Hash)>

Get the vacation responder Returns the stored vacation rule or 404 if none is set.

Parameters:

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

    the optional parameters

Returns:

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

    VacationResponder data, response status code and response headers



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
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
# File 'lib/lockally/api/mailboxes_api.rb', line 631

def v1_mailboxes_email_vacation_get_with_http_info(email, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MailboxesApi.v1_mailboxes_email_vacation_get ...'
  end
  # verify the required parameter 'email' is set
  if @api_client.config.client_side_validation && email.nil?
    fail ArgumentError, "Missing the required parameter 'email' when calling MailboxesApi.v1_mailboxes_email_vacation_get"
  end
  # resource path
  local_var_path = '/v1/mailboxes/{email}/vacation'.sub('{email}', CGI.escape(email.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', 'application/problem+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] || 'VacationResponder'

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

  new_options = opts.merge(
    :operation => :"MailboxesApi.v1_mailboxes_email_vacation_get",
    :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#v1_mailboxes_email_vacation_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#v1_mailboxes_email_vacation_put(email, v1_mailboxes_email_vacation_put_request, opts = {}) ⇒ VacationResponder

Set the vacation responder Upsert — same endpoint creates or replaces the rule. Clears synced_at; the rule is staged on lockally until a sync worker pushes it to the mail server.

Parameters:

Returns:



685
686
687
688
# File 'lib/lockally/api/mailboxes_api.rb', line 685

def v1_mailboxes_email_vacation_put(email, v1_mailboxes_email_vacation_put_request, opts = {})
  data, _status_code, _headers = v1_mailboxes_email_vacation_put_with_http_info(email, v1_mailboxes_email_vacation_put_request, opts)
  data
end

#v1_mailboxes_email_vacation_put_with_http_info(email, v1_mailboxes_email_vacation_put_request, opts = {}) ⇒ Array<(VacationResponder, Integer, Hash)>

Set the vacation responder Upsert — same endpoint creates or replaces the rule. Clears `synced_at`; the rule is staged on lockally until a sync worker pushes it to the mail server.

Parameters:

Returns:

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

    VacationResponder data, response status code and response headers



696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
# File 'lib/lockally/api/mailboxes_api.rb', line 696

def v1_mailboxes_email_vacation_put_with_http_info(email, v1_mailboxes_email_vacation_put_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MailboxesApi.v1_mailboxes_email_vacation_put ...'
  end
  # verify the required parameter 'email' is set
  if @api_client.config.client_side_validation && email.nil?
    fail ArgumentError, "Missing the required parameter 'email' when calling MailboxesApi.v1_mailboxes_email_vacation_put"
  end
  # verify the required parameter 'v1_mailboxes_email_vacation_put_request' is set
  if @api_client.config.client_side_validation && v1_mailboxes_email_vacation_put_request.nil?
    fail ArgumentError, "Missing the required parameter 'v1_mailboxes_email_vacation_put_request' when calling MailboxesApi.v1_mailboxes_email_vacation_put"
  end
  # resource path
  local_var_path = '/v1/mailboxes/{email}/vacation'.sub('{email}', CGI.escape(email.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', 'application/problem+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

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

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

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

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

  new_options = opts.merge(
    :operation => :"MailboxesApi.v1_mailboxes_email_vacation_put",
    :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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MailboxesApi#v1_mailboxes_email_vacation_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#v1_mailboxes_get(opts = {}) ⇒ V1MailboxesGet200Response

List mailboxes Returns mailboxes under the calling tenant — active and soft-deleted. ?limit=N between 1 and 200 (default 50).

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer) — default: default to 50

Returns:



758
759
760
761
# File 'lib/lockally/api/mailboxes_api.rb', line 758

def v1_mailboxes_get(opts = {})
  data, _status_code, _headers = v1_mailboxes_get_with_http_info(opts)
  data
end

#v1_mailboxes_get_with_http_info(opts = {}) ⇒ Array<(V1MailboxesGet200Response, Integer, Hash)>

List mailboxes Returns mailboxes under the calling tenant — active and soft-deleted. `?limit=N` between 1 and 200 (default 50).

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer) — default: default to 50

Returns:

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

    V1MailboxesGet200Response data, response status code and response headers



768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
# File 'lib/lockally/api/mailboxes_api.rb', line 768

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

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

  # resource path
  local_var_path = '/v1/mailboxes'

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+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] || 'V1MailboxesGet200Response'

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

  new_options = opts.merge(
    :operation => :"MailboxesApi.v1_mailboxes_get",
    :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#v1_mailboxes_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#v1_mailboxes_post(v1_mailboxes_post_request, opts = {}) ⇒ Mailbox

Create a mailbox Creates a mailbox on a tenant-verified domain. If password is omitted, lockally generates a 16-char password and returns it in the response — shown once. Gate. The mailbox's domain must already be registered AND verified for this tenant (via /v1/domains + /v1/domains/{domain}/verify). Idempotent. Re-posting the same email returns the existing mailbox UNTOUCHED — password is NOT regenerated. To change a password, use PATCH instead.

Parameters:

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

    the optional parameters

Returns:



826
827
828
829
# File 'lib/lockally/api/mailboxes_api.rb', line 826

def v1_mailboxes_post(v1_mailboxes_post_request, opts = {})
  data, _status_code, _headers = v1_mailboxes_post_with_http_info(v1_mailboxes_post_request, opts)
  data
end

#v1_mailboxes_post_with_http_info(v1_mailboxes_post_request, opts = {}) ⇒ Array<(Mailbox, Integer, Hash)>

Create a mailbox Creates a mailbox on a tenant-verified domain. If `password` is omitted, lockally generates a 16-char password and returns it in the response — shown once. Gate. The mailbox's domain must already be registered AND verified for this tenant (via `/v1/domains` + `/v1/domains/domain/verify`). Idempotent. Re-posting the same email returns the existing mailbox UNTOUCHED — password is NOT regenerated. To change a password, use PATCH instead.

Parameters:

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

    the optional parameters

Returns:

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

    Mailbox data, response status code and response headers



836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
# File 'lib/lockally/api/mailboxes_api.rb', line 836

def v1_mailboxes_post_with_http_info(v1_mailboxes_post_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MailboxesApi.v1_mailboxes_post ...'
  end
  # verify the required parameter 'v1_mailboxes_post_request' is set
  if @api_client.config.client_side_validation && v1_mailboxes_post_request.nil?
    fail ArgumentError, "Missing the required parameter 'v1_mailboxes_post_request' when calling MailboxesApi.v1_mailboxes_post"
  end
  # resource path
  local_var_path = '/v1/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', 'application/problem+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

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

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

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

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

  new_options = opts.merge(
    :operation => :"MailboxesApi.v1_mailboxes_post",
    :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#v1_mailboxes_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#v1_vacation_get(opts = {}) ⇒ V1VacationGet200Response

List all vacation responders Returns every vacation responder for the calling tenant.

Parameters:

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

    the optional parameters

Returns:



893
894
895
896
# File 'lib/lockally/api/mailboxes_api.rb', line 893

def v1_vacation_get(opts = {})
  data, _status_code, _headers = v1_vacation_get_with_http_info(opts)
  data
end

#v1_vacation_get_with_http_info(opts = {}) ⇒ Array<(V1VacationGet200Response, Integer, Hash)>

List all vacation responders Returns every vacation responder for the calling tenant.

Parameters:

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

    the optional parameters

Returns:

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

    V1VacationGet200Response data, response status code and response headers



902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
# File 'lib/lockally/api/mailboxes_api.rb', line 902

def v1_vacation_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MailboxesApi.v1_vacation_get ...'
  end
  # resource path
  local_var_path = '/v1/vacation'

  # 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', 'application/problem+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] || 'V1VacationGet200Response'

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

  new_options = opts.merge(
    :operation => :"MailboxesApi.v1_vacation_get",
    :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#v1_vacation_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end