prelude-sdk 0.2.0 → 0.3.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.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +48 -0
  3. data/README.md +1 -1
  4. data/lib/prelude_sdk/client.rb +7 -0
  5. data/lib/prelude_sdk/internal/transport/pooled_net_requester.rb +13 -11
  6. data/lib/prelude_sdk/internal/util.rb +39 -3
  7. data/lib/prelude_sdk/models/lookup_lookup_params.rb +9 -1
  8. data/lib/prelude_sdk/models/notify_get_subscription_config_params.rb +7 -1
  9. data/lib/prelude_sdk/models/notify_get_subscription_phone_number_params.rb +7 -1
  10. data/lib/prelude_sdk/models/notify_list_subscription_phone_number_events_params.rb +8 -1
  11. data/lib/prelude_sdk/models/notify_list_subscription_phone_numbers_params.rb +8 -1
  12. data/lib/prelude_sdk/models/notify_send_batch_params.rb +32 -1
  13. data/lib/prelude_sdk/models/notify_send_batch_response.rb +39 -1
  14. data/lib/prelude_sdk/models/notify_send_params.rb +32 -1
  15. data/lib/prelude_sdk/models/notify_send_response.rb +36 -1
  16. data/lib/prelude_sdk/models/transactional_send_params.rb +32 -1
  17. data/lib/prelude_sdk/models/verification_create_params.rb +35 -48
  18. data/lib/prelude_sdk/models/verification_create_response.rb +15 -0
  19. data/lib/prelude_sdk/models/verification_management_delete_phone_number_params.rb +8 -1
  20. data/lib/prelude_sdk/models/verification_management_list_phone_numbers_params.rb +7 -1
  21. data/lib/prelude_sdk/models/verification_management_set_phone_number_params.rb +8 -1
  22. data/lib/prelude_sdk/models/watch_predict_params.rb +16 -12
  23. data/lib/prelude_sdk/models/watch_predict_response.rb +51 -1
  24. data/lib/prelude_sdk/models/watch_send_feedbacks_params.rb +1 -128
  25. data/lib/prelude_sdk/resources/lookup.rb +4 -1
  26. data/lib/prelude_sdk/resources/notify.rb +13 -5
  27. data/lib/prelude_sdk/resources/transactional.rb +4 -1
  28. data/lib/prelude_sdk/resources/verification.rb +1 -0
  29. data/lib/prelude_sdk/resources/verification_management.rb +1 -0
  30. data/lib/prelude_sdk/resources/watch.rb +1 -0
  31. data/lib/prelude_sdk/version.rb +1 -1
  32. data/rbi/prelude_sdk/client.rbi +7 -0
  33. data/rbi/prelude_sdk/internal/util.rbi +21 -1
  34. data/rbi/prelude_sdk/models/lookup_lookup_params.rbi +8 -0
  35. data/rbi/prelude_sdk/models/notify_get_subscription_config_params.rbi +13 -5
  36. data/rbi/prelude_sdk/models/notify_get_subscription_phone_number_params.rbi +10 -2
  37. data/rbi/prelude_sdk/models/notify_list_subscription_phone_number_events_params.rbi +6 -0
  38. data/rbi/prelude_sdk/models/notify_list_subscription_phone_numbers_params.rbi +6 -0
  39. data/rbi/prelude_sdk/models/notify_send_batch_params.rbi +50 -0
  40. data/rbi/prelude_sdk/models/notify_send_batch_response.rbi +80 -0
  41. data/rbi/prelude_sdk/models/notify_send_params.rbi +48 -0
  42. data/rbi/prelude_sdk/models/notify_send_response.rbi +75 -0
  43. data/rbi/prelude_sdk/models/transactional_send_params.rbi +50 -0
  44. data/rbi/prelude_sdk/models/verification_create_params.rbi +53 -93
  45. data/rbi/prelude_sdk/models/verification_create_response.rbi +26 -0
  46. data/rbi/prelude_sdk/models/verification_management_delete_phone_number_params.rbi +16 -1
  47. data/rbi/prelude_sdk/models/verification_management_list_phone_numbers_params.rbi +21 -4
  48. data/rbi/prelude_sdk/models/verification_management_set_phone_number_params.rbi +16 -1
  49. data/rbi/prelude_sdk/models/watch_predict_params.rbi +24 -16
  50. data/rbi/prelude_sdk/models/watch_predict_response.rbi +152 -3
  51. data/rbi/prelude_sdk/models/watch_send_feedbacks_params.rbi +3 -243
  52. data/rbi/prelude_sdk/resources/lookup.rbi +2 -0
  53. data/rbi/prelude_sdk/resources/notify.rbi +9 -0
  54. data/rbi/prelude_sdk/resources/transactional.rbi +5 -0
  55. data/rbi/prelude_sdk/resources/verification.rbi +1 -0
  56. data/rbi/prelude_sdk/resources/verification_management.rbi +1 -0
  57. data/rbi/prelude_sdk/resources/watch.rbi +1 -0
  58. data/sig/prelude_sdk/internal/util.rbs +10 -0
  59. data/sig/prelude_sdk/models/lookup_lookup_params.rbs +8 -1
  60. data/sig/prelude_sdk/models/notify_get_subscription_config_params.rbs +11 -3
  61. data/sig/prelude_sdk/models/notify_get_subscription_phone_number_params.rbs +6 -1
  62. data/sig/prelude_sdk/models/notify_list_subscription_phone_number_events_params.rbs +10 -1
  63. data/sig/prelude_sdk/models/notify_list_subscription_phone_numbers_params.rbs +5 -0
  64. data/sig/prelude_sdk/models/notify_send_batch_params.rbs +21 -0
  65. data/sig/prelude_sdk/models/notify_send_batch_response.rbs +27 -0
  66. data/sig/prelude_sdk/models/notify_send_params.rbs +21 -0
  67. data/sig/prelude_sdk/models/notify_send_response.rbs +27 -0
  68. data/sig/prelude_sdk/models/transactional_send_params.rbs +21 -0
  69. data/sig/prelude_sdk/models/verification_create_params.rbs +2 -21
  70. data/sig/prelude_sdk/models/verification_create_response.rbs +2 -1
  71. data/sig/prelude_sdk/models/verification_management_delete_phone_number_params.rbs +9 -1
  72. data/sig/prelude_sdk/models/verification_management_list_phone_numbers_params.rbs +14 -3
  73. data/sig/prelude_sdk/models/verification_management_set_phone_number_params.rbs +9 -1
  74. data/sig/prelude_sdk/models/watch_predict_response.rbs +41 -3
  75. data/sig/prelude_sdk/models/watch_send_feedbacks_params.rbs +3 -110
  76. data/sig/prelude_sdk/resources/notify.rbs +2 -0
  77. data/sig/prelude_sdk/resources/transactional.rbs +1 -0
  78. metadata +16 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 20bf770b210bf23b3214f6dc77fd7e2f74a96869d52c7f96788a548a87c8afb0
