sendmux-mailbox 1.2.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 185a1cf244f03c241ad489815c5775df280176f155933b4a7993d6e10a6b21e0
4
- data.tar.gz: ac65eea0e636acb0c16ecf60a2e986dfcceff9fea7d6d8419438625932c13500
3
+ metadata.gz: c8e1b0e705f607337315096115ace9127a97f01d79aca0c2e5fecc48b4c7ed8e
4
+ data.tar.gz: 3a924f8fc35fd94b028d3a16ca97140e16b29aa2a680d92de07c0b4d7d6a81ab
5
5
  SHA512:
6
- metadata.gz: c6c951a2c866d039d5553f3c4d97c8ee895d93422c252168912cb418a0e71092fcbcda468f8348cefb1fc2b9ce092a107c1eaab860ffb59d216817f1bb9b65f6
7
- data.tar.gz: b97ee7501cc9ef8f72d09d7453036855e1a511d2dc77f421c4a9f1db895077e44142eff7853b1fa0ad165ad15a554fe88d2255681069c7492ce63015bd707326
6
+ metadata.gz: 5eab57ef617a7d08c59da74bbb0126cc1e30c2ffcb7316cd832e37e6ba6fb5b99658a44a3b7686c2e310722afdbba7988f67d74b1d2cfcf976ace33cb825ac65
7
+ data.tar.gz: cb889b2b515e98b60e826e4f3404effe59593ff0c83950ecd8e91ae2021312691ffe3cad4d86540e2e89b7c8bbfc972ffdaa294a257cc01474ee2c6856cd8fc5
data/CHANGELOG.md CHANGED
@@ -1,10 +1,20 @@
1
1
  # Changelog
2
2
 
