Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Automated regeneration of Datastore client #10946

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1133,7 +1133,7 @@ defmodule GoogleApi.Datastore.V1.Api.Projects do
end

@doc """
Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/*/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/*}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.
Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.

## Parameters

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ defmodule GoogleApi.Datastore.V1 do
API client metadata for GoogleApi.Datastore.V1.
"""

@discovery_revision "20221029"
@discovery_revision "20240226"

def discovery_revision(), do: @discovery_revision
end
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,29 @@

defmodule GoogleApi.Datastore.V1.Model.Aggregation do
@moduledoc """
Defines a aggregation that produces a single result.
Defines an aggregation that produces a single result.

## Attributes

* `alias` (*type:* `String.t`, *default:* `nil`) - Optional. Optional name of the property to store the result of the aggregation. If not provided, Datastore will pick a default name following the format `property_`. For example: ``` AGGREGATE COUNT_UP_TO(1) AS count_up_to_1, COUNT_UP_TO(2), COUNT_UP_TO(3) AS count_up_to_3, COUNT_UP_TO(4) OVER ( ... ); ``` becomes: ``` AGGREGATE COUNT_UP_TO(1) AS count_up_to_1, COUNT_UP_TO(2) AS property_1, COUNT_UP_TO(3) AS count_up_to_3, COUNT_UP_TO(4) AS property_2 OVER ( ... ); ``` Requires: * Must be unique across all aggregation aliases. * Conform to entity property name limitations.
* `alias` (*type:* `String.t`, *default:* `nil`) - Optional. Optional name of the property to store the result of the aggregation. If not provided, Datastore will pick a default name following the format `property_`. For example: ``` AGGREGATE COUNT_UP_TO(1) AS count_up_to_1, COUNT_UP_TO(2), COUNT_UP_TO(3) AS count_up_to_3, COUNT(*) OVER ( ... ); ``` becomes: ``` AGGREGATE COUNT_UP_TO(1) AS count_up_to_1, COUNT_UP_TO(2) AS property_1, COUNT_UP_TO(3) AS count_up_to_3, COUNT(*) AS property_2 OVER ( ... ); ``` Requires: * Must be unique across all aggregation aliases. * Conform to entity property name limitations.
* `avg` (*type:* `GoogleApi.Datastore.V1.Model.Avg.t`, *default:* `nil`) - Average aggregator.
* `count` (*type:* `GoogleApi.Datastore.V1.Model.Count.t`, *default:* `nil`) - Count aggregator.
* `sum` (*type:* `GoogleApi.Datastore.V1.Model.Sum.t`, *default:* `nil`) - Sum aggregator.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:alias => String.t() | nil,
:count => GoogleApi.Datastore.V1.Model.Count.t() | nil
:avg => GoogleApi.Datastore.V1.Model.Avg.t() | nil,
:count => GoogleApi.Datastore.V1.Model.Count.t() | nil,
:sum => GoogleApi.Datastore.V1.Model.Sum.t() | nil
}

field(:alias)
field(:avg, as: GoogleApi.Datastore.V1.Model.Avg)
field(:count, as: GoogleApi.Datastore.V1.Model.Count)
field(:sum, as: GoogleApi.Datastore.V1.Model.Sum)
end

defimpl Poison.Decoder, for: GoogleApi.Datastore.V1.Model.Aggregation do
Expand Down
46 changes: 46 additions & 0 deletions clients/datastore/lib/google_api/datastore/v1/model/avg.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Datastore.V1.Model.Avg do
@moduledoc """
Average of the values of the requested property. * Only numeric values will be aggregated. All non-numeric values including `NULL` are skipped. * If the aggregated values contain `NaN`, returns `NaN`. Infinity math follows IEEE-754 standards. * If the aggregated value set is empty, returns `NULL`. * Always returns the result as a double.

## Attributes

* `property` (*type:* `GoogleApi.Datastore.V1.Model.PropertyReference.t`, *default:* `nil`) - The property to aggregate on.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:property => GoogleApi.Datastore.V1.Model.PropertyReference.t() | nil
}

field(:property, as: GoogleApi.Datastore.V1.Model.PropertyReference)
end

defimpl Poison.Decoder, for: GoogleApi.Datastore.V1.Model.Avg do
def decode(value, options) do
GoogleApi.Datastore.V1.Model.Avg.decode(value, options)
end
end