4
- data.tar.gz: fcb6a885d033659e8a2d8f7c91b97e04cf9df00ac8da6ad1392961f77f52c525
3
+ metadata.gz: 0442af375a6b077b348b680c39f073a48a66ff185d57f5f20ee53300531a8bf7
4
+ data.tar.gz: 60d8b444c65e5e55b487f61d158c9531fcb02435c66a1f9eaa3688640789d08f
5
5
  SHA512:
6
- metadata.gz: 2797a1a23e09c4a7038ac2f06a86d491c1505c734d7fecaea592b7d0fc125818a1517cab2d1431229c3cf1634b8847c754e58b511c7d7968517f2095a3aa1536
7
- data.tar.gz: 5bdad09b05d0f22ceba1f75fd9b3fbf7f045331729c288ae938b78de419a378382469347e1ea50ab7f6fcf044f3ffe120ff27136c995ea163bad08987991840c
6
+ metadata.gz: 6c337ee4e3c9f6d13391ae942cda76beaef0ff292b14b5416f66450005908bfe09d250fad09444635eaabf1fb3e02eb3ad8d356740218a0a7188729487c65639
7
+ data.tar.gz: cb6ae9f844d4a6d5313e001802b40b0624e93da2cfdbbefaec0cfa68f2cd14f74a0397dd8ac51d338f52b24c478f350d19d9eb77a8cf4d17d12e9fe7778ffcea
data/CHANGELOG.md CHANGED
@@ -1,5 +1,53 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.0 (2026-03-23)
4
+
5
+ Full Changelog: [v0.2.0...v0.3.0](https://github.com/prelude-so/ruby-sdk/compare/v0.2.0...v0.3.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([24553b3](https://github.com/prelude-so/ruby-sdk/commit/24553b346bf3e424aa565b58dfc0a5ff339d0ffd))
10
+ * **api:** api update ([c8e488b](https://github.com/prelude-so/ruby-sdk/commit/c8e488bc5106f22fd3c3e1e996aa865bf51ff3a1))
11
+ * **api:** api update ([bc9d8d4](https://github.com/prelude-so/ruby-sdk/commit/bc9d8d41c941879192c531c1b5f07d619d4bfc7b))
12
+ * **api:** api update ([1e8ea21](https://github.com/prelude-so/ruby-sdk/commit/1e8ea213c96c039d76722d6bc522e84e0ff0278f))
13
+ * **api:** api update ([c339306](https://github.com/prelude-so/ruby-sdk/commit/c3393069dc67ed5ecaecb276b26c2308a00356d1))
14
+ * **api:** api update ([ec6ca20](https://github.com/prelude-so/ruby-sdk/commit/ec6ca2085c7628b495b9486bd46c27656432e9eb))
15
+ * **api:** api update ([64ca50e](https://github.com/prelude-so/ruby-sdk/commit/64ca50eae743d655d253c2ab6564eade851b60be))
16
+ * **api:** api update ([240811f](https://github.com/prelude-so/ruby-sdk/commit/240811ffbc8caabaad46ce164bdb9ac3c6cbf9b0))
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * calling `break` out of streams should be instantaneous ([a880e79](https://github.com/prelude-so/ruby-sdk/commit/a880e79694d57969c34395666edbd365d5a65483))
22
+ * **client:** add types for path params, and update structure of unions nested in params ([dff25fc](https://github.com/prelude-so/ruby-sdk/commit/dff25fc4134005a9e8a7f84d8fc6fbd5f9ac8098))
23
+ * **client:** always add content-length to post body, even when empty ([73b8b98](https://github.com/prelude-so/ruby-sdk/commit/73b8b98d2f14602fb5b297a697d3894699659b84))
24
+ * **client:** loosen json header parsing ([144e10b](https://github.com/prelude-so/ruby-sdk/commit/144e10bb50679a7748df724edf574a86fc8fbc9e))
25
+ * **client:** serialize query parameters properly ([e59d46e](https://github.com/prelude-so/ruby-sdk/commit/e59d46eaa39b1033807c4c000cfb4220b1c8d0ff))
26
+ * issue where json.parse errors when receiving HTTP 204 with nobody ([5960180](https://github.com/prelude-so/ruby-sdk/commit/59601805484363ad564d640ae2dec6a2eff08f26))
27
+ * properly mock time in ruby ci tests ([19a7259](https://github.com/prelude-so/ruby-sdk/commit/19a7259d6c21e24e6773487981154c17215846f0))
28
+
29
+
30
+ ### Chores
31
+
32
+ * **ci:** add build step ([9517e54](https://github.com/prelude-so/ruby-sdk/commit/9517e54b4ad0cf6bfeefdb9c227217f5f732cf27))
33
+ * **ci:** skip uploading artifacts on stainless-internal branches ([b239f23](https://github.com/prelude-so/ruby-sdk/commit/b239f237e3b67cc6a01f992028fc5885336f6538))
34
+ * **docs:** add missing descriptions ([874587d](https://github.com/prelude-so/ruby-sdk/commit/874587d45083a9a5e0fc188b378a9b8d58dd39a5))
35
+ * **docs:** remove www prefix ([9c41466](https://github.com/prelude-so/ruby-sdk/commit/9c41466d86710318107d52692f8efb93515e9738))
36
+ * **internal:** codegen related update ([4721c32](https://github.com/prelude-so/ruby-sdk/commit/4721c32fbc82220da55e561f4ad10ac22223108b))
37
+ * **internal:** codegen related update ([d227583](https://github.com/prelude-so/ruby-sdk/commit/d227583e5a4a92a1cbc4bd75ed70b18df8a2f0ff))
38
+ * **internal:** tweak CI branches ([1a3bb89](https://github.com/prelude-so/ruby-sdk/commit/1a3bb8905066138aec8da0bba42d3f699da7144f))
39
+ * **internal:** update `actions/checkout` version ([dd49de2](https://github.com/prelude-so/ruby-sdk/commit/dd49de2c037b0f622d7cdead21ab464a1455363f))
40
+ * **internal:** update gitignore ([603a4c6](https://github.com/prelude-so/ruby-sdk/commit/603a4c69350448463dae3f8d99d6aa09d0c48b1b))
41
+ * **test:** do not count install time for mock server timeout ([77b5e70](https://github.com/prelude-so/ruby-sdk/commit/77b5e70ec2a773c70e55ca4cb3e527e8d2446459))
42
+ * **tests:** bump steady to v0.19.4 ([001f050](https://github.com/prelude-so/ruby-sdk/commit/001f050d338b3015dba4527bc278795fadb04ac2))
43
+ * **tests:** bump steady to v0.19.5 ([e824cb0](https://github.com/prelude-so/ruby-sdk/commit/e824cb0c8e2f3f601a4e07f7c36afeafcfff9b28))
44
+ * update mock server docs ([6fa353c](https://github.com/prelude-so/ruby-sdk/commit/6fa353cd9d0112786119b6a50d96fc48c77253c3))
45
+
46
+
47
+ ### Refactors
48
+
49
+ * **tests:** switch from prism to steady ([4f1499f](https://github.com/prelude-so/ruby-sdk/commit/4f1499f85472caac00731960ba4a9623131c57f6))
50
+
3
51
  ## 0.2.0 (2025-12-05)
4
52
 
5
53
  Full Changelog: [v0.1.0...v0.2.0](https://github.com/prelude-so/ruby-sdk/compare/v0.1.0...v0.2.0)
data/README.md CHANGED
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
17
17
  <!-- x-release-please-start-version -->
18
18
 
19
19
  ```ruby
20
- gem "prelude-sdk", "~> 0.2.0"
20
+ gem "prelude-sdk", "~> 0.3.0"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -19,21 +19,28 @@ module PreludeSDK
19
19
  # @return [String]
20
20
  attr_reader :api_token
21
21
 
22
+ # Retrieve detailed information about a phone number including carrier data, line
23
+ # type, and portability status.
22
24
  # @return [PreludeSDK::Resources::Lookup]
23
25
  attr_reader :lookup
24
26
 
27
+ # Send transactional and marketing messages with compliance enforcement.
25
28
  # @return [PreludeSDK::Resources::Notify]
26
29
  attr_reader :notify
27
30
 
31
+ # Send transactional messages (deprecated - use Notify API instead).
28
32
  # @return [PreludeSDK::Resources::Transactional]
29
33
  attr_reader :transactional
30
34
 
35
+ # Verify phone numbers.
31
36
  # @return [PreludeSDK::Resources::Verification]
32
37
  attr_reader :verification
33
38
 
39
+ # Verify phone numbers.
34
40
  # @return [PreludeSDK::Resources::VerificationManagement]
35
41
  attr_reader :verification_management
36
42
 
43
+ # Evaluate email addresses and phone numbers for trustworthiness.
37
44
  # @return [PreludeSDK::Resources::Watch]
38
45
  attr_reader :watch
39
46
 
@@ -75,7 +75,7 @@ module PreludeSDK
75
75
 
76
76
  case body
77
77
  in nil
78
- nil
78
+ req["content-length"] ||= 0 unless req["transfer-encoding"]
79
79
  in String
80
80
  req["content-length"] ||= body.bytesize.to_s unless req["transfer-encoding"]
81
81
  req.body_stream = PreludeSDK::Internal::Util::ReadIOAdapter.new(body, &blk)
@@ -153,17 +153,19 @@ module PreludeSDK
153
153
  end
154
154
 
155
155
  self.class.calibrate_socket_timeout(conn, deadline)
156
- conn.request(req) do |rsp|
157
- y << [req, rsp]
158
- break if finished
159
-
160
- rsp.read_body do |bytes|
161
- y << bytes.force_encoding(Encoding::BINARY)
162
- break if finished
163
-
164
- self.class.calibrate_socket_timeout(conn, deadline)
156
+ ::Kernel.catch(:jump) do
157
+ conn.request(req) do |rsp|
158
+ y << [req, rsp]
159
+ ::Kernel.throw(:jump) if finished
160
+
161
+ rsp.read_body do |bytes|
162
+ y << bytes.force_encoding(Encoding::BINARY)
163
+ ::Kernel.throw(:jump) if finished
164
+
165
+ self.class.calibrate_socket_timeout(conn, deadline)
166
+ end
167
+ eof = true
165
168
  end
166
- eof = true
167
169
  end
168
170
  end
169
171
  ensure
@@ -485,11 +485,42 @@ module PreludeSDK
485
485
  end
486
486
 
487
487
  # @type [Regexp]
488
- JSON_CONTENT = %r{^application/(?:vnd(?:\.[^.]+)*\+)?json(?!l)}
488
+ JSON_CONTENT = %r{^application/(?:[a-zA-Z0-9.-]+\+)?json(?!l)}
489
489
  # @type [Regexp]
490
490
  JSONL_CONTENT = %r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)}
491
491
 
492
492
  class << self
493
+ # @api private
494
+ #
495
+ # @param query [Hash{Symbol=>Object}]
496
+ #
497
+ # @return [Hash{Symbol=>Object}]
498
+ def encode_query_params(query)
499
+ out = {}
500
+ query.each { write_query_param_element!(out, _1, _2) }
501
+ out
502
+ end
503
+
504
+ # @api private
505
+ #
506
+ # @param collection [Hash{Symbol=>Object}]
507
+ # @param key [String]
508
+ # @param element [Object]
509
+ #
510
+ # @return [nil]
511
+ private def write_query_param_element!(collection, key, element)
512
+ case element
513
+ in Hash
514
+ element.each do |name, value|
515
+ write_query_param_element!(collection, "#{key}[#{name}]", value)
516
+ end
517
+ in Array
518
+ collection[key] = element.map(&:to_s).join(",")
519
+ else
520
+ collection[key] = element.to_s
521
+ end
522
+ end
523
+
493
524
  # @api private
494
525
  #
495
526
  # @param y [Enumerator::Yielder]
@@ -657,7 +688,8 @@ module PreludeSDK
657
688
  def decode_content(headers, stream:, suppress_error: false)
658
689
  case (content_type = headers["content-type"])
659
690
  in PreludeSDK::Internal::Util::JSON_CONTENT
660
- json = stream.to_a.join
691
+ return nil if (json = stream.to_a.join).empty?
692
+
661
693
  begin
662
694
  JSON.parse(json, symbolize_names: true)
663
695
  rescue JSON::ParserError => e
@@ -667,7 +699,11 @@ module PreludeSDK
667
699
  in PreludeSDK::Internal::Util::JSONL_CONTENT
668
700
  lines = decode_lines(stream)
669
701
  chain_fused(lines) do |y|
670
- lines.each { y << JSON.parse(_1, symbolize_names: true) }
702
+ lines.each do
703
+ next if _1.empty?
704
+
705
+ y << JSON.parse(_1, symbolize_names: true)
706
+ end
671
707
  end
672
708
  in %r{^text/event-stream}
673
709
  lines = decode_lines(stream)
@@ -7,6 +7,12 @@ module PreludeSDK
7
7
  extend PreludeSDK::Internal::Type::RequestParameters::Converter
8
8
  include PreludeSDK::Internal::Type::RequestParameters
9
9
 
10
+ # @!attribute phone_number
11
+ # An E.164 formatted phone number to look up.
12
+ #
13
+ # @return [String]
14
+ required :phone_number, String
15
+
10
16
  # @!attribute type
11
17
  # Optional features. Possible values are:
12
18
  #
@@ -16,10 +22,12 @@ module PreludeSDK
16
22
  # @return [Array<Symbol, PreludeSDK::Models::LookupLookupParams::Type>, nil]
17
23
  optional :type, -> { PreludeSDK::Internal::Type::ArrayOf[enum: PreludeSDK::LookupLookupParams::Type] }
18
24
 
19
- # @!method initialize(type: nil, request_options: {})
25
+ # @!method initialize(phone_number:, type: nil, request_options: {})
20
26
  # Some parameter documentations has been truncated, see
21
27
  # {PreludeSDK::Models::LookupLookupParams} for more details.
22
28
  #
29
+ # @param phone_number [String] An E.164 formatted phone number to look up.
30
+ #
23
31
  # @param type [Array<Symbol, PreludeSDK::Models::LookupLookupParams::Type>] Optional features. Possible values are:
24
32
  #
25
33
  # @param request_options [PreludeSDK::RequestOptions, Hash{Symbol=>Object}]
@@ -7,7 +7,13 @@ module PreludeSDK
7
7
  extend PreludeSDK::Internal::Type::RequestParameters::Converter
8
8
  include PreludeSDK::Internal::Type::RequestParameters
9
9
 
10
- # @!method initialize(request_options: {})
10
+ # @!attribute config_id
11
+ #
12
+ # @return [String]
13
+ required :config_id, String
14
+
15
+ # @!method initialize(config_id:, request_options: {})
16
+ # @param config_id [String]
11
17
  # @param request_options [PreludeSDK::RequestOptions, Hash{Symbol=>Object}]
12
18
  end
13
19
  end
@@ -12,8 +12,14 @@ module PreludeSDK
12
12
  # @return [String]
13
13
  required :config_id, String
14
14
 
15
- # @!method initialize(config_id:, request_options: {})
15
+ # @!attribute phone_number
16
+ #
17
+ # @return [String]
18
+ required :phone_number, String
19
+
20
+ # @!method initialize(config_id:, phone_number:, request_options: {})
16
21
  # @param config_id [String]
22
+ # @param phone_number [String]
17
23
  # @param request_options [PreludeSDK::RequestOptions, Hash{Symbol=>Object}]
18
24
  end
19
25
  end
@@ -12,6 +12,11 @@ module PreludeSDK
12
12
  # @return [String]
13
13
  required :config_id, String
14
14
 
15
+ # @!attribute phone_number
16
+ #
17
+ # @return [String]
18
+ required :phone_number, String
19
+
15
20
  # @!attribute cursor
16
21
  # Pagination cursor from the previous response
17
22
  #
@@ -24,9 +29,11 @@ module PreludeSDK
24
29
  # @return [Integer, nil]
25
30
  optional :limit, Integer
26
31
 
27
- # @!method initialize(config_id:, cursor: nil, limit: nil, request_options: {})
32
+ # @!method initialize(config_id:, phone_number:, cursor: nil, limit: nil, request_options: {})
28
33
  # @param config_id [String]
29
34
  #
35
+ # @param phone_number [String]
36
+ #
30
37
  # @param cursor [String] Pagination cursor from the previous response
31
38
  #
32
39
  # @param limit [Integer] Maximum number of events to return per page
@@ -7,6 +7,11 @@ module PreludeSDK
7
7
  extend PreludeSDK::Internal::Type::RequestParameters::Converter
8
8
  include PreludeSDK::Internal::Type::RequestParameters
9
9
 
10
+ # @!attribute config_id
11
+ #
12
+ # @return [String]
13
+ required :config_id, String
14
+
10
15
  # @!attribute cursor
11
16
  # Pagination cursor from the previous response
12
17
  #
@@ -25,7 +30,9 @@ module PreludeSDK
25
30
  # @return [Symbol, PreludeSDK::Models::NotifyListSubscriptionPhoneNumbersParams::State, nil]
26
31
  optional :state, enum: -> { PreludeSDK::NotifyListSubscriptionPhoneNumbersParams::State }
27
32
 
28
- # @!method initialize(cursor: nil, limit: nil, state: nil, request_options: {})
33
+ # @!method initialize(config_id:, cursor: nil, limit: nil, state: nil, request_options: {})
34
+ # @param config_id [String]
35
+ #
29
36
  # @param cursor [String] Pagination cursor from the previous response
30
37
  #
31
38
  # @param limit [Integer] Maximum number of phone numbers to return per page
@@ -31,6 +31,13 @@ module PreludeSDK
31
31
  # @return [String, nil]
32
32
  optional :correlation_id, String
33
33
 
34
+ # @!attribute document
35
+ # A document to attach to the message. Only supported on WhatsApp templates that
36
+ # have a document header.
37
+ #
38
+ # @return [PreludeSDK::Models::NotifySendBatchParams::Document, nil]
39
+ optional :document, -> { PreludeSDK::NotifySendBatchParams::Document }
40
+
34
41
  # @!attribute expires_at
35
42
  # The message expiration date in RFC3339 format. Messages will not be sent after
36
43
  # this time.
@@ -69,7 +76,7 @@ module PreludeSDK
69
76
  # @return [Hash{Symbol=>String}, nil]
70
77
  optional :variables, PreludeSDK::Internal::Type::HashOf[String]
71
78
 
72
- # @!method initialize(template_id:, to:, callback_url: nil, correlation_id: nil, expires_at: nil, from: nil, locale: nil, preferred_channel: nil, schedule_at: nil, variables: nil, request_options: {})
79
+ # @!method initialize(template_id:, to:, callback_url: nil, correlation_id: nil, document: nil, expires_at: nil, from: nil, locale: nil, preferred_channel: nil, schedule_at: nil, variables: nil, request_options: {})
73
80
  # Some parameter documentations has been truncated, see
74
81
  # {PreludeSDK::Models::NotifySendBatchParams} for more details.
75
82
  #
@@ -81,6 +88,8 @@ module PreludeSDK
81
88
  #
82
89
  # @param correlation_id [String] A user-defined identifier to correlate this request with your internal systems.
83
90
  #
91
+ # @param document [PreludeSDK::Models::NotifySendBatchParams::Document] A document to attach to the message. Only supported on WhatsApp templates that h
92
+ #
84
93
  # @param expires_at [Time] The message expiration date in RFC3339 format. Messages will not be sent after t
85
94
  #
86
95
  # @param from [String] The Sender ID. Must be approved for your account.
@@ -95,6 +104,28 @@ module PreludeSDK
95
104
  #
96
105
  # @param request_options [PreludeSDK::RequestOptions, Hash{Symbol=>Object}]
97
106
 
107
+ class Document < PreludeSDK::Internal::Type::BaseModel
108
+ # @!attribute filename
109
+ # The filename to display for the document.
110
+ #
111
+ # @return [String]
112
+ required :filename, String
113
+
114
+ # @!attribute url
115
+ # The URL of the document to attach. Must be a valid HTTP or HTTPS URL.
116
+ #
117
+ # @return [String]
118
+ required :url, String
119
+
120
+ # @!method initialize(filename:, url:)
121
+ # A document to attach to the message. Only supported on WhatsApp templates that
122
+ # have a document header.
123
+ #
124
+ # @param filename [String] The filename to display for the document.
125
+ #
126
+ # @param url [String] The URL of the document to attach. Must be a valid HTTP or HTTPS URL.
127
+ end
128
+
98
129
  # Preferred channel for delivery. If unavailable, automatic fallback applies.
99
130
  module PreferredChannel
100
131
  extend PreludeSDK::Internal::Type::Enum
@@ -146,6 +146,22 @@ module PreludeSDK
146
146
  # @return [Time, nil]
147
147
  optional :created_at, Time
148
148
 
149
+ # @!attribute encoding
150
+ # The SMS encoding type based on message content. GSM-7 supports standard
151
+ # characters (up to 160 chars per segment), while UCS-2 supports Unicode including
152
+ # emoji (up to 70 chars per segment). Only present for SMS messages.
153
+ #
154
+ # @return [Symbol, PreludeSDK::Models::NotifySendBatchResponse::Result::Message::Encoding, nil]
155
+ optional :encoding, enum: -> { PreludeSDK::Models::NotifySendBatchResponse::Result::Message::Encoding }
156
+
157
+ # @!attribute estimated_segment_count
158
+ # The estimated number of SMS segments for this message. This value is not
159
+ # contractual; the actual segment count will be determined after the SMS is sent
160
+ # by the provider. Only present for SMS messages.
161
+ #
162
+ # @return [Integer, nil]
163
+ optional :estimated_segment_count, Integer
164
+
149
165
  # @!attribute expires_at
150
166
  # The message expiration date in RFC3339 format.
151
167
  #
@@ -176,7 +192,10 @@ module PreludeSDK
176
192
  # @return [String, nil]
177
193
  optional :to, String
178
194
 
179
- # @!method initialize(id: nil, correlation_id: nil, created_at: nil, expires_at: nil, from: nil, locale: nil, schedule_at: nil, to: nil)
195
+ # @!method initialize(id: nil, correlation_id: nil, created_at: nil, encoding: nil, estimated_segment_count: nil, expires_at: nil, from: nil, locale: nil, schedule_at: nil, to: nil)
196
+ # Some parameter documentations has been truncated, see
197
+ # {PreludeSDK::Models::NotifySendBatchResponse::Result::Message} for more details.
198
+ #
180
199
  # Present only if success is true.
181
200
  #
182
201
  # @param id [String] The message identifier.
@@ -185,6 +204,10 @@ module PreludeSDK
185
204
  #
186
205
  # @param created_at [Time] The message creation date in RFC3339 format.
187
206
  #
207
+ # @param encoding [Symbol, PreludeSDK::Models::NotifySendBatchResponse::Result::Message::Encoding] The SMS encoding type based on message content. GSM-7 supports standard characte
208
+ #
209
+ # @param estimated_segment_count [Integer] The estimated number of SMS segments for this message. This value is not contrac
210
+ #
188
211
  # @param expires_at [Time] The message expiration date in RFC3339 format.
189
212
  #
190
213
  # @param from [String] The Sender ID used for this message.
@@ -194,6 +217,21 @@ module PreludeSDK
194
217
  # @param schedule_at [Time] When the message will actually be sent in RFC3339 format with timezone offset.
195
218
  #
196
219
  # @param to [String] The recipient's phone number in E.164 format.
220
+
221
+ # The SMS encoding type based on message content. GSM-7 supports standard
222
+ # characters (up to 160 chars per segment), while UCS-2 supports Unicode including
223
+ # emoji (up to 70 chars per segment). Only present for SMS messages.
224
+ #
225
+ # @see PreludeSDK::Models::NotifySendBatchResponse::Result::Message#encoding
226
+ module Encoding
227
+ extend PreludeSDK::Internal::Type::Enum
228
+
229
+ GSM_7 = :"GSM-7"
230
+ UCS_2 = :"UCS-2"
231
+
232
+ # @!method self.values
233
+ # @return [Array<Symbol>]
234
+ end
197
235
  end
198
236
  end
199
237
  end
@@ -33,6 +33,13 @@ module PreludeSDK
33
33
  # @return [String, nil]
34
34
  optional :correlation_id, String
35
35
 
36
+ # @!attribute document
37
+ # A document to attach to the message. Only supported on WhatsApp templates that
38
+ # have a document header.
39
+ #
40
+ # @return [PreludeSDK::Models::NotifySendParams::Document, nil]
41
+ optional :document, -> { PreludeSDK::NotifySendParams::Document }
42
+
36
43
  # @!attribute expires_at
37
44
  # The message expiration date in RFC3339 format. The message will not be sent if
38
45
  # this time is reached.
@@ -76,7 +83,7 @@ module PreludeSDK
76
83
  # @return [Hash{Symbol=>String}, nil]
77
84
  optional :variables, PreludeSDK::Internal::Type::HashOf[String]
78
85
 
79
- # @!method initialize(template_id:, to:, callback_url: nil, correlation_id: nil, expires_at: nil, from: nil, locale: nil, preferred_channel: nil, schedule_at: nil, variables: nil, request_options: {})
86
+ # @!method initialize(template_id:, to:, callback_url: nil, correlation_id: nil, document: nil, expires_at: nil, from: nil, locale: nil, preferred_channel: nil, schedule_at: nil, variables: nil, request_options: {})
80
87
  # Some parameter documentations has been truncated, see
81
88
  # {PreludeSDK::Models::NotifySendParams} for more details.
82
89
  #
@@ -88,6 +95,8 @@ module PreludeSDK
88
95
  #
89
96
  # @param correlation_id [String] A user-defined identifier to correlate this message with your internal systems.
90
97
  #
98
+ # @param document [PreludeSDK::Models::NotifySendParams::Document] A document to attach to the message. Only supported on WhatsApp templates that h
99
+ #
91
100
  # @param expires_at [Time] The message expiration date in RFC3339 format. The message will not be sent if t
92
101
  #
93
102
  # @param from [String] The Sender ID. Must be approved for your account.
@@ -102,6 +111,28 @@ module PreludeSDK
102
111
  #
103
112
  # @param request_options [PreludeSDK::RequestOptions, Hash{Symbol=>Object}]
104
113
 
114
+ class Document < PreludeSDK::Internal::Type::BaseModel
115
+ # @!attribute filename
116
+ # The filename to display for the document.
117
+ #
118
+ # @return [String]
119
+ required :filename, String
120
+
121
+ # @!attribute url
122
+ # The URL of the document to attach. Must be a valid HTTP or HTTPS URL.
123
+ #
124
+ # @return [String]
125
+ required :url, String
126
+
127
+ # @!method initialize(filename:, url:)
128
+ # A document to attach to the message. Only supported on WhatsApp templates that
129
+ # have a document header.
130
+ #
131
+ # @param filename [String] The filename to display for the document.
132
+ #
133
+ # @param url [String] The URL of the document to attach. Must be a valid HTTP or HTTPS URL.
134
+ end
135
+
105
136
  # The preferred channel to be used in priority for message delivery. If the
106
137
  # channel is unavailable, the system will fallback to other available channels.
107
138
  module PreferredChannel
@@ -52,6 +52,22 @@ module PreludeSDK
52
52
  # @return [String, nil]
53
53
  optional :correlation_id, String
54
54
 
55
+ # @!attribute encoding
56
+ # The SMS encoding type based on message content. GSM-7 supports standard
57
+ # characters (up to 160 chars per segment), while UCS-2 supports Unicode including
58
+ # emoji (up to 70 chars per segment). Only present for SMS messages.
59
+ #
60
+ # @return [Symbol, PreludeSDK::Models::NotifySendResponse::Encoding, nil]
61
+ optional :encoding, enum: -> { PreludeSDK::Models::NotifySendResponse::Encoding }
62
+
63
+ # @!attribute estimated_segment_count
64
+ # The estimated number of SMS segments for this message. This value is not
65
+ # contractual; the actual segment count will be determined after the SMS is sent
66
+ # by the provider. Only present for SMS messages.
67
+ #
68
+ # @return [Integer, nil]
69
+ optional :estimated_segment_count, Integer
70
+
55
71
  # @!attribute from
56
72
  # The Sender ID used for this message.
57
73
  #
@@ -66,7 +82,7 @@ module PreludeSDK
66
82
  # @return [Time, nil]
67
83
  optional :schedule_at, Time
68
84
 
69
- # @!method initialize(id:, created_at:, expires_at:, template_id:, to:, variables:, callback_url: nil, correlation_id: nil, from: nil, schedule_at: nil)
85
+ # @!method initialize(id:, created_at:, expires_at:, template_id:, to:, variables:, callback_url: nil, correlation_id: nil, encoding: nil, estimated_segment_count: nil, from: nil, schedule_at: nil)
70
86
  # Some parameter documentations has been truncated, see
71
87
  # {PreludeSDK::Models::NotifySendResponse} for more details.
72
88
  #
@@ -86,9 +102,28 @@ module PreludeSDK
86
102
  #
87
103
  # @param correlation_id [String] A user-defined identifier to correlate this message with your internal systems.
88
104
  #
105
+ # @param encoding [Symbol, PreludeSDK::Models::NotifySendResponse::Encoding] The SMS encoding type based on message content. GSM-7 supports standard characte
106
+ #
107
+ # @param estimated_segment_count [Integer] The estimated number of SMS segments for this message. This value is not contrac
108
+ #
89
109
  # @param from [String] The Sender ID used for this message.
90
110
  #
91
111
  # @param schedule_at [Time] When the message will actually be sent in RFC3339 format with timezone offset. F
112
+
113
+ # The SMS encoding type based on message content. GSM-7 supports standard
114
+ # characters (up to 160 chars per segment), while UCS-2 supports Unicode including
115
+ # emoji (up to 70 chars per segment). Only present for SMS messages.
116
+ #
117
+ # @see PreludeSDK::Models::NotifySendResponse#encoding
118
+ module Encoding
119
+ extend PreludeSDK::Internal::Type::Enum
120
+
121
+ GSM_7 = :"GSM-7"
122
+ UCS_2 = :"UCS-2"
123
+
124
+ # @!method self.values
125
+ # @return [Array<Symbol>]
126
+ end
92
127
  end
93
128
  end
94
129
  end
@@ -33,6 +33,13 @@ module PreludeSDK
33
33
  # @return [String, nil]
34
34
  optional :correlation_id, String
35
35
 
36
+ # @!attribute document
37
+ # A document to attach to the message. Only supported on WhatsApp templates that
38
+ # have a document header.
39
+ #
40
+ # @return [PreludeSDK::Models::TransactionalSendParams::Document, nil]
41
+ optional :document, -> { PreludeSDK::TransactionalSendParams::Document }
42
+
36
43
  # @!attribute expires_at
37
44
  # The message expiration date.
38
45
  #
@@ -74,7 +81,7 @@ module PreludeSDK
74
81
  # @return [Hash{Symbol=>String}, nil]
75
82
  optional :variables, PreludeSDK::Internal::Type::HashOf[String]
76
83
 
77
- # @!method initialize(template_id:, to:, callback_url: nil, correlation_id: nil, expires_at: nil, from: nil, locale: nil, preferred_channel: nil, variables: nil, request_options: {})
84
+ # @!method initialize(template_id:, to:, callback_url: nil, correlation_id: nil, document: nil, expires_at: nil, from: nil, locale: nil, preferred_channel: nil, variables: nil, request_options: {})
78
85
  # Some parameter documentations has been truncated, see
79
86
  # {PreludeSDK::Models::TransactionalSendParams} for more details.
80
87
  #
@@ -86,6 +93,8 @@ module PreludeSDK
86
93
  #
87
94
  # @param correlation_id [String] A user-defined identifier to correlate this transactional message with. It is re
88
95
  #
96
+ # @param document [PreludeSDK::Models::TransactionalSendParams::Document] A document to attach to the message. Only supported on WhatsApp templates that h
97
+ #
89
98
  # @param expires_at [String] The message expiration date.
90
99
  #
91
100
  # @param from [String] The Sender ID.
@@ -98,6 +107,28 @@ module PreludeSDK
98
107
  #
99
108
  # @param request_options [PreludeSDK::RequestOptions, Hash{Symbol=>Object}]
100
109
 
110
+ class Document < PreludeSDK::Internal::Type::BaseModel
111
+ # @!attribute filename
112
+ # The filename to display for the document.
113
+ #
114
+ # @return [String]
115
+ required :filename, String
116
+
117
+ # @!attribute url
118
+ # The URL of the document to attach. Must be a valid HTTP or HTTPS URL.
119
+ #
120
+ # @return [String]
121
+ required :url, String
122
+
123
+ # @!method initialize(filename:, url:)
124
+ # A document to attach to the message. Only supported on WhatsApp templates that
125
+ # have a document header.
126
+ #
127
+ # @param filename [String] The filename to display for the document.
128
+ #
129
+ # @param url [String] The URL of the document to attach. Must be a valid HTTP or HTTPS URL.
130
+ end
131
+
101
132
  # The preferred delivery channel for the message. When specified, the system will
102
133
  # prioritize sending via the requested channel if the template is configured for
103
134
  # it.