prelude-sdk 0.1.0.pre.alpha.2 → 0.1.0.pre.alpha.3

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 (38) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +29 -0
  3. data/README.md +1 -1
  4. data/lib/prelude_sdk/internal/transport/base_client.rb +11 -3
  5. data/lib/prelude_sdk/internal/transport/pooled_net_requester.rb +1 -9
  6. data/lib/prelude_sdk/internal/type/array_of.rb +1 -0
  7. data/lib/prelude_sdk/internal/type/base_model.rb +4 -9
  8. data/lib/prelude_sdk/internal/type/converter.rb +27 -0
  9. data/lib/prelude_sdk/internal/type/hash_of.rb +1 -0
  10. data/lib/prelude_sdk/internal/type/union.rb +9 -7
  11. data/lib/prelude_sdk/internal/util.rb +1 -1
  12. data/lib/prelude_sdk/models/transactional_send_params.rb +4 -2
  13. data/lib/prelude_sdk/models/transactional_send_response.rb +7 -2
  14. data/lib/prelude_sdk/models/verification_check_response.rb +6 -1
  15. data/lib/prelude_sdk/models/verification_create_params.rb +13 -16
  16. data/lib/prelude_sdk/models/verification_create_response.rb +39 -12
  17. data/lib/prelude_sdk/models/watch_predict_params.rb +6 -2
  18. data/lib/prelude_sdk/models/watch_send_feedbacks_params.rb +7 -2
  19. data/lib/prelude_sdk/resources/transactional.rb +1 -1
  20. data/lib/prelude_sdk/version.rb +1 -1
  21. data/rbi/prelude_sdk/errors.rbi +2 -2
  22. data/rbi/prelude_sdk/internal/transport/base_client.rbi +1 -1
  23. data/rbi/prelude_sdk/internal/type/converter.rbi +54 -0
  24. data/rbi/prelude_sdk/internal/type/union.rbi +9 -2
  25. data/rbi/prelude_sdk/models/transactional_send_params.rbi +6 -2
  26. data/rbi/prelude_sdk/models/transactional_send_response.rbi +6 -2
  27. data/rbi/prelude_sdk/models/verification_check_response.rbi +7 -1
  28. data/rbi/prelude_sdk/models/verification_create_params.rbi +10 -18
  29. data/rbi/prelude_sdk/models/verification_create_response.rbi +121 -15
  30. data/rbi/prelude_sdk/models/watch_predict_params.rbi +4 -2
  31. data/rbi/prelude_sdk/models/watch_send_feedbacks_params.rbi +4 -2
  32. data/rbi/prelude_sdk/resources/transactional.rbi +3 -1
  33. data/sig/prelude_sdk/internal/transport/base_client.rbs +1 -1
  34. data/sig/prelude_sdk/internal/type/converter.rbs +17 -0
  35. data/sig/prelude_sdk/internal/type/union.rbs +2 -2
  36. data/sig/prelude_sdk/models/verification_create_params.rbs +6 -15
  37. data/sig/prelude_sdk/models/verification_create_response.rbs +41 -16
  38. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 12b02adb152b32c9bd2e7dd2587ddbd3c2cd0852b00af005c6227a938276e997
4
- data.tar.gz: 4c62e71aa6241371ba0547bc643d51bb73c5193bac70725f073e3c8b5f3949c1
3
+ metadata.gz: 4f92fe6a16b20591bab5d7212829340cb90ece7b18a1c0ab76c90d5c2444ca7a
4
+ data.tar.gz: 83cb5e4ec4af8adc647af9a1e69ccfbed0b69d9cdabd407a3dd964542902eca8
5
5
  SHA512:
