Skip to content

Commit

Permalink
feat: Automated regeneration of DataMigration client (#12661)
Browse files Browse the repository at this point in the history
Auto-created at 2024-12-07 13:16:58 +0000 using the toys pull request generator.
  • Loading branch information
yoshi-code-bot authored Dec 7, 2024
1 parent b5d16ca commit b2c2650
Show file tree
Hide file tree
Showing 17 changed files with 663 additions and 9 deletions.
2 changes: 1 addition & 1 deletion clients/data_migration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Install this package from [Hex](https://hex.pm) by adding

```elixir
def deps do
[{:google_api_data_migration, "~> 0.19"}]
[{:google_api_data_migration, "~> 0.20"}]
end
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2615,6 +2615,76 @@ defmodule GoogleApi.DataMigration.V1.Api.Projects do
|> Response.decode(opts ++ [struct: %GoogleApi.DataMigration.V1.Model.Operation{}])
end

@doc """
Retrieves objects from the source database that can be selected for data migration. This is applicable for the following migrations: 1. PostgreSQL to Cloud SQL for PostgreSQL 2. PostgreSQL to AlloyDB for PostgreSQL.
## Parameters
* `connection` (*type:* `GoogleApi.DataMigration.V1.Connection.t`) - Connection to server
* `name` (*type:* `String.t`) - Required. The resource name for the migration job for which source objects should be returned.
* `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").
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.DataMigration.V1.Model.Operation{}}` on success
* `{:error, info}` on failure
"""
@spec datamigration_projects_locations_migration_jobs_fetch_source_objects(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.DataMigration.V1.Model.Operation.t()}
| {:ok, Tesla.Env.t()}
| {:ok, list()}
| {:error, any()}
def datamigration_projects_locations_migration_jobs_fetch_source_objects(
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
}

request =
Request.new()
|> Request.method(:get)
|> Request.url("/v1/{+name}:fetchSourceObjects", %{
"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.DataMigration.V1.Model.Operation{}])
end

@doc """
Generate a SSH configuration script to configure the reverse SSH connectivity.
Expand Down Expand Up @@ -3635,6 +3705,76 @@ defmodule GoogleApi.DataMigration.V1.Api.Projects do
|> Response.decode(opts ++ [struct: %GoogleApi.DataMigration.V1.Model.Operation{}])
end

@doc """
Use this method to get details about a migration job object.
## Parameters
* `connection` (*type:* `GoogleApi.DataMigration.V1.Connection.t`) - Connection to server
* `name` (*type:* `String.t`) - Required. The name of the migration job object resource to get.
* `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").
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.DataMigration.V1.Model.MigrationJobObject{}}` on success
* `{:error, info}` on failure
"""
@spec datamigration_projects_locations_migration_jobs_objects_get(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.DataMigration.V1.Model.MigrationJobObject.t()}
| {:ok, Tesla.Env.t()}
| {:ok, list()}
| {:error, any()}
def datamigration_projects_locations_migration_jobs_objects_get(
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
}

request =
Request.new()
|> Request.method(:get)
|> Request.url("/v1/{+name}", %{
"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.DataMigration.V1.Model.MigrationJobObject{}])
end

@doc """
Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
Expand Down Expand Up @@ -3707,6 +3847,154 @@ defmodule GoogleApi.DataMigration.V1.Api.Projects do
|> Response.decode(opts ++ [struct: %GoogleApi.DataMigration.V1.Model.Policy{}])
end

@doc """
Use this method to list the objects of a specific migration job.
## Parameters
* `connection` (*type:* `GoogleApi.DataMigration.V1.Connection.t`) - Connection to server
* `parent` (*type:* `String.t`) - Required. The parent migration job that owns the collection of objects.
* `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").
* `:pageSize` (*type:* `integer()`) - Maximum number of objects to return. Default is 50. The maximum value is 1000; values above 1000 will be coerced to 1000.
* `:pageToken` (*type:* `String.t`) - Page token received from a previous `ListMigrationJObObjectsRequest` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListMigrationJobObjectsRequest` must match the call that provided the page token.
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.DataMigration.V1.Model.ListMigrationJobObjectsResponse{}}` on success
* `{:error, info}` on failure
"""
@spec datamigration_projects_locations_migration_jobs_objects_list(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.DataMigration.V1.Model.ListMigrationJobObjectsResponse.t()}
| {:ok, Tesla.Env.t()}
| {:ok, list()}
| {:error, any()}
def datamigration_projects_locations_migration_jobs_objects_list(
connection,
parent,
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,
:pageSize => :query,
:pageToken => :query
}

request =
Request.new()
|> Request.method(:get)
|> Request.url("/v1/{+parent}/objects", %{
"parent" => URI.encode(parent, &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.DataMigration.V1.Model.ListMigrationJobObjectsResponse{}]
)
end

@doc """
Use this method to look up a migration job object by its source object identifier.
## Parameters
* `connection` (*type:* `GoogleApi.DataMigration.V1.Connection.t`) - Connection to server
* `parent` (*type:* `String.t`) - Required. The parent migration job that owns the collection of objects.
* `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.DataMigration.V1.Model.LookupMigrationJobObjectRequest.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.DataMigration.V1.Model.MigrationJobObject{}}` on success
* `{:error, info}` on failure
"""
@spec datamigration_projects_locations_migration_jobs_objects_lookup(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.DataMigration.V1.Model.MigrationJobObject.t()}
| {:ok, Tesla.Env.t()}
| {:ok, list()}
| {:error, any()}
def datamigration_projects_locations_migration_jobs_objects_lookup(
connection,
parent,
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/{+parent}/objects:lookup", %{
"parent" => URI.encode(parent, &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.DataMigration.V1.Model.MigrationJobObject{}])
end

@doc """
Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.
Expand Down Expand Up @@ -3854,7 +4142,7 @@ defmodule GoogleApi.DataMigration.V1.Api.Projects do
end

