Class: Lockally::AgentsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/lockally/api/agents_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ AgentsApi

Returns a new instance of AgentsApi.



19
20
21
# File 'lib/lockally/api/agents_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/agents_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#v1_api_keys_key_id_mailboxes_get(key_id, opts = {}) ⇒ Object

List a key's mailbox grants

Parameters:

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

    the optional parameters

Returns:

  • (Object)


26
27
28
29
# File 'lib/lockally/api/agents_api.rb', line 26

def v1_api_keys_key_id_mailboxes_get(key_id, opts = {})
  data, _status_code, _headers = v1_api_keys_key_id_mailboxes_get_with_http_info(key_id, opts)
  data
end

#v1_api_keys_key_id_mailboxes_get_with_http_info(key_id, opts = {}) ⇒ Array<(Object, Integer, Hash)>

List a key's mailbox grants

Parameters:

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

    the optional parameters

Returns:

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

    Object data, response status code and response headers



35
36
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
# File 'lib/lockally/api/agents_api.rb', line 35

def v1_api_keys_key_id_mailboxes_get_with_http_info(key_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentsApi.v1_api_keys_key_id_mailboxes_get ...'
  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 AgentsApi.v1_api_keys_key_id_mailboxes_get"
  end
  # resource path
  local_var_path = '/v1/api-keys/{keyID}/mailboxes'.sub('{keyID}', 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] || 'Object'

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

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

#v1_api_keys_key_id_mailboxes_mailbox_id_delete(key_id, mailbox_id, opts = {}) ⇒ nil

Revoke a mailbox grant

Parameters:

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

    the optional parameters

Returns:

  • (nil)


88
89
90
91
# File 'lib/lockally/api/agents_api.rb', line 88

def v1_api_keys_key_id_mailboxes_mailbox_id_delete(key_id, mailbox_id, opts = {})
  v1_api_keys_key_id_mailboxes_mailbox_id_delete_with_http_info(key_id, mailbox_id, opts)
  nil
end

#v1_api_keys_key_id_mailboxes_mailbox_id_delete_with_http_info(key_id, mailbox_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Revoke a mailbox grant

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



98
99
100
101
102
103
104
105
106
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
# File 'lib/lockally/api/agents_api.rb', line 98

def v1_api_keys_key_id_mailboxes_mailbox_id_delete_with_http_info(key_id, mailbox_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentsApi.v1_api_keys_key_id_mailboxes_mailbox_id_delete ...'
  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 AgentsApi.v1_api_keys_key_id_mailboxes_mailbox_id_delete"
  end
  # verify the required parameter 'mailbox_id' is set
  if @api_client.config.client_side_validation && mailbox_id.nil?
    fail ArgumentError, "Missing the required parameter 'mailbox_id' when calling AgentsApi.v1_api_keys_key_id_mailboxes_mailbox_id_delete"
  end
  # resource path
  local_var_path = '/v1/api-keys/{keyID}/mailboxes/{mailboxID}'.sub('{keyID}', CGI.escape(key_id.to_s)).sub('{mailboxID}', CGI.escape(mailbox_id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}

  # 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 => :"AgentsApi.v1_api_keys_key_id_mailboxes_mailbox_id_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: AgentsApi#v1_api_keys_key_id_mailboxes_mailbox_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#v1_api_keys_key_id_mailboxes_post(key_id, opts = {}) ⇒ Object

Grant a mailbox to a key Body: \"email or id\". Refused (422) for mailboxes with agent access disabled or an active E2E encryption key — the server cannot read E2E mailboxes.

Parameters:

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

    the optional parameters

Returns:

  • (Object)


153
154
155
156
# File 'lib/lockally/api/agents_api.rb', line 153

def v1_api_keys_key_id_mailboxes_post(key_id, opts = {})
  data, _status_code, _headers = v1_api_keys_key_id_mailboxes_post_with_http_info(key_id, opts)
  data
end

#v1_api_keys_key_id_mailboxes_post_with_http_info(key_id, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Grant a mailbox to a key Body: \"email or id\". Refused (422) for mailboxes with agent access disabled or an active E2E encryption key — the server cannot read E2E mailboxes.

Parameters:

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

    the optional parameters

Returns:

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

    Object data, response status code and response headers



163
164
165
166
167
168
169
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
# File 'lib/lockally/api/agents_api.rb', line 163

def v1_api_keys_key_id_mailboxes_post_with_http_info(key_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentsApi.v1_api_keys_key_id_mailboxes_post ...'
  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 AgentsApi.v1_api_keys_key_id_mailboxes_post"
  end
  # resource path
  local_var_path = '/v1/api-keys/{keyID}/mailboxes'.sub('{keyID}', 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] || 'Object'

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

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

#v1_auth_whoami_get(opts = {}) ⇒ Object

Introspect the calling credentials Returns the tenant, auth kind (api_key/session), key label, and granted scopes. The MCP server uses this to scope-filter tool discovery.

Parameters:

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

    the optional parameters

Returns:

  • (Object)


215
216
217
218
# File 'lib/lockally/api/agents_api.rb', line 215

def v1_auth_whoami_get(opts = {})
  data, _status_code, _headers = v1_auth_whoami_get_with_http_info(opts)
  data
end

#v1_auth_whoami_get_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

Introspect the calling credentials Returns the tenant, auth kind (api_key/session), key label, and granted scopes. The MCP server uses this to scope-filter tool discovery.

Parameters:

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

    the optional parameters

Returns:

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

    Object data, response status code and response headers



224
225
226
227
228
229
230
231
232
233
234
235
236
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
# File 'lib/lockally/api/agents_api.rb', line 224

def v1_auth_whoami_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentsApi.v1_auth_whoami_get ...'
  end
  # resource path
  local_var_path = '/v1/auth/whoami'

  # 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] || 'Object'

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

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

#v1_contacts_lookup_get(email, opts = {}) ⇒ Object

Who is this sender? Directory record (name, company, role, notes), whether the address is one of the tenant's own mailboxes, and grant-aware correspondence history (thread count, first/last seen across granted mailboxes only).

Parameters:

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

    the optional parameters

Returns:

  • (Object)


273
274
275
276
# File 'lib/lockally/api/agents_api.rb', line 273

def v1_contacts_lookup_get(email, opts = {})
  data, _status_code, _headers = v1_contacts_lookup_get_with_http_info(email, opts)
  data
end

#v1_contacts_lookup_get_with_http_info(email, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Who is this sender? Directory record (name, company, role, notes), whether the address is one of the tenant's own mailboxes, and grant-aware correspondence history (thread count, first/last seen across granted mailboxes only).

Parameters:

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

    the optional parameters

Returns:

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

    Object data, response status code and response headers



283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
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
# File 'lib/lockally/api/agents_api.rb', line 283

def v1_contacts_lookup_get_with_http_info(email, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentsApi.v1_contacts_lookup_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 AgentsApi.v1_contacts_lookup_get"
  end
  # resource path
  local_var_path = '/v1/contacts/lookup'

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

  # 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] || 'Object'

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

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

#v1_inboxes_get(opts = {}) ⇒ Object

List granted inboxes The mailboxes this key is granted, with thread counts and last activity. Admin sessions see every agent-enabled, non-E2E mailbox.

Parameters:

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

    the optional parameters

Returns:

  • (Object)


336
337
338
339
# File 'lib/lockally/api/agents_api.rb', line 336

def v1_inboxes_get(opts = {})
  data, _status_code, _headers = v1_inboxes_get_with_http_info(opts)
  data
end

#v1_inboxes_get_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

List granted inboxes The mailboxes this key is granted, with thread counts and last activity. Admin sessions see every agent-enabled, non-E2E mailbox.

Parameters:

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

    the optional parameters

Returns:

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

    Object data, response status code and response headers



345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
# File 'lib/lockally/api/agents_api.rb', line 345

def v1_inboxes_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentsApi.v1_inboxes_get ...'
  end
  # resource path
  local_var_path = '/v1/inboxes'

  # 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] || 'Object'

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

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

#v1_inboxes_mailbox_messages_post(mailbox, idempotency_key, v1_inboxes_mailbox_messages_post_request, opts = {}) ⇒ Object

Start a new conversation (agent stream) Sends a new email from a granted mailbox. Classified stream=agent (isolated reputation, per-key rate caps). The first inbound reply adopts the created thread via the References chain. Idempotency-Key required. Mailboxes with agent_draft_policy=always_approve divert this into a pending draft.

Parameters:

  • mailbox (String)
  • idempotency_key (String)
  • v1_inboxes_mailbox_messages_post_request (V1InboxesMailboxMessagesPostRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


396
397
398
399
# File 'lib/lockally/api/agents_api.rb', line 396

def v1_inboxes_mailbox_messages_post(mailbox, idempotency_key, v1_inboxes_mailbox_messages_post_request, opts = {})
  data, _status_code, _headers = v1_inboxes_mailbox_messages_post_with_http_info(mailbox, idempotency_key, v1_inboxes_mailbox_messages_post_request, opts)
  data
end

#v1_inboxes_mailbox_messages_post_with_http_info(mailbox, idempotency_key, v1_inboxes_mailbox_messages_post_request, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Start a new conversation (agent stream) Sends a new email from a granted mailbox. Classified stream=agent (isolated reputation, per-key rate caps). The first inbound reply adopts the created thread via the References chain. Idempotency-Key required. Mailboxes with agent_draft_policy=always_approve divert this into a pending draft.

Parameters:

  • mailbox (String)
  • idempotency_key (String)
  • v1_inboxes_mailbox_messages_post_request (V1InboxesMailboxMessagesPostRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    Object data, response status code and response headers



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
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
# File 'lib/lockally/api/agents_api.rb', line 408

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

  # verify the required parameter 'v1_inboxes_mailbox_messages_post_request' is set
  if @api_client.config.client_side_validation && v1_inboxes_mailbox_messages_post_request.nil?
    fail ArgumentError, "Missing the required parameter 'v1_inboxes_mailbox_messages_post_request' when calling AgentsApi.v1_inboxes_mailbox_messages_post"
  end
  # resource path
  local_var_path = '/v1/inboxes/{mailbox}/messages'.sub('{mailbox}', CGI.escape(mailbox.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'] = idempotency_key

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

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

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

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

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

#v1_inboxes_mailbox_threads_get(mailbox, opts = {}) ⇒ Object

List conversation threads Newest-active first. Cursors: ?before=<RFC3339> pages backwards; ?since=<RFC3339> delta-syncs forward (oldest first) so an agent can catch up in order.

Parameters:

  • mailbox (String)

    mailbox email or id

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

    the optional parameters

Options Hash (opts):

  • :since (Time)
  • :before (Time)
  • :limit (Integer) — default: default to 50

Returns:

  • (Object)


482
483
484
485
# File 'lib/lockally/api/agents_api.rb', line 482

def v1_inboxes_mailbox_threads_get(mailbox, opts = {})
  data, _status_code, _headers = v1_inboxes_mailbox_threads_get_with_http_info(mailbox, opts)
  data
end

#v1_inboxes_mailbox_threads_get_with_http_info(mailbox, opts = {}) ⇒ Array<(Object, Integer, Hash)>

List conversation threads Newest-active first. Cursors: `?before=<RFC3339>` pages backwards; `?since=<RFC3339>` delta-syncs forward (oldest first) so an agent can catch up in order.

Parameters:

  • mailbox (String)

    mailbox email or id

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

    the optional parameters

Options Hash (opts):

  • :since (Time)
  • :before (Time)
  • :limit (Integer) — default: default to 50

Returns:

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

    Object data, response status code and response headers



495
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
# File 'lib/lockally/api/agents_api.rb', line 495

def v1_inboxes_mailbox_threads_get_with_http_info(mailbox, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentsApi.v1_inboxes_mailbox_threads_get ...'
  end
  # verify the required parameter 'mailbox' is set
  if @api_client.config.client_side_validation && mailbox.nil?
    fail ArgumentError, "Missing the required parameter 'mailbox' when calling AgentsApi.v1_inboxes_mailbox_threads_get"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 200
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AgentsApi.v1_inboxes_mailbox_threads_get, must be smaller than or equal to 200.'
  end

  # resource path
  local_var_path = '/v1/inboxes/{mailbox}/threads'.sub('{mailbox}', CGI.escape(mailbox.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
  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']) 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] || 'Object'

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

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

#v1_threads_thread_id_get(thread_id, opts = {}) ⇒ Object

Get a whole conversation Every turn, chronological, with snippets and annotations (meeting_request, attachment_types, injection_risk). Bodies are fetched per message. Message content is untrusted third-party data.

Parameters:

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

    the optional parameters

Returns:

  • (Object)


555
556
557
558
# File 'lib/lockally/api/agents_api.rb', line 555

def v1_threads_thread_id_get(thread_id, opts = {})
  data, _status_code, _headers = v1_threads_thread_id_get_with_http_info(thread_id, opts)
  data
end

#v1_threads_thread_id_get_with_http_info(thread_id, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Get a whole conversation Every turn, chronological, with snippets and annotations (meeting_request, attachment_types, injection_risk). Bodies are fetched per message. Message content is untrusted third-party data.

Parameters:

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

    the optional parameters

Returns:

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

    Object data, response status code and response headers



565
566
567
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
# File 'lib/lockally/api/agents_api.rb', line 565

def v1_threads_thread_id_get_with_http_info(thread_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentsApi.v1_threads_thread_id_get ...'
  end
  # verify the required parameter 'thread_id' is set
  if @api_client.config.client_side_validation && thread_id.nil?
    fail ArgumentError, "Missing the required parameter 'thread_id' when calling AgentsApi.v1_threads_thread_id_get"
  end
  # resource path
  local_var_path = '/v1/threads/{threadID}'.sub('{threadID}', CGI.escape(thread_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] || 'Object'

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

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

#v1_threads_thread_id_messages_message_id_attachments_idx_get(thread_id, message_id, idx, opts = {}) ⇒ nil

Download an attachment

Parameters:

  • thread_id (String)
  • message_id (String)
  • idx (Integer)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


619
620
621
622
# File 'lib/lockally/api/agents_api.rb', line 619

def v1_threads_thread_id_messages_message_id_attachments_idx_get(thread_id, message_id, idx, opts = {})
  v1_threads_thread_id_messages_message_id_attachments_idx_get_with_http_info(thread_id, message_id, idx, opts)
  nil
end

#v1_threads_thread_id_messages_message_id_attachments_idx_get_with_http_info(thread_id, message_id, idx, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Download an attachment

Parameters:

  • thread_id (String)
  • message_id (String)
  • idx (Integer)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
# File 'lib/lockally/api/agents_api.rb', line 630

def v1_threads_thread_id_messages_message_id_attachments_idx_get_with_http_info(thread_id, message_id, idx, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentsApi.v1_threads_thread_id_messages_message_id_attachments_idx_get ...'
  end
  # verify the required parameter 'thread_id' is set
  if @api_client.config.client_side_validation && thread_id.nil?
    fail ArgumentError, "Missing the required parameter 'thread_id' when calling AgentsApi.v1_threads_thread_id_messages_message_id_attachments_idx_get"
  end
  # verify the required parameter 'message_id' is set
  if @api_client.config.client_side_validation && message_id.nil?
    fail ArgumentError, "Missing the required parameter 'message_id' when calling AgentsApi.v1_threads_thread_id_messages_message_id_attachments_idx_get"
  end
  # verify the required parameter 'idx' is set
  if @api_client.config.client_side_validation && idx.nil?
    fail ArgumentError, "Missing the required parameter 'idx' when calling AgentsApi.v1_threads_thread_id_messages_message_id_attachments_idx_get"
  end
  if @api_client.config.client_side_validation && idx < 0
    fail ArgumentError, 'invalid value for "idx" when calling AgentsApi.v1_threads_thread_id_messages_message_id_attachments_idx_get, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/v1/threads/{threadID}/messages/{messageID}/attachments/{idx}'.sub('{threadID}', CGI.escape(thread_id.to_s)).sub('{messageID}', CGI.escape(message_id.to_s)).sub('{idx}', CGI.escape(idx.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}

  # 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 => :"AgentsApi.v1_threads_thread_id_messages_message_id_attachments_idx_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: AgentsApi#v1_threads_thread_id_messages_message_id_attachments_idx_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#v1_threads_thread_id_messages_message_id_get(thread_id, message_id, opts = {}) ⇒ Object

Get one message with body Full text/html body fetched on demand from mail storage. Never marks the message read.

Parameters:

  • thread_id (String)
  • message_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


694
695
696
697
# File 'lib/lockally/api/agents_api.rb', line 694

def v1_threads_thread_id_messages_message_id_get(thread_id, message_id, opts = {})
  data, _status_code, _headers = v1_threads_thread_id_messages_message_id_get_with_http_info(thread_id, message_id, opts)
  data
end

#v1_threads_thread_id_messages_message_id_get_with_http_info(thread_id, message_id, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Get one message with body Full text/html body fetched on demand from mail storage. Never marks the message read.

Parameters:

  • thread_id (String)
  • message_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    Object data, response status code and response headers



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
752
753
754
755
# File 'lib/lockally/api/agents_api.rb', line 705

def v1_threads_thread_id_messages_message_id_get_with_http_info(thread_id, message_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentsApi.v1_threads_thread_id_messages_message_id_get ...'
  end
  # verify the required parameter 'thread_id' is set
  if @api_client.config.client_side_validation && thread_id.nil?
    fail ArgumentError, "Missing the required parameter 'thread_id' when calling AgentsApi.v1_threads_thread_id_messages_message_id_get"
  end
  # verify the required parameter 'message_id' is set
  if @api_client.config.client_side_validation && message_id.nil?
    fail ArgumentError, "Missing the required parameter 'message_id' when calling AgentsApi.v1_threads_thread_id_messages_message_id_get"
  end
  # resource path
  local_var_path = '/v1/threads/{threadID}/messages/{messageID}'.sub('{threadID}', CGI.escape(thread_id.to_s)).sub('{messageID}', CGI.escape(message_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] || 'Object'

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

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

#v1_threads_thread_id_messages_message_id_read_post(thread_id, message_id, opts = {}) ⇒ Object

Mark read/unread The ONLY way agent access changes unread state. Body: true|false (default true).

Parameters:

  • thread_id (String)
  • message_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


763
764
765
766
# File 'lib/lockally/api/agents_api.rb', line 763

def v1_threads_thread_id_messages_message_id_read_post(thread_id, message_id, opts = {})
  data, _status_code, _headers = v1_threads_thread_id_messages_message_id_read_post_with_http_info(thread_id, message_id, opts)
  data
end

#v1_threads_thread_id_messages_message_id_read_post_with_http_info(thread_id, message_id, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Mark read/unread The ONLY way agent access changes unread state. Body: true|false (default true).

Parameters:

  • thread_id (String)
  • message_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    Object data, response status code and response headers



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
820
821
822
823
824
# File 'lib/lockally/api/agents_api.rb', line 774

def v1_threads_thread_id_messages_message_id_read_post_with_http_info(thread_id, message_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AgentsApi.v1_threads_thread_id_messages_message_id_read_post ...'
  end
  # verify the required parameter 'thread_id' is set
  if @api_client.config.client_side_validation && thread_id.nil?
    fail ArgumentError, "Missing the required parameter 'thread_id' when calling AgentsApi.v1_threads_thread_id_messages_message_id_read_post"
  end
  # verify the required parameter 'message_id' is set
  if @api_client.config.client_side_validation && message_id.nil?
    fail ArgumentError, "Missing the required parameter 'message_id' when calling AgentsApi.v1_threads_thread_id_messages_message_id_read_post"
  end
  # resource path
  local_var_path = '/v1/threads/{threadID}/messages/{messageID}/read'.sub('{threadID}', CGI.escape(thread_id.to_s)).sub('{messageID}', CGI.escape(message_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] || 'Object'

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

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

#v1_threads_thread_id_reply_post(thread_id, idempotency_key, opts = {}) ⇒ Object

Reply in-thread (agent stream) The server builds In-Reply-To/References and defaults recipients + subject from the conversation — a minimal call is \"...\". Guarded by the reply-loop detector (≥5 outbound/10min → 429 + agent.loop_detected). Idempotency-Key required.

Parameters:

  • thread_id (String)
  • idempotency_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


832
833
834
835
# File 'lib/lockally/api/agents_api.rb', line 832

def v1_threads_thread_id_reply_post(thread_id, idempotency_key, opts = {})
  data, _status_code, _headers = v1_threads_thread_id_reply_post_with_http_info(thread_id, idempotency_key, opts)
  data
end

#v1_threads_thread_id_reply_post_with_http_info(thread_id, idempotency_key, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Reply in-thread (agent stream) The server builds In-Reply-To/References and defaults recipients + subject from the conversation — a minimal call is \"...\". Guarded by the reply-loop detector (≥5 outbound/10min → 429 + agent.loop_detected). Idempotency-Key required.

Parameters:

  • thread_id (String)
  • idempotency_key (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    Object data, response status code and response headers



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
888
889
890
891
892
893
894
895
896
897
898
# File 'lib/lockally/api/agents_api.rb', line 843

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

  # resource path
  local_var_path = '/v1/threads/{threadID}/reply'.sub('{threadID}', CGI.escape(thread_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'] = idempotency_key

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

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

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

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

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