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 Storage client #12234

Merged
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
2 changes: 1 addition & 1 deletion clients/storage/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_storage, "~> 0.42"}]
[{:google_api_storage, "~> 0.43"}]
end
```

Expand Down
56 changes: 56 additions & 0 deletions clients/storage/lib/google_api/storage/v1/api/buckets.ex
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,62 @@ defmodule GoogleApi.Storage.V1.Api.Buckets do
|> Response.decode(opts ++ [struct: %GoogleApi.Storage.V1.Model.Bucket{}])
end

@doc """
Initiates a long-running Relocate Bucket operation on the specified bucket.

## Parameters

* `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server
* `bucket` (*type:* `String.t`) - Name of the bucket to be moved.
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:alt` (*type:* `String.t`) - Data format for the response.
* `: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`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
* `:uploadType` (*type:* `String.t`) - Upload protocol for media (e.g. "media", "multipart", "resumable").
* `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead.
* `:body` (*type:* `GoogleApi.Storage.V1.Model.RelocateBucketRequest.t`) -
* `opts` (*type:* `keyword()`) - Call options

## Returns

* `{:ok, %GoogleApi.Storage.V1.Model.GoogleLongrunningOperation{}}` on success
* `{:error, info}` on failure
"""
@spec storage_buckets_relocate(Tesla.Env.client(), String.t(), keyword(), keyword()) ::
{:ok, GoogleApi.Storage.V1.Model.GoogleLongrunningOperation.t()}
| {:ok, Tesla.Env.t()}
| {:ok, list()}
| {:error, any()}
def storage_buckets_relocate(connection, bucket, optional_params \\ [], opts \\ []) do
optional_params_config = %{
:alt => :query,
:fields => :query,
:key => :query,
:oauth_token => :query,
:prettyPrint => :query,
:quotaUser => :query,
:uploadType => :query,
:userIp => :query,
:body => :body
}

request =
Request.new()
|> Request.method(:post)
|> Request.url("/storage/v1/b/{bucket}/relocate", %{
"bucket" => URI.encode(bucket, &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.Storage.V1.Model.GoogleLongrunningOperation{}])
end

@doc """
Restores a soft-deleted bucket.

Expand Down
2 changes: 1 addition & 1 deletion clients/storage/lib/google_api/storage/v1/metadata.ex
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ defmodule GoogleApi.Storage.V1 do
API client metadata for GoogleApi.Storage.V1.
"""

@discovery_revision "20240916"
@discovery_revision "20240924"

def discovery_revision(), do: @discovery_revision
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# 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.Storage.V1.Model.RelocateBucketRequest do
@moduledoc """
A Relocate Bucket request.

## Attributes

* `destinationCustomPlacementConfig` (*type:* `GoogleApi.Storage.V1.Model.RelocateBucketRequestDestinationCustomPlacementConfig.t`, *default:* `nil`) - The bucket's new custom placement configuration if relocating to a Custom Dual Region.
* `destinationLocation` (*type:* `String.t`, *default:* `nil`) - The new location the bucket will be relocated to.
* `validateOnly` (*type:* `boolean()`, *default:* `nil`) - If true, validate the operation, but do not actually relocate the bucket.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:destinationCustomPlacementConfig =>
GoogleApi.Storage.V1.Model.RelocateBucketRequestDestinationCustomPlacementConfig.t()
| nil,
:destinationLocation => String.t() | nil,
:validateOnly => boolean() | nil
}

field(:destinationCustomPlacementConfig,
as: GoogleApi.Storage.V1.Model.RelocateBucketRequestDestinationCustomPlacementConfig
)

field(:destinationLocation)
field(:validateOnly)
end

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

defimpl Poison.Encoder, for: GoogleApi.Storage.V1.Model.RelocateBucketRequest do
def encode(value, options) do
GoogleApi.Gax.ModelBase.encode(value, options)
end
end
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.Storage.V1.Model.RelocateBucketRequestDestinationCustomPlacementConfig do
@moduledoc """
The bucket's new custom placement configuration if relocating to a Custom Dual Region.

## Attributes

* `dataLocations` (*type:* `list(String.t)`, *default:* `nil`) - The list of regional locations in which data is placed.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:dataLocations => list(String.t()) | nil
}

field(:dataLocations, type: :list)
end

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

defimpl Poison.Encoder,
for: GoogleApi.Storage.V1.Model.RelocateBucketRequestDestinationCustomPlacementConfig do
def encode(value, options) do
GoogleApi.Gax.ModelBase.encode(value, options)
end
end
2 changes: 1 addition & 1 deletion clients/storage/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
defmodule GoogleApi.Storage.Mixfile do
use Mix.Project

@version "0.42.0"
@version "0.43.0"

def project() do
[
Expand Down
Loading