@doc """
Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.
Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of `1`, corresponding to `Code.CANCELLED`.
## Parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ defmodule GoogleApi.DataMigration.V1 do
API client metadata for GoogleApi.DataMigration.V1.
"""

@discovery_revision "20241109"
@discovery_revision "20241202"

def discovery_revision(), do: @discovery_revision
end
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ defmodule GoogleApi.DataMigration.V1.Model.GoogleCloudClouddmsV1OperationMetadat
* `apiVersion` (*type:* `String.t`, *default:* `nil`) - Output only. API version used to start the operation.
* `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time the operation was created.
* `endTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time the operation finished running.
* `requestedCancellation` (*type:* `boolean()`, *default:* `nil`) - Output only. Identifies whether the user has requested cancellation of the operation. Operations that have successfully been cancelled have Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.
* `requestedCancellation` (*type:* `boolean()`, *default:* `nil`) - Output only. Identifies whether the user has requested cancellation of the operation. Operations that have successfully been cancelled have google.longrunning.Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.
* `statusMessage` (*type:* `String.t`, *default:* `nil`) - Output only. Human-readable status of the operation, if any.
* `target` (*type:* `String.t`, *default:* `nil`) - Output only. Server-defined resource path for the target of the operation.
* `verb` (*type:* `String.t`, *default:* `nil`) - Output only. Name of the verb executed by the operation.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# 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.DataMigration.V1.Model.ListMigrationJobObjectsResponse do
@moduledoc """
Response containing the objects for a migration job.
## Attributes
* `migrationJobObjects` (*type:* `list(GoogleApi.DataMigration.V1.Model.MigrationJobObject.t)`, *default:* `nil`) - List of migration job objects.
* `nextPageToken` (*type:* `String.t`, *default:* `nil`) - A token, which can be sent as `page_token` to retrieve the next page.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:migrationJobObjects =>
list(GoogleApi.DataMigration.V1.Model.MigrationJobObject.t()) | nil,
:nextPageToken => String.t() | nil
}

field(:migrationJobObjects, as: GoogleApi.DataMigration.V1.Model.MigrationJobObject, type: :list)

field(:nextPageToken)
end

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

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

0 comments on commit b2c2650

Please sign in to comment.