defimpl Poison.Encoder, for: GoogleApi.Datastore.V1.Model.Avg do
def encode(value, options) do
GoogleApi.Gax.ModelBase.encode(value, options)
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ defmodule GoogleApi.Datastore.V1.Model.CommitRequest do
* `databaseId` (*type:* `String.t`, *default:* `nil`) - The ID of the database against which to make the request. '(default)' is not allowed; please use empty string '' to refer the default database.
* `mode` (*type:* `String.t`, *default:* `nil`) - The type of commit to perform. Defaults to `TRANSACTIONAL`.
* `mutations` (*type:* `list(GoogleApi.Datastore.V1.Model.Mutation.t)`, *default:* `nil`) - The mutations to perform. When mode is `TRANSACTIONAL`, mutations affecting a single entity are applied in order. The following sequences of mutations affecting a single entity are not permitted in a single `Commit` request: - `insert` followed by `insert` - `update` followed by `insert` - `upsert` followed by `insert` - `delete` followed by `update` When mode is `NON_TRANSACTIONAL`, no two mutations may affect a single entity.
* `singleUseTransaction` (*type:* `GoogleApi.Datastore.V1.Model.TransactionOptions.t`, *default:* `nil`) - Options for beginning a new transaction for this request. The transaction is committed when the request completes. If specified, TransactionOptions.mode must be TransactionOptions.ReadWrite.
* `transaction` (*type:* `String.t`, *default:* `nil`) - The identifier of the transaction associated with the commit. A transaction identifier is returned by a call to Datastore.BeginTransaction.
"""

Expand All @@ -33,12 +34,14 @@ defmodule GoogleApi.Datastore.V1.Model.CommitRequest do
:databaseId => String.t() | nil,
:mode => String.t() | nil,
:mutations => list(GoogleApi.Datastore.V1.Model.Mutation.t()) | nil,
:singleUseTransaction => GoogleApi.Datastore.V1.Model.TransactionOptions.t() | nil,
:transaction => String.t() | nil
}

field(:databaseId)
field(:mode)
field(:mutations, as: GoogleApi.Datastore.V1.Model.Mutation, type: :list)
field(:singleUseTransaction, as: GoogleApi.Datastore.V1.Model.TransactionOptions)
field(:transaction)
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ defmodule GoogleApi.Datastore.V1.Model.Count do

## Attributes

* `upTo` (*type:* `String.t`, *default:* `nil`) - Optional. Optional constraint on the maximum number of entities to count. This provides a way to set an upper bound on the number of entities to scan, limiting latency and cost. Unspecified is interpreted as no bound. If a zero value is provided, a count result of zero should always be expected. High-Level Example: ``` AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); ``` Requires: * Must be non-negative when present.
* `upTo` (*type:* `String.t`, *default:* `nil`) - Optional. Optional constraint on the maximum number of entities to count. This provides a way to set an upper bound on the number of entities to scan, limiting latency, and cost. Unspecified is interpreted as no bound. If a zero value is provided, a count result of zero should always be expected. High-Level Example: ``` AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); ``` Requires: * Must be non-negative when present.
"""

use GoogleApi.Gax.ModelBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@

defmodule GoogleApi.Datastore.V1.Model.Entity do
@moduledoc """
A Datastore data object. An entity is limited to 1 megabyte when stored. That _roughly_ corresponds to a limit of 1 megabyte for the serialized form of this message.
A Datastore data object. Must not exceed 1 MiB - 4 bytes.

## Attributes

* `key` (*type:* `GoogleApi.Datastore.V1.Model.Key.t`, *default:* `nil`) - The entity's key. An entity must have a key, unless otherwise documented (for example, an entity in `Value.entity_value` may have no key). An entity's kind is its key path's last element's kind, or null if it has no key.
* `properties` (*type:* `%{optional(String.t) => GoogleApi.Datastore.V1.Model.Value.t}`, *default:* `nil`) - The entity's properties. The map's keys are property names. A property name matching regex `__.*__` is reserved. A reserved property name is forbidden in certain documented contexts. The name must not contain more than 500 characters. The name cannot be `""`.
* `properties` (*type:* `%{optional(String.t) => GoogleApi.Datastore.V1.Model.Value.t}`, *default:* `nil`) - The entity's properties. The map's keys are property names. A property name matching regex `__.*__` is reserved. A reserved property name is forbidden in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
"""

use GoogleApi.Gax.ModelBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ defmodule GoogleApi.Datastore.V1.Model.EntityResult do

## Attributes

