turbopuffer 1.19.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 (50) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +24 -0
  3. data/README.md +1 -1
  4. data/lib/turbopuffer/client.rb +14 -1
  5. data/lib/turbopuffer/internal/util.rb +3 -1
  6. data/lib/turbopuffer/models/attribute_schema.rb +1 -1
  7. data/lib/turbopuffer/models/attribute_schema_config.rb +34 -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 +4 -57
  17. data/lib/turbopuffer/models/namespace_multi_query_params.rb +103 -3
  18. data/lib/turbopuffer/models/namespace_write_params.rb +3 -31
  19. data/lib/turbopuffer/models.rb +6 -2
  20. data/lib/turbopuffer/resources/namespaces.rb +67 -4
  21. data/lib/turbopuffer/version.rb +1 -1
  22. data/lib/turbopuffer.rb +5 -1
  23. data/rbi/turbopuffer/models/attribute_schema_config.rbi +60 -5
  24. data/rbi/turbopuffer/models/columns.rbi +1 -8
  25. data/rbi/turbopuffer/models/encryption.rbi +76 -0
  26. data/rbi/turbopuffer/models/namespace_branch_from_params.rbi +55 -0
  27. data/rbi/turbopuffer/models/namespace_branch_from_response.rbi +162 -0
  28. data/rbi/turbopuffer/models/namespace_copy_from_params.rbi +77 -0
  29. data/rbi/turbopuffer/models/namespace_copy_from_response.rbi +162 -0
  30. data/rbi/turbopuffer/models/namespace_metadata.rbi +6 -122
  31. data/rbi/turbopuffer/models/namespace_multi_query_params.rbi +162 -3
  32. data/rbi/turbopuffer/models/namespace_write_params.rbi +25 -72
  33. data/rbi/turbopuffer/models.rbi +6 -2
  34. data/rbi/turbopuffer/resources/namespaces.rbi +48 -2
  35. data/sig/turbopuffer/models/attribute_schema_config.rbs +29 -3
  36. data/sig/turbopuffer/models/columns.rbs +1 -3
  37. data/sig/turbopuffer/models/encryption.rbs +35 -0
  38. data/sig/turbopuffer/models/namespace_branch_from_params.rbs +30 -0
  39. data/sig/turbopuffer/models/namespace_branch_from_response.rbs +99 -0
  40. data/sig/turbopuffer/models/namespace_copy_from_params.rbs +47 -0
  41. data/sig/turbopuffer/models/namespace_copy_from_response.rbs +99 -0
  42. data/sig/turbopuffer/models/namespace_metadata.rbs +4 -49
  43. data/sig/turbopuffer/models/namespace_multi_query_params.rbs +93 -4
  44. data/sig/turbopuffer/models/namespace_write_params.rbs +6 -35
  45. data/sig/turbopuffer/models.rbs +6 -2
  46. data/sig/turbopuffer/resources/namespaces.rbs +16 -2
  47. metadata +19 -7
  48. data/lib/turbopuffer/models/query.rb +0 -104
  49. data/rbi/turbopuffer/models/query.rbi +0 -154
  50. data/sig/turbopuffer/models/query.rbs +0 -92
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5b7d18934b6b6f5b4bca87b243216d1ba458598472cc5df4751bf1e23b8eb38c
4
- data.tar.gz: 9ae7f3ad01c68fa4c76ad46419949bca2c957362e3e6bc96a2f9becf762632ea
3
+ metadata.gz: 6fde3b29deac3a828174a6a5f6255d81bde5182f8c4b4cb83f702e16c69a2c6c
4
+ data.tar.gz: 90aabb5c4ce6118046e6a93063f0ead79498511fc1a61f0d61f1da0b961ac51d
5
5
  SHA512:
6
- metadata.gz: c22b27d365408dec9029a0dd8b876fc3701c05e6ac69b9caf7e4a31140ff7af3635d31499421667b1ba026f15ef8f934bbe4a47378a4225720e0624626ec1f8a
7
- data.tar.gz: 6b5ddcafe494903ed7bda7b113906feba7a150d7a51663b297c7134160fc2146fc35f7bb3e62b724a950d13e6a8e5cc42b6f420fce244a9a08d80203858507cc
6
+ metadata.gz: a3c9579b604aee56e05f0617558f582c41591c7570d577a739404916c07dc4aaf5c77988823c3d630720157aaa262ac50d6ae20e4c4a906b2582293688196b81
7
+ data.tar.gz: a7da8ab2ba206e0282f8db9b7d55a096d3248db24456ec3674c87b64f8db8222a869a42b346a329eaab390ecfdfcdb90f45648f7ef076af6409b7779b42a9735
data/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
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
+
3
27
  ## 1.19.0 (2026-04-06)
4
28
 
5
29
  Full Changelog: [v1.18.0...v1.19.0](https://github.com/turbopuffer/turbopuffer-ruby/compare/v1.18.0...v1.19.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.19.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
@@ -610,6 +610,7 @@ module Turbopuffer
610
610
  #
611
611
  # @return [Array(String, Enumerable<String>)]
612
612
  private def encode_multipart_streaming(body)
613
+ # rubocop:disable Style/CaseEquality
613
614
  # RFC 1521 Section 7.2.1 says we should have 70 char maximum for boundary length
614
615
  boundary = SecureRandom.urlsafe_base64(46)
615
616
 
@@ -619,7 +620,7 @@ module Turbopuffer
619
620
  in Hash
620
621
  body.each do |key, val|
621
622
  case val
622
- in Array if val.all? { primitive?(_1) }
623
+ in Array if val.all? { primitive?(_1) || Turbopuffer::Internal::Type::FileInput === _1 }
623
624
  val.each do |v|
624
625
  write_multipart_chunk(y, boundary: boundary, key: key, val: v, closing: closing)
625
626
  end
@@ -635,6 +636,7 @@ module Turbopuffer
635
636
 
636
637
  fused_io = fused_enum(strio) { closing.each(&:call) }
637
638
  [boundary, fused_io]
639
+ # rubocop:enable Style/CaseEquality
638
640
  end
639
641
 
640
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,6 +32,12 @@ 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
+
35
41
  # @!attribute glob
36
42
  # Whether to enable Glob filters on this attribute.
37
43
  #
@@ -44,7 +50,14 @@ module Turbopuffer
44
50
  # @return [Boolean, nil]
45
51
  optional :regex, Turbopuffer::Internal::Type::Boolean
46
52
 
47
- # @!method initialize(type:, ann: nil, filterable: nil, full_text_search: nil, glob: 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)
48
61
  # Some parameter documentations has been truncated, see
49
62
  # {Turbopuffer::Models::AttributeSchemaConfig} for more details.
50
63
  #
@@ -58,9 +71,13 @@ module Turbopuffer
58
71
  #
59
72
  # @param full_text_search [Boolean, Turbopuffer::Models::FullTextSearchConfig] Whether this attribute can be used as part of a BM25 full-text search. Requires
60
73
  #
74
+ # @param fuzzy [Boolean] Whether to enable Fuzzy filters on this attribute.
75
+ #
61
76
  # @param glob [Boolean] Whether to enable Glob filters on this attribute.
62
77
  #
63
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
64
81
 
65
82
  # Whether to create an approximate nearest neighbor index for the attribute. Can
66
83
  # be a boolean or a detailed configuration object.
@@ -90,6 +107,21 @@ module Turbopuffer
90
107
  # @!method self.variants
91
108
  # @return [Array(Boolean, Turbopuffer::Models::AttributeSchemaConfig::Ann::AnnConfig)]
92
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
93
125
  end
94
126
  end
95
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
@@ -0,0 +1,113 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Turbopuffer
4
+ module Models
5
+ # @see Turbopuffer::Resources::Namespaces#copy_from
6
+ class NamespaceCopyFromResponse < 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::NamespaceCopyFromResponse} 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