3
- ## Unreleased
3
+ ## [1.4.0](https://github.com/Sendmux/sendmux-sdk/compare/ruby-mailbox/v1.3.0...ruby-mailbox/v1.4.0) (2026-09-10)
4
+
5
+
6
+ ### Features
7
+
8
+ * add REST OAuth clients and CLI token lifecycle ([cc4a3aa](https://github.com/Sendmux/sendmux-sdk/commit/cc4a3aa6110378641418a94455ed5b9a986e65ff))
9
+
10
+ ## [1.3.0](https://github.com/Sendmux/sendmux-sdk/compare/ruby-mailbox/v1.2.0...ruby-mailbox/v1.3.0) (2026-09-08)
11
+
4
12
 
5
13
  ### Features
6
14
 
7
15
  * regenerate mailbox models for short-lived attachment download URLs and upload intents
16
+ * add connection checks across SDKs, CLI and MCP ([77f449e](https://github.com/Sendmux/sendmux-sdk/commit/77f449e2c8cba49bc8bc84c49c35baa61120866a))
17
+ * **sdk:** add connection checks across clients, CLI and MCP ([3e02c67](https://github.com/Sendmux/sendmux-sdk/commit/3e02c67dcab45e37dad7abbdd4c4e1bd0b1fbbe6))
8
18
 
9
19
  ## [1.2.0](https://github.com/Sendmux/sendmux-sdk/compare/ruby-mailbox/v1.1.0...ruby-mailbox/v1.2.0) (2026-07-08)
10
20
 
data/README.md CHANGED
@@ -18,6 +18,8 @@ Ruby SDK package for the Sendmux Mailbox API.
18
18
  - Ruby 3.1 or newer.
19
19
  - A mailbox-scoped `smx_mbx_` key or scoped `smx_agent_` token.
20
20
 
21
+ For OAuth, use a REST access token with the scopes and mailbox access required by the operation. See [OAuth for REST APIs](https://sendmux.ai/docs/developer-tools/oauth).
22
+
21
23
  ## Installation
22
24
 
23
25
  ```sh
@@ -30,9 +32,21 @@ Or add it to your Gemfile:
30
32
  gem "sendmux-mailbox", "~> 1.0"
31
33
  ```
32
34
 
35
+ ## OAuth access tokens
36
+
37
+ Pass either `api_key:` or `access_token:`. `access_token:` accepts a bare token string or a callable; the callable is evaluated once per authenticated request. Your application owns token storage, expiry checks and refresh coordination.
38
+
39
+ ```ruby
40
+ require "sendmux/mailbox"
41
+
42
+ client = Sendmux::Mailbox::Client.new(
43
+ access_token: -> { ENV.fetch("SENDMUX_ACCESS_TOKEN") }
44
+ )
45
+ ```
46
+
33
47
  ## Usage
34
48
 
35
- Create a mailbox client with a mailbox key or scoped agent token before calling generated operations.
49
+ Create a mailbox client with a mailbox key or scoped agent token for the API-key example below.
36
50
 
37
51
  ```ruby
38
52
  require "sendmux/mailbox"
@@ -5,6 +5,12 @@ module Sendmux
5
5
  DEFAULT_BASE_URL = 'https://app.sendmux.ai/api/v1'
6
6
 
7
7
  class ApiClient < Generated::ApiClient
8
+ def update_params_for_auth!(header_params, query_params, auth_names)
9
+ return super unless config.access_token_getter && !Array(auth_names).empty?
10
+
11
+ header_params['Authorization'] = "Bearer #{config.access_token_with_refresh}"
12
+ end
13
+
8
14
  def call_api(...)
9
15
  super
10
16
  rescue Generated::ApiError => e
@@ -15,12 +21,13 @@ module Sendmux
15
21
  class Client
16
22
  attr_reader :api_client, :configuration
17
23
 
18
- def initialize(api_key:, base_url: DEFAULT_BASE_URL, retry_options: nil)
24
+ def initialize(api_key: nil, access_token: nil, base_url: DEFAULT_BASE_URL, retry_options: nil)
19
25
  @configuration = Sendmux::Core::Auth.configure_bearer(
20
26
  Generated::Configuration.new,
21
27
  api_key,
22
28
  Sendmux::Core::ApiKeySurface::MAILBOX,
23
- base_url: base_url
29
+ base_url: base_url,
30
+ access_token: access_token
24
31
  )
25
32
  Sendmux::Core::Retry.configure(@configuration, retry_options)
26
33
  @api_client = ApiClient.new(@configuration)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sendmux
4
4
  module Mailbox
5
- VERSION = '1.2.0'
5
+ VERSION = '1.4.0'
6
6
  end
7
7
  end
@@ -67,7 +67,7 @@ module Sendmux::Mailbox::Generated
67
67
  return_type = opts[:debug_return_type] || 'MailboxBatchDeleteMessagesResultResponse'
68
68
 
69
69
  # auth_names
70
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
70
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
71
71
 
72
72
  new_options = opts.merge(
73
73
  :operation => :"MailboxAPIApi.mailbox_batch_delete_messages",
@@ -134,7 +134,7 @@ module Sendmux::Mailbox::Generated
134
134
  return_type = opts[:debug_return_type] || 'MailboxBatchGetResultResponse'
135
135
 
136
136
  # auth_names
137
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
137
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
138
138
 
139
139
  new_options = opts.merge(
140
140
  :operation => :"MailboxAPIApi.mailbox_batch_get_messages",
@@ -201,7 +201,7 @@ module Sendmux::Mailbox::Generated
201
201
  return_type = opts[:debug_return_type] || 'MailboxBatchUpdateMessagesResultResponse'
202
202
 
203
203
  # auth_names
204
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
204
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
205
205
 
206
206
  new_options = opts.merge(
207
207
  :operation => :"MailboxAPIApi.mailbox_batch_update_messages",
@@ -326,7 +326,7 @@ module Sendmux::Mailbox::Generated
326
326
  return_type = opts[:debug_return_type] || 'MailboxMessageCountResponse'
327
327
 
328
328
  # auth_names
329
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
329
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
330
330
 
331
331
  new_options = opts.merge(
332
332
  :operation => :"MailboxAPIApi.mailbox_count_messages",
@@ -346,7 +346,7 @@ module Sendmux::Mailbox::Generated
346
346
  end
347
347
 
348
348
  # Create a presigned mailbox attachment upload
349
- # Creates a short-lived signed PUT URL for one attachment. The caller must be authenticated to mint the URL; the later PUT uses the signed URL, exact Content-Type, and exact Content-Length without sending an API key. The PUT returns a blob ID that can be supplied to `POST /mailbox/messages/send`.
349
+ # Creates a short-lived signed PUT URL for one attachment. The caller must be authenticated to mint the URL; the later PUT uses the signed URL, exact Content-Type, and exact Content-Length without sending a bearer token. The PUT returns a blob ID that can be supplied to `POST /mailbox/messages/send`.
350
350
  # @param [Hash] opts the optional parameters
351
351
  # @option opts [String] :mailbox_id Mailbox public ID to target when the credential grants access to more than one mailbox. Omit when the credential is scoped to exactly one mailbox.
352
352
  # @option opts [MailboxAttachmentUploadIntentBody] :mailbox_attachment_upload_intent_body
@@ -357,7 +357,7 @@ module Sendmux::Mailbox::Generated
357
357
  end
358
358
 
359
359
  # Create a presigned mailbox attachment upload
360
- # Creates a short-lived signed PUT URL for one attachment. The caller must be authenticated to mint the URL; the later PUT uses the signed URL, exact Content-Type, and exact Content-Length without sending an API key. The PUT returns a blob ID that can be supplied to &#x60;POST /mailbox/messages/send&#x60;.
360
+ # Creates a short-lived signed PUT URL for one attachment. The caller must be authenticated to mint the URL; the later PUT uses the signed URL, exact Content-Type, and exact Content-Length without sending a bearer token. The PUT returns a blob ID that can be supplied to &#x60;POST /mailbox/messages/send&#x60;.
361
361
  # @param [Hash] opts the optional parameters
362
362
  # @option opts [String] :mailbox_id Mailbox public ID to target when the credential grants access to more than one mailbox. Omit when the credential is scoped to exactly one mailbox.
363
363
  # @option opts [MailboxAttachmentUploadIntentBody] :mailbox_attachment_upload_intent_body
@@ -393,7 +393,7 @@ module Sendmux::Mailbox::Generated
393
393
  return_type = opts[:debug_return_type] || 'MailboxAttachmentUploadIntentResultResponse'
394
394
 
395
395
  # auth_names
396
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
396
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
397
397
 
398
398
  new_options = opts.merge(
399
399
  :operation => :"MailboxAPIApi.mailbox_create_attachment_upload",
@@ -460,7 +460,7 @@ module Sendmux::Mailbox::Generated
460
460
  return_type = opts[:debug_return_type] || 'MailboxFolderResponse'
461
461
 
462
462
  # auth_names
463
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
463
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
464
464
 
465
465
  new_options = opts.merge(
466
466
  :operation => :"MailboxAPIApi.mailbox_create_folder",
@@ -529,7 +529,7 @@ module Sendmux::Mailbox::Generated
529
529
  return_type = opts[:debug_return_type] || 'MailboxFolderDeletedResponse'
530
530
 
531
531
  # auth_names
532
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
532
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
533
533
 
534
534
  new_options = opts.merge(
535
535
  :operation => :"MailboxAPIApi.mailbox_delete_folder",
@@ -601,7 +601,7 @@ module Sendmux::Mailbox::Generated
601
601
  return_type = opts[:debug_return_type] || 'MailboxMessageDeletedResponse'
602
602
 
603
603
  # auth_names
604
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
604
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
605
605
 
606
606
  new_options = opts.merge(
607
607
  :operation => :"MailboxAPIApi.mailbox_delete_message",
@@ -696,7 +696,7 @@ module Sendmux::Mailbox::Generated
696
696
  return_type = opts[:debug_return_type] || 'MailboxGetChanges200Response'
697
697
 
698
698
  # auth_names
699
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
699
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
700
700
 
701
701
  new_options = opts.merge(
702
702
  :operation => :"MailboxAPIApi.mailbox_get_changes",
@@ -715,6 +715,66 @@ module Sendmux::Mailbox::Generated
715
715
  return data, status_code, headers
716
716
  end
717
717
 
718
+ # Get Mailbox connection
719
+ # Validate this credential and return its team, connection label, permissions and authorised mailboxes. No additional read permission or mailbox selection is required. Mailbox storage and sending availability are not checked. No user profile or secrets are returned.
720
+ # @param [Hash] opts the optional parameters
721
+ # @option opts [String] :if_none_match ETag from a previous response. A match returns 304 with no body after rechecking authentication.
722
+ # @return [ConnectionResponse]
723
+ def mailbox_get_connection(opts = {})
724
+ data, _status_code, _headers = mailbox_get_connection_with_http_info(opts)
725
+ data
726
+ end
727
+
728
+ # Get Mailbox connection
729
+ # Validate this credential and return its team, connection label, permissions and authorised mailboxes. No additional read permission or mailbox selection is required. Mailbox storage and sending availability are not checked. No user profile or secrets are returned.
730
+ # @param [Hash] opts the optional parameters
731
+ # @option opts [String] :if_none_match ETag from a previous response. A match returns 304 with no body after rechecking authentication.
732
+ # @return [Array<(ConnectionResponse, Integer, Hash)>] ConnectionResponse data, response status code and response headers
733
+ def mailbox_get_connection_with_http_info(opts = {})
734
+ if @api_client.config.debugging
735
+ @api_client.config.logger.debug 'Calling API: MailboxAPIApi.mailbox_get_connection ...'
736
+ end
737
+ # resource path
738
+ local_var_path = '/mailbox/connection'
739
+
740
+ # query parameters
741
+ query_params = opts[:query_params] || {}
742
+
743
+ # header parameters
744
+ header_params = opts[:header_params] || {}
745
+ # HTTP header 'Accept' (if needed)
746
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
747
+ header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?
748
+
749
+ # form parameters
750
+ form_params = opts[:form_params] || {}
751
+
752
+ # http body (model)
753
+ post_body = opts[:debug_body]
754
+
755
+ # return_type
756
+ return_type = opts[:debug_return_type] || 'ConnectionResponse'
757
+
758
+ # auth_names
759
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
760
+
761
+ new_options = opts.merge(
762
+ :operation => :"MailboxAPIApi.mailbox_get_connection",
763
+ :header_params => header_params,
764
+ :query_params => query_params,
765
+ :form_params => form_params,
766
+ :body => post_body,
767
+ :auth_names => auth_names,
768
+ :return_type => return_type
769
+ )
770
+
771
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
772
+ if @api_client.config.debugging
773
+ @api_client.config.logger.debug "API called: MailboxAPIApi#mailbox_get_connection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
774
+ end
775
+ return data, status_code, headers
776
+ end
777
+
718
778
  # Get a mailbox folder
719
779
  # Returns one folder from the authenticated mailbox. Responses include a weak `ETag` header.
720
780
  # @param folder_id [String]
@@ -765,7 +825,7 @@ module Sendmux::Mailbox::Generated
765
825
  return_type = opts[:debug_return_type] || 'MailboxFolderResponse'
766
826
 
767
827
  # auth_names
768
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
828
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
769
829
 
770
830
  new_options = opts.merge(
771
831
  :operation => :"MailboxAPIApi.mailbox_get_folder",
@@ -839,7 +899,7 @@ module Sendmux::Mailbox::Generated
839
899
  return_type = opts[:debug_return_type] || 'MailboxChangesResponse'
840
900
 
841
901
  # auth_names
842
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
902
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
843
903
 
844
904
  new_options = opts.merge(
845
905
  :operation => :"MailboxAPIApi.mailbox_get_folder_changes",
@@ -899,7 +959,7 @@ module Sendmux::Mailbox::Generated
899
959
  return_type = opts[:debug_return_type] || 'MailboxIdentityResponse'
900
960
 
901
961
  # auth_names
902
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
962
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
903
963
 
904
964
  new_options = opts.merge(
905
965
  :operation => :"MailboxAPIApi.mailbox_get_identity",
@@ -919,7 +979,7 @@ module Sendmux::Mailbox::Generated
919
979
  end
920
980
 
921
981
  # Self-introspect the calling mailbox
922
- # Returns the mailbox the bearer token is scoped to, including live storage usage. Intended for SDK auto-discovery — call once on startup to resolve the mailbox ID. Requires a mailbox-scoped API key; root keys receive 403. Responses carry a weak `ETag` header — send it back as `If-None-Match` on the next request and the server will return `304 Not Modified` (no body) when the mailbox state has not changed.
982
+ # Returns the selected mailbox, including live storage usage. Requires a mailbox credential or OAuth grant with Mailbox API access. For credential validation without selecting a mailbox or checking storage, use GET /mailbox/connection. Responses carry a weak `ETag` header — send it back as `If-None-Match` on the next request and the server will return `304 Not Modified` (no body) when the mailbox state has not changed.
923
983
  # @param [Hash] opts the optional parameters
924
984
  # @option opts [String] :if_none_match
925
985
  # @option opts [String] :mailbox_id Mailbox public ID to target when the credential grants access to more than one mailbox. Omit when the credential is scoped to exactly one mailbox.
@@ -930,7 +990,7 @@ module Sendmux::Mailbox::Generated
930
990
  end
931
991
 
932
992
  # Self-introspect the calling mailbox
933
- # Returns the mailbox the bearer token is scoped to, including live storage usage. Intended for SDK auto-discovery — call once on startup to resolve the mailbox ID. Requires a mailbox-scoped API key; root keys receive 403. Responses carry a weak &#x60;ETag&#x60; header — send it back as &#x60;If-None-Match&#x60; on the next request and the server will return &#x60;304 Not Modified&#x60; (no body) when the mailbox state has not changed.
993
+ # Returns the selected mailbox, including live storage usage. Requires a mailbox credential or OAuth grant with Mailbox API access. For credential validation without selecting a mailbox or checking storage, use GET /mailbox/connection. Responses carry a weak &#x60;ETag&#x60; header — send it back as &#x60;If-None-Match&#x60; on the next request and the server will return &#x60;304 Not Modified&#x60; (no body) when the mailbox state has not changed.
934
994
  # @param [Hash] opts the optional parameters
935
995
  # @option opts [String] :if_none_match
936
996
  # @option opts [String] :mailbox_id Mailbox public ID to target when the credential grants access to more than one mailbox. Omit when the credential is scoped to exactly one mailbox.
@@ -962,7 +1022,7 @@ module Sendmux::Mailbox::Generated
962
1022
  return_type = opts[:debug_return_type] || 'MailboxMeItemResponse'
963
1023
 
964
1024
  # auth_names
965
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
1025
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
966
1026
 
967
1027
  new_options = opts.merge(
968
1028
  :operation => :"MailboxAPIApi.mailbox_get_me",
@@ -1031,7 +1091,7 @@ module Sendmux::Mailbox::Generated
1031
1091
  return_type = opts[:debug_return_type] || 'MailboxMessageDetailResponse'
1032
1092
 
1033
1093
  # auth_names
1034
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
1094
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
1035
1095
 
1036
1096
  new_options = opts.merge(
1037
1097
  :operation => :"MailboxAPIApi.mailbox_get_message",
@@ -1109,7 +1169,7 @@ module Sendmux::Mailbox::Generated
1109
1169
  return_type = opts[:debug_return_type]
1110
1170
 
1111
1171
  # auth_names
1112
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
1172
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
1113
1173
 
1114
1174
  new_options = opts.merge(
1115
1175
  :operation => :"MailboxAPIApi.mailbox_get_message_attachment",
@@ -1183,7 +1243,7 @@ module Sendmux::Mailbox::Generated
1183
1243
  return_type = opts[:debug_return_type] || 'MailboxChangesResponse'
1184
1244
 
1185
1245
  # auth_names
1186
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
1246
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
1187
1247
 
1188
1248
  new_options = opts.merge(
1189
1249
  :operation => :"MailboxAPIApi.mailbox_get_quota_changes",
@@ -1246,7 +1306,7 @@ module Sendmux::Mailbox::Generated
1246
1306
  return_type = opts[:debug_return_type] || 'MailboxSessionResponse'
1247
1307
 
1248
1308
  # auth_names
1249
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
1309
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
1250
1310
 
1251
1311
  new_options = opts.merge(
1252
1312
  :operation => :"MailboxAPIApi.mailbox_get_session",
@@ -1315,7 +1375,7 @@ module Sendmux::Mailbox::Generated
1315
1375
  return_type = opts[:debug_return_type] || 'MailboxSubmissionResponse'
1316
1376
 
1317
1377
  # auth_names
1318
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
1378
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
1319
1379
 
1320
1380
  new_options = opts.merge(
1321
1381
  :operation => :"MailboxAPIApi.mailbox_get_submission",
@@ -1389,7 +1449,7 @@ module Sendmux::Mailbox::Generated
1389
1449
  return_type = opts[:debug_return_type] || 'MailboxChangesResponse'
1390
1450
 
1391
1451
  # auth_names
1392
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
1452
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
1393
1453
 
1394
1454
  new_options = opts.merge(
1395
1455
  :operation => :"MailboxAPIApi.mailbox_get_submission_changes",
@@ -1458,7 +1518,7 @@ module Sendmux::Mailbox::Generated
1458
1518
  return_type = opts[:debug_return_type] || 'MailboxThreadDetailResponse'
1459
1519
 
1460
1520
  # auth_names
1461
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
1521
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
1462
1522
 
1463
1523
  new_options = opts.merge(
1464
1524
  :operation => :"MailboxAPIApi.mailbox_get_thread",
@@ -1592,7 +1652,7 @@ module Sendmux::Mailbox::Generated
1592
1652
  return_type = opts[:debug_return_type] || 'MailboxThreadContentResponse'
1593
1653
 
1594
1654
  # auth_names
1595
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
1655
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
1596
1656
 
1597
1657
  new_options = opts.merge(
1598
1658
  :operation => :"MailboxAPIApi.mailbox_get_thread_content",
@@ -1679,7 +1739,7 @@ module Sendmux::Mailbox::Generated
1679
1739
  return_type = opts[:debug_return_type] || 'MailboxRawBodyResponse'
1680
1740
 
1681
1741
  # auth_names
1682
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
1742
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
1683
1743
 
1684
1744
  new_options = opts.merge(
1685
1745
  :operation => :"MailboxAPIApi.mailbox_list_body",
@@ -1792,7 +1852,7 @@ module Sendmux::Mailbox::Generated
1792
1852
  return_type = opts[:debug_return_type] || 'MailboxMessageContentResponse'
1793
1853
 
1794
1854
  # auth_names
1795
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
1855
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
1796
1856
 
1797
1857
  new_options = opts.merge(
1798
1858
  :operation => :"MailboxAPIApi.mailbox_list_content",
@@ -1866,7 +1926,7 @@ module Sendmux::Mailbox::Generated
1866
1926
  return_type = opts[:debug_return_type] || 'MailboxFolderCursorListResponse'
1867
1927
 
1868
1928
  # auth_names
1869
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
1929
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
1870
1930
 
1871
1931
  new_options = opts.merge(
1872
1932
  :operation => :"MailboxAPIApi.mailbox_list_folders",
@@ -1940,7 +2000,7 @@ module Sendmux::Mailbox::Generated
1940
2000
  return_type = opts[:debug_return_type] || 'GrantedMailboxListResponse'
1941
2001
 
1942
2002
  # auth_names
1943
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
2003
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
1944
2004
 
1945
2005
  new_options = opts.merge(
1946
2006
  :operation => :"MailboxAPIApi.mailbox_list_granted_mailboxes",
@@ -2014,7 +2074,7 @@ module Sendmux::Mailbox::Generated
2014
2074
  return_type = opts[:debug_return_type] || 'MailboxIdentityCursorListResponse'
2015
2075
 
2016
2076
  # auth_names
2017
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
2077
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
2018
2078
 
2019
2079
  new_options = opts.merge(
2020
2080
  :operation => :"MailboxAPIApi.mailbox_list_identities",
@@ -2034,7 +2094,7 @@ module Sendmux::Mailbox::Generated
2034
2094
  end
2035
2095
 
2036
2096
  # List mailbox messages
2037
- # Returns a cursor-paginated list of messages for the authenticated mailbox. Requires a mailbox API key.
2097
+ # Returns a cursor-paginated list of messages for the authenticated mailbox. Requires Mailbox API access.
2038
2098
  # @param [Hash] opts the optional parameters
2039
2099
  # @option opts [String] :cursor
2040
2100
  # @option opts [Integer] :limit
@@ -2067,7 +2127,7 @@ module Sendmux::Mailbox::Generated
2067
2127
  end
2068
2128
 
2069
2129
  # List mailbox messages
2070
- # Returns a cursor-paginated list of messages for the authenticated mailbox. Requires a mailbox API key.
2130
+ # Returns a cursor-paginated list of messages for the authenticated mailbox. Requires Mailbox API access.
2071
2131
  # @param [Hash] opts the optional parameters
2072
2132
  # @option opts [String] :cursor
2073
2133
  # @option opts [Integer] :limit
@@ -2167,7 +2227,7 @@ module Sendmux::Mailbox::Generated
2167
2227
  return_type = opts[:debug_return_type] || 'MailboxMessageSummaryCursorListResponse'
2168
2228
 
2169
2229
  # auth_names
2170
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
2230
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
2171
2231
 
2172
2232
  new_options = opts.merge(
2173
2233
  :operation => :"MailboxAPIApi.mailbox_list_messages",
@@ -2275,7 +2335,7 @@ module Sendmux::Mailbox::Generated
2275
2335
  return_type = opts[:debug_return_type] || 'MailboxQuotaCursorListResponse'
2276
2336
 
2277
2337
  # auth_names
2278
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
2338
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
2279
2339
 
2280
2340
  new_options = opts.merge(
2281
2341
  :operation => :"MailboxAPIApi.mailbox_list_quotas",
@@ -2385,7 +2445,7 @@ module Sendmux::Mailbox::Generated
2385
2445
  return_type = opts[:debug_return_type] || 'MailboxSubmissionCursorListResponse'
2386
2446
 
2387
2447
  # auth_names
2388
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
2448
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
2389
2449
 
2390
2450
  new_options = opts.merge(
2391
2451
  :operation => :"MailboxAPIApi.mailbox_list_submissions",
@@ -2472,7 +2532,7 @@ module Sendmux::Mailbox::Generated
2472
2532
  return_type = opts[:debug_return_type] || 'MailboxMessageSummaryCursorListResponse'
2473
2533
 
2474
2534
  # auth_names
2475
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
2535
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
2476
2536
 
2477
2537
  new_options = opts.merge(
2478
2538
  :operation => :"MailboxAPIApi.mailbox_list_thread_messages",
@@ -2574,7 +2634,7 @@ module Sendmux::Mailbox::Generated
2574
2634
  return_type = opts[:debug_return_type] || 'MailboxThreadSummaryCursorListResponse'
2575
2635
 
2576
2636
  # auth_names
2577
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
2637
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
2578
2638
 
2579
2639
  new_options = opts.merge(
2580
2640
  :operation => :"MailboxAPIApi.mailbox_list_threads",
@@ -2637,7 +2697,7 @@ module Sendmux::Mailbox::Generated
2637
2697
  return_type = opts[:debug_return_type] || 'MailboxUsageResponse'
2638
2698
 
2639
2699
  # auth_names
2640
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
2700
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
2641
2701
 
2642
2702
  new_options = opts.merge(
2643
2703
  :operation => :"MailboxAPIApi.mailbox_list_usage",
@@ -2711,7 +2771,7 @@ module Sendmux::Mailbox::Generated
2711
2771
  return_type = opts[:debug_return_type] || 'MailboxFolderQueryChangesResponse'
2712
2772
 
2713
2773
  # auth_names
2714
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
2774
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
2715
2775
 
2716
2776
  new_options = opts.merge(
2717
2777
  :operation => :"MailboxAPIApi.mailbox_query_folder_changes",
@@ -2867,7 +2927,7 @@ module Sendmux::Mailbox::Generated
2867
2927
  return_type = opts[:debug_return_type] || 'MailboxMessageQueryChangesResponse'
2868
2928
 
2869
2929
  # auth_names
2870
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
2930
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
2871
2931
 
2872
2932
  new_options = opts.merge(
2873
2933
  :operation => :"MailboxAPIApi.mailbox_query_message_changes",
@@ -3007,7 +3067,7 @@ module Sendmux::Mailbox::Generated
3007
3067
  return_type = opts[:debug_return_type] || 'MailboxSearchSnippetsResultResponse'
3008
3068
 
3009
3069
  # auth_names
3010
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
3070
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
3011
3071
 
3012
3072
  new_options = opts.merge(
3013
3073
  :operation => :"MailboxAPIApi.mailbox_search_message_snippets",
@@ -3081,7 +3141,7 @@ module Sendmux::Mailbox::Generated
3081
3141
  return_type = opts[:debug_return_type] || 'MailboxSendResultResponse'
3082
3142
 
3083
3143
  # auth_names
3084
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
3144
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
3085
3145
 
3086
3146
  new_options = opts.merge(
3087
3147
  :operation => :"MailboxAPIApi.mailbox_send_message",
@@ -3103,12 +3163,12 @@ module Sendmux::Mailbox::Generated
3103
3163
  # Stream mailbox events
3104
3164
  # Streams bounded rich mailbox events for connected clients. Each received-message event includes subject, participants, preview, attachment metadata, and a capped body snapshot; use the message endpoints for full content or attachment bytes.
3105
3165
  # @param [Hash] opts the optional parameters
3166
+ # @option opts [String] :mailbox_id
3106
3167
  # @option opts [String] :event_types
3107
3168
  # @option opts [String] :last_event_id
3108
3169
  # @option opts [Integer] :ping
3109
3170
  # @option opts [Integer] :close_after
3110
3171
  # @option opts [String] :last_event_id2
3111
- # @option opts [String] :mailbox_id Mailbox public ID to target when the credential grants access to more than one mailbox. Omit when the credential is scoped to exactly one mailbox.
3112
3172
  # @return [MailboxRealtimeEvent]
3113
3173
  def mailbox_stream_events(opts = {})
3114
3174
  data, _status_code, _headers = mailbox_stream_events_with_http_info(opts)
@@ -3118,12 +3178,12 @@ module Sendmux::Mailbox::Generated
3118
3178
  # Stream mailbox events
3119
3179
  # Streams bounded rich mailbox events for connected clients. Each received-message event includes subject, participants, preview, attachment metadata, and a capped body snapshot; use the message endpoints for full content or attachment bytes.
3120
3180
  # @param [Hash] opts the optional parameters
3181
+ # @option opts [String] :mailbox_id
3121
3182
  # @option opts [String] :event_types
3122
3183
  # @option opts [String] :last_event_id
3123
3184
  # @option opts [Integer] :ping
3124
3185
  # @option opts [Integer] :close_after
3125
3186
  # @option opts [String] :last_event_id2
3126
- # @option opts [String] :mailbox_id Mailbox public ID to target when the credential grants access to more than one mailbox. Omit when the credential is scoped to exactly one mailbox.
3127
3187
  # @return [Array<(MailboxRealtimeEvent, Integer, Hash)>] MailboxRealtimeEvent data, response status code and response headers
3128
3188
  def mailbox_stream_events_with_http_info(opts = {})
3129
3189
  if @api_client.config.debugging
@@ -3150,11 +3210,11 @@ module Sendmux::Mailbox::Generated
3150
3210
 
3151
3211
  # query parameters
3152
3212
  query_params = opts[:query_params] || {}
3213
+ query_params[:'mailbox_id'] = opts[:'mailbox_id'] if !opts[:'mailbox_id'].nil?
3153
3214
  query_params[:'event_types'] = opts[:'event_types'] if !opts[:'event_types'].nil?
3154
3215
  query_params[:'last_event_id'] = opts[:'last_event_id'] if !opts[:'last_event_id'].nil?
3155
3216
  query_params[:'ping'] = opts[:'ping'] if !opts[:'ping'].nil?
3156
3217
  query_params[:'close_after'] = opts[:'close_after'] if !opts[:'close_after'].nil?
3157
- query_params[:'mailbox_id'] = opts[:'mailbox_id'] if !opts[:'mailbox_id'].nil?
3158
3218
 
3159
3219
  # header parameters
3160
3220
  header_params = opts[:header_params] || {}
@@ -3172,7 +3232,7 @@ module Sendmux::Mailbox::Generated
3172
3232
  return_type = opts[:debug_return_type] || 'MailboxRealtimeEvent'
3173
3233
 
3174
3234
  # auth_names
3175
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
3235
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
3176
3236
 
3177
3237
  new_options = opts.merge(
3178
3238
  :operation => :"MailboxAPIApi.mailbox_stream_events",
@@ -3248,7 +3308,7 @@ module Sendmux::Mailbox::Generated
3248
3308
  return_type = opts[:debug_return_type] || 'MailboxFolderResponse'
3249
3309
 
3250
3310
  # auth_names
3251
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
3311
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
3252
3312
 
3253
3313
  new_options = opts.merge(
3254
3314
  :operation => :"MailboxAPIApi.mailbox_update_folder",
@@ -3315,7 +3375,7 @@ module Sendmux::Mailbox::Generated
3315
3375
  return_type = opts[:debug_return_type] || 'MailboxIdentityResponse'
3316
3376
 
3317
3377
  # auth_names
3318
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
3378
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
3319
3379
 
3320
3380
  new_options = opts.merge(
3321
3381
  :operation => :"MailboxAPIApi.mailbox_update_identity",
@@ -3391,7 +3451,7 @@ module Sendmux::Mailbox::Generated
3391
3451
  return_type = opts[:debug_return_type] || 'MailboxMessageDetailResponse'
3392
3452
 
3393
3453
  # auth_names
3394
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
3454
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
3395
3455
 
3396
3456
  new_options = opts.merge(
3397
3457
  :operation => :"MailboxAPIApi.mailbox_update_message",
@@ -3465,7 +3525,7 @@ module Sendmux::Mailbox::Generated
3465
3525
  return_type = opts[:debug_return_type] || 'MailboxAttachmentUploadResultResponse'
3466
3526
 
3467
3527
  # auth_names
3468
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
3528
+ auth_names = opts[:debug_auth_names] || ['oauth2', 'bearerAuth']
3469
3529
 
3470
3530
  new_options = opts.merge(
3471
3531
  :operation => :"MailboxAPIApi.mailbox_upload_attachment",
@@ -256,6 +256,13 @@ module Sendmux::Mailbox::Generated
256
256
  key: 'Authorization',
257
257
  value: "Bearer #{access_token_with_refresh}"
258
258
  },
259
+ 'oauth2' =>
260
+ {
261
+ type: 'oauth2',
262
+ in: 'header',
263
+ key: 'Authorization',
264
+ value: "Bearer #{access_token_with_refresh}"
265
+ },
259
266
  }
260
267
  end
261
268