Skip to content

Commit ec510f2

Browse files
feat: Automated regeneration of Storage client (googleapis#12676)
Auto-created at 2024-12-10 13:21:08 +0000 using the toys pull request generator.
1 parent 89faba0 commit ec510f2

File tree

4 files changed

+93
-3
lines changed

4 files changed

+93
-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.45"}]
14+
[{:google_api_storage, "~> 0.46"}]
1515
end
1616
```
1717

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

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -912,6 +912,96 @@ defmodule GoogleApi.Storage.V1.Api.Objects do
912912
|> Response.decode(opts ++ [struct: %GoogleApi.Storage.V1.Model.Objects{}])
913913
end
914914

915+
@doc """
916+
Moves the source object to the destination object in the same bucket.
917+
918+
## Parameters
919+
920+
* `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server
921+
* `bucket` (*type:* `String.t`) - Name of the bucket in which the object resides.
922+
* `source_object` (*type:* `String.t`) - Name of the source object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).
923+
* `destination_object` (*type:* `String.t`) - Name of the destination object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).
924+
* `optional_params` (*type:* `keyword()`) - Optional parameters
925+
* `:alt` (*type:* `String.t`) - Data format for the response.
926+
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
927+
* `: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.
928+
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
929+
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
930+
* `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
931+
* `:uploadType` (*type:* `String.t`) - Upload protocol for media (e.g. "media", "multipart", "resumable").
932+
* `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead.
933+
* `:ifGenerationMatch` (*type:* `String.t`) - Makes the operation conditional on whether the destination object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. `ifGenerationMatch` and `ifGenerationNotMatch` conditions are mutually exclusive: it's an error for both of them to be set in the request.
934+
* `:ifGenerationNotMatch` (*type:* `String.t`) - Makes the operation conditional on whether the destination object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.`ifGenerationMatch` and `ifGenerationNotMatch` conditions are mutually exclusive: it's an error for both of them to be set in the request.
935+
* `:ifMetagenerationMatch` (*type:* `String.t`) - Makes the operation conditional on whether the destination object's current metageneration matches the given value. `ifMetagenerationMatch` and `ifMetagenerationNotMatch` conditions are mutually exclusive: it's an error for both of them to be set in the request.
936+
* `:ifMetagenerationNotMatch` (*type:* `String.t`) - Makes the operation conditional on whether the destination object's current metageneration does not match the given value. `ifMetagenerationMatch` and `ifMetagenerationNotMatch` conditions are mutually exclusive: it's an error for both of them to be set in the request.
937+
* `:ifSourceGenerationMatch` (*type:* `String.t`) - Makes the operation conditional on whether the source object's current generation matches the given value. `ifSourceGenerationMatch` and `ifSourceGenerationNotMatch` conditions are mutually exclusive: it's an error for both of them to be set in the request.
938+
* `:ifSourceGenerationNotMatch` (*type:* `String.t`) - Makes the operation conditional on whether the source object's current generation does not match the given value. `ifSourceGenerationMatch` and `ifSourceGenerationNotMatch` conditions are mutually exclusive: it's an error for both of them to be set in the request.
939+
* `:ifSourceMetagenerationMatch` (*type:* `String.t`) - Makes the operation conditional on whether the source object's current metageneration matches the given value. `ifSourceMetagenerationMatch` and `ifSourceMetagenerationNotMatch` conditions are mutually exclusive: it's an error for both of them to be set in the request.
940+
* `:ifSourceMetagenerationNotMatch` (*type:* `String.t`) - Makes the operation conditional on whether the source object's current metageneration does not match the given value. `ifSourceMetagenerationMatch` and `ifSourceMetagenerationNotMatch` conditions are mutually exclusive: it's an error for both of them to be set in the request.
941+
* `:userProject` (*type:* `String.t`) - The project to be billed for this request. Required for Requester Pays buckets.
942+
* `opts` (*type:* `keyword()`) - Call options
943+
944+
## Returns
945+
946+
* `{:ok, %GoogleApi.Storage.V1.Model.Object{}}` on success
947+
* `{:error, info}` on failure
948+
"""
949+
@spec storage_objects_move(
950+
Tesla.Env.client(),
951+
String.t(),
952+
String.t(),
953+
String.t(),
954+
keyword(),
955+
keyword()
956+
) ::
957+
{:ok, GoogleApi.Storage.V1.Model.Object.t()}
958+
| {:ok, Tesla.Env.t()}
959+
| {:ok, list()}
960+
| {:error, any()}
961+
def storage_objects_move(
962+
connection,
963+
bucket,
964+
source_object,
965+
destination_object,
966+
optional_params \\ [],
967+
opts \\ []
968+
) do
969+
optional_params_config = %{
970+
:alt => :query,
971+
:fields => :query,
972+
:key => :query,
973+
:oauth_token => :query,
974+
:prettyPrint => :query,
975+
:quotaUser => :query,
976+
:uploadType => :query,
977+
:userIp => :query,
978+
:ifGenerationMatch => :query,
979+
:ifGenerationNotMatch => :query,
980+
:ifMetagenerationMatch => :query,
981+
:ifMetagenerationNotMatch => :query,
982+
:ifSourceGenerationMatch => :query,
983+
:ifSourceGenerationNotMatch => :query,
984+
:ifSourceMetagenerationMatch => :query,
985+
:ifSourceMetagenerationNotMatch => :query,
986+
:userProject => :query
987+
}
988+
989+
request =
990+
Request.new()
991+
|> Request.method(:post)
992+
|> Request.url("/storage/v1/b/{bucket}/o/{sourceObject}/moveTo/o/{destinationObject}", %{
993+
"bucket" => URI.encode(bucket, &URI.char_unreserved?/1),
994+
"sourceObject" => URI.encode(source_object, &URI.char_unreserved?/1),
995+
"destinationObject" => URI.encode(destination_object, &URI.char_unreserved?/1)
996+
})
997+
|> Request.add_optional_params(optional_params_config, optional_params)
998+
|> Request.library_version(@library_version)
999+
1000+
connection
1001+
|> Connection.execute(request)
1002+
|> Response.decode(opts ++ [struct: %GoogleApi.Storage.V1.Model.Object{}])
1003+
end
1004+
9151005
@doc """
9161006
Patches an object's metadata.
9171007

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 "20241113"
23+
@discovery_revision "20241206"
2424

2525
def discovery_revision(), do: @discovery_revision
2626
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.45.0"
21+
@version "0.46.0"
2222

2323
def project() do
2424
[

0 commit comments

Comments
 (0)