Skip to content

Commit 26d9044

Browse files
feat: Automated regeneration of Spanner client (googleapis#12842)
Auto-created at 2025-01-19 13:13:40 +0000 using the toys pull request generator.
1 parent 26f2dbf commit 26d9044

File tree

6 files changed

+264
-1
lines changed

6 files changed

+264
-1
lines changed

clients/spanner/lib/google_api/spanner/v1/api/projects.ex

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2716,6 +2716,78 @@ defmodule GoogleApi.Spanner.V1.Api.Projects do
27162716
)
27172717
end
27182718

2719+
@doc """
2720+
Adds split points to specified tables, indexes of a database.
2721+
2722+
## Parameters
2723+
2724+
* `connection` (*type:* `GoogleApi.Spanner.V1.Connection.t`) - Connection to server
2725+
* `database` (*type:* `String.t`) - Required. The database on whose tables/indexes split points are to be added. Values are of the form `projects//instances//databases/`.
2726+
* `optional_params` (*type:* `keyword()`) - Optional parameters
2727+
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
2728+
* `:access_token` (*type:* `String.t`) - OAuth access token.
2729+
* `:alt` (*type:* `String.t`) - Data format for response.
2730+
* `:callback` (*type:* `String.t`) - JSONP
2731+
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
2732+
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
2733+
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
2734+
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
2735+
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
2736+
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
2737+
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
2738+
* `:body` (*type:* `GoogleApi.Spanner.V1.Model.AddSplitPointsRequest.t`) -
2739+
* `opts` (*type:* `keyword()`) - Call options
2740+
2741+
## Returns
2742+
2743+
* `{:ok, %GoogleApi.Spanner.V1.Model.AddSplitPointsResponse{}}` on success
2744+
* `{:error, info}` on failure
2745+
"""
2746+
@spec spanner_projects_instances_databases_add_split_points(
2747+
Tesla.Env.client(),
2748+
String.t(),
2749+
keyword(),
2750+
keyword()
2751+
) ::
2752+
{:ok, GoogleApi.Spanner.V1.Model.AddSplitPointsResponse.t()}
2753+
| {:ok, Tesla.Env.t()}
2754+
| {:ok, list()}
2755+
| {:error, any()}
2756+
def spanner_projects_instances_databases_add_split_points(
2757+
connection,
2758+
database,
2759+
optional_params \\ [],
2760+
opts \\ []
2761+
) do
2762+
optional_params_config = %{
2763+
:"$.xgafv" => :query,
2764+
:access_token => :query,
2765+
:alt => :query,
2766+
:callback => :query,
2767+
:fields => :query,
2768+
:key => :query,
2769+
:oauth_token => :query,
2770+
:prettyPrint => :query,
2771+
:quotaUser => :query,
2772+
:uploadType => :query,
2773+
:upload_protocol => :query,
2774+
:body => :body
2775+
}
2776+
2777+
request =
2778+
Request.new()
2779+
|> Request.method(:post)
2780+
|> Request.url("/v1/{+database}:addSplitPoints", %{
2781+
"database" => URI.encode(database, &URI.char_unreserved?/1)
2782+
})
2783+
|> Request.add_optional_params(optional_params_config, optional_params)
2784+
|> Request.library_version(@library_version)
2785+
2786+
connection
2787+
|> Connection.execute(request)
2788+
|> Response.decode(opts ++ [struct: %GoogleApi.Spanner.V1.Model.AddSplitPointsResponse{}])
2789+
end
2790+
27192791
@doc """
27202792
`ChangeQuorum` is strictly restricted to databases that use dual-region instance configurations. Initiates a background operation to change the quorum of a database from dual-region mode to single-region mode or vice versa. The returned long-running operation has a name of the format `projects//instances//databases//operations/` and can be used to track execution of the `ChangeQuorum`. The metadata field type is ChangeQuorumMetadata. Authorization requires `spanner.databases.changequorum` permission on the resource database.
27212793

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

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

23-
@discovery_revision "20241220"
23+
@discovery_revision "20250113"
2424

2525
def discovery_revision(), do: @discovery_revision
2626
end
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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.Spanner.V1.Model.AddSplitPointsRequest do
19+
@moduledoc """
20+
The request for AddSplitPoints.
21+
22+
## Attributes
23+
24+
* `initiator` (*type:* `String.t`, *default:* `nil`) - Optional. A user-supplied tag associated with the split points. For example, "intital_data_load", "special_event_1". Defaults to "CloudAddSplitPointsAPI" if not specified. The length of the tag must not exceed 50 characters,else will be trimmed. Only valid UTF8 characters are allowed.
25+
* `splitPoints` (*type:* `list(GoogleApi.Spanner.V1.Model.SplitPoints.t)`, *default:* `nil`) - Required. The split points to add.
26+
"""
27+
28+
use GoogleApi.Gax.ModelBase
29+
30+
@type t :: %__MODULE__{
31+
:initiator => String.t() | nil,
32+
:splitPoints => list(GoogleApi.Spanner.V1.Model.SplitPoints.t()) | nil
33+
}
34+
35+
field(:initiator)
36+
field(:splitPoints, as: GoogleApi.Spanner.V1.Model.SplitPoints, type: :list)
37+
end
38+
39+
defimpl Poison.Decoder, for: GoogleApi.Spanner.V1.Model.AddSplitPointsRequest do
40+
def decode(value, options) do
41+
GoogleApi.Spanner.V1.Model.AddSplitPointsRequest.decode(value, options)
42+
end
43+
end
44+
45+
defimpl Poison.Encoder, for: GoogleApi.Spanner.V1.Model.AddSplitPointsRequest do
46+
def encode(value, options) do
47+
GoogleApi.Gax.ModelBase.encode(value, options)
48+
end
49+
end
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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.Spanner.V1.Model.AddSplitPointsResponse do
19+
@moduledoc """
20+
The response for AddSplitPoints.
21+
22+
## Attributes
23+
24+
"""
25+
26+
use GoogleApi.Gax.ModelBase
27+
28+
@type t :: %__MODULE__{}
29+
end
30+
31+
defimpl Poison.Decoder, for: GoogleApi.Spanner.V1.Model.AddSplitPointsResponse do
32+
def decode(value, options) do
33+
GoogleApi.Spanner.V1.Model.AddSplitPointsResponse.decode(value, options)
34+
end
35+
end
36+
37+
defimpl Poison.Encoder, for: GoogleApi.Spanner.V1.Model.AddSplitPointsResponse do
38+
def encode(value, options) do
39+
GoogleApi.Gax.ModelBase.encode(value, options)
40+
end
41+
end
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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.Spanner.V1.Model.Key do
19+
@moduledoc """
20+
A split key.
21+
22+
## Attributes
23+
24+
* `keyParts` (*type:* `list(any())`, *default:* `nil`) - Required. The column values making up the split key.
25+
"""
26+
27+
use GoogleApi.Gax.ModelBase
28+
29+
@type t :: %__MODULE__{
30+
:keyParts => list(any()) | nil
31+
}
32+
33+
field(:keyParts, type: :list)
34+
end
35+
36+
defimpl Poison.Decoder, for: GoogleApi.Spanner.V1.Model.Key do
37+
def decode(value, options) do
38+
GoogleApi.Spanner.V1.Model.Key.decode(value, options)
39+
end
40+
end
41+
42+
defimpl Poison.Encoder, for: GoogleApi.Spanner.V1.Model.Key do
43+
def encode(value, options) do
44+
GoogleApi.Gax.ModelBase.encode(value, options)
45+
end
46+
end
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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.Spanner.V1.Model.SplitPoints do
19+
@moduledoc """
20+
The split points of a table/index.
21+
22+
## Attributes
23+
24+
* `expireTime` (*type:* `DateTime.t`, *default:* `nil`) - Optional. The expiration timestamp of the split points. A timestamp in the past means immediate expiration. The maximum value can be 30 days in the future. Defaults to 10 days in the future if not specified.
25+
* `index` (*type:* `String.t`, *default:* `nil`) - The index to split. If specified, the `table` field must refer to the index's base table.
26+
* `keys` (*type:* `list(GoogleApi.Spanner.V1.Model.Key.t)`, *default:* `nil`) - Required. The list of split keys, i.e., the split boundaries.
27+
* `table` (*type:* `String.t`, *default:* `nil`) - The table to split.
28+
"""
29+
30+
use GoogleApi.Gax.ModelBase
31+
32+
@type t :: %__MODULE__{
33+
:expireTime => DateTime.t() | nil,
34+
:index => String.t() | nil,
35+
:keys => list(GoogleApi.Spanner.V1.Model.Key.t()) | nil,
36+
:table => String.t() | nil
37+
}
38+
39+
field(:expireTime, as: DateTime)
40+
field(:index)
41+
field(:keys, as: GoogleApi.Spanner.V1.Model.Key, type: :list)
42+
field(:table)
43+
end
44+
45+
defimpl Poison.Decoder, for: GoogleApi.Spanner.V1.Model.SplitPoints do
46+
def decode(value, options) do
47+
GoogleApi.Spanner.V1.Model.SplitPoints.decode(value, options)
48+
end
49+
end
50+
51+
defimpl Poison.Encoder, for: GoogleApi.Spanner.V1.Model.SplitPoints do
52+
def encode(value, options) do
53+
GoogleApi.Gax.ModelBase.encode(value, options)
54+
end
55+
end

0 commit comments

Comments
 (0)