Skip to content

Commit 49ead39

Browse files
feat: Automated regeneration of Datastore client (googleapis#12426)
Auto-created at 2024-10-28 13:17:35 +0000 using the toys pull request generator.
1 parent 8ec5a94 commit 49ead39

File tree

5 files changed

+68
-4
lines changed

5 files changed

+68
-4
lines changed

clients/datastore/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Install this package from [Hex](https://hex.pm) by adding
1111

1212
```elixir
1313
def deps do
14-
[{:google_api_datastore, "~> 0.24"}]
14+
[{:google_api_datastore, "~> 0.25"}]
1515
end
1616
```
1717

clients/datastore/lib/google_api/datastore/v1/metadata.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ defmodule GoogleApi.Datastore.V1 do
2020
API client metadata for GoogleApi.Datastore.V1.
2121
"""
2222

23-
@discovery_revision "20241008"
23+
@discovery_revision "20241018"
2424

2525
def discovery_revision(), do: @discovery_revision
2626
end
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Copyright 2019 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# NOTE: This file is auto generated by the elixir code generator program.
16+
# Do not edit this file manually.
17+
18+
defmodule GoogleApi.Datastore.V1.Model.FindNearest do
19+
@moduledoc """
20+
Nearest Neighbors search config. The ordering provided by FindNearest supersedes the order_by stage. If multiple documents have the same vector distance, the returned document order is not guaranteed to be stable between queries.
21+
22+
## Attributes
23+
24+
* `distanceMeasure` (*type:* `String.t`, *default:* `nil`) - Required. The Distance Measure to use, required.
25+
* `distanceResultProperty` (*type:* `String.t`, *default:* `nil`) - Optional. Optional name of the field to output the result of the vector distance calculation. Must conform to entity property limitations.
26+
* `distanceThreshold` (*type:* `float()`, *default:* `nil`) - Optional. Option to specify a threshold for which no less similar documents will be returned. The behavior of the specified `distance_measure` will affect the meaning of the distance threshold. Since DOT_PRODUCT distances increase when the vectors are more similar, the comparison is inverted. * For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold * For DOT_PRODUCT: WHERE distance >= distance_threshold
27+
* `limit` (*type:* `integer()`, *default:* `nil`) - Required. The number of nearest neighbors to return. Must be a positive integer of no more than 100.
28+
* `queryVector` (*type:* `GoogleApi.Datastore.V1.Model.Value.t`, *default:* `nil`) - Required. The query vector that we are searching on. Must be a vector of no more than 2048 dimensions.
29+
* `vectorProperty` (*type:* `GoogleApi.Datastore.V1.Model.PropertyReference.t`, *default:* `nil`) - Required. An indexed vector property to search upon. Only documents which contain vectors whose dimensionality match the query_vector can be returned.
30+
"""
31+
32+
use GoogleApi.Gax.ModelBase
33+
34+
@type t :: %__MODULE__{
35+
:distanceMeasure => String.t() | nil,
36+
:distanceResultProperty => String.t() | nil,
37+
:distanceThreshold => float() | nil,
38+
:limit => integer() | nil,
39+
:queryVector => GoogleApi.Datastore.V1.Model.Value.t() | nil,
40+
:vectorProperty => GoogleApi.Datastore.V1.Model.PropertyReference.t() | nil
41+
}
42+
43+
field(:distanceMeasure)
44+
field(:distanceResultProperty)
45+
field(:distanceThreshold)
46+
field(:limit)
47+
field(:queryVector, as: GoogleApi.Datastore.V1.Model.Value)
48+
field(:vectorProperty, as: GoogleApi.Datastore.V1.Model.PropertyReference)
49+
end
50+
51+
defimpl Poison.Decoder, for: GoogleApi.Datastore.V1.Model.FindNearest do
52+
def decode(value, options) do
53+
GoogleApi.Datastore.V1.Model.FindNearest.decode(value, options)
54+
end
55+
end
56+
57+
defimpl Poison.Encoder, for: GoogleApi.Datastore.V1.Model.FindNearest do
58+
def encode(value, options) do
59+
GoogleApi.Gax.ModelBase.encode(value, options)
60+
end
61+
end

clients/datastore/lib/google_api/datastore/v1/model/query.ex

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@
1717

1818
defmodule GoogleApi.Datastore.V1.Model.Query do
1919
@moduledoc """
20-
A query for entities.
20+
A query for entities. The query stages are executed in the following order: 1. kind 2. filter 3. projection 4. order + start_cursor + end_cursor 5. offset 6. limit 7. find_nearest
2121
2222
## Attributes
2323
2424
* `distinctOn` (*type:* `list(GoogleApi.Datastore.V1.Model.PropertyReference.t)`, *default:* `nil`) - The properties to make distinct. The query results will contain the first result for each distinct combination of values for the given properties (if empty, all results are returned). Requires: * If `order` is specified, the set of distinct on properties must appear before the non-distinct on properties in `order`.
2525
* `endCursor` (*type:* `String.t`, *default:* `nil`) - An ending point for the query results. Query cursors are returned in query result batches and [can only be used to limit the same query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets).
2626
* `filter` (*type:* `GoogleApi.Datastore.V1.Model.Filter.t`, *default:* `nil`) - The filter to apply.
27+
* `findNearest` (*type:* `GoogleApi.Datastore.V1.Model.FindNearest.t`, *default:* `nil`) - Optional. A potential Nearest Neighbors Search. Applies after all other filters and ordering. Finds the closest vector embeddings to the given query vector.
2728
* `kind` (*type:* `list(GoogleApi.Datastore.V1.Model.KindExpression.t)`, *default:* `nil`) - The kinds to query (if empty, returns entities of all kinds). Currently at most 1 kind may be specified.
2829
* `limit` (*type:* `integer()`, *default:* `nil`) - The maximum number of results to return. Applies after all other constraints. Optional. Unspecified is interpreted as no limit. Must be >= 0 if specified.
2930
* `offset` (*type:* `integer()`, *default:* `nil`) - The number of results to skip. Applies before limit, but after all other constraints. Optional. Must be >= 0 if specified.
@@ -38,6 +39,7 @@ defmodule GoogleApi.Datastore.V1.Model.Query do
3839
:distinctOn => list(GoogleApi.Datastore.V1.Model.PropertyReference.t()) | nil,
3940
:endCursor => String.t() | nil,
4041
:filter => GoogleApi.Datastore.V1.Model.Filter.t() | nil,
42+
:findNearest => GoogleApi.Datastore.V1.Model.FindNearest.t() | nil,
4143
:kind => list(GoogleApi.Datastore.V1.Model.KindExpression.t()) | nil,
4244
:limit => integer() | nil,
4345
:offset => integer() | nil,
@@ -49,6 +51,7 @@ defmodule GoogleApi.Datastore.V1.Model.Query do
4951
field(:distinctOn, as: GoogleApi.Datastore.V1.Model.PropertyReference, type: :list)
5052
field(:endCursor)
5153
field(:filter, as: GoogleApi.Datastore.V1.Model.Filter)
54+
field(:findNearest, as: GoogleApi.Datastore.V1.Model.FindNearest)
5255
field(:kind, as: GoogleApi.Datastore.V1.Model.KindExpression, type: :list)
5356
field(:limit)
5457
field(:offset)

clients/datastore/mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
defmodule GoogleApi.Datastore.Mixfile do
1919
use Mix.Project
2020

21-
@version "0.24.0"
21+
@version "0.25.0"
2222

2323
def project() do
2424
[

0 commit comments

Comments
 (0)