diff --git a/clients/spanner/lib/google_api/spanner/v1/api/projects.ex b/clients/spanner/lib/google_api/spanner/v1/api/projects.ex index f09d040d0d..3650cd6942 100644 --- a/clients/spanner/lib/google_api/spanner/v1/api/projects.ex +++ b/clients/spanner/lib/google_api/spanner/v1/api/projects.ex @@ -2716,6 +2716,78 @@ defmodule GoogleApi.Spanner.V1.Api.Projects do ) end + @doc """ + Adds split points to specified tables, indexes of a database. + + ## Parameters + + * `connection` (*type:* `GoogleApi.Spanner.V1.Connection.t`) - Connection to server + * `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/`. + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. + * `:access_token` (*type:* `String.t`) - OAuth access token. + * `:alt` (*type:* `String.t`) - Data format for response. + * `:callback` (*type:* `String.t`) - JSONP + * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. + * `: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. + * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. + * `: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. + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). + * `:body` (*type:* `GoogleApi.Spanner.V1.Model.AddSplitPointsRequest.t`) - + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Spanner.V1.Model.AddSplitPointsResponse{}}` on success + * `{:error, info}` on failure + """ + @spec spanner_projects_instances_databases_add_split_points( + Tesla.Env.client(), + String.t(), + keyword(), + keyword() + ) :: + {:ok, GoogleApi.Spanner.V1.Model.AddSplitPointsResponse.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def spanner_projects_instances_databases_add_split_points( + connection, + database, + optional_params \\ [], + opts \\ [] + ) do + optional_params_config = %{ + :"$.xgafv" => :query, + :access_token => :query, + :alt => :query, + :callback => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :upload_protocol => :query, + :body => :body + } + + request = + Request.new() + |> Request.method(:post) + |> Request.url("/v1/{+database}:addSplitPoints", %{ + "database" => URI.encode(database, &URI.char_unreserved?/1) + }) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [struct: %GoogleApi.Spanner.V1.Model.AddSplitPointsResponse{}]) + end + @doc """ `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. diff --git a/clients/spanner/lib/google_api/spanner/v1/metadata.ex b/clients/spanner/lib/google_api/spanner/v1/metadata.ex index 420eea0137..32a5cd305d 100644 --- a/clients/spanner/lib/google_api/spanner/v1/metadata.ex +++ b/clients/spanner/lib/google_api/spanner/v1/metadata.ex @@ -20,7 +20,7 @@ defmodule GoogleApi.Spanner.V1 do API client metadata for GoogleApi.Spanner.V1. """ - @discovery_revision "20241220" + @discovery_revision "20250113" def discovery_revision(), do: @discovery_revision end diff --git a/clients/spanner/lib/google_api/spanner/v1/model/add_split_points_request.ex b/clients/spanner/lib/google_api/spanner/v1/model/add_split_points_request.ex new file mode 100644 index 0000000000..8b418772f3 --- /dev/null +++ b/clients/spanner/lib/google_api/spanner/v1/model/add_split_points_request.ex @@ -0,0 +1,49 @@ +# 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.Spanner.V1.Model.AddSplitPointsRequest do + @moduledoc """ + The request for AddSplitPoints. + + ## Attributes + + * `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. + * `splitPoints` (*type:* `list(GoogleApi.Spanner.V1.Model.SplitPoints.t)`, *default:* `nil`) - Required. The split points to add. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :initiator => String.t() | nil, + :splitPoints => list(GoogleApi.Spanner.V1.Model.SplitPoints.t()) | nil + } + + field(:initiator) + field(:splitPoints, as: GoogleApi.Spanner.V1.Model.SplitPoints, type: :list) +end + +defimpl Poison.Decoder, for: GoogleApi.Spanner.V1.Model.AddSplitPointsRequest do + def decode(value, options) do + GoogleApi.Spanner.V1.Model.AddSplitPointsRequest.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Spanner.V1.Model.AddSplitPointsRequest do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/spanner/lib/google_api/spanner/v1/model/add_split_points_response.ex b/clients/spanner/lib/google_api/spanner/v1/model/add_split_points_response.ex new file mode 100644 index 0000000000..261179e587 --- /dev/null +++ b/clients/spanner/lib/google_api/spanner/v1/model/add_split_points_response.ex @@ -0,0 +1,41 @@ +# 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.Spanner.V1.Model.AddSplitPointsResponse do + @moduledoc """ + The response for AddSplitPoints. + + ## Attributes + + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{} +end + +defimpl Poison.Decoder, for: GoogleApi.Spanner.V1.Model.AddSplitPointsResponse do + def decode(value, options) do + GoogleApi.Spanner.V1.Model.AddSplitPointsResponse.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Spanner.V1.Model.AddSplitPointsResponse do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/spanner/lib/google_api/spanner/v1/model/key.ex b/clients/spanner/lib/google_api/spanner/v1/model/key.ex new file mode 100644 index 0000000000..d5553ab483 --- /dev/null +++ b/clients/spanner/lib/google_api/spanner/v1/model/key.ex @@ -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.Spanner.V1.Model.Key do + @moduledoc """ + A split key. + + ## Attributes + + * `keyParts` (*type:* `list(any())`, *default:* `nil`) - Required. The column values making up the split key. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :keyParts => list(any()) | nil + } + + field(:keyParts, type: :list) +end + +defimpl Poison.Decoder, for: GoogleApi.Spanner.V1.Model.Key do + def decode(value, options) do + GoogleApi.Spanner.V1.Model.Key.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Spanner.V1.Model.Key do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/spanner/lib/google_api/spanner/v1/model/split_points.ex b/clients/spanner/lib/google_api/spanner/v1/model/split_points.ex new file mode 100644 index 0000000000..79cdb50082 --- /dev/null +++ b/clients/spanner/lib/google_api/spanner/v1/model/split_points.ex @@ -0,0 +1,55 @@ +# 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.Spanner.V1.Model.SplitPoints do + @moduledoc """ + The split points of a table/index. + + ## Attributes + + * `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. + * `index` (*type:* `String.t`, *default:* `nil`) - The index to split. If specified, the `table` field must refer to the index's base table. + * `keys` (*type:* `list(GoogleApi.Spanner.V1.Model.Key.t)`, *default:* `nil`) - Required. The list of split keys, i.e., the split boundaries. + * `table` (*type:* `String.t`, *default:* `nil`) - The table to split. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :expireTime => DateTime.t() | nil, + :index => String.t() | nil, + :keys => list(GoogleApi.Spanner.V1.Model.Key.t()) | nil, + :table => String.t() | nil + } + + field(:expireTime, as: DateTime) + field(:index) + field(:keys, as: GoogleApi.Spanner.V1.Model.Key, type: :list) + field(:table) +end + +defimpl Poison.Decoder, for: GoogleApi.Spanner.V1.Model.SplitPoints do + def decode(value, options) do + GoogleApi.Spanner.V1.Model.SplitPoints.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Spanner.V1.Model.SplitPoints do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end