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 SQLAdmin client #10977

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 @@ -182,7 +182,7 @@ defmodule GoogleApi.SQLAdmin.V1.Api.Databases do
end

@doc """
Inserts a resource containing information about a database inside a Cloud SQL instance.
Inserts a resource containing information about a database inside a Cloud SQL instance. **Note:** You can't modify the default character set and collation.

## Parameters

Expand Down
350 changes: 349 additions & 1 deletion clients/sql_admin/lib/google_api/sql_admin/v1/api/instances.ex

Large diffs are not rendered by default.

62 changes: 62 additions & 0 deletions clients/sql_admin/lib/google_api/sql_admin/v1/api/operations.ex
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,68 @@ defmodule GoogleApi.SQLAdmin.V1.Api.Operations do

@library_version Mix.Project.config() |> Keyword.get(:version, "")

@doc """
Cancels an instance operation that has been performed on an instance.

## Parameters

* `connection` (*type:* `GoogleApi.SQLAdmin.V1.Connection.t`) - Connection to server
* `project` (*type:* `String.t`) - Project ID of the project that contains the instance.
* `operation` (*type:* `String.t`) - Instance operation ID.
* `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.SQLAdmin.V1.Model.Empty{}}` on success
* `{:error, info}` on failure
"""
@spec sql_operations_cancel(Tesla.Env.client(), String.t(), String.t(), keyword(), keyword()) ::
{:ok, GoogleApi.SQLAdmin.V1.Model.Empty.t()}
| {:ok, Tesla.Env.t()}
| {:ok, list()}
| {:error, any()}
def sql_operations_cancel(connection, project, operation, 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(:post)
|> Request.url("/v1/projects/{project}/operations/{operation}/cancel", %{
"project" => URI.encode(project, &URI.char_unreserved?/1),
"operation" => URI.encode(operation, &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.SQLAdmin.V1.Model.Empty{}])
end

@doc """
Retrieves an instance operation that has been performed on an instance.

Expand Down
304 changes: 304 additions & 0 deletions clients/sql_admin/lib/google_api/sql_admin/v1/api/projects.ex
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,234 @@ defmodule GoogleApi.SQLAdmin.V1.Api.Projects do

@library_version Mix.Project.config() |> Keyword.get(:version, "")

@doc """
Get Disk Shrink Config for a given instance.

## Parameters

* `connection` (*type:* `GoogleApi.SQLAdmin.V1.Connection.t`) - Connection to server
* `project` (*type:* `String.t`) - Project ID of the project that contains the instance.
* `instance` (*type:* `String.t`) - Cloud SQL instance ID. This does not include the project ID.
* `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.SQLAdmin.V1.Model.SqlInstancesGetDiskShrinkConfigResponse{}}` on success
* `{:error, info}` on failure
"""
@spec sql_projects_instances_get_disk_shrink_config(
Tesla.Env.client(),
String.t(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.SQLAdmin.V1.Model.SqlInstancesGetDiskShrinkConfigResponse.t()}
| {:ok, Tesla.Env.t()}
| {:ok, list()}
| {:error, any()}
def sql_projects_instances_get_disk_shrink_config(
connection,
project,
instance,
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/projects/{project}/instances/{instance}/getDiskShrinkConfig", %{
"project" => URI.encode(project, &URI.char_unreserved?/1),
"instance" => URI.encode(instance, &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.SQLAdmin.V1.Model.SqlInstancesGetDiskShrinkConfigResponse{}]
)
end

@doc """
Get Latest Recovery Time for a given instance.

## Parameters

* `connection` (*type:* `GoogleApi.SQLAdmin.V1.Connection.t`) - Connection to server
* `project` (*type:* `String.t`) - Project ID of the project that contains the instance.
* `instance` (*type:* `String.t`) - Cloud SQL instance ID. This does not include the project ID.
* `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.SQLAdmin.V1.Model.SqlInstancesGetLatestRecoveryTimeResponse{}}` on success
* `{:error, info}` on failure
"""
@spec sql_projects_instances_get_latest_recovery_time(
Tesla.Env.client(),
String.t(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.SQLAdmin.V1.Model.SqlInstancesGetLatestRecoveryTimeResponse.t()}
| {:ok, Tesla.Env.t()}
| {:ok, list()}
| {:error, any()}
def sql_projects_instances_get_latest_recovery_time(
connection,
project,
instance,
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/projects/{project}/instances/{instance}/getLatestRecoveryTime", %{
"project" => URI.encode(project, &URI.char_unreserved?/1),
"instance" => URI.encode(instance, &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.SQLAdmin.V1.Model.SqlInstancesGetLatestRecoveryTimeResponse{}]
)
end

@doc """
Perform Disk Shrink on primary instance.

## Parameters

* `connection` (*type:* `GoogleApi.SQLAdmin.V1.Connection.t`) - Connection to server
* `project` (*type:* `String.t`) - Project ID of the project that contains the instance.
* `instance` (*type:* `String.t`) - Cloud SQL instance ID. This does not include the project ID.
* `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.SQLAdmin.V1.Model.PerformDiskShrinkContext.t`) -
* `opts` (*type:* `keyword()`) - Call options

## Returns

* `{:ok, %GoogleApi.SQLAdmin.V1.Model.Operation{}}` on success
* `{:error, info}` on failure
"""
@spec sql_projects_instances_perform_disk_shrink(
Tesla.Env.client(),
String.t(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.SQLAdmin.V1.Model.Operation.t()}
| {:ok, Tesla.Env.t()}
| {:ok, list()}
| {:error, any()}
def sql_projects_instances_perform_disk_shrink(
connection,
project,
instance,
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/projects/{project}/instances/{instance}/performDiskShrink", %{
"project" => URI.encode(project, &URI.char_unreserved?/1),
"instance" => URI.encode(instance, &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.SQLAdmin.V1.Model.Operation{}])
end

@doc """
Reschedules the maintenance on the given instance.

Expand Down Expand Up @@ -101,6 +329,82 @@ defmodule GoogleApi.SQLAdmin.V1.Api.Projects do
|> Response.decode(opts ++ [struct: %GoogleApi.SQLAdmin.V1.Model.Operation{}])
end

@doc """
Reset Replica Size to primary instance disk size.

## Parameters

* `connection` (*type:* `GoogleApi.SQLAdmin.V1.Connection.t`) - Connection to server
* `project` (*type:* `String.t`) - ID of the project that contains the read replica.
* `instance` (*type:* `String.t`) - Cloud SQL read replica instance 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.SQLAdmin.V1.Model.SqlInstancesResetReplicaSizeRequest.t`) -
* `opts` (*type:* `keyword()`) - Call options

## Returns

* `{:ok, %GoogleApi.SQLAdmin.V1.Model.Operation{}}` on success
* `{:error, info}` on failure
"""
@spec sql_projects_instances_reset_replica_size(
Tesla.Env.client(),
String.t(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.SQLAdmin.V1.Model.Operation.t()}
| {:ok, Tesla.Env.t()}
| {:ok, list()}
| {:error, any()}
def sql_projects_instances_reset_replica_size(
connection,
project,
instance,
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/projects/{project}/instances/{instance}/resetReplicaSize", %{
"project" => URI.encode(project, &URI.char_unreserved?/1),
"instance" => URI.encode(instance, &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.SQLAdmin.V1.Model.Operation{}])
end

@doc """
Start External primary instance migration.

Expand Down
Loading
Loading