* `createTime` (*type:* `DateTime.t`, *default:* `nil`) - The time at which the entity was created. This field is set for `FULL` entity results. If this entity is missing, this field will not be set.
* `cursor` (*type:* `String.t`, *default:* `nil`) - A cursor that points to the position after the result entity. Set only when the `EntityResult` is part of a `QueryResultBatch` message.
* `entity` (*type:* `GoogleApi.Datastore.V1.Model.Entity.t`, *default:* `nil`) - The resulting entity.
* `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - The time at which the entity was last changed. This field is set for `FULL` entity results. If this entity is missing, this field will not be set.
Expand All @@ -30,12 +31,14 @@ defmodule GoogleApi.Datastore.V1.Model.EntityResult do
use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:createTime => DateTime.t() | nil,
:cursor => String.t() | nil,
:entity => GoogleApi.Datastore.V1.Model.Entity.t() | nil,
:updateTime => DateTime.t() | nil,
:version => String.t() | nil
}

field(:createTime, as: DateTime)
field(:cursor)
field(:entity, as: GoogleApi.Datastore.V1.Model.Entity)
field(:updateTime, as: DateTime)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ defmodule GoogleApi.Datastore.V1.Model.GoogleLongrunningOperation do
* `error` (*type:* `GoogleApi.Datastore.V1.Model.Status.t`, *default:* `nil`) - The error result of the operation in case of failure or cancellation.
* `metadata` (*type:* `map()`, *default:* `nil`) - Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
* `name` (*type:* `String.t`, *default:* `nil`) - The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.
* `response` (*type:* `map()`, *default:* `nil`) - The normal response of the operation in case of success. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
* `response` (*type:* `map()`, *default:* `nil`) - The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
"""

use GoogleApi.Gax.ModelBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ defmodule GoogleApi.Datastore.V1.Model.LookupResponse do
* `found` (*type:* `list(GoogleApi.Datastore.V1.Model.EntityResult.t)`, *default:* `nil`) - Entities found as `ResultType.FULL` entities. The order of results in this field is undefined and has no relation to the order of the keys in the input.
* `missing` (*type:* `list(GoogleApi.Datastore.V1.Model.EntityResult.t)`, *default:* `nil`) - Entities not found as `ResultType.KEY_ONLY` entities. The order of results in this field is undefined and has no relation to the order of the keys in the input.
* `readTime` (*type:* `DateTime.t`, *default:* `nil`) - The time at which these entities were read or found missing.
* `transaction` (*type:* `String.t`, *default:* `nil`) - The identifier of the transaction that was started as part of this Lookup request. Set only when ReadOptions.new_transaction was set in LookupRequest.read_options.
"""

use GoogleApi.Gax.ModelBase
Expand All @@ -33,13 +34,15 @@ defmodule GoogleApi.Datastore.V1.Model.LookupResponse do
:deferred => list(GoogleApi.Datastore.V1.Model.Key.t()) | nil,
:found => list(GoogleApi.Datastore.V1.Model.EntityResult.t()) | nil,
:missing => list(GoogleApi.Datastore.V1.Model.EntityResult.t()) | nil,
:readTime => DateTime.t() | nil
:readTime => DateTime.t() | nil,
:transaction => String.t() | nil
}

field(:deferred, as: GoogleApi.Datastore.V1.Model.Key, type: :list)
field(:found, as: GoogleApi.Datastore.V1.Model.EntityResult, type: :list)
field(:missing, as: GoogleApi.Datastore.V1.Model.EntityResult, type: :list)
field(:readTime, as: DateTime)
field(:transaction)
end

defimpl Poison.Decoder, for: GoogleApi.Datastore.V1.Model.LookupResponse do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ defmodule GoogleApi.Datastore.V1.Model.MutationResult do
## Attributes

* `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.
* `createTime` (*type:* `DateTime.t`, *default:* `nil`) - The create time of the entity. This field will not be set after a 'delete'.
* `key` (*type:* `GoogleApi.Datastore.V1.Model.Key.t`, *default:* `nil`) - The automatically allocated key. Set only when the mutation allocated a key.
* `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'.
* `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.
Expand All @@ -31,12 +32,14 @@ defmodule GoogleApi.Datastore.V1.Model.MutationResult do

@type t :: %__MODULE__{
:conflictDetected => boolean() | nil,
:createTime => DateTime.t() | nil,
:key => GoogleApi.Datastore.V1.Model.Key.t() | nil,
:updateTime => DateTime.t() | nil,
:version => String.t() | nil
}

field(:conflictDetected)
field(:createTime, as: DateTime)
field(:key, as: GoogleApi.Datastore.V1.Model.Key)
field(:updateTime, as: DateTime)
field(:version)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ defmodule GoogleApi.Datastore.V1.Model.PropertyReference do

## Attributes

* `name` (*type:* `String.t`, *default:* `nil`) - The name of the property. If name includes "."s, it may be interpreted as a property name path.
* `name` (*type:* `String.t`, *default:* `nil`) - A reference to a property. Requires: * MUST be a dot-delimited (`.`) string of segments, where each segment conforms to entity property name limitations.
"""

use GoogleApi.Gax.ModelBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ defmodule GoogleApi.Datastore.V1.Model.Query do

## Attributes

* `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).
* `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`.
* `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).
* `filter` (*type:* `GoogleApi.Datastore.V1.Model.Filter.t`, *default:* `nil`) - The filter to apply.
* `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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ defmodule GoogleApi.Datastore.V1.Model.ReadOnly do

## Attributes

* `readTime` (*type:* `DateTime.t`, *default:* `nil`) - Reads entities at the given time. This may not be older than 60 seconds.
* `readTime` (*type:* `DateTime.t`, *default:* `nil`) - Reads entities at the given time. This must be a microsecond precision timestamp within the past one hour, or if Point-in-Time Recovery is enabled, can additionally be a whole minute timestamp within the past 7 days.
"""

use GoogleApi.Gax.ModelBase
Expand Down
Loading
Loading