Skip to content

Commit

Permalink
feat: Automated regeneration of Datastream client (#10841)
Browse files Browse the repository at this point in the history
Auto-created at 2024-03-12 01:24:13 +0000 using the toys pull request generator.
  • Loading branch information
yoshi-code-bot authored Mar 12, 2024
1 parent d78d553 commit 5ecf9d5
Show file tree
Hide file tree
Showing 36 changed files with 873 additions and 17 deletions.
76 changes: 75 additions & 1 deletion clients/datastream/lib/google_api/datastream/v1/api/projects.ex
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ defmodule GoogleApi.Datastream.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 Expand Up @@ -988,6 +988,7 @@ defmodule GoogleApi.Datastream.V1.Api.Projects do
* `: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").
* `:force` (*type:* `boolean()`) - Optional. If set to true, will skip validations.
* `:privateConnectionId` (*type:* `String.t`) - Required. The private connectivity identifier.
* `:requestId` (*type:* `String.t`) - Optional. A request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
* `:body` (*type:* `GoogleApi.Datastream.V1.Model.PrivateConnection.t`) -
Expand Down Expand Up @@ -1026,6 +1027,7 @@ defmodule GoogleApi.Datastream.V1.Api.Projects do
:quotaUser => :query,
:uploadType => :query,
:upload_protocol => :query,
:force => :query,
:privateConnectionId => :query,
:requestId => :query,
:body => :body
Expand Down Expand Up @@ -1945,6 +1947,78 @@ defmodule GoogleApi.Datastream.V1.Api.Projects do
|> Response.decode(opts ++ [struct: %GoogleApi.Datastream.V1.Model.Operation{}])
end

@doc """
Use this method to start, resume or recover a stream with a non default CDC strategy. NOTE: This feature is currently experimental.
## Parameters
* `connection` (*type:* `GoogleApi.Datastream.V1.Connection.t`) - Connection to server
* `name` (*type:* `String.t`) - Required. Name of the stream resource to start, in the format: projects/{project_id}/locations/{location}/streams/{stream_name}
* `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.Datastream.V1.Model.RunStreamRequest.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.Datastream.V1.Model.Operation{}}` on success
* `{:error, info}` on failure
"""
@spec datastream_projects_locations_streams_run(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.Datastream.V1.Model.Operation.t()}
| {:ok, Tesla.Env.t()}
| {:ok, list()}
| {:error, any()}
def datastream_projects_locations_streams_run(
connection,
name,
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/{+name}:run", %{
"name" => URI.encode(name, &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.Datastream.V1.Model.Operation{}])
end

@doc """
Use this method to get details about a stream object.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ defmodule GoogleApi.Datastream.V1 do
API client metadata for GoogleApi.Datastream.V1.
"""

@discovery_revision "20221019"
@discovery_revision "20240228"

def discovery_revision(), do: @discovery_revision
end
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,22 @@ defmodule GoogleApi.Datastream.V1.Model.BackfillAllStrategy do
* `mysqlExcludedObjects` (*type:* `GoogleApi.Datastream.V1.Model.MysqlRdbms.t`, *default:* `nil`) - MySQL data source objects to avoid backfilling.
* `oracleExcludedObjects` (*type:* `GoogleApi.Datastream.V1.Model.OracleRdbms.t`, *default:* `nil`) - Oracle data source objects to avoid backfilling.
* `postgresqlExcludedObjects` (*type:* `GoogleApi.Datastream.V1.Model.PostgresqlRdbms.t`, *default:* `nil`) - PostgreSQL data source objects to avoid backfilling.
* `sqlServerExcludedObjects` (*type:* `GoogleApi.Datastream.V1.Model.SqlServerRdbms.t`, *default:* `nil`) - SQLServer data source objects to avoid backfilling
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:mysqlExcludedObjects => GoogleApi.Datastream.V1.Model.MysqlRdbms.t() | nil,
:oracleExcludedObjects => GoogleApi.Datastream.V1.Model.OracleRdbms.t() | nil,
:postgresqlExcludedObjects => GoogleApi.Datastream.V1.Model.PostgresqlRdbms.t() | nil
:postgresqlExcludedObjects => GoogleApi.Datastream.V1.Model.PostgresqlRdbms.t() | nil,
:sqlServerExcludedObjects => GoogleApi.Datastream.V1.Model.SqlServerRdbms.t() | nil
}

field(:mysqlExcludedObjects, as: GoogleApi.Datastream.V1.Model.MysqlRdbms)
field(:oracleExcludedObjects, as: GoogleApi.Datastream.V1.Model.OracleRdbms)
field(:postgresqlExcludedObjects, as: GoogleApi.Datastream.V1.Model.PostgresqlRdbms)
field(:sqlServerExcludedObjects, as: GoogleApi.Datastream.V1.Model.SqlServerRdbms)
end

defimpl Poison.Decoder, for: GoogleApi.Datastream.V1.Model.BackfillAllStrategy do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ defmodule GoogleApi.Datastream.V1.Model.BackfillJob do
* `errors` (*type:* `list(GoogleApi.Datastream.V1.Model.Error.t)`, *default:* `nil`) - Output only. Errors which caused the backfill job to fail.
* `lastEndTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Backfill job's end time.
* `lastStartTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Backfill job's start time.
* `state` (*type:* `String.t`, *default:* `nil`) - Backfill job state.
* `state` (*type:* `String.t`, *default:* `nil`) - Output only. Backfill job state.
* `trigger` (*type:* `String.t`, *default:* `nil`) - Backfill job's triggering reason.
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

defmodule GoogleApi.Datastream.V1.Model.BigQueryDestinationConfig do
@moduledoc """
BigQuery destination configuration
## Attributes
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# 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.Datastream.V1.Model.CdcStrategy do
@moduledoc """
The strategy that the stream uses for CDC replication.
## Attributes
* `mostRecentStartPosition` (*type:* `GoogleApi.Datastream.V1.Model.MostRecentStartPosition.t`, *default:* `nil`) - Optional. Start replicating from the most recent position in the source.
* `nextAvailableStartPosition` (*type:* `GoogleApi.Datastream.V1.Model.NextAvailableStartPosition.t`, *default:* `nil`) - Optional. Resume replication from the next available position in the source.
* `specificStartPosition` (*type:* `GoogleApi.Datastream.V1.Model.SpecificStartPosition.t`, *default:* `nil`) - Optional. Start replicating from a specific position in the source.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:mostRecentStartPosition =>
GoogleApi.Datastream.V1.Model.MostRecentStartPosition.t() | nil,
:nextAvailableStartPosition =>
GoogleApi.Datastream.V1.Model.NextAvailableStartPosition.t() | nil,
:specificStartPosition => GoogleApi.Datastream.V1.Model.SpecificStartPosition.t() | nil
}

field(:mostRecentStartPosition, as: GoogleApi.Datastream.V1.Model.MostRecentStartPosition)
field(:nextAvailableStartPosition, as: GoogleApi.Datastream.V1.Model.NextAvailableStartPosition)
field(:specificStartPosition, as: GoogleApi.Datastream.V1.Model.SpecificStartPosition)
end

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

defimpl Poison.Encoder, for: GoogleApi.Datastream.V1.Model.CdcStrategy 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 @@ -32,6 +32,7 @@ defmodule GoogleApi.Datastream.V1.Model.ConnectionProfile do
* `oracleProfile` (*type:* `GoogleApi.Datastream.V1.Model.OracleProfile.t`, *default:* `nil`) - Oracle ConnectionProfile configuration.
* `postgresqlProfile` (*type:* `GoogleApi.Datastream.V1.Model.PostgresqlProfile.t`, *default:* `nil`) - PostgreSQL Connection Profile configuration.
* `privateConnectivity` (*type:* `GoogleApi.Datastream.V1.Model.PrivateConnectivity.t`, *default:* `nil`) - Private connectivity.
* `sqlServerProfile` (*type:* `GoogleApi.Datastream.V1.Model.SqlServerProfile.t`, *default:* `nil`) - SQLServer Connection Profile configuration.
* `staticServiceIpConnectivity` (*type:* `GoogleApi.Datastream.V1.Model.StaticServiceIpConnectivity.t`, *default:* `nil`) - Static Service IP connectivity.
* `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The update time of the resource.
"""
Expand All @@ -51,6 +52,7 @@ defmodule GoogleApi.Datastream.V1.Model.ConnectionProfile do
:oracleProfile => GoogleApi.Datastream.V1.Model.OracleProfile.t() | nil,
:postgresqlProfile => GoogleApi.Datastream.V1.Model.PostgresqlProfile.t() | nil,
:privateConnectivity => GoogleApi.Datastream.V1.Model.PrivateConnectivity.t() | nil,
:sqlServerProfile => GoogleApi.Datastream.V1.Model.SqlServerProfile.t() | nil,
:staticServiceIpConnectivity =>
GoogleApi.Datastream.V1.Model.StaticServiceIpConnectivity.t() | nil,
:updateTime => DateTime.t() | nil
Expand All @@ -67,6 +69,7 @@ defmodule GoogleApi.Datastream.V1.Model.ConnectionProfile do
field(:oracleProfile, as: GoogleApi.Datastream.V1.Model.OracleProfile)
field(:postgresqlProfile, as: GoogleApi.Datastream.V1.Model.PostgresqlProfile)
field(:privateConnectivity, as: GoogleApi.Datastream.V1.Model.PrivateConnectivity)
field(:sqlServerProfile, as: GoogleApi.Datastream.V1.Model.SqlServerProfile)

field(:staticServiceIpConnectivity,
as: GoogleApi.Datastream.V1.Model.StaticServiceIpConnectivity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ defmodule GoogleApi.Datastream.V1.Model.GcsDestinationConfig do
## Attributes
* `avroFileFormat` (*type:* `GoogleApi.Datastream.V1.Model.AvroFileFormat.t`, *default:* `nil`) - AVRO file format configuration.
* `fileRotationInterval` (*type:* `String.t`, *default:* `nil`) - The maximum duration for which new events are added before a file is closed and a new file is created.
* `fileRotationInterval` (*type:* `String.t`, *default:* `nil`) - The maximum duration for which new events are added before a file is closed and a new file is created. Values within the range of 15-60 seconds are allowed.
* `fileRotationMb` (*type:* `integer()`, *default:* `nil`) - The maximum file size to be saved in the bucket.
* `jsonFileFormat` (*type:* `GoogleApi.Datastream.V1.Model.JsonFileFormat.t`, *default:* `nil`) - JSON file format configuration.
* `path` (*type:* `String.t`, *default:* `nil`) - Path inside the Cloud Storage bucket to write data to.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

defmodule GoogleApi.Datastream.V1.Model.Location do
@moduledoc """
A resource that represents Google Cloud Platform location.
A resource that represents a Google Cloud location.
## Attributes
Expand Down
Original file line number Diff line number Diff line change
@@ -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.Datastream.V1.Model.MostRecentStartPosition do
@moduledoc """
CDC strategy to start replicating from the most recent position in the source.
## Attributes
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{}
end

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

defimpl Poison.Encoder, for: GoogleApi.Datastream.V1.Model.MostRecentStartPosition 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 @@ -27,7 +27,9 @@ defmodule GoogleApi.Datastream.V1.Model.MysqlColumn do
* `length` (*type:* `integer()`, *default:* `nil`) - Column length.
* `nullable` (*type:* `boolean()`, *default:* `nil`) - Whether or not the column can accept a null value.
* `ordinalPosition` (*type:* `integer()`, *default:* `nil`) - The ordinal position of the column in the table.
* `precision` (*type:* `integer()`, *default:* `nil`) - Column precision.
* `primaryKey` (*type:* `boolean()`, *default:* `nil`) - Whether or not the column represents a primary key.
* `scale` (*type:* `integer()`, *default:* `nil`) - Column scale.
"""

