turbopuffer 1.19.0 → 2.0.0.pre.alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +32 -0
- data/README.md +1 -1
- data/lib/turbopuffer/client.rb +14 -1
- data/lib/turbopuffer/internal/util.rb +3 -1
- data/lib/turbopuffer/models/attribute_schema.rb +1 -1
- data/lib/turbopuffer/models/attribute_schema_config.rb +34 -2
- data/lib/turbopuffer/models/columns.rb +2 -8
- data/lib/turbopuffer/models/encryption.rb +55 -0
- data/lib/turbopuffer/models/id.rb +1 -1
- data/lib/turbopuffer/models/limit.rb +0 -3
- data/lib/turbopuffer/models/namespace_branch_from_params.rb +29 -0
- data/lib/turbopuffer/models/namespace_branch_from_response.rb +113 -0
- data/lib/turbopuffer/models/namespace_copy_from_params.rb +45 -0
- data/lib/turbopuffer/models/namespace_copy_from_response.rb +113 -0
- data/lib/turbopuffer/models/namespace_metadata.rb +4 -57
- data/lib/turbopuffer/models/namespace_multi_query_params.rb +103 -3
- data/lib/turbopuffer/models/namespace_write_params.rb +3 -31
- data/lib/turbopuffer/models/sparse_distance_metric.rb +15 -0
- data/lib/turbopuffer/models.rb +8 -2
- data/lib/turbopuffer/resources/namespaces.rb +67 -4
- data/lib/turbopuffer/version.rb +1 -1
- data/lib/turbopuffer.rb +6 -1
- data/rbi/turbopuffer/models/attribute_schema_config.rbi +68 -5
- data/rbi/turbopuffer/models/columns.rbi +1 -8
- data/rbi/turbopuffer/models/encryption.rbi +76 -0
- data/rbi/turbopuffer/models/namespace_branch_from_params.rbi +55 -0
- data/rbi/turbopuffer/models/namespace_branch_from_response.rbi +162 -0
- data/rbi/turbopuffer/models/namespace_copy_from_params.rbi +77 -0
- data/rbi/turbopuffer/models/namespace_copy_from_response.rbi +162 -0
- data/rbi/turbopuffer/models/namespace_metadata.rbi +6 -122
- data/rbi/turbopuffer/models/namespace_multi_query_params.rbi +162 -3
- data/rbi/turbopuffer/models/namespace_write_params.rbi +25 -72
- data/rbi/turbopuffer/models/sparse_distance_metric.rbi +25 -0
- data/rbi/turbopuffer/models.rbi +8 -2
- data/rbi/turbopuffer/resources/namespaces.rbi +48 -2
- data/sig/turbopuffer/models/attribute_schema_config.rbs +34 -3
- data/sig/turbopuffer/models/columns.rbs +1 -3
- data/sig/turbopuffer/models/encryption.rbs +35 -0
- data/sig/turbopuffer/models/namespace_branch_from_params.rbs +30 -0
- data/sig/turbopuffer/models/namespace_branch_from_response.rbs +99 -0
- data/sig/turbopuffer/models/namespace_copy_from_params.rbs +47 -0
- data/sig/turbopuffer/models/namespace_copy_from_response.rbs +99 -0
- data/sig/turbopuffer/models/namespace_metadata.rbs +4 -49
- data/sig/turbopuffer/models/namespace_multi_query_params.rbs +93 -4
- data/sig/turbopuffer/models/namespace_write_params.rbs +6 -35
- data/sig/turbopuffer/models/sparse_distance_metric.rbs +13 -0
- data/sig/turbopuffer/models.rbs +8 -2
- data/sig/turbopuffer/resources/namespaces.rbs +16 -2
- metadata +22 -7
- data/lib/turbopuffer/models/query.rb +0 -104
- data/rbi/turbopuffer/models/query.rbi +0 -154
- data/sig/turbopuffer/models/query.rbs +0 -92
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ec352d339fe92ac66fb6632df2bed51b81559d640f3b4a2140e1ded77218f282
|
|
4
|
+
data.tar.gz: ce362c309ffab91afb01bf3d057f66200b166cc8087bc7055d95f26492cfb941
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '0854bb51b122e2db1f0df2c44e2625e6486c964489615e730b97dd6a541cdb1dff537c41b3e93b967fc5b04a501068cab9342e787a8d186051d0b5a91096588a'
|
|
7
|
+
data.tar.gz: 00514217b637eb9f7d8a6dab848489334267aa8ff5b1ae1c3956fb3e1779cab7c6da22db534e57eb349dee4d9f176e872eae52780a90a234b7342bb01b13e52b
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.0.0-alpha.2 (2026-04-29)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v2.0.0-alpha.1...v2.0.0-alpha.2](https://github.com/turbopuffer/turbopuffer-ruby/compare/v2.0.0-alpha.1...v2.0.0-alpha.2)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* Spec: Add sparse_distance_metric to the list of models. ([81f2998](https://github.com/turbopuffer/turbopuffer-ruby/commit/81f29982fb72e5f90923a35975841633b40aacc5))
|
|
10
|
+
|
|
11
|
+
## 2.0.0-alpha.1 (2026-04-29)
|
|
12
|
+
|
|
13
|
+
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)
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* Add sparse vectors to the spec. ([060434a](https://github.com/turbopuffer/turbopuffer-ruby/commit/060434a1516b678fdf8090b9c7d37c9b9102c3f3))
|
|
18
|
+
* Enable Stainless normalizer v2 while keeping Query inlined ([20d751b](https://github.com/turbopuffer/turbopuffer-ruby/commit/20d751b10ff3a74dfc27f5f5baf4ac41ee50f71d))
|
|
19
|
+
* Require `fuzzy: true` in the schema to use the `Fuzzy` filter ([7408995](https://github.com/turbopuffer/turbopuffer-ruby/commit/7408995fefd4c32638309feefe39e1c4d474213b))
|
|
20
|
+
* set up branchFrom and copyFrom sugar in the OpenAPI spec ([3b0df07](https://github.com/turbopuffer/turbopuffer-ruby/commit/3b0df076ee081ed3ddf129be8762d683a949845c))
|
|
21
|
+
* spec: flatten branchFrom/copyFrom sugar endpoint params ([06214bc](https://github.com/turbopuffer/turbopuffer-ruby/commit/06214bcbded87f2c214b3fc7b2cf2309540b197b))
|
|
22
|
+
* spec: update OpenAPI spec for v2 encryption API ([0c2654f](https://github.com/turbopuffer/turbopuffer-ruby/commit/0c2654fdb779231b867c4c40f9ff9e904601ca3c))
|
|
23
|
+
* support setting headers via env ([a0c4d53](https://github.com/turbopuffer/turbopuffer-ruby/commit/a0c4d53342da77dfbf07f60350246ab418926cff))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Bug Fixes
|
|
27
|
+
|
|
28
|
+
* multipart encoding for file arrays ([bca18a3](https://github.com/turbopuffer/turbopuffer-ruby/commit/bca18a3d40304187b478ec130b274316fb95125a))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Chores
|
|
32
|
+
|
|
33
|
+
* **internal:** more robust bootstrap script ([0b727d5](https://github.com/turbopuffer/turbopuffer-ruby/commit/0b727d5f42db0363d4143b8a912621c2c892c93f))
|
|
34
|
+
|
|
3
35
|
## 1.19.0 (2026-04-06)
|
|
4
36
|
|
|
5
37
|
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
data/lib/turbopuffer/client.rb
CHANGED
|
@@ -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:
|
|
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
|
-
# @!
|
|
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, Turbopuffer::Models::SparseDistanceMetric]
|
|
117
|
+
required :distance_metric, enum: -> { Turbopuffer::SparseDistanceMetric }
|
|
118
|
+
|
|
119
|
+
# @!method initialize(distance_metric:)
|
|
120
|
+
# Whether to create a sparse kNN index for the attribute. Requires the `{}f16`
|
|
121
|
+
# type.
|
|
122
|
+
#
|
|
123
|
+
# @param distance_metric [Symbol, Turbopuffer::Models::SparseDistanceMetric] 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
|
|
36
|
-
variant -> { Turbopuffer::
|
|
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
|
|
@@ -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
|