6
- metadata.gz: eeb2a335540419f67629c0cfbf9d9dd0cc357cb174f0e5a4c309a6afc681cc1aa088cf3852c20b60b46bed5939a8b4d2af33de1b1e9d17af6f5c42e69911da0f
7
- data.tar.gz: 7970fd85651bc993d6a8f9305118e5966c86558a79026a6279a9a9686b023a12dfcb962e12073a8ffc6cc4cd1fbd142398443b084a00bb40421f60df5e43ceed
6
+ metadata.gz: 00ab2023d3b9f12f43fefde4186d2214926e54f5efe6ecac2a22cbdeab3db9b5019c7ff1967d4ab596db4f4e8ba1cd847f597e712ade232967acf4cafe215bf0
7
+ data.tar.gz: ad64312be23a8b2200656143841ec8296f9454be8bc78368bb28a4618f4c8cdd09b333747cf9548c5ba5bf227187795da4f3c6ca395a092071d958ad31d7ae19
data/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.0-alpha.3 (2025-09-02)
4
+
5
+ Full Changelog: [v0.1.0-alpha.2...v0.1.0-alpha.3](https://github.com/prelude-so/ruby-sdk/compare/v0.1.0-alpha.2...v0.1.0-alpha.3)
6
+
7
+ ### Features
8
+
9
+ * **api:** add Ruby-specific rename transformation ([42dadd3](https://github.com/prelude-so/ruby-sdk/commit/42dadd3bddbb321fc9cf76542b26651807050fc4))
10
+ * **api:** api update ([036b7b2](https://github.com/prelude-so/ruby-sdk/commit/036b7b298dc4de946eeff885f8f2a0e9566e1de0))
11
+ * **api:** update via SDK Studio ([791c53f](https://github.com/prelude-so/ruby-sdk/commit/791c53fdbb730ded753d2eb227f87ff6e86ee1bd))
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * bump sorbet version and fix new type errors from the breaking change ([18e0dd1](https://github.com/prelude-so/ruby-sdk/commit/18e0dd1e8f90e1e77c74b491490931309a9cdd4b))
17
+ * **internal:** ensure sorbet test always runs serially ([73f6bb9](https://github.com/prelude-so/ruby-sdk/commit/73f6bb9d30db4eb38e746d74da4ff2eb81881080))
18
+
19
+
20
+ ### Chores
21
+
22
+ * add json schema comment for rubocop.yml ([c6b0b40](https://github.com/prelude-so/ruby-sdk/commit/c6b0b40955adff0da669b9d6177ef37a4cbdbbcf))
23
+ * collect metadata from type DSL ([7bf4d61](https://github.com/prelude-so/ruby-sdk/commit/7bf4d61d21cbd50bb83986e147a5c29793400ca5))
24
+ * **internal:** allow streams to also be unwrapped on a per-row basis ([8572174](https://github.com/prelude-so/ruby-sdk/commit/8572174e262d9c6b7cc66a0894fd6d09184569f1))
25
+ * **internal:** increase visibility of internal helper method ([f04772f](https://github.com/prelude-so/ruby-sdk/commit/f04772fd6d66ba49a3d2f73d21f4538c7957bd28))
26
+ * **internal:** update comment in script ([a5fe28e](https://github.com/prelude-so/ruby-sdk/commit/a5fe28eacf22acdad6f621a1e6ee4e4dfb077d16))
27
+ * **internal:** update test skipping reason ([55f2205](https://github.com/prelude-so/ruby-sdk/commit/55f220596e6310b2d89fe3b460c02fdfe57b9e78))
28
+ * **internal:** version bump ([eb3405c](https://github.com/prelude-so/ruby-sdk/commit/eb3405ca5ae74eb673b5e0cbafde6943e83314fa))
29
+ * update @stainless-api/prism-cli to v5.15.0 ([58f1de5](https://github.com/prelude-so/ruby-sdk/commit/58f1de5007b309c40d197031aeea1e5574213bbe))
30
+ * update contribute.md ([65b7754](https://github.com/prelude-so/ruby-sdk/commit/65b7754e9bfac05f99efcc9a48200fada3940535))
31
+
3
32
  ## 0.1.0-alpha.2 (2025-06-27)
4
33
 
5
34
  Full Changelog: [v0.1.0-alpha.1...v0.1.0-alpha.2](https://github.com/prelude-so/ruby-sdk/compare/v0.1.0-alpha.1...v0.1.0-alpha.2)
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.1.0.pre.alpha.2"
20
+ gem "prelude-sdk", "~> 0.1.0.pre.alpha.3"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -365,7 +365,7 @@ module PreludeSDK
365
365
  #
366
366
  # @raise [PreludeSDK::Errors::APIError]
367
367
  # @return [Array(Integer, Net::HTTPResponse, Enumerable<String>)]
368
- private def send_request(request, redirect_count:, retry_count:, send_retry_header:)
368
+ def send_request(request, redirect_count:, retry_count:, send_retry_header:)
369
369
  url, headers, max_retries, timeout = request.fetch_values(:url, :headers, :max_retries, :timeout)
370
370
  input = {**request.except(:timeout), deadline: PreludeSDK::Internal::Util.monotonic_secs + timeout}
371
371
 
@@ -471,6 +471,7 @@ module PreludeSDK
471
471
  self.class.validate!(req)
472
472
  model = req.fetch(:model) { PreludeSDK::Internal::Type::Unknown }
473
473
  opts = req[:options].to_h
474
+ unwrap = req[:unwrap]
474
475
  PreludeSDK::RequestOptions.validate!(opts)
475
476
  request = build_request(req.except(:options), opts)
476
477
  url = request.fetch(:url)
@@ -487,11 +488,18 @@ module PreludeSDK
487
488
  decoded = PreludeSDK::Internal::Util.decode_content(response, stream: stream)
488
489
  case req
489
490
  in {stream: Class => st}
490
- st.new(model: model, url: url, status: status, response: response, stream: decoded)
491
+ st.new(
492
+ model: model,
493
+ url: url,
494
+ status: status,
495
+ response: response,
496
+ unwrap: unwrap,
497
+ stream: decoded
498
+ )
491
499
  in {page: Class => page}
492
500
  page.new(client: self, req: req, headers: response, page_data: decoded)
493
501
  else
494
- unwrapped = PreludeSDK::Internal::Util.dig(decoded, req[:unwrap])
502
+ unwrapped = PreludeSDK::Internal::Util.dig(decoded, unwrap)
495
503
  PreludeSDK::Internal::Type::Converter.coerce(model, unwrapped)
496
504
  end
497
505
  end
@@ -193,15 +193,7 @@ module PreludeSDK
193
193
  end
194
194
 
195
195
  define_sorbet_constant!(:Request) do
196
- T.type_alias do
197
- {
198
- method: Symbol,
199
- url: URI::Generic,
200
- headers: T::Hash[String, String],
201
- body: T.anything,
202
- deadline: Float
203
- }
204
- end
196
+ T.type_alias { {method: Symbol, url: URI::Generic, headers: T::Hash[String, String], body: T.anything, deadline: Float} }
205
197
  end
206
198
  end
207
199
  end
@@ -148,6 +148,7 @@ module PreludeSDK
148
148
  # @option spec [Boolean] :"nil?"
149
149
  def initialize(type_info, spec = {})
150
150
  @item_type_fn = PreludeSDK::Internal::Type::Converter.type_info(type_info || spec)
151
+ @meta = PreludeSDK::Internal::Type::Converter.meta_info(type_info, spec)
151
152
  @nilable = spec.fetch(:nil?, false)
152
153
  end
153
154
 
@@ -52,6 +52,7 @@ module PreludeSDK
52
52
  #
53
53
  # @option spec [Boolean] :"nil?"
54
54
  private def add_field(name_sym, required:, type_info:, spec:)
55
+ meta = PreludeSDK::Internal::Type::Converter.meta_info(type_info, spec)
55
56
  type_fn, info =
56
57
  case type_info
57
58
  in Proc | PreludeSDK::Internal::Type::Converter | Class
@@ -63,14 +64,7 @@ module PreludeSDK
63
64
  setter = :"#{name_sym}="
64
65
  api_name = info.fetch(:api_name, name_sym)
65
66
  nilable = info.fetch(:nil?, false)
66
- const = if required && !nilable
67
- info.fetch(
68
- :const,
69
- PreludeSDK::Internal::OMIT
70
- )
71
- else
72
- PreludeSDK::Internal::OMIT
73
- end
67
+ const = required && !nilable ? info.fetch(:const, PreludeSDK::Internal::OMIT) : PreludeSDK::Internal::OMIT
74
68
 
75
69
  [name_sym, setter].each { undef_method(_1) } if known_fields.key?(name_sym)
76
70
 
@@ -81,7 +75,8 @@ module PreludeSDK
81
75
  required: required,
82
76
  nilable: nilable,
83
77
  const: const,
84
- type_fn: type_fn
78
+ type_fn: type_fn,
79
+ meta: meta
85
80
  }
86
81
 
87
82
  define_method(setter) do |value|
@@ -98,6 +98,33 @@ module PreludeSDK
98
98
  end
99
99
  end
100
100
 
101
+ # @api private
102
+ #
103
+ # @param type_info [Hash{Symbol=>Object}, Proc, PreludeSDK::Internal::Type::Converter, Class] .
104
+ #
105
+ # @option type_info [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
106
+ #
107
+ # @option type_info [Proc] :enum
108
+ #
109
+ # @option type_info [Proc] :union
110
+ #
111
+ # @option type_info [Boolean] :"nil?"
112
+ #
113
+ # @param spec [Hash{Symbol=>Object}, Proc, PreludeSDK::Internal::Type::Converter, Class] .
114
+ #
115
+ # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
116
+ #
117
+ # @option spec [Proc] :enum
118
+ #
119
+ # @option spec [Proc] :union
120
+ #
121
+ # @option spec [Boolean] :"nil?"
122
+ #
123
+ # @return [Hash{Symbol=>Object}]
124
+ def meta_info(type_info, spec)
125
+ [spec, type_info].grep(Hash).first.to_h.except(:const, :enum, :union, :nil?)
126
+ end
127
+
101
128
  # @api private
102
129
  #
103
130
  # @param translate_names [Boolean]
@@ -168,6 +168,7 @@ module PreludeSDK
168
168
  # @option spec [Boolean] :"nil?"
169
169
  def initialize(type_info, spec = {})
170
170
  @item_type_fn = PreludeSDK::Internal::Type::Converter.type_info(type_info || spec)
171
+ @meta = PreludeSDK::Internal::Type::Converter.meta_info(type_info, spec)
171
172
  @nilable = spec.fetch(:nil?, false)
172
173
  end
173
174
 
@@ -12,20 +12,20 @@ module PreludeSDK
12
12
  #
13
13
  # All of the specified variant info for this union.
14
14
  #
15
- # @return [Array<Array(Symbol, Proc)>]
15
+ # @return [Array<Array(Symbol, Proc, Hash{Symbol=>Object})>]
16
16
  private def known_variants = (@known_variants ||= [])
17
17
 
18
18
  # @api private
19
19
  #
20
- # @return [Array<Array(Symbol, Object)>]
20
+ # @return [Array<Array(Symbol, Object, Hash{Symbol=>Object})>]
21
21
  protected def derefed_variants
22
- known_variants.map { |key, variant_fn| [key, variant_fn.call] }
22
+ known_variants.map { |key, variant_fn, meta| [key, variant_fn.call, meta] }
23
23
  end
24
24
 
25
25
  # All of the specified variants for this union.
26
26
  #
27
27
  # @return [Array<Object>]
28
- def variants = derefed_variants.map(&:last)
28
+ def variants = derefed_variants.map { _2 }
29
29
 
30
30
  # @api private
31
31
  #
@@ -51,12 +51,13 @@ module PreludeSDK
51
51
  #
52
52
  # @option spec [Boolean] :"nil?"
53
53
  private def variant(key, spec = nil)
54
+ meta = PreludeSDK::Internal::Type::Converter.meta_info(nil, spec)
54
55
  variant_info =
55
56
  case key
56
57
  in Symbol
57
- [key, PreludeSDK::Internal::Type::Converter.type_info(spec)]
58
+ [key, PreludeSDK::Internal::Type::Converter.type_info(spec), meta]
58
59
  in Proc | PreludeSDK::Internal::Type::Converter | Class | Hash
59
- [nil, PreludeSDK::Internal::Type::Converter.type_info(key)]
60
+ [nil, PreludeSDK::Internal::Type::Converter.type_info(key), meta]
60
61
  end
61
62
 
62
63
  known_variants << variant_info
@@ -79,7 +80,8 @@ module PreludeSDK
79
80
  return nil if key == PreludeSDK::Internal::OMIT
80
81
 
81
82
  key = key.to_sym if key.is_a?(String)
82
- known_variants.find { |k,| k == key }&.last&.call
83
+ _, found = known_variants.find { |k,| k == key }
84
+ found&.call
83
85
  else
84
86
  nil
85
87
  end
@@ -244,7 +244,7 @@ module PreludeSDK
244
244
  #
245
245
  # @return [String]
246
246
  def uri_origin(uri)
247
- "#{uri.scheme}://#{uri.host}#{uri.port == uri.default_port ? '' : ":#{uri.port}"}"
247
+ "#{uri.scheme}://#{uri.host}#{":#{uri.port}" unless uri.port == uri.default_port}"
248
248
  end
249
249
 
250
250
  # @api private
@@ -26,7 +26,9 @@ module PreludeSDK
26
26
  optional :callback_url, String
27
27
 
28
28
  # @!attribute correlation_id
29
- # A unique, user-defined identifier that will be included in webhook events.
29
+ # A user-defined identifier to correlate this transactional message with. It is
30
+ # returned in the response and any webhook events that refer to this
31
+ # transactionalmessage.
30
32
  #
31
33
  # @return [String, nil]
32
34
  optional :correlation_id, String
@@ -68,7 +70,7 @@ module PreludeSDK
68
70
  #
69
71
  # @param callback_url [String] The callback URL.
70
72
  #
71
- # @param correlation_id [String] A unique, user-defined identifier that will be included in webhook events.
73
+ # @param correlation_id [String] A user-defined identifier to correlate this transactional message with. It is re
72
74
  #
73
75
  # @param expires_at [String] The message expiration date.
74
76
  #
@@ -47,7 +47,9 @@ module PreludeSDK
47
47
  optional :callback_url, String
48
48
 
49
49
  # @!attribute correlation_id
50
- # A unique, user-defined identifier that will be included in webhook events.
50
+ # A user-defined identifier to correlate this transactional message with. It is
51
+ # returned in the response and any webhook events that refer to this transactional
52
+ # message.
51
53
  #
52
54
  # @return [String, nil]
53
55
  optional :correlation_id, String
@@ -59,6 +61,9 @@ module PreludeSDK
59
61
  optional :from, String
60
62
 
61
63
  # @!method initialize(id:, created_at:, expires_at:, template_id:, to:, variables:, callback_url: nil, correlation_id: nil, from: nil)
64
+ # Some parameter documentations has been truncated, see
65
+ # {PreludeSDK::Models::TransactionalSendResponse} for more details.
66
+ #
62
67
  # @param id [String] The message identifier.
63
68
  #
64
69
  # @param created_at [Time] The message creation date.
@@ -73,7 +78,7 @@ module PreludeSDK
73
78
  #
74
79
  # @param callback_url [String] The callback URL.
75
80
  #
76
- # @param correlation_id [String] A unique, user-defined identifier that will be included in webhook events.
81
+ # @param correlation_id [String] A user-defined identifier to correlate this transactional message with. It is re
77
82
  #
78
83
  # @param from [String] The Sender ID.
79
84
  end
@@ -53,14 +53,19 @@ module PreludeSDK
53
53
  # @see PreludeSDK::Models::VerificationCheckResponse#metadata
54
54
  class Metadata < PreludeSDK::Internal::Type::BaseModel
55
55
  # @!attribute correlation_id
56
+ # A user-defined identifier to correlate this verification with. It is returned in
57
+ # the response and any webhook events that refer to this verification.
56
58
  #
57
59
  # @return [String, nil]
58
60
  optional :correlation_id, String
59
61
 
60
62
  # @!method initialize(correlation_id: nil)
63
+ # Some parameter documentations has been truncated, see
64
+ # {PreludeSDK::Models::VerificationCheckResponse::Metadata} for more details.
65
+ #
61
66
  # The metadata for this verification.
62
67
  #
63
- # @param correlation_id [String]
68
+ # @param correlation_id [String] A user-defined identifier to correlate this verification with. It is returned in
64
69
  end
65
70
  end
66
71
  end
@@ -93,16 +93,20 @@ module PreludeSDK
93
93
 
94
94
  class Metadata < PreludeSDK::Internal::Type::BaseModel
95
95
  # @!attribute correlation_id
96
- # A user-defined identifier to correlate this verification with.
96
+ # A user-defined identifier to correlate this verification with. It is returned in
97
+ # the response and any webhook events that refer to this verification.
97
98
  #
98
99
  # @return [String, nil]
99
100
  optional :correlation_id, String
100
101
 
101
102
  # @!method initialize(correlation_id: nil)
103
+ # Some parameter documentations has been truncated, see
104
+ # {PreludeSDK::Models::VerificationCreateParams::Metadata} for more details.
105
+ #
102
106
  # The metadata for this verification. This object will be returned with every
103
107
  # response or webhook sent that refers to this verification.
104
108
  #
105
- # @param correlation_id [String] A user-defined identifier to correlate this verification with.
109
+ # @param correlation_id [String] A user-defined identifier to correlate this verification with. It is returned in
106
110
  end
107
111
 
108
112
  class Options < PreludeSDK::Internal::Type::BaseModel
@@ -145,27 +149,22 @@ module PreludeSDK
145
149
  # @return [String, nil]
146
150
  optional :locale, String
147
151
 
148
- # @!attribute method_
152
+ # @!attribute verification_method
149
153
  # The method used for verifying this phone number. The 'voice' option provides an
150
154
  # accessible alternative for visually impaired users by delivering the
151
155
  # verification code through a phone call rather than a text message. It also
152
156
  # allows verification of landline numbers that cannot receive SMS messages.
153
157
  #
154
158
  # @return [Symbol, PreludeSDK::Models::VerificationCreateParams::Options::Method, nil]
155
- optional :method_,
156
- enum: -> {
157
- PreludeSDK::VerificationCreateParams::Options::Method
158
- },
159
+ optional :verification_method,
160
+ enum: -> { PreludeSDK::VerificationCreateParams::Options::Method },
159
161
  api_name: :method
160
162
 
161
163
  # @!attribute preferred_channel
162
164
  # The preferred channel to be used in priority for verification.
163
165
  #
164
166
  # @return [Symbol, PreludeSDK::Models::VerificationCreateParams::Options::PreferredChannel, nil]
165
- optional :preferred_channel,
166
- enum: -> {
167
- PreludeSDK::VerificationCreateParams::Options::PreferredChannel
168
- }
167
+ optional :preferred_channel, enum: -> { PreludeSDK::VerificationCreateParams::Options::PreferredChannel }
169
168
 
170
169
  # @!attribute sender_id
171
170
  # The Sender ID to use for this message. The Sender ID needs to be enabled by
@@ -187,7 +186,7 @@ module PreludeSDK
187
186
  # @return [Hash{Symbol=>String}, nil]
188
187
  optional :variables, PreludeSDK::Internal::Type::HashOf[String]
189
188
 
190
- # @!method initialize(app_realm: nil, callback_url: nil, code_size: nil, custom_code: nil, locale: nil, method_: nil, preferred_channel: nil, sender_id: nil, template_id: nil, variables: nil)
189
+ # @!method initialize(app_realm: nil, callback_url: nil, code_size: nil, custom_code: nil, locale: nil, verification_method: nil, preferred_channel: nil, sender_id: nil, template_id: nil, variables: nil)
191
190
  # Some parameter documentations has been truncated, see
192
191
  # {PreludeSDK::Models::VerificationCreateParams::Options} for more details.
193
192
  #
@@ -203,7 +202,7 @@ module PreludeSDK
203
202
  #
204
203
  # @param locale [String] A BCP-47 formatted locale string with the language the text message will be sent
205
204
  #
206
- # @param method_ [Symbol, PreludeSDK::Models::VerificationCreateParams::Options::Method] The method used for verifying this phone number. The 'voice' option provides an
205
+ # @param verification_method [Symbol, PreludeSDK::Models::VerificationCreateParams::Options::Method] The method used for verifying this phone number. The 'voice' option provides an
207
206
  #
208
207
  # @param preferred_channel [Symbol, PreludeSDK::Models::VerificationCreateParams::Options::PreferredChannel] The preferred channel to be used in priority for verification.
209
208
  #
@@ -259,7 +258,7 @@ module PreludeSDK
259
258
  # verification code through a phone call rather than a text message. It also
260
259
  # allows verification of landline numbers that cannot receive SMS messages.
261
260
  #
262
- # @see PreludeSDK::Models::VerificationCreateParams::Options#method_
261
+ # @see PreludeSDK::Models::VerificationCreateParams::Options#verification_method
263
262
  module Method
264
263
  extend PreludeSDK::Internal::Type::Enum
265
264
 
@@ -282,8 +281,6 @@ module PreludeSDK
282
281
  VIBER = :viber
283
282
  ZALO = :zalo
284
283
  TELEGRAM = :telegram
285
- SILENT = :silent
286
- VOICE = :voice
287
284
 
288
285
  # @!method self.values
289
286
  # @return [Array<Symbol>]
@@ -10,11 +10,13 @@ module PreludeSDK
10
10
  # @return [String]
11
11
  required :id, String
12
12
 
13
- # @!attribute method_
13
+ # @!attribute verification_method
14
14
  # The method used for verifying this phone number.
15
15
  #
16
16
  # @return [Symbol, PreludeSDK::Models::VerificationCreateResponse::Method]
17
- required :method_, enum: -> { PreludeSDK::Models::VerificationCreateResponse::Method }, api_name: :method
17
+ required :verification_method,
18
+ enum: -> { PreludeSDK::Models::VerificationCreateResponse::Method },
19
+ api_name: :method
18
20
 
19
21
  # @!attribute status
20
22
  # The status of the verification.
@@ -25,8 +27,9 @@ module PreludeSDK
25
27
  # @!attribute channels
26
28
  # The ordered sequence of channels to be used for verification
27
29
  #
28
- # @return [Array<String>, nil]
29
- optional :channels, PreludeSDK::Internal::Type::ArrayOf[String]
30
+ # @return [Array<Symbol, PreludeSDK::Models::VerificationCreateResponse::Channel>, nil]
31
+ optional :channels,
32
+ -> { PreludeSDK::Internal::Type::ArrayOf[enum: PreludeSDK::Models::VerificationCreateResponse::Channel] }
30
33
 
31
34
  # @!attribute metadata
32
35
  # The metadata for this verification.
@@ -52,17 +55,17 @@ module PreludeSDK
52
55
  # @return [PreludeSDK::Models::VerificationCreateResponse::Silent, nil]
53
56
  optional :silent, -> { PreludeSDK::Models::VerificationCreateResponse::Silent }
54
57
 
55
- # @!method initialize(id:, method_:, status:, channels: nil, metadata: nil, reason: nil, request_id: nil, silent: nil)
58
+ # @!method initialize(id:, verification_method:, status:, channels: nil, metadata: nil, reason: nil, request_id: nil, silent: nil)
56
59
  # Some parameter documentations has been truncated, see
57
60
  # {PreludeSDK::Models::VerificationCreateResponse} for more details.
58
61
  #
59
62
  # @param id [String] The verification identifier.
60
63
  #
61
- # @param method_ [Symbol, PreludeSDK::Models::VerificationCreateResponse::Method] The method used for verifying this phone number.
64
+ # @param verification_method [Symbol, PreludeSDK::Models::VerificationCreateResponse::Method] The method used for verifying this phone number.
62
65
  #
63
66
  # @param status [Symbol, PreludeSDK::Models::VerificationCreateResponse::Status] The status of the verification.
64
67
  #
65
- # @param channels [Array<String>] The ordered sequence of channels to be used for verification
68
+ # @param channels [Array<Symbol, PreludeSDK::Models::VerificationCreateResponse::Channel>] The ordered sequence of channels to be used for verification
66
69
  #
67
70
  # @param metadata [PreludeSDK::Models::VerificationCreateResponse::Metadata] The metadata for this verification.
68
71
  #
@@ -74,10 +77,11 @@ module PreludeSDK
74
77
 
75
78
  # The method used for verifying this phone number.
76
79
  #
77
- # @see PreludeSDK::Models::VerificationCreateResponse#method_
80
+ # @see PreludeSDK::Models::VerificationCreateResponse#verification_method
78
81
  module Method
79
82
  extend PreludeSDK::Internal::Type::Enum
80
83
 
84
+ EMAIL = :email
81
85
  MESSAGE = :message
82
86
  SILENT = :silent
83
87
  VOICE = :voice
@@ -100,17 +104,38 @@ module PreludeSDK
100
104
  # @return [Array<Symbol>]
101
105
  end
102
106
 
107
+ module Channel
108
+ extend PreludeSDK::Internal::Type::Enum
109
+
110
+ RCS = :rcs
111
+ SILENT = :silent
112
+ SMS = :sms
113
+ TELEGRAM = :telegram
114
+ VIBER = :viber
115
+ VOICE = :voice
116
+ WHATSAPP = :whatsapp
117
+ ZALO = :zalo
118
+
119
+ # @!method self.values
120
+ # @return [Array<Symbol>]
121
+ end
122
+
103
123
  # @see PreludeSDK::Models::VerificationCreateResponse#metadata
104
124
  class Metadata < PreludeSDK::Internal::Type::BaseModel
105
125
  # @!attribute correlation_id
126
+ # A user-defined identifier to correlate this verification with. It is returned in
127
+ # the response and any webhook events that refer to this verification.
106
128
  #
107
129
  # @return [String, nil]
108
130
  optional :correlation_id, String
109
131
 
110
132
  # @!method initialize(correlation_id: nil)
133
+ # Some parameter documentations has been truncated, see
134
+ # {PreludeSDK::Models::VerificationCreateResponse::Metadata} for more details.
135
+ #
111
136
  # The metadata for this verification.
112
137
  #
113
- # @param correlation_id [String]
138
+ # @param correlation_id [String] A user-defined identifier to correlate this verification with. It is returned in
114
139
  end
115
140
 
116
141
  # The reason why the verification was blocked. Only present when status is
@@ -120,11 +145,13 @@ module PreludeSDK
120
145
  module Reason
121
146
  extend PreludeSDK::Internal::Type::Enum
122
147
 
123
- SUSPICIOUS = :suspicious
124
- REPEATED_ATTEMPTS = :repeated_attempts
148
+ EXPIRED_SIGNATURE = :expired_signature
149
+ IN_BLOCK_LIST = :in_block_list
125
150
  INVALID_PHONE_LINE = :invalid_phone_line
126
151
  INVALID_PHONE_NUMBER = :invalid_phone_number
127
- IN_BLOCK_LIST = :in_block_list
152
+ INVALID_SIGNATURE = :invalid_signature
153
+ REPEATED_ATTEMPTS = :repeated_attempts
154
+ SUSPICIOUS = :suspicious
128
155
 
129
156
  # @!method self.values
130
157
  # @return [Array<Symbol>]
@@ -82,15 +82,19 @@ module PreludeSDK
82
82
 
83
83
  class Metadata < PreludeSDK::Internal::Type::BaseModel
84
84
  # @!attribute correlation_id
85
- # A user-defined identifier to correlate this prediction with.
85
+ # A user-defined identifier to correlate this prediction with. It is returned in
86
+ # the response and any webhook events that refer to this prediction.
86
87
  #
87
88
  # @return [String, nil]
88
89
  optional :correlation_id, String
89
90
 
90
91
  # @!method initialize(correlation_id: nil)
92
+ # Some parameter documentations has been truncated, see
93
+ # {PreludeSDK::Models::WatchPredictParams::Metadata} for more details.
94
+ #
91
95
  # The metadata for this prediction.
92
96
  #
93
- # @param correlation_id [String] A user-defined identifier to correlate this prediction with.
97
+ # @param correlation_id [String] A user-defined identifier to correlate this prediction with. It is returned in t
94
98
  end
95
99
 
96
100
  class Signals < PreludeSDK::Internal::Type::BaseModel
@@ -116,15 +116,20 @@ module PreludeSDK
116
116
  # @see PreludeSDK::Models::WatchSendFeedbacksParams::Feedback#metadata
117
117
  class Metadata < PreludeSDK::Internal::Type::BaseModel
118
118
  # @!attribute correlation_id
119
- # A user-defined identifier to correlate this feedback with.
119
+ # A user-defined identifier to correlate this feedback with. It is returned in the
120
+ # response and any webhook events that refer to this feedback.
120
121
  #
121
122
  # @return [String, nil]
122
123
  optional :correlation_id, String
123
124
 
124
125
  # @!method initialize(correlation_id: nil)
126
+ # Some parameter documentations has been truncated, see
127
+ # {PreludeSDK::Models::WatchSendFeedbacksParams::Feedback::Metadata} for more
128
+ # details.
129
+ #
125
130
  # The metadata for this feedback.
126
131
  #
127
- # @param correlation_id [String] A user-defined identifier to correlate this feedback with.
132
+ # @param correlation_id [String] A user-defined identifier to correlate this feedback with. It is returned in the
128
133
  end
129
134
 
130
135
  # @see PreludeSDK::Models::WatchSendFeedbacksParams::Feedback#signals
@@ -16,7 +16,7 @@ module PreludeSDK
16
16
  #
17
17
  # @param callback_url [String] The callback URL.
18
18
  #
19
- # @param correlation_id [String] A unique, user-defined identifier that will be included in webhook events.
19
+ # @param correlation_id [String] A user-defined identifier to correlate this transactional message with. It is re
20
20
  #
21
21
  # @param expires_at [String] The message expiration date.
22
22
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PreludeSDK
4
- VERSION = "0.1.0.pre.alpha.2"
4
+ VERSION = "0.1.0.pre.alpha.3"
5
5
  end
@@ -59,10 +59,10 @@ module PreludeSDK
59
59
  end
60
60
 
61
61
  class APIConnectionError < PreludeSDK::Errors::APIError
62
- sig { void }
62
+ sig { returns(NilClass) }
63
63
  attr_accessor :status
64
64
 
65
- sig { void }
65
+ sig { returns(NilClass) }
66
66
  attr_accessor :body
67
67
 
68
68
  # @api private
@@ -216,7 +216,7 @@ module PreludeSDK
216
216
  send_retry_header: T::Boolean
217
217
  ).returns([Integer, Net::HTTPResponse, T::Enumerable[String]])
218
218
  end
219
- private def send_request(
219
+ def send_request(
220
220
  request,
221
221
  redirect_count:,
222
222
  retry_count:,