use GoogleApi.Gax.ModelBase
Expand All @@ -39,7 +41,9 @@ defmodule GoogleApi.Datastream.V1.Model.MysqlColumn do
:length => integer() | nil,
:nullable => boolean() | nil,
:ordinalPosition => integer() | nil,
:primaryKey => boolean() | nil
:precision => integer() | nil,
:primaryKey => boolean() | nil,
:scale => integer() | nil
}

field(:collation)
Expand All @@ -48,7 +52,9 @@ defmodule GoogleApi.Datastream.V1.Model.MysqlColumn do
field(:length)
field(:nullable)
field(:ordinalPosition)
field(:precision)
field(:primaryKey)
field(:scale)
end

defimpl Poison.Decoder, for: GoogleApi.Datastream.V1.Model.MysqlColumn do
Expand Down
Original file line number Diff line number Diff line change
@@ -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.Datastream.V1.Model.MysqlLogPosition do
@moduledoc """
MySQL log position
## Attributes
* `logFile` (*type:* `String.t`, *default:* `nil`) - Required. The binary log file name.
* `logPosition` (*type:* `integer()`, *default:* `nil`) - Optional. The position within the binary log file. Default is head of file.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:logFile => String.t() | nil,
:logPosition => integer() | nil
}

field(:logFile)
field(:logPosition)
end

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

defimpl Poison.Encoder, for: GoogleApi.Datastream.V1.Model.MysqlLogPosition do
def encode(value, options) do
GoogleApi.Gax.ModelBase.encode(value, options)
end
end
Loading

0 comments on commit 5ecf9d5

Please sign in to comment.