Skip to content

Commit 7a2bd33

Browse files
feat: Automated regeneration of Storage client (googleapis#12234)
Auto-created at 2024-09-28 13:11:56 +0000 using the toys pull request generator.
1 parent bdb704e commit 7a2bd33

File tree

6 files changed

+167
-3
lines changed

6 files changed

+167
-3
lines changed

clients/storage/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Install this package from [Hex](https://hex.pm) by adding
1111

1212
```elixir
1313
def deps do
14-
[{:google_api_storage, "~> 0.42"}]
14+
[{:google_api_storage, "~> 0.43"}]
1515
end
1616
```
1717

clients/storage/lib/google_api/storage/v1/api/buckets.ex

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,62 @@ defmodule GoogleApi.Storage.V1.Api.Buckets do
530530
|> Response.decode(opts ++ [struct: %GoogleApi.Storage.V1.Model.Bucket{}])
531531
end
532532

533+
@doc """
534+
Initiates a long-running Relocate Bucket operation on the specified bucket.
535+
536+
## Parameters
537+
538+
* `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server
539+
* `bucket` (*type:* `String.t`) - Name of the bucket to be moved.
540+
* `optional_params` (*type:* `keyword()`) - Optional parameters
541+
* `:alt` (*type:* `String.t`) - Data format for the response.
542+
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
543+
* `: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.
544+
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
545+
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
546+
* `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
547+
* `:uploadType` (*type:* `String.t`) - Upload protocol for media (e.g. "media", "multipart", "resumable").
548+
* `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead.
549+
* `:body` (*type:* `GoogleApi.Storage.V1.Model.RelocateBucketRequest.t`) -
550+
* `opts` (*type:* `keyword()`) - Call options
551+
552+
## Returns
553+
554+
* `{:ok, %GoogleApi.Storage.V1.Model.GoogleLongrunningOperation{}}` on success
555+
* `{:error, info}` on failure
556+
"""
557+
@spec storage_buckets_relocate(Tesla.Env.client(), String.t(), keyword(), keyword()) ::
558+
{:ok, GoogleApi.Storage.V1.Model.GoogleLongrunningOperation.t()}
559+
| {:ok, Tesla.Env.t()}
560+
| {:ok, list()}
561+
| {:error, any()}
562+
def storage_buckets_relocate(connection, bucket, optional_params \\ [], opts \\ []) do
563+
optional_params_config = %{
564+
:alt => :query,
565+
:fields => :query,
566+
:key => :query,
567+
:oauth_token => :query,
568+
:prettyPrint => :query,
569+
:quotaUser => :query,
570+
:uploadType => :query,
571+
:userIp => :query,
572+
:body => :body
573+
}
574+
575+
request =
576+
Request.new()
577+
|> Request.method(:post)
578+
|> Request.url("/storage/v1/b/{bucket}/relocate", %{
579+
"bucket" => URI.encode(bucket, &URI.char_unreserved?/1)
580+
})
581+
|> Request.add_optional_params(optional_params_config, optional_params)
582+
|> Request.library_version(@library_version)
583+
584+
connection
585+
|> Connection.execute(request)
586+
|> Response.decode(opts ++ [struct: %GoogleApi.Storage.V1.Model.GoogleLongrunningOperation{}])
587+
end
588+
533589
@doc """
534590
Restores a soft-deleted bucket.
535591

clients/storage/lib/google_api/storage/v1/metadata.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ defmodule GoogleApi.Storage.V1 do
2020
API client metadata for GoogleApi.Storage.V1.
2121
"""
2222

23-
@discovery_revision "20240916"
23+
@discovery_revision "20240924"
2424

2525
def discovery_revision(), do: @discovery_revision
2626
end
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Copyright 2019 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# NOTE: This file is auto generated by the elixir code generator program.
16+
# Do not edit this file manually.
17+
18+
defmodule GoogleApi.Storage.V1.Model.RelocateBucketRequest do
19+
@moduledoc """
20+
A Relocate Bucket request.
21+
22+
## Attributes
23+
24+
* `destinationCustomPlacementConfig` (*type:* `GoogleApi.Storage.V1.Model.RelocateBucketRequestDestinationCustomPlacementConfig.t`, *default:* `nil`) - The bucket's new custom placement configuration if relocating to a Custom Dual Region.
25+
* `destinationLocation` (*type:* `String.t`, *default:* `nil`) - The new location the bucket will be relocated to.
26+
* `validateOnly` (*type:* `boolean()`, *default:* `nil`) - If true, validate the operation, but do not actually relocate the bucket.
27+
"""
28+
29+
use GoogleApi.Gax.ModelBase
30+
31+
@type t :: %__MODULE__{
32+
:destinationCustomPlacementConfig =>
33+
GoogleApi.Storage.V1.Model.RelocateBucketRequestDestinationCustomPlacementConfig.t()
34+
| nil,
35+
:destinationLocation => String.t() | nil,
36+
:validateOnly => boolean() | nil
37+
}
38+
39+
field(:destinationCustomPlacementConfig,
40+
as: GoogleApi.Storage.V1.Model.RelocateBucketRequestDestinationCustomPlacementConfig
41+
)
42+
43+
field(:destinationLocation)
44+
field(:validateOnly)
45+
end
46+
47+
defimpl Poison.Decoder, for: GoogleApi.Storage.V1.Model.RelocateBucketRequest do
48+
def decode(value, options) do
49+
GoogleApi.Storage.V1.Model.RelocateBucketRequest.decode(value, options)
50+
end
51+
end
52+
53+
defimpl Poison.Encoder, for: GoogleApi.Storage.V1.Model.RelocateBucketRequest do
54+
def encode(value, options) do
55+
GoogleApi.Gax.ModelBase.encode(value, options)
56+
end
57+
end
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Copyright 2019 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# NOTE: This file is auto generated by the elixir code generator program.
16+
# Do not edit this file manually.
17+
18+
defmodule GoogleApi.Storage.V1.Model.RelocateBucketRequestDestinationCustomPlacementConfig do
19+
@moduledoc """
20+
The bucket's new custom placement configuration if relocating to a Custom Dual Region.
21+
22+
## Attributes
23+
24+
* `dataLocations` (*type:* `list(String.t)`, *default:* `nil`) - The list of regional locations in which data is placed.
25+
"""
26+
27+
use GoogleApi.Gax.ModelBase
28+
29+
@type t :: %__MODULE__{
30+
:dataLocations => list(String.t()) | nil
31+
}
32+
33+
field(:dataLocations, type: :list)
34+
end
35+
36+
defimpl Poison.Decoder,
37+
for: GoogleApi.Storage.V1.Model.RelocateBucketRequestDestinationCustomPlacementConfig do
38+
def decode(value, options) do
39+
GoogleApi.Storage.V1.Model.RelocateBucketRequestDestinationCustomPlacementConfig.decode(
40+
value,
41+
options
42+
)
43+
end
44+
end
45+
46+
defimpl Poison.Encoder,
47+
for: GoogleApi.Storage.V1.Model.RelocateBucketRequestDestinationCustomPlacementConfig do
48+
def encode(value, options) do
49+
GoogleApi.Gax.ModelBase.encode(value, options)
50+
end
51+
end

clients/storage/mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
defmodule GoogleApi.Storage.Mixfile do
1919
use Mix.Project
2020

21-
@version "0.42.0"
21+
@version "0.43.0"
2222

2323
def project() do
2424
[

0 commit comments

Comments
 (0)