Skip to content

Commit 5e945fa

Browse files
feat: Automated regeneration of Datastore client (googleapis#12351)
Auto-created at 2024-10-17 13:20:20 +0000 using the toys pull request generator.
1 parent f2b25e6 commit 5e945fa

File tree

6 files changed

+76
-3
lines changed

6 files changed

+76
-3
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.23"}]
14+
[{:google_api_datastore, "~> 0.24"}]
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 "20240317"
23+
@discovery_revision "20241008"
2424

2525
def discovery_revision(), do: @discovery_revision
2626
end

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ defmodule GoogleApi.Datastore.V1.Model.Mutation do
2222
## Attributes
2323
2424
* `baseVersion` (*type:* `String.t`, *default:* `nil`) - The version of the entity that this mutation is being applied to. If this does not match the current version on the server, the mutation conflicts.
25+
* `conflictResolutionStrategy` (*type:* `String.t`, *default:* `nil`) - The strategy to use when a conflict is detected. Defaults to `SERVER_VALUE`. If this is set, then `conflict_detection_strategy` must also be set.
2526
* `delete` (*type:* `GoogleApi.Datastore.V1.Model.Key.t`, *default:* `nil`) - The key of the entity to delete. The entity may or may not already exist. Must have a complete key path and must not be reserved/read-only.
2627
* `insert` (*type:* `GoogleApi.Datastore.V1.Model.Entity.t`, *default:* `nil`) - The entity to insert. The entity must not already exist. The entity key's final path element may be incomplete.
2728
* `propertyMask` (*type:* `GoogleApi.Datastore.V1.Model.PropertyMask.t`, *default:* `nil`) - The properties to write in this mutation. None of the properties in the mask may have a reserved name, except for `__key__`. This field is ignored for `delete`. If the entity already exists, only properties referenced in the mask are updated, others are left untouched. Properties referenced in the mask but not in the entity are deleted.
29+
* `propertyTransforms` (*type:* `list(GoogleApi.Datastore.V1.Model.PropertyTransform.t)`, *default:* `nil`) - Optional. The transforms to perform on the entity. This field can be set only when the operation is `insert`, `update`, or `upsert`. If present, the transforms are be applied to the entity regardless of the property mask, in order, after the operation.
2830
* `update` (*type:* `GoogleApi.Datastore.V1.Model.Entity.t`, *default:* `nil`) - The entity to update. The entity must already exist. Must have a complete key path.
2931
* `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - The update time of the entity that this mutation is being applied to. If this does not match the current update time on the server, the mutation conflicts.
3032
* `upsert` (*type:* `GoogleApi.Datastore.V1.Model.Entity.t`, *default:* `nil`) - The entity to upsert. The entity may or may not already exist. The entity key's final path element may be incomplete.
@@ -34,18 +36,22 @@ defmodule GoogleApi.Datastore.V1.Model.Mutation do
3436

3537
@type t :: %__MODULE__{
3638
:baseVersion => String.t() | nil,
39+
:conflictResolutionStrategy => String.t() | nil,
3740
:delete => GoogleApi.Datastore.V1.Model.Key.t() | nil,
3841
:insert => GoogleApi.Datastore.V1.Model.Entity.t() | nil,
3942
:propertyMask => GoogleApi.Datastore.V1.Model.PropertyMask.t() | nil,
43+
:propertyTransforms => list(GoogleApi.Datastore.V1.Model.PropertyTransform.t()) | nil,
4044
:update => GoogleApi.Datastore.V1.Model.Entity.t() | nil,
4145
:updateTime => DateTime.t() | nil,
4246
:upsert => GoogleApi.Datastore.V1.Model.Entity.t() | nil
4347
}
4448

4549
field(:baseVersion)
50+
field(:conflictResolutionStrategy)
4651
field(:delete, as: GoogleApi.Datastore.V1.Model.Key)
4752
field(:insert, as: GoogleApi.Datastore.V1.Model.Entity)
4853
field(:propertyMask, as: GoogleApi.Datastore.V1.Model.PropertyMask)
54+
field(:propertyTransforms, as: GoogleApi.Datastore.V1.Model.PropertyTransform, type: :list)
4955
field(:update, as: GoogleApi.Datastore.V1.Model.Entity)
5056
field(:updateTime, as: DateTime)
5157
field(:upsert, as: GoogleApi.Datastore.V1.Model.Entity)

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ defmodule GoogleApi.Datastore.V1.Model.MutationResult do
2424
* `conflictDetected` (*type:* `boolean()`, *default:* `nil`) - Whether a conflict was detected for this mutation. Always false when a conflict detection strategy field is not set in the mutation.
2525
* `createTime` (*type:* `DateTime.t`, *default:* `nil`) - The create time of the entity. This field will not be set after a 'delete'.
2626
* `key` (*type:* `GoogleApi.Datastore.V1.Model.Key.t`, *default:* `nil`) - The automatically allocated key. Set only when the mutation allocated a key.
27+
* `transformResults` (*type:* `list(GoogleApi.Datastore.V1.Model.Value.t)`, *default:* `nil`) - The results of applying each PropertyTransform, in the same order of the request.
2728
* `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - The update time of the entity on the server after processing the mutation. If the mutation doesn't change anything on the server, then the timestamp will be the update timestamp of the current entity. This field will not be set after a 'delete'.
2829
* `version` (*type:* `String.t`, *default:* `nil`) - The version of the entity on the server after processing the mutation. If the mutation doesn't change anything on the server, then the version will be the version of the current entity or, if no entity is present, a version that is strictly greater than the version of any previous entity and less than the version of any possible future entity.
2930
"""
@@ -34,13 +35,15 @@ defmodule GoogleApi.Datastore.V1.Model.MutationResult do
3435
:conflictDetected => boolean() | nil,
3536
:createTime => DateTime.t() | nil,
3637
:key => GoogleApi.Datastore.V1.Model.Key.t() | nil,
38+
:transformResults => list(GoogleApi.Datastore.V1.Model.Value.t()) | nil,
3739
:updateTime => DateTime.t() | nil,
3840
:version => String.t() | nil
3941
}
4042

4143
field(:conflictDetected)
4244
field(:createTime, as: DateTime)
4345
field(:key, as: GoogleApi.Datastore.V1.Model.Key)
46+
field(:transformResults, as: GoogleApi.Datastore.V1.Model.Value, type: :list)
4447
field(:updateTime, as: DateTime)
4548
field(:version)
4649
end
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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.PropertyTransform do
19+
@moduledoc """
20+
A transformation of an entity property.
21+
22+
## Attributes
23+
24+
* `appendMissingElements` (*type:* `GoogleApi.Datastore.V1.Model.ArrayValue.t`, *default:* `nil`) - Appends the given elements in order if they are not already present in the current property value. If the property is not an array, or if the property does not yet exist, it is first set to the empty array. Equivalent numbers of different types (e.g. 3L and 3.0) are considered equal when checking if a value is missing. NaN is equal to NaN, and the null value is equal to the null value. If the input contains multiple equivalent values, only the first will be considered. The corresponding transform result will be the null value.
25+
* `increment` (*type:* `GoogleApi.Datastore.V1.Model.Value.t`, *default:* `nil`) - Adds the given value to the property's current value. This must be an integer or a double value. If the property is not an integer or double, or if the property does not yet exist, the transformation will set the property to the given value. If either of the given value or the current property value are doubles, both values will be interpreted as doubles. Double arithmetic and representation of double values follows IEEE 754 semantics. If there is positive/negative integer overflow, the property is resolved to the largest magnitude positive/negative integer.
26+
* `maximum` (*type:* `GoogleApi.Datastore.V1.Model.Value.t`, *default:* `nil`) - Sets the property to the maximum of its current value and the given value. This must be an integer or a double value. If the property is not an integer or double, or if the property does not yet exist, the transformation will set the property to the given value. If a maximum operation is applied where the property and the input value are of mixed types (that is - one is an integer and one is a double) the property takes on the type of the larger operand. If the operands are equivalent (e.g. 3 and 3.0), the property does not change. 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and zero input value is always the stored value. The maximum of any numeric value x and NaN is NaN.
27+
* `minimum` (*type:* `GoogleApi.Datastore.V1.Model.Value.t`, *default:* `nil`) - Sets the property to the minimum of its current value and the given value. This must be an integer or a double value. If the property is not an integer or double, or if the property does not yet exist, the transformation will set the property to the input value. If a minimum operation is applied where the property and the input value are of mixed types (that is - one is an integer and one is a double) the property takes on the type of the smaller operand. If the operands are equivalent (e.g. 3 and 3.0), the property does not change. 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and zero input value is always the stored value. The minimum of any numeric value x and NaN is NaN.
28+
* `property` (*type:* `String.t`, *default:* `nil`) - Optional. The name of the property. Property paths (a list of property names separated by dots (`.`)) may be used to refer to properties inside entity values. For example `foo.bar` means the property `bar` inside the entity property `foo`. If a property name contains a dot `.` or a backlslash `\\`, then that name must be escaped.
29+
* `removeAllFromArray` (*type:* `GoogleApi.Datastore.V1.Model.ArrayValue.t`, *default:* `nil`) - Removes all of the given elements from the array in the property. If the property is not an array, or if the property does not yet exist, it is set to the empty array. Equivalent numbers of different types (e.g. 3L and 3.0) are considered equal when deciding whether an element should be removed. NaN is equal to NaN, and the null value is equal to the null value. This will remove all equivalent values if there are duplicates. The corresponding transform result will be the null value.
30+
* `setToServerValue` (*type:* `String.t`, *default:* `nil`) - Sets the property to the given server value.
31+
"""
32+
33+
use GoogleApi.Gax.ModelBase
34+
35+
@type t :: %__MODULE__{
36+
:appendMissingElements => GoogleApi.Datastore.V1.Model.ArrayValue.t() | nil,
37+
:increment => GoogleApi.Datastore.V1.Model.Value.t() | nil,
38+
:maximum => GoogleApi.Datastore.V1.Model.Value.t() | nil,
39+
:minimum => GoogleApi.Datastore.V1.Model.Value.t() | nil,
40+
:property => String.t() | nil,
41+
:removeAllFromArray => GoogleApi.Datastore.V1.Model.ArrayValue.t() | nil,
42+
:setToServerValue => String.t() | nil
43+
}
44+
45+
field(:appendMissingElements, as: GoogleApi.Datastore.V1.Model.ArrayValue)
46+
field(:increment, as: GoogleApi.Datastore.V1.Model.Value)
47+
field(:maximum, as: GoogleApi.Datastore.V1.Model.Value)
48+
field(:minimum, as: GoogleApi.Datastore.V1.Model.Value)
49+
field(:property)
50+
field(:removeAllFromArray, as: GoogleApi.Datastore.V1.Model.ArrayValue)
51+
field(:setToServerValue)
52+
end
53+
54+
defimpl Poison.Decoder, for: GoogleApi.Datastore.V1.Model.PropertyTransform do
55+
def decode(value, options) do
56+
GoogleApi.Datastore.V1.Model.PropertyTransform.decode(value, options)
57+
end
58+
end
59+
60+
defimpl Poison.Encoder, for: GoogleApi.Datastore.V1.Model.PropertyTransform do
61+
def encode(value, options) do
62+
GoogleApi.Gax.ModelBase.encode(value, options)
63+
end
64+
end

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.23.0"
21+
@version "0.24.0"
2222

2323
def project() do
2424
[

0 commit comments

Comments
 (0)