turbopuffer 1.18.0 → 2.0.0.pre.alpha.1

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 (64) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +49 -0
  3. data/README.md +1 -1
  4. data/lib/turbopuffer/client.rb +14 -1
  5. data/lib/turbopuffer/internal/util.rb +22 -7
  6. data/lib/turbopuffer/models/attribute_schema.rb +1 -1
  7. data/lib/turbopuffer/models/attribute_schema_config.rb +42 -2
  8. data/lib/turbopuffer/models/columns.rb +2 -8
  9. data/lib/turbopuffer/models/encryption.rb +55 -0
  10. data/lib/turbopuffer/models/id.rb +1 -1
  11. data/lib/turbopuffer/models/limit.rb +0 -3
  12. data/lib/turbopuffer/models/namespace_branch_from_params.rb +29 -0
  13. data/lib/turbopuffer/models/namespace_branch_from_response.rb +113 -0
  14. data/lib/turbopuffer/models/namespace_copy_from_params.rb +45 -0
  15. data/lib/turbopuffer/models/namespace_copy_from_response.rb +113 -0
  16. data/lib/turbopuffer/models/namespace_metadata.rb +61 -57
  17. data/lib/turbopuffer/models/namespace_metadata_patch.rb +46 -0
  18. data/lib/turbopuffer/models/namespace_multi_query_params.rb +103 -3
  19. data/lib/turbopuffer/models/namespace_recall_params.rb +10 -1
  20. data/lib/turbopuffer/models/namespace_update_metadata_params.rb +20 -0
  21. data/lib/turbopuffer/models/namespace_write_params.rb +3 -31
  22. data/lib/turbopuffer/models/pinning_config.rb +18 -0
  23. data/lib/turbopuffer/models.rb +11 -1
  24. data/lib/turbopuffer/resources/namespaces.rb +100 -4
  25. data/lib/turbopuffer/version.rb +1 -1
  26. data/lib/turbopuffer.rb +8 -1
  27. data/rbi/turbopuffer/internal/util.rbi +8 -0
  28. data/rbi/turbopuffer/models/attribute_schema_config.rbi +71 -5
  29. data/rbi/turbopuffer/models/columns.rbi +1 -8
  30. data/rbi/turbopuffer/models/encryption.rbi +76 -0
  31. data/rbi/turbopuffer/models/namespace_branch_from_params.rbi +55 -0
  32. data/rbi/turbopuffer/models/namespace_branch_from_response.rbi +162 -0
  33. data/rbi/turbopuffer/models/namespace_copy_from_params.rbi +77 -0
  34. data/rbi/turbopuffer/models/namespace_copy_from_response.rbi +162 -0
  35. data/rbi/turbopuffer/models/namespace_metadata.rbi +117 -124
  36. data/rbi/turbopuffer/models/namespace_metadata_patch.rbi +71 -0
  37. data/rbi/turbopuffer/models/namespace_multi_query_params.rbi +162 -3
  38. data/rbi/turbopuffer/models/namespace_recall_params.rbi +13 -0
  39. data/rbi/turbopuffer/models/namespace_update_metadata_params.rbi +41 -0
  40. data/rbi/turbopuffer/models/namespace_write_params.rbi +25 -72
  41. data/rbi/turbopuffer/models/pinning_config.rbi +31 -0
  42. data/rbi/turbopuffer/models.rbi +12 -1
  43. data/rbi/turbopuffer/resources/namespaces.rbi +75 -2
  44. data/sig/turbopuffer/internal/util.rbs +4 -0
  45. data/sig/turbopuffer/models/attribute_schema_config.rbs +36 -3
  46. data/sig/turbopuffer/models/columns.rbs +1 -3
  47. data/sig/turbopuffer/models/encryption.rbs +35 -0
  48. data/sig/turbopuffer/models/namespace_branch_from_params.rbs +30 -0
  49. data/sig/turbopuffer/models/namespace_branch_from_response.rbs +99 -0
  50. data/sig/turbopuffer/models/namespace_copy_from_params.rbs +47 -0
  51. data/sig/turbopuffer/models/namespace_copy_from_response.rbs +99 -0
  52. data/sig/turbopuffer/models/namespace_metadata.rbs +57 -52
  53. data/sig/turbopuffer/models/namespace_metadata_patch.rbs +26 -0
  54. data/sig/turbopuffer/models/namespace_multi_query_params.rbs +93 -4
  55. data/sig/turbopuffer/models/namespace_recall_params.rbs +7 -0
  56. data/sig/turbopuffer/models/namespace_update_metadata_params.rbs +25 -0
  57. data/sig/turbopuffer/models/namespace_write_params.rbs +6 -35
  58. data/sig/turbopuffer/models/pinning_config.rbs +15 -0
  59. data/sig/turbopuffer/models.rbs +11 -1
  60. data/sig/turbopuffer/resources/namespaces.rbs +23 -2
  61. metadata +28 -7
  62. data/lib/turbopuffer/models/query.rb +0 -104
  63. data/rbi/turbopuffer/models/query.rbi +0 -154
  64. data/sig/turbopuffer/models/query.rbs +0 -92
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 392026af67d721a1c1e41655fa994e4b091513a09098debb10dfe3d7f5b28b10
4
- data.tar.gz: b2594569c7c125a0ac5adf38e0a2837143672f8c5e2fac0d2c6e44c1a9e74f27
3
+ metadata.gz: 6fde3b29deac3a828174a6a5f6255d81bde5182f8c4b4cb83f702e16c69a2c6c
4
+ data.tar.gz: 90aabb5c4ce6118046e6a93063f0ead79498511fc1a61f0d61f1da0b961ac51d
5
5
  SHA512:
6
- metadata.gz: 5479a222309efe4bcf5c8405c3801e1b69701ae752e97629503da8fb575267f6a5ae1c9ad25761c76c4cc0e390e8ba5b236fdbd950fbcd4a6901ab7f9d4170e9
7
- data.tar.gz: c8ae2cdf9de61b0766fb85f8de6e647d8eeda1d5d59fa5de98dbe69d22d02ae7a7106e4ac9403cba15a5449f21bff58cea6b0cf015dbbd89072f94c5bae02a6b
6
+ metadata.gz: a3c9579b604aee56e05f0617558f582c41591c7570d577a739404916c07dc4aaf5c77988823c3d630720157aaa262ac50d6ae20e4c4a906b2582293688196b81
7
+ data.tar.gz: a7da8ab2ba206e0282f8db9b7d55a096d3248db24456ec3674c87b64f8db8222a869a42b346a329eaab390ecfdfcdb90f45648f7ef076af6409b7779b42a9735
data/CHANGELOG.md CHANGED
@@ -1,5 +1,54 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.0.0-alpha.1 (2026-04-29)
4
+
5
+ Full Changelog: [v1.19.0...v2.0.0-alpha.1](https://github.com/turbopuffer/turbopuffer-ruby/compare/v1.19.0...v2.0.0-alpha.1)
6
+
7
+ ### Features
8
+
9
+ * Add sparse vectors to the spec. ([060434a](https://github.com/turbopuffer/turbopuffer-ruby/commit/060434a1516b678fdf8090b9c7d37c9b9102c3f3))
10
+ * Enable Stainless normalizer v2 while keeping Query inlined ([20d751b](https://github.com/turbopuffer/turbopuffer-ruby/commit/20d751b10ff3a74dfc27f5f5baf4ac41ee50f71d))
11
+ * Require `fuzzy: true` in the schema to use the `Fuzzy` filter ([7408995](https://github.com/turbopuffer/turbopuffer-ruby/commit/7408995fefd4c32638309feefe39e1c4d474213b))
12
+ * set up branchFrom and copyFrom sugar in the OpenAPI spec ([3b0df07](https://github.com/turbopuffer/turbopuffer-ruby/commit/3b0df076ee081ed3ddf129be8762d683a949845c))
13
+ * spec: flatten branchFrom/copyFrom sugar endpoint params ([06214bc](https://github.com/turbopuffer/turbopuffer-ruby/commit/06214bcbded87f2c214b3fc7b2cf2309540b197b))
14
+ * spec: update OpenAPI spec for v2 encryption API ([0c2654f](https://github.com/turbopuffer/turbopuffer-ruby/commit/0c2654fdb779231b867c4c40f9ff9e904601ca3c))
15
+ * support setting headers via env ([a0c4d53](https://github.com/turbopuffer/turbopuffer-ruby/commit/a0c4d53342da77dfbf07f60350246ab418926cff))
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * multipart encoding for file arrays ([bca18a3](https://github.com/turbopuffer/turbopuffer-ruby/commit/bca18a3d40304187b478ec130b274316fb95125a))
21
+
22
+
23
+ ### Chores
24
+
25
+ * **internal:** more robust bootstrap script ([0b727d5](https://github.com/turbopuffer/turbopuffer-ruby/commit/0b727d5f42db0363d4143b8a912621c2c892c93f))
26
+
27
+ ## 1.19.0 (2026-04-06)
28
+
29
+ Full Changelog: [v1.18.0...v1.19.0](https://github.com/turbopuffer/turbopuffer-ruby/compare/v1.18.0...v1.19.0)
30
+
31
+ ### Features
32
+
33
+ * add update_metadata method to configure pinning ([f59a80b](https://github.com/turbopuffer/turbopuffer-ruby/commit/f59a80b8ff95b181a07d7bf2feb9715bf6ed2080))
34
+ * docs for glob/regex acceleration ([bafcf09](https://github.com/turbopuffer/turbopuffer-ruby/commit/bafcf09b3b25db23394a76cf6acb688f471a35ea))
35
+ * Multiple Vector Columns Docs ([76392ee](https://github.com/turbopuffer/turbopuffer-ruby/commit/76392ee17ea6ea2d177b7002ca791c27bff394d6))
36
+ * spec: include pinning status in /metadata response ([0ff4fa4](https://github.com/turbopuffer/turbopuffer-ruby/commit/0ff4fa4877dea26f3c5786891632b060e97ad7a2))
37
+
38
+
39
+ ### Bug Fixes
40
+
41
+ * align path encoding with RFC 3986 section 3.3 ([77633f8](https://github.com/turbopuffer/turbopuffer-ruby/commit/77633f885d255631ce1d4b48075c87f5120973ab))
42
+ * **internal:** correct multipart form field name encoding ([7f54d40](https://github.com/turbopuffer/turbopuffer-ruby/commit/7f54d4035b422d568d640ad74d0a311135743927))
43
+ * variable name typo ([7b17a7a](https://github.com/turbopuffer/turbopuffer-ruby/commit/7b17a7a9830198e0ffa46c406bdf87ea865f5863))
44
+
45
+
46
+ ### Chores
47
+
48
+ * **ci:** skip lint on metadata-only changes ([016dab3](https://github.com/turbopuffer/turbopuffer-ruby/commit/016dab37b9e2e92fb14dfea9e814590f329a7cc5))
49
+ * **ci:** support opting out of skipping builds on metadata-only commits ([afc1d7d](https://github.com/turbopuffer/turbopuffer-ruby/commit/afc1d7d3f532ac4d79b73a171308d627e14afd68))
50
+ * **internal:** update gitignore ([cb07b77](https://github.com/turbopuffer/turbopuffer-ruby/commit/cb07b772afcb6337e032217f724cc9d121004adc))
51
+
3
52
  ## 1.18.0 (2026-03-20)
4
53
 
5
54
  Full Changelog: [v1.17.0...v1.18.0](https://github.com/turbopuffer/turbopuffer-ruby/compare/v1.17.0...v1.18.0)
data/README.md CHANGED
@@ -26,7 +26,7 @@ To use this gem, install via Bundler by adding the following to your application
26
26
  <!-- x-release-please-start-version -->
27
27
 
28
28
  ```ruby
29
- gem "turbopuffer", "~> 1.18.0"
29
+ gem "turbopuffer", "~> 2.0.0.pre.alpha.1"
30
30
  ```
31
31
 
32
32
  <!-- x-release-please-end -->
@@ -109,6 +109,19 @@ module Turbopuffer
109
109
  raise ArgumentError.new("api_key is required, and can be set via environ: \"TURBOPUFFER_API_KEY\"")
110
110
  end
111
111
 
112
+ headers = compression ? {} : {"accept-encoding" => "identity"}
113
+ custom_headers_env = ENV["TURBOPUFFER_CUSTOM_HEADERS"]
114
+ unless custom_headers_env.nil?
115
+ parsed = {}
116
+ custom_headers_env.split("\n").each do |line|
117
+ colon = line.index(":")
118
+ unless colon.nil?
119
+ parsed[line[0...colon].strip] = line[(colon + 1)..].strip
120
+ end
121
+ end
122
+ headers = parsed.merge(headers)
123
+ end
124
+
112
125
  if base_url.include?("{region}")
113
126
  if region.nil?
114
127
  raise ArgumentError.new("region is required when base_url contains {region} placeholder: #{base_url}")
@@ -128,7 +141,7 @@ module Turbopuffer
128
141
  max_retries: max_retries,
129
142
  initial_retry_delay: initial_retry_delay,
130
143
  max_retry_delay: max_retry_delay,
131
- headers: compression ? {} : {"accept-encoding" => "identity"}
144
+ headers: headers
132
145
  )
133
146
  end
134
147
  end
@@ -157,7 +157,7 @@ module Turbopuffer
157
157
  in Hash | nil => coerced
158
158
  coerced
159
159
  else
160
- message = "Expected a #{Hash} or #{Turbopuffer::Internal::Type::BaseModel}, got #{data.inspect}"
160
+ message = "Expected a #{Hash} or #{Turbopuffer::Internal::Type::BaseModel}, got #{input.inspect}"
161
161
  raise ArgumentError.new(message)
162
162
  end
163
163
  end
@@ -237,6 +237,11 @@ module Turbopuffer
237
237
  end
238
238
  end
239
239
 
240
+ # @type [Regexp]
241
+ #
242
+ # https://www.rfc-editor.org/rfc/rfc3986.html#section-3.3
243
+ RFC_3986_NOT_PCHARS = /[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/
244
+
240
245
  class << self
241
246
  # @api private
242
247
  #
@@ -247,6 +252,15 @@ module Turbopuffer
247
252
  "#{uri.scheme}://#{uri.host}#{":#{uri.port}" unless uri.port == uri.default_port}"
248
253
  end
249
254
 
255
+ # @api private
256
+ #
257
+ # @param path [String, Integer]
258
+ #
259
+ # @return [String]
260
+ def encode_path(path)
261
+ path.to_s.gsub(Turbopuffer::Internal::Util::RFC_3986_NOT_PCHARS) { ERB::Util.url_encode(_1) }
262
+ end
263
+
250
264
  # @api private
251
265
  #
252
266
  # @param path [String, Array<String>]
@@ -259,7 +273,7 @@ module Turbopuffer
259
273
  in []
260
274
  ""
261
275
  in [String => p, *interpolations]
262
- encoded = interpolations.map { ERB::Util.url_encode(_1) }
276
+ encoded = interpolations.map { encode_path(_1) }
263
277
  format(p, *encoded)
264
278
  end
265
279
  end
@@ -571,16 +585,15 @@ module Turbopuffer
571
585
  y << "Content-Disposition: form-data"
572
586
 
573
587
  unless key.nil?
574
- name = ERB::Util.url_encode(key.to_s)
575
- y << "; name=\"#{name}\""
588
+ y << "; name=\"#{key}\""
576
589
  end
577
590
 
578
591
  case val
579
592
  in Turbopuffer::FilePart unless val.filename.nil?
580
- filename = ERB::Util.url_encode(val.filename)
593
+ filename = encode_path(val.filename)
581
594
  y << "; filename=\"#{filename}\""
582
595
  in Pathname | IO
583
- filename = ERB::Util.url_encode(::File.basename(val.to_path))
596
+ filename = encode_path(::File.basename(val.to_path))
584
597
  y << "; filename=\"#{filename}\""
585
598
  else
586
599
  end
@@ -597,6 +610,7 @@ module Turbopuffer
597
610
  #
598
611
  # @return [Array(String, Enumerable<String>)]
599
612
  private def encode_multipart_streaming(body)
613
+ # rubocop:disable Style/CaseEquality
600
614
  # RFC 1521 Section 7.2.1 says we should have 70 char maximum for boundary length
601
615
  boundary = SecureRandom.urlsafe_base64(46)
602
616
 
@@ -606,7 +620,7 @@ module Turbopuffer
606
620
  in Hash
607
621
  body.each do |key, val|
608
622
  case val
609
- in Array if val.all? { primitive?(_1) }
623
+ in Array if val.all? { primitive?(_1) || Turbopuffer::Internal::Type::FileInput === _1 }
610
624
  val.each do |v|
611
625
  write_multipart_chunk(y, boundary: boundary, key: key, val: v, closing: closing)
612
626
  end
@@ -622,6 +636,7 @@ module Turbopuffer
622
636
 
623
637
  fused_io = fused_enum(strio) { closing.each(&:call) }
624
638
  [boundary, fused_io]
639
+ # rubocop:enable Style/CaseEquality
625
640
  end
626
641
 
627
642
  # @api private
@@ -6,7 +6,7 @@ module Turbopuffer
6
6
  module AttributeSchema
7
7
  extend Turbopuffer::Internal::Type::Union
8
8
 
9
- # The data type of the attribute. Valid values: string, int, uint, float, uuid, datetime, bool, []string, []int, []uint, []float, []uuid, []datetime, []bool, [DIMS]f16, [DIMS]f32.
9
+ # The data type of the attribute. Valid values: string, int, uint, float, uuid, datetime, bool, []string, []int, []uint, []float, []uuid, []datetime, []bool, [DIMS]f16, [DIMS]f32, {}f16.
10
10
  variant -> { Turbopuffer::AttributeType }
11
11
 
12
12
  # Detailed configuration for an attribute attached to a document.
@@ -6,7 +6,7 @@ module Turbopuffer
6
6
  # @!attribute type
7
7
  # The data type of the attribute. Valid values: string, int, uint, float, uuid,
8
8
  # datetime, bool, []string, []int, []uint, []float, []uuid, []datetime, []bool,
9
- # [DIMS]f16, [DIMS]f32.
9
+ # [DIMS]f16, [DIMS]f32, {}f16.
10
10
  #
11
11
  # @return [String]
12
12
  required :type, String
@@ -32,13 +32,32 @@ module Turbopuffer
32
32
  # @return [Boolean, Turbopuffer::Models::FullTextSearchConfig, nil]
33
33
  optional :full_text_search, union: -> { Turbopuffer::FullTextSearch }
34
34
 
35
+ # @!attribute fuzzy
36
+ # Whether to enable Fuzzy filters on this attribute.
37
+ #
38
+ # @return [Boolean, nil]
39
+ optional :fuzzy, Turbopuffer::Internal::Type::Boolean
40
+
41
+ # @!attribute glob
42
+ # Whether to enable Glob filters on this attribute.
43
+ #
44
+ # @return [Boolean, nil]
45
+ optional :glob, Turbopuffer::Internal::Type::Boolean
46
+
35
47
  # @!attribute regex
36
48
  # Whether to enable Regex filters on this attribute.
37
49
  #
38
50
  # @return [Boolean, nil]
39
51
  optional :regex, Turbopuffer::Internal::Type::Boolean
40
52
 
41
- # @!method initialize(type:, ann: nil, filterable: nil, full_text_search: nil, regex: nil)
53
+ # @!attribute sparse_knn
54
+ # Whether to create a sparse kNN index for the attribute. Requires the `{}f16`
55
+ # type.
56
+ #
57
+ # @return [Turbopuffer::Models::AttributeSchemaConfig::SparseKnn, nil]
58
+ optional :sparse_knn, -> { Turbopuffer::AttributeSchemaConfig::SparseKnn }
59
+
60
+ # @!method initialize(type:, ann: nil, filterable: nil, full_text_search: nil, fuzzy: nil, glob: nil, regex: nil, sparse_knn: nil)
42
61
  # Some parameter documentations has been truncated, see
43
62
  # {Turbopuffer::Models::AttributeSchemaConfig} for more details.
44
63
  #
@@ -52,7 +71,13 @@ module Turbopuffer
52
71
  #
53
72
  # @param full_text_search [Boolean, Turbopuffer::Models::FullTextSearchConfig] Whether this attribute can be used as part of a BM25 full-text search. Requires
54
73
  #
74
+ # @param fuzzy [Boolean] Whether to enable Fuzzy filters on this attribute.
75
+ #
76
+ # @param glob [Boolean] Whether to enable Glob filters on this attribute.
77
+ #
55
78
  # @param regex [Boolean] Whether to enable Regex filters on this attribute.
79
+ #
80
+ # @param sparse_knn [Turbopuffer::Models::AttributeSchemaConfig::SparseKnn] Whether to create a sparse kNN index for the attribute. Requires the `{}f16` typ
56
81
 
57
82
  # Whether to create an approximate nearest neighbor index for the attribute. Can
58
83
  # be a boolean or a detailed configuration object.
@@ -82,6 +107,21 @@ module Turbopuffer
82
107
  # @!method self.variants
83
108
  # @return [Array(Boolean, Turbopuffer::Models::AttributeSchemaConfig::Ann::AnnConfig)]
84
109
  end
110
+
111
+ # @see Turbopuffer::Models::AttributeSchemaConfig#sparse_knn
112
+ class SparseKnn < Turbopuffer::Internal::Type::BaseModel
113
+ # @!attribute distance_metric
114
+ # A function used to calculate sparse vector similarity.
115
+ #
116
+ # @return [Symbol, :dot_product]
117
+ required :distance_metric, const: :dot_product
118
+
119
+ # @!method initialize(distance_metric: :dot_product)
120
+ # Whether to create a sparse kNN index for the attribute. Requires the `{}f16`
121
+ # type.
122
+ #
123
+ # @param distance_metric [Symbol, :dot_product] A function used to calculate sparse vector similarity.
124
+ end
85
125
  end
86
126
  end
87
127
  end
@@ -32,20 +32,14 @@ module Turbopuffer
32
32
  # The vector embeddings of the documents.
33
33
  variant -> { Turbopuffer::Models::Columns::Vector::VectorArray }
34
34
 
35
- # A dense vector encoded as an array of floats.
36
- variant -> { Turbopuffer::Models::Columns::Vector::FloatArray }
37
-
38
- # A dense vector encoded as a base64 string.
39
- variant String
35
+ # A vector embedding associated with a document.
36
+ variant union: -> { Turbopuffer::Vector }
40
37
 
41
38
  # @!method self.variants
42
39
  # @return [Array(Array<Array<Float>, String>, Array<Float>, String)]
43
40
 
44
41
  # @type [Turbopuffer::Internal::Type::Converter]
45
42
  VectorArray = Turbopuffer::Internal::Type::ArrayOf[union: -> { Turbopuffer::Vector }]
46
-
47
- # @type [Turbopuffer::Internal::Type::Converter]
48
- FloatArray = Turbopuffer::Internal::Type::ArrayOf[Float]
49
43
  end
50
44
 
51
45
  def method_missing(name, *args, &block)
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Turbopuffer
4
+ module Models
5
+ # The encryption configuration for a namespace.
6
+ module Encryption
7
+ extend Turbopuffer::Internal::Type::Union
8
+
9
+ # Encrypt the namespace with a customer-managed encryption key (CMEK).
10
+ variant -> { Turbopuffer::Encryption::CustomerManaged }
11
+
12
+ # Use the default server-side encryption (SSE).
13
+ variant -> { Turbopuffer::Encryption::Default }
14
+
15
+ class CustomerManaged < Turbopuffer::Internal::Type::BaseModel
16
+ # @!attribute key_name
17
+ # The identifier of the CMEK key to use for encryption. For GCP, the
18
+ # fully-qualified resource name of the key. For AWS, the ARN of the key.
19
+ #
20
+ # @return [String]
21
+ required :key_name, String
22
+
23
+ # @!attribute mode
24
+ #
25
+ # @return [Symbol, :"customer-managed"]
26
+ required :mode, const: :"customer-managed"
27
+
28
+ # @!method initialize(key_name:, mode: :"customer-managed")
29
+ # Some parameter documentations has been truncated, see
30
+ # {Turbopuffer::Models::Encryption::CustomerManaged} for more details.
31
+ #
32
+ # Encrypt the namespace with a customer-managed encryption key (CMEK).
33
+ #
34
+ # @param key_name [String] The identifier of the CMEK key to use for encryption. For GCP, the fully-qualifi
35
+ #
36
+ # @param mode [Symbol, :"customer-managed"]
37
+ end
38
+
39
+ class Default < Turbopuffer::Internal::Type::BaseModel
40
+ # @!attribute mode
41
+ #
42
+ # @return [Symbol, :default]
43
+ required :mode, const: :default
44
+
45
+ # @!method initialize(mode: :default)
46
+ # Use the default server-side encryption (SSE).
47
+ #
48
+ # @param mode [Symbol, :default]
49
+ end
50
+
51
+ # @!method self.variants
52
+ # @return [Array(Turbopuffer::Models::Encryption::CustomerManaged, Turbopuffer::Models::Encryption::Default)]
53
+ end
54
+ end
55
+ end
@@ -6,7 +6,7 @@ module Turbopuffer
6
6
  module ID
7
7
  extend Turbopuffer::Internal::Type::Union
8
8
 
9
- # A UUID.
9
+ # A string ID.
10
10
  variant String
11
11
 
12
12
  # An integer ID.
@@ -41,9 +41,6 @@ module Turbopuffer
41
41
  required :limit, Integer
42
42
 
43
43
  # @!method initialize(attributes:, limit:)
44
- # Some parameter documentations has been truncated, see
45
- # {Turbopuffer::Models::Limit::Per} for more details.
46
- #
47
44
  # Limits the number of documents with the same value for a set of attributes (the
48
45
  # "limit key") that can appear in the results.
49
46
  #
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Turbopuffer
4
+ module Models
5
+ # @see Turbopuffer::Resources::Namespaces#branch_from
6
+ class NamespaceBranchFromParams < Turbopuffer::Internal::Type::BaseModel
7
+ extend Turbopuffer::Internal::Type::RequestParameters::Converter
8
+ include Turbopuffer::Internal::Type::RequestParameters
9
+
10
+ # @!attribute namespace
11
+ #
12
+ # @return [String, nil]
13
+ optional :namespace, String
14
+
15
+ # @!attribute source_namespace
16
+ # The namespace to create an instant, copy-on-write clone of.
17
+ #
18
+ # @return [String]
19
+ required :source_namespace, String
20
+
21
+ # @!method initialize(source_namespace:, namespace: nil, request_options: {})
22
+ # @param source_namespace [String] The namespace to create an instant, copy-on-write clone of.
23
+ #
24
+ # @param namespace [String]
25
+ #
26
+ # @param request_options [Turbopuffer::RequestOptions, Hash{Symbol=>Object}]
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,113 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Turbopuffer
4
+ module Models
5
+ # @see Turbopuffer::Resources::Namespaces#branch_from
6
+ class NamespaceBranchFromResponse < Turbopuffer::Internal::Type::BaseModel
7
+ # @!attribute billing
8
+ # The billing information for a write request.
9
+ #
10
+ # @return [Turbopuffer::Models::WriteBilling]
11
+ required :billing, -> { Turbopuffer::WriteBilling }
12
+
13
+ # @!attribute message
14
+ # A message describing the result of the write request.
15
+ #
16
+ # @return [String]
17
+ required :message, String
18
+
19
+ # @!attribute rows_affected
20
+ # The number of rows affected by the write request.
21
+ #
22
+ # @return [Integer]
23
+ required :rows_affected, Integer
24
+
25
+ # @!attribute status
26
+ # The status of the request.
27
+ #
28
+ # @return [Symbol, :OK]
29
+ required :status, const: :OK
30
+
31
+ # @!attribute deleted_ids
32
+ # The IDs of documents that were deleted. Only included when `return_affected_ids`
33
+ # is true and at least one document was deleted.
34
+ #
35
+ # @return [Array<String, Integer>, nil]
36
+ optional :deleted_ids, -> { Turbopuffer::Internal::Type::ArrayOf[union: Turbopuffer::ID] }
37
+
38
+ # @!attribute patched_ids
39
+ # The IDs of documents that were patched. Only included when `return_affected_ids`
40
+ # is true and at least one document was patched.
41
+ #
42
+ # @return [Array<String, Integer>, nil]
43
+ optional :patched_ids, -> { Turbopuffer::Internal::Type::ArrayOf[union: Turbopuffer::ID] }
44
+
45
+ # @!attribute performance
46
+ # The performance information for a write request.
47
+ #
48
+ # @return [Turbopuffer::Models::WritePerformance, nil]
49
+ optional :performance, -> { Turbopuffer::WritePerformance }
50
+
51
+ # @!attribute rows_deleted
52
+ # The number of rows deleted by the write request.
53
+ #
54
+ # @return [Integer, nil]
55
+ optional :rows_deleted, Integer
56
+
57
+ # @!attribute rows_patched
58
+ # The number of rows patched by the write request.
59
+ #
60
+ # @return [Integer, nil]
61
+ optional :rows_patched, Integer
62
+
63
+ # @!attribute rows_remaining
64
+ # Whether more documents match the filter for partial operations.
65
+ #
66
+ # @return [Boolean, nil]
67
+ optional :rows_remaining, Turbopuffer::Internal::Type::Boolean
68
+
69
+ # @!attribute rows_upserted
70
+ # The number of rows upserted by the write request.
71
+ #
72
+ # @return [Integer, nil]
73
+ optional :rows_upserted, Integer
74
+
75
+ # @!attribute upserted_ids
76
+ # The IDs of documents that were upserted. Only included when
77
+ # `return_affected_ids` is true and at least one document was upserted.
78
+ #
79
+ # @return [Array<String, Integer>, nil]
80
+ optional :upserted_ids, -> { Turbopuffer::Internal::Type::ArrayOf[union: Turbopuffer::ID] }
81
+
82
+ # @!method initialize(billing:, message:, rows_affected:, deleted_ids: nil, patched_ids: nil, performance: nil, rows_deleted: nil, rows_patched: nil, rows_remaining: nil, rows_upserted: nil, upserted_ids: nil, status: :OK)
83
+ # Some parameter documentations has been truncated, see
84
+ # {Turbopuffer::Models::NamespaceBranchFromResponse} for more details.
85
+ #
86
+ # The response to a successful write request.
87
+ #
88
+ # @param billing [Turbopuffer::Models::WriteBilling] The billing information for a write request.
89
+ #
90
+ # @param message [String] A message describing the result of the write request.
91
+ #
92
+ # @param rows_affected [Integer] The number of rows affected by the write request.
93
+ #
94
+ # @param deleted_ids [Array<String, Integer>] The IDs of documents that were deleted. Only included when `return_affected_ids`
95
+ #
96
+ # @param patched_ids [Array<String, Integer>] The IDs of documents that were patched. Only included when `return_affected_ids`
97
+ #
98
+ # @param performance [Turbopuffer::Models::WritePerformance] The performance information for a write request.
99
+ #
100
+ # @param rows_deleted [Integer] The number of rows deleted by the write request.
101
+ #
102
+ # @param rows_patched [Integer] The number of rows patched by the write request.
103
+ #
104
+ # @param rows_remaining [Boolean] Whether more documents match the filter for partial operations.
105
+ #
106
+ # @param rows_upserted [Integer] The number of rows upserted by the write request.
107
+ #
108
+ # @param upserted_ids [Array<String, Integer>] The IDs of documents that were upserted. Only included when `return_affected_ids
109
+ #
110
+ # @param status [Symbol, :OK] The status of the request.
111
+ end
112
+ end
113
+ end
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Turbopuffer
4
+ module Models
5
+ # @see Turbopuffer::Resources::Namespaces#copy_from
6
+ class NamespaceCopyFromParams < Turbopuffer::Internal::Type::BaseModel
7
+ extend Turbopuffer::Internal::Type::RequestParameters::Converter
8
+ include Turbopuffer::Internal::Type::RequestParameters
9
+
10
+ # @!attribute namespace
11
+ #
12
+ # @return [String, nil]
13
+ optional :namespace, String
14
+
15
+ # @!attribute source_namespace
16
+ # The namespace to copy documents from.
17
+ #
18
+ # @return [String]
19
+ required :source_namespace, String
20
+
21
+ # @!attribute source_api_key
22
+ # (Optional) An API key for the organization containing the source namespace
23
+ #
24
+ # @return [String, nil]
25
+ optional :source_api_key, String
26
+
27
+ # @!attribute source_region
28
+ # (Optional) The region of the source namespace.
29
+ #
30
+ # @return [String, nil]
31
+ optional :source_region, String
32
+
33
+ # @!method initialize(source_namespace:, namespace: nil, source_api_key: nil, source_region: nil, request_options: {})
34
+ # @param source_namespace [String] The namespace to copy documents from.
35
+ #
36
+ # @param namespace [String]
37
+ #
38
+ # @param source_api_key [String] (Optional) An API key for the organization containing the source namespace
39
+ #
40
+ # @param source_region [String] (Optional) The region of the source namespace.
41
+ #
42
+ # @param request_options [Turbopuffer::RequestOptions, Hash{Symbol=>Object}]
43
+ end
44
+ end